@font-face { font-family: "Bagel Fat One"; src: url("/static/fonts/BagelFatOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Lemon"; src: url("/static/fonts/Lemon-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Palanquin"; src: url("/static/fonts/Palanquin-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --cream: #fde8b0;
  --paper: #fff7e0;
  --card: #fffbef;
  --mustard: #edb92e;
  --mustard-d: #c28e14;
  --purple: #9b5dc0;
  --purple-d: #2e1f6e;
  --purple-l: #c9a3e0;
  --teal: #169c7c;
  --teal-d: #0d6b55;
  --orange: #eba35a;
  --brown: #8a6634;
  --ink: #3a2614;
  --ink-2: #6b5234;
  /* Night background and the text that sits directly on it */
  --night: #120b2e;
  --night-2: #1d1150;
  --on-night: #f6efff;
  --on-night-2: #b8a8e6;
  --neon-teal: #2ee6b8;
  --neon-gold: #ffd23f;
  --red: #e4473c;
  --green: #2f9e57;
  --display: "Bagel Fat One", "Lemon", "Arial Black", system-ui, sans-serif;
  --body: "Palanquin", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--night);
  background-image:
    url("/static/img/bg_arcs_tl.svg"),
    url("/static/img/bg_arcs_br.svg"),
    radial-gradient(60vmax 45vmax at 85% 8%, rgba(180,108,255,.28), transparent 70%),
    radial-gradient(55vmax 40vmax at 10% 95%, rgba(46,230,184,.18), transparent 70%),
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px),
    linear-gradient(165deg, var(--night-2), var(--night) 55%, #0a0620);
  background-size: min(62vmin, 440px) auto, min(62vmin, 440px) auto, auto, auto, 22px 22px, auto;
  background-position: left top, right bottom, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font: 700 16px/1.35 var(--body);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }

.frame {
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0) 16px calc(16px + env(safe-area-inset-bottom, 0));
  position: relative;
}
.screen { display: flex; flex-direction: column; gap: 14px; padding-block: 12px 24px; }
/* Space between a screen's heading and its content (TR-11, TR-12). */
.pick, .rounds, .shop { display: flex; flex-direction: column; gap: 16px; }
.pick .sub, .pick .chosen { margin-top: -8px; }
/* The category screen ends with the sticky Reset / Start Run bar: drop the
   page's bottom padding so the bar rests at the bottom edge when scrolled to
   the end, the same place it sits while scrolling (TR-10). */
.screen.screen-pick { padding-bottom: 0; }
.frame:has(.screen-pick) { padding-bottom: 0; }

/* ---------------------------------------------------------------- type */
.headline {
  font: 400 clamp(30px, 8vw, 40px)/1.05 var(--display);
  color: var(--neon-gold);
  text-align: center;
  margin: 4px 0 0;
  text-wrap: balance;
  text-shadow: 0 3px 0 var(--purple), 0 6px 0 #0a0620, 0 0 24px rgba(255,210,63,.35);
  letter-spacing: 0.5px;
}
.headline.big { font-size: clamp(40px, 11vw, 56px); }
.sub { text-align: center; margin: 4px 0 0; color: var(--on-night-2); text-wrap: balance; }
.section { font: 400 22px/1 var(--display); color: var(--neon-teal); margin: 8px 0 0; }
.section small { font: 700 14px var(--body); color: var(--on-night-2); }
.hint-text { margin: 0; font-size: 14px; color: var(--on-night-2); }

/* ---------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font: 400 20px/1 var(--display);
  letter-spacing: 0.5px;
  padding: 14px 26px 16px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 5px 0 var(--purple-d);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 1px 0 var(--purple-d); }
.btn:disabled { background: #b9aec4; box-shadow: 0 4px 0 #8a7f96; cursor: not-allowed; opacity: .8; }
.btn.alt { background: var(--teal); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 5px 0 var(--teal-d); }
.btn.small { font-size: 17px; padding: 10px 18px 12px; }
.btn.tiny { font-size: 14px; padding: 7px 12px 9px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 0 var(--teal-d); }
.btn.play { align-self: center; font-size: 34px; padding: 18px 64px 22px; background: var(--teal); box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), 0 7px 0 var(--teal-d); }
:focus-visible { outline: 3px solid var(--purple-d); outline-offset: 3px; }

.icon-btn {
  border: 0; background: none; padding: 4px; cursor: pointer; line-height: 0;
  font-size: 22px; min-width: 40px; min-height: 40px; display: inline-grid; place-items: center;
  border-radius: 10px;
}
.icon-btn img { width: 36px; height: 36px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.shop-actions { padding-top: 6px; }
.sticky-actions {
  position: sticky; bottom: 0; padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0));
  /* No backing panel (TR-14): the buttons sit straight on the page background. */
  z-index: 5;
}

