/* Oregon or Bust — "Deluxe" look.
   Everything lives inside #screen, a 4:3 box that scales to fit the window.
   Sizes use cqw (1cqw = 1% of the screen's width) so the layout scales as one piece. */
:root {
  --wood: #6b4524; --wood-hi: #9a6a3c; --wood-lo: #3e2612;
  --parch: #f3e6c6; --parch-dk: #e6d4ae; --ink: #3a2614; --ink-soft: #8a6a44;
  --gold: #e8b04a; --gold-lo: #8a5a1a; --red: #c4452f; --green: #2f7a2c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { display: grid; place-items: center; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }

#screen {
  position: relative; width: min(100vw, calc(100vh * 4 / 3)); width: min(100vw, calc(100dvh * 4 / 3)); aspect-ratio: 4 / 3;
  background: #2a1d12; overflow: hidden; container-type: inline-size;
  font-family: 'IM Fell English', Georgia, serif; color: var(--ink); font-size: 3.4cqw; line-height: 1.2;
}
#screen canvas { display: block; width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.scene { position: absolute; left: 0; top: 0; width: 100%; }

#rotate-hint { display: none; position: fixed; left: 0; right: 0; bottom: 18px; text-align: center; color: #c9b892;
  font: 600 15px Nunito, sans-serif; }
@media (orientation: portrait) and (max-width: 700px) { #rotate-hint { display: block; } }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 1cqw; text-align: center; cursor: pointer;
  background: var(--gold); color: #3a2210; font-family: Nunito, sans-serif; font-weight: 800; font-size: 2.9cqw; line-height: 1.1;
  border: 0; border-radius: .8cqw; padding: 1.2cqw 1.4cqw; box-shadow: 0 .5cqw 0 var(--gold-lo); transition: transform .06s, filter .1s; }