/* ---------------------------------------------------------------- top bar */
.topbar { display: flex; align-items: center; gap: 8px; }
.topbar .mute { margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 3px solid var(--mustard);
  border-radius: 999px; padding: 3px 12px; font: 400 18px/1.2 var(--display);
  font-variant-numeric: tabular-nums;
}
.pill.gold { color: var(--brown); }
.pill.bmo { color: var(--purple); }
.pill.bmo b { font-weight: 400; }
.pill.clock { color: var(--teal-d); min-width: 72px; justify-content: center; }
.pill.clock.low { color: #fff; background: var(--red); border-color: #a92a21; animation: pulse 1s infinite; }
.pill.streak { margin-left: auto; color: #b3541e; }
.pill.streak b { font-weight: 400; }

/* ---------------------------------------------------------------- title */
.title-screen { display: flex; flex-direction: column; gap: 22px; min-height: calc(100dvh - 40px); }
.title-screen .logo { align-self: center; width: min(88%, 388px); height: auto; margin-top: 8vh; animation: bob 3.2s ease-in-out infinite; }
.bmo-note { text-align: center; color: var(--on-night-2); margin: 0; }

/* ---------------------------------------------------------------- pick */
.chosen { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0; }
.chosen span { background: var(--teal); color: #fff; border-radius: 999px; padding: 4px 14px; }
.cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cat {
  background: var(--card); border: 3px solid var(--mustard); border-radius: var(--radius);
  padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
}
.cat.is-picked { border-color: var(--teal); background: #eaf7ef; }
.cat-head { grid-column: 1 / -1; }
.cat h2 { margin: 0; font: 400 22px/1.1 var(--display); color: var(--purple); }
.cat p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.bar em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.track { height: 10px; border-radius: 99px; background: #f1dfb1; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.bar.hot .track i { background: var(--red); }

/* ---------------------------------------------------------------- rounds */
.round-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.round-card {
  background: var(--card); border: 4px solid var(--mustard); border-radius: var(--radius);
  padding: 14px 16px; display: grid; gap: 6px; position: relative;
}
.round-card.current { border-color: var(--purple); box-shadow: 0 6px 0 var(--purple-d); }
.round-card.done { opacity: .6; }
.round-card.boss { background: #fbe4e1; }
.round-card h2 { margin: 0; font: 400 24px/1.1 var(--display); color: var(--purple); }
.round-card .desc { margin: 0; color: var(--ink-2); }
.boss-name { margin: 0; color: var(--red); font: 400 16px/1 var(--display); letter-spacing: .5px; text-transform: uppercase; }
.round-card dl { display: flex; gap: 20px; margin: 4px 0; }
.round-card dl div { display: grid; }
.round-card dt { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); }
.round-card dd { margin: 0; font: 400 22px/1.1 var(--display); color: var(--brown); font-variant-numeric: tabular-nums; }
.round-card .btn { justify-self: start; }
.stamp { margin: 0; font: 400 18px var(--display); color: var(--teal-d); transform: rotate(-4deg); }
.clock-note { text-align: center; margin: 0; color: var(--on-night-2); }

/* ---------------------------------------------------------------- round */
.round { display: flex; flex-direction: column; gap: 10px; position: relative; }
/* Questions and answers can't be selected, copied or long-pressed (to stop
   copy-paste lookups); the round screen also blocks copy and the context menu. */
.round { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.round-info { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.round-name { grid-column: 1 / -1; font-size: 14px; color: var(--on-night); }
.round-name .boss-name { display: inline; font-size: 14px; color: #ff7a6e; }
.progress {
  position: relative; height: 30px; border-radius: 99px; background: var(--card);
  border: 3px solid var(--mustard); overflow: hidden;
}
.progress i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .5s ease-out; }
.progress .preview { background: #d9c5ea; }
.progress .fill { background: var(--purple); }
.progress span { position: relative; display: block; text-align: center; font-size: 14px; line-height: 24px; color: var(--ink); text-shadow: 0 0 4px #fff, 0 0 2px #fff; font-variant-numeric: tabular-nums; }
.discard {
  position: relative; border: 0; background: none; padding: 0; cursor: pointer; line-height: 0;
}
.discard img { width: 46px; height: 46px; }
.discard b {
  position: absolute; right: -4px; bottom: -4px; background: var(--red); color: #fff; font: 400 14px/22px var(--display);
  min-width: 22px; border-radius: 99px; text-align: center;
}
.discard:disabled { opacity: .4; cursor: not-allowed; }

.items { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 6px; align-items: center; }
.item {
  aspect-ratio: 1; background: var(--card); border: 3px solid var(--mustard); border-radius: 12px;
  display: grid; place-items: center; position: relative; padding: 6px; outline: none;
}
.item img { width: 100%; height: 100%; object-fit: contain; }
.item.empty { background: rgba(255,255,255,.05); border-style: dashed; border-color: rgba(237,185,46,.55); }
.item.firing { border-color: var(--purple); animation: wiggle .25s ease-in-out; transform: scale(1.08); }
.item .bubble {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--purple); color: #fff; font: 400 13px/1 var(--display); padding: 5px 8px; border-radius: 8px; z-index: 3;
}
.item .tip {
  display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: 200px; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 13px; z-index: 10;
}
.item .tip b { display: block; font: 400 15px var(--display); color: var(--mustard); }
.item:hover .tip, .item:focus .tip { display: block; }
.items .count { font: 400 15px var(--display); color: var(--on-night-2); padding-left: 2px; }

.billboard {
  min-height: 74px; display: grid; place-items: center; text-align: center;
  background: var(--paper);
  border: 10px solid var(--mustard);
  border-radius: 26px;
  box-shadow: inset 0 0 0 3px #fff4, 0 4px 0 var(--mustard-d);
  background-image: radial-gradient(circle, #fff 3px, transparent 3.5px), radial-gradient(circle, #fff 3px, transparent 3.5px);
  background-size: 16px 10px; background-repeat: repeat-x; background-position: 0 -8px, 0 calc(100% + 8px);
  font: 400 30px/1 var(--display); color: var(--purple-d); font-variant-numeric: tabular-nums;
  transition: transform .15s;
}
.billboard .pts-mult i { font-style: normal; color: var(--orange); }
.billboard .pts-mult b { font-weight: 400; }
.billboard .pts-mult b:last-child { color: var(--red); }
.billboard.flash { animation: marquee .3s steps(2) infinite, grow 1.17s ease-out forwards; }
.billboard.good { color: var(--green); }
.billboard.bad { color: var(--red); }

.question {
  background: var(--card); border: 4px solid var(--purple); border-radius: 22px; padding: 14px 14px 16px;
  display: grid; gap: 12px; box-shadow: 0 6px 0 var(--purple-d);
}
.question.enemy { border-color: var(--red); box-shadow: 0 6px 0 #7d1f18; }
.q-top { display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
.q-label { font: 400 14px/1 var(--display); letter-spacing: 1px; color: var(--teal-d); text-transform: uppercase; }
.question.enemy .q-label { color: var(--red); }
.marks { display: inline-flex; align-items: center; gap: 6px; }
.marks img { width: 30px; height: 30px; }
.marks em { font: 700 12px/1.1 var(--body); font-style: normal; color: var(--ink-2); text-align: right; }
.q-text { margin: 0; font-size: 20px; line-height: 1.3; text-wrap: balance; min-height: 3.9em; }
.q-text.fact { color: var(--teal-d); font-size: 18px; }
.q-clock { display: flex; align-items: center; gap: 12px; }
.dial {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); color: #fff; font: 400 26px/1 var(--display); box-shadow: 0 4px 0 var(--teal-d);
  font-variant-numeric: tabular-nums;
}
.dial.low { background: var(--red); box-shadow: 0 4px 0 #a92a21; animation: pulse .6s infinite; }
.hint { display: flex; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; padding: 0; }
.hint img { width: 46px; height: 44px; }
.hint span { font: 400 16px var(--display); color: var(--ink-2); }
.hint:disabled { opacity: .35; cursor: not-allowed; }
.upgrades { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.upg { display: inline-flex; align-items: center; gap: 2px; font: 400 14px var(--display); color: var(--brown); animation: pop .3s; }
.upg img { width: 26px; height: 26px; }

.answers { display: grid; gap: 10px; }
.answer {
  border: 0; border-radius: 16px; cursor: pointer;
  background: var(--purple); color: #fff; font-size: 18px; padding: 12px 16px 14px; text-align: center;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.15), 0 5px 0 var(--purple-d);
  transition: transform .08s, background .2s, opacity .2s;
}
.answer:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 2px 0 var(--purple-d); }
.answer:disabled { background: #b8adc2; box-shadow: 0 5px 0 #8a7f96; cursor: not-allowed; opacity: .75; }
.answer.eliminated { text-decoration: line-through; opacity: .55; }
.answer.chosen, .answer.chosen:disabled { background: var(--orange); box-shadow: 0 5px 0 #a9661f; text-decoration: none; opacity: 1; }
.answer.correct, .answer.correct:disabled { background: var(--green); box-shadow: 0 5px 0 #1c6636; text-decoration: none; opacity: 1; animation: pop .35s; }
.answer.incorrect, .answer.incorrect:disabled { background: var(--red); box-shadow: 0 5px 0 #8f231b; text-decoration: none; opacity: 1; animation: shake .35s; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.9s ease-in forwards; }
.win-banner {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-4deg); z-index: 30;
  background: var(--teal); color: #fff; font: 400 34px var(--display); padding: 14px 28px; border-radius: 18px;
  box-shadow: 0 6px 0 var(--teal-d); animation: pop .4s;
}

/* ---------------------------------------------------------------- round complete / over */
.panel-screen { display: flex; flex-direction: column; gap: 16px; }
.panel-screen > .btn { align-self: center; }
.gains { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gain { background: var(--card); border: 4px solid var(--mustard); border-radius: var(--radius); padding: 10px 18px; text-align: center; display: grid; }
.gain span { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); }
.gain b { font: 400 30px/1.1 var(--display); color: var(--brown); font-weight: 400; }
.gain.bmo { border-color: var(--purple); }
.gain.bmo b { color: var(--purple); }
.eor { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eor li { background: var(--card); border: 3px solid var(--mustard); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 4px; }
.eor h2 { margin: 0; font: 400 20px var(--display); color: var(--purple); }
.eor h2 small { font: 700 13px var(--body); color: var(--red); }
.eor-counts { display: flex; gap: 16px; margin: 0; font-size: 14px; color: var(--ink-2); }
.eor-counts b { color: var(--ink); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.stats div { background: var(--card); border: 3px solid var(--mustard); border-radius: var(--radius); padding: 10px 12px; }
.stats div.bmo { border-color: var(--purple); grid-column: 1 / -1; }
.stats dt { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); }
.stats dd { margin: 0; font: 400 26px/1.1 var(--display); color: var(--brown); font-variant-numeric: tabular-nums; }
.stats .bmo dd { color: var(--purple); }

/* ---------------------------------------------------------------- shop */
/* Every card in a grid is the same size: rows take the tallest card's height,
   and the Buy button / Sold stamp sits in a fixed-height slot under the card. */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.offers.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.offers.three .offer { padding: 8px 6px; min-height: 0; }
.offers.three .offer h3 { font-size: 14px; }
.offer-wrap { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.offer-wrap > .offer { flex: 1 0 auto; }
.offer-wrap > .btn, .offer-wrap > .stamp { flex: none; height: 42px; display: inline-grid; place-items: center; padding-block: 0 2px; }
.offer {
  width: 100%; background: var(--card); border: 3px solid var(--mustard); border-radius: var(--radius);
  padding: 10px; display: grid; justify-items: center; text-align: center; gap: 4px; min-height: 176px; align-content: start;
}
.offer img { width: 56px; height: 56px; object-fit: contain; }
.offer h3 { margin: 0; font: 400 16px/1.1 var(--display); color: var(--purple); overflow-wrap: anywhere; }
.offer p { margin: 0; font-size: 12.5px; line-height: 1.25; color: var(--ink-2); }
.offer.booster { border-color: var(--teal); background: #e9f6f0; }
.offer.book { border-color: var(--orange); }
.offer.upgrade { border-color: var(--purple-l); }
.offer.sold { opacity: .45; }
.offer .tag { margin-top: auto; padding: 2px 8px; border-radius: 99px; background: rgba(46,31,110,.08); color: var(--purple-d); font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.offer-wrap .stamp { font-size: 16px; color: var(--neon-teal); }
.owned { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.owned-item {
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; align-items: center;
  background: var(--card); border: 3px solid var(--mustard); border-radius: var(--radius); padding: 8px 10px;
}
.owned-item img { width: 44px; height: 44px; object-fit: contain; }
.owned-item b { display: block; font: 400 16px var(--display); color: var(--purple); }
.owned-item span { font-size: 13px; color: var(--ink-2); }
.owned-actions { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* ---------------------------------------------------------------- overlays */
.overlay {
  position: fixed; inset: 0; background: rgba(8,5,24,.72); z-index: 40;
  display: grid; place-items: center; padding: 16px;
}
.panel {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--paper); border: 5px solid var(--mustard); border-radius: 22px; padding: 18px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; box-shadow: 0 8px 0 var(--mustard-d);
}
.panel > .btn { justify-self: center; }
.panel h2 { margin: 0; text-align: center; font: 400 30px var(--display); color: var(--purple); }
.panel h3 { margin: 4px 0 0; font: 400 18px var(--display); color: var(--teal-d); }
.ups { width: 100%; border-collapse: collapse; font-size: 13px; }
.ups th { text-align: left; font-weight: 700; }
.ups th, .ups td { padding: 4px 4px; border-bottom: 1px solid #efd9a3; }
.ups td { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: calc(100% - 32px);
}
.htmx-request .answer, .htmx-request.btn { cursor: progress; }

/* ---------------------------------------------------------------- motion */
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes wiggle { 25% { rotate: -6deg; } 75% { rotate: 6deg; } }
@keyframes pop { 0% { transform: scale(.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes grow { to { transform: scale(1.1); } }
@keyframes marquee { 50% { border-color: #f6d25a; } }
@keyframes fall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 380px) {
  .bar { grid-template-columns: 76px 1fr auto; }
  .billboard { font-size: 24px; }
  .q-text { font-size: 18px; }
}

/* ---------------------------------------------------------------- landscape
   Phones turned sideways and wide windows: the frame widens and the round
   screen splits into two columns (status on the left, question on the right)
   so a question and all four answers fit without scrolling. */
@media (orientation: landscape) and (min-width: 600px) {
  .frame {
    max-width: 1000px;
    padding-left: max(16px, env(safe-area-inset-left, 0));
    padding-right: max(16px, env(safe-area-inset-right, 0));
  }

  .round {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    grid-template-areas: "top q" "info q" "items q" "board q" ". q";
    grid-template-rows: auto auto auto auto 1fr;
    gap: 10px 18px;
    align-items: start;
  }
  .round > .topbar { grid-area: top; }
  .round > .round-info { grid-area: info; }
  .round > .items { grid-area: items; }
  .round > .billboard { grid-area: board; }
  .round > .question { grid-area: q; }
  .answers { grid-template-columns: 1fr 1fr; }
  .answer { display: grid; place-items: center; }

  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .round-cards { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .eor { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .owned { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .panel { width: min(640px, 100%); }
}

/* Short landscape (phones): tighten vertical spacing so screens fit ~320px tall. */
@media (orientation: landscape) and (max-height: 520px) {
  .screen { gap: 8px; padding-block: 6px 10px; }
  .headline { font-size: 28px; }
  .headline.big { font-size: 38px; }
  .sub { margin: 0; }

  .title-screen { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; align-content: center; gap: 8px 32px; min-height: calc(100dvh - 40px); }
  .title-screen .logo { margin-top: 0; width: auto; max-height: 56dvh; }
  .title-screen > .topbar, .title-screen .bmo-note { flex-basis: 100%; }
  .title-screen > .topbar { align-self: flex-start; }
  .rounds .headline { margin: 0; }
  .round-card dl { margin: 0; }

  .icon-btn { min-width: 34px; min-height: 34px; }
  .icon-btn img { width: 30px; height: 30px; }
  .pill { font-size: 16px; padding: 2px 10px; border-width: 2px; }

  .round { gap: 8px 16px; }
  .progress { height: 26px; }
  .progress span { line-height: 20px; }
  .discard img { width: 38px; height: 38px; }
  .items { gap: 5px; }
  .item { padding: 4px; border-width: 2px; }
  .item .tip { top: auto; bottom: calc(100% + 6px); }
  .billboard { min-height: 54px; font-size: 24px; border-width: 7px; border-radius: 20px; }

  .question { padding: 10px 12px 12px; gap: 8px; border-radius: 18px; }
  .q-top { min-height: 20px; }
  .marks img { width: 22px; height: 22px; }
  .q-text { font-size: 17px; line-height: 1.25; min-height: 2.5em; }
  .q-text.fact { font-size: 16px; }
  .dial { width: 44px; height: 44px; font-size: 21px; }
  .hint img { width: 36px; height: 34px; }
  .answers { gap: 8px; }
  .answer { font-size: 16px; padding: 8px 12px 10px; border-radius: 14px; }

  .cat { padding: 8px 12px; }
  .round-card { padding: 10px 14px; }
  .gain b { font-size: 24px; }
  .stats dd { font-size: 22px; }
  .offer { min-height: 150px; }
  .panel { padding: 12px 14px; gap: 8px; max-height: calc(100dvh - 16px); }
  .overlay { padding: 8px; }
  .panel h2 { font-size: 24px; }
  .win-banner { top: 50%; }
}