.btn.alt { background: #e3d5b8; box-shadow: 0 .5cqw 0 #7a6a50; }
.btn.red { background: var(--red); color: #fff3d6; box-shadow: 0 .5cqw 0 #7a2414; }
.btn:hover { filter: brightness(1.07); }
.btn:active, .btn.pressed { transform: translateY(.4cqw); box-shadow: 0 .1cqw 0 var(--gold-lo); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn .key { font-size: 2cqw; opacity: .6; font-weight: 700; }
.btn:focus-visible { outline: .4cqw solid #fff; outline-offset: .3cqw; }

/* ---------- wooden bottom panel ---------- */
.panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.8cqw 2.4cqw;
  background: linear-gradient(#7a4f2a, #5d3a1e); box-shadow: inset 0 .6cqw 0 var(--wood-hi), inset 0 -.6cqw 0 var(--wood-lo); }
.panel::before { content: ''; position: absolute; left: 0; right: 0; top: -.6cqw; height: .6cqw; background: #1a120a; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; }
.chips.four { grid-template-columns: repeat(4, 1fr); }
.chip { background: var(--parch); color: var(--ink); border-radius: .8cqw; padding: .6cqw 1.4cqw; box-shadow: 0 .4cqw 0 var(--wood-lo);
  font-size: 3.3cqw; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip small { display: block; font-family: Nunito, sans-serif; font-size: 2.1cqw; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.chip .good { color: var(--green); } .chip .fair { color: #8a7a1a; } .chip .poor { color: #b4621e; } .chip .vpoor { color: #b42a1e; }
.btns { display: flex; gap: 1.4cqw; margin-top: 1.6cqw; }
.btns .btn { flex: 1; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3cqw; margin-top: 1.3cqw; }
.opt-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.tip { margin-top: 1.2cqw; font-family: Nunito, sans-serif; font-size: 2.6cqw; color: var(--parch); }

/* ---------- labels over the painting ---------- */
.datebar { position: absolute; top: 1.6cqw; left: 2cqw; right: 2cqw; display: flex; justify-content: space-between; pointer-events: none;
  font-size: 3.4cqw; color: #fff; }
.datebar span { background: rgba(40, 26, 14, .72); padding: .3cqw 1.4cqw; border-radius: .8cqw; }
.ribbon { position: absolute; top: 3cqw; left: 50%; transform: translateX(-50%); background: var(--parch); color: var(--ink); text-align: center;
  padding: 1cqw 5cqw 1.2cqw; font-size: 5.2cqw; line-height: 1; border-radius: .6cqw; white-space: nowrap;
  box-shadow: 0 .5cqw 0 #7a5a3a, 0 1.4cqw 2cqw rgba(0, 0, 0, .25); }
.ribbon small { display: block; font-family: Nunito, sans-serif; font-size: 2.3cqw; color: var(--ink-soft); margin-top: .6cqw; letter-spacing: .04em; }

/* ---------- full parchment pages (menus, questions, reading) ---------- */
.page { position: absolute; inset: 0; padding: 4cqw 7cqw 3cqw; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 40%, #f7ecd2 0%, #efdfba 70%, #dcc596 100%); color: var(--ink); }
.page::after { content: ''; position: absolute; inset: 1.4cqw; border: .35cqw solid #b89a68; border-radius: .6cqw; pointer-events: none; }
.page h1 { margin: 0 0 1cqw; font-weight: 400; font-size: 5.6cqw; text-align: center; line-height: 1.05; }
.page h2 { margin: 0 0 1.4cqw; font-weight: 400; font-size: 4.2cqw; text-align: center; }
.page .sub { text-align: center; font-family: Nunito, sans-serif; font-size: 2.5cqw; color: var(--ink-soft); margin-bottom: 1.6cqw; }
.page p { margin: 0 0 1.3cqw; font-size: 3.2cqw; line-height: 1.3; }
.page .body { flex: 1; overflow: auto; position: relative; z-index: 1; }
.page .foot { position: relative; z-index: 1; display: flex; gap: 1.4cqw; justify-content: center; margin-top: 1.4cqw; }
.page .foot .btn { min-width: 24cqw; }
.menu { display: flex; flex-direction: column; gap: 1.5cqw; width: 64%; margin: 1cqw auto 0; position: relative; z-index: 1; }
.menu .btn { justify-content: flex-start; padding: 1.4cqw 2.4cqw; font-size: 3.1cqw; }
.menu .btn .key { margin-right: .8cqw; }
.menu .btn small { margin-left: auto; font-weight: 600; opacity: .7; font-size: 2.4cqw; }
.menu.two { display: grid; grid-template-columns: 1fr 1fr; width: 86%; }
.page .picture { width: 100%; border-radius: .6cqw; box-shadow: 0 .4cqw 0 #b89a68; }

/* text inputs */
.field { display: flex; align-items: center; gap: 2cqw; margin: 1cqw auto; width: 74%; position: relative; z-index: 1; }
.field label { flex: 0 0 30%; text-align: right; font-size: 3.2cqw; }
.field input { flex: 1; font: 700 3.2cqw Nunito, sans-serif; color: var(--ink); background: #fffaf0; border: .3cqw solid #b89a68;
  border-radius: .7cqw; padding: .9cqw 1.6cqw; outline: none; user-select: text; -webkit-user-select: text; }
.field input:focus { border-color: var(--gold-lo); box-shadow: 0 0 0 .4cqw rgba(232, 176, 74, .45); }

/* ---------- ledger (store, supplies) ---------- */
.ledger { position: absolute; left: 0; right: 0; top: 13.3%; bottom: 0; padding: 1.4cqw 3cqw; color: var(--ink);
  background: repeating-linear-gradient(var(--parch) 0 6.2cqw, var(--parch-dk) 6.2cqw 6.4cqw); box-shadow: inset 0 .8cqw 0 #5d3a1e; display: flex; flex-direction: column; }
.ledger-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 4.4cqw; border-bottom: .4cqw solid var(--ink-soft); padding-bottom: .5cqw; }
.ledger-h .sm { font-family: Nunito, sans-serif; font-size: 2.4cqw; color: var(--ink-soft); }
.item { display: flex; align-items: center; gap: 1.2cqw; min-height: 8.2cqw; font-size: 3.5cqw; border-bottom: .2cqw dashed #cbb68c; }
.item .nm { flex: 1; line-height: 1.05; }
.item .nm small { display: block; font-family: Nunito, sans-serif; font-size: 2.1cqw; color: var(--ink-soft); }
.step { width: 5.2cqw; height: 5.2cqw; flex: none; border-radius: 50%; background: var(--gold); color: #3a2210; font: 800 3.4cqw/1 Nunito, sans-serif;
  display: grid; place-items: center; box-shadow: 0 .4cqw 0 var(--gold-lo); cursor: pointer; border: 0; padding: 0; }
.step:active { transform: translateY(.3cqw); box-shadow: none; }
.step[disabled] { opacity: .35; pointer-events: none; }
.item .qty { width: 14cqw; text-align: center; font: 700 2.8cqw Nunito, sans-serif; }
.item .pr { width: 12cqw; text-align: right; }
.ledger-f { display: flex; align-items: center; gap: 3cqw; margin-top: auto; padding-top: 1cqw; font-family: Nunito, sans-serif; font-size: 2.8cqw; }
.ledger-f b { font-size: 3.4cqw; }
.ledger-f .btn { margin-left: auto; padding: 1.2cqw 3cqw; }
.ledger-f .warn { color: var(--red); font-weight: 700; }
.sub-row { display: flex; gap: 1cqw; align-items: center; font-size: 2.6cqw; font-family: Nunito, sans-serif; padding-left: 3cqw; min-height: 6cqw; border-bottom: .2cqw dashed #cbb68c; }
.sub-row span.lbl { flex: 1; }

/* ---------- message card (events, news) ---------- */
.veil { position: absolute; inset: 0; background: rgba(20, 12, 6, .45); display: grid; place-items: center; z-index: 20; animation: fade .15s ease-out; }
.card { width: 70%; background: var(--parch); color: var(--ink); border-radius: 1cqw; padding: 3cqw 3.6cqw 2.6cqw; text-align: center;
  box-shadow: 0 .8cqw 0 #7a5a3a, 0 2cqw 5cqw rgba(0, 0, 0, .45); animation: pop .18s ease-out; }
.card h3 { margin: 0 0 1cqw; font-weight: 400; font-size: 4.6cqw; line-height: 1.05; }
.card p { margin: 0 0 1.2cqw; font-size: 3.2cqw; line-height: 1.28; }
.card .btns { justify-content: center; }
.card .btns .btn { flex: 0 1 auto; min-width: 22cqw; }
.card.bad h3 { color: #8a2a1a; }
.card.good h3 { color: var(--green); }
.card .menu { width: 100%; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- misc ---------- */
.title-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 5cqw; pointer-events: none; }
.title { font-size: 10.5cqw; letter-spacing: .02em; color: #fff3d6; text-shadow: 0 .5cqw 0 #5a2a2a, 0 0 3cqw rgba(255, 180, 90, .55); line-height: 1; }
.subtitle { font-size: 3.6cqw; color: #ffe2b0; margin-top: 1.4cqw; letter-spacing: .08em; }
.dx-menu { position: absolute; left: 50%; transform: translateX(-50%); bottom: 5cqw; width: 46%; display: flex; flex-direction: column; gap: 1.5cqw; }
.dx-menu .btn { font-size: 3.2cqw; padding: 1.3cqw 0; }
.dx-menu .btn.alt { background: var(--parch); box-shadow: 0 .5cqw 0 #7a5a3a; }
.corner { position: absolute; right: 2.4cqw; bottom: 2.4cqw; font: 600 2.4cqw Nunito, sans-serif; color: var(--parch); background: rgba(0, 0, 0, .4);
  padding: .6cqw 1.6cqw; border-radius: 3cqw; cursor: pointer; border: 0; }
.corner.left { right: auto; left: 2.4cqw; }
table.top10 { width: 80%; margin: 0 auto; border-collapse: collapse; font-size: 3.1cqw; position: relative; z-index: 1; }
table.top10 th { font: 700 2.2cqw Nunito, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); text-align: left; padding-bottom: .6cqw; }
table.top10 td { padding: .35cqw 0; border-bottom: .2cqw dashed #cbb68c; }
table.top10 td.n { text-align: right; padding-right: 2cqw; }
table.top10 tr.me td { color: #8a2a1a; }
.epitaph { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); text-align: center; color: #3a3530; width: 28%; font-size: 3cqw; line-height: 1.15; }
.epitaph b { display: block; font-size: 3.6cqw; font-weight: 400; }
.hl { color: #8a2a1a; }
.mono { font-family: Nunito, sans-serif; font-weight: 700; }
.weather { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Hall of Fame tabs ---------- */
.tabs { display: flex; justify-content: center; gap: 1cqw; margin: .4cqw 0 1.4cqw; position: relative; z-index: 1; }
.tab { font: 700 2.5cqw Nunito, sans-serif; color: var(--ink-soft); background: transparent; border: .3cqw solid #cbb68c; border-radius: 3cqw; padding: .7cqw 2.2cqw; cursor: pointer; }
.tab.on { background: var(--ink); color: var(--parch); border-color: var(--ink); }
.hof-msg { text-align: center; font-family: Nunito, sans-serif; font-size: 2.4cqw; color: var(--ink-soft); margin-top: 1.4cqw; }
.hof-me { font-family: Nunito, sans-serif; font-size: 2.5cqw; color: var(--ink-soft); align-self: center; margin-right: auto; }
.hof-me b { color: var(--ink); }
table.top10.class { width: 92%; font-size: 2.8cqw; }
table.top10 small.dim { font-family: Nunito, sans-serif; font-size: 2cqw; color: var(--ink-soft); }
.tabs + .body table.top10 { font-size: 2.8cqw; }
.tabs + .body table.top10 td { padding: .15cqw 0; }
.tabs + .body .hof-msg { margin-top: .8cqw; }
