/* You vs ProCompNav — blocky, friendly game skin. Photos are the hero; blocks are the frame. */
:root {
  --bg: #eaf1e4;
  --bg-dot: #dbe6d3;
  --surface: #ffffff;
  --surface-2: #f4f7f0;
  --ink: #1b241d;
  --ink-soft: #536257;
  --edge: #1b241d;
  --grass: #46a035;
  --grass-hi: #6cc04f;
  --grass-dark: #2c6e20;
  --on-grass: #ffffff;
  --dirt: #8a5a35;
  --gold: #f0ad1f;
  --gold-hi: #ffd05a;
  --gold-dark: #9a6a00;
  --on-gold: #1b241d;
  --red: #d63f35;
  --red-soft: #fbe1de;
  --green-soft: #e0f3d8;
  --stone: #8f9690;
  --stone-2: #7b827c;
  --stone-ink: #f4f6f4;
  --human: #ddeef9;
  --human-edge: #2f7fb3;
  --focus: #e06c00;
  --shadow: 0 4px 0 var(--edge);
  --shadow-sm: 0 2px 0 var(--edge);
  --skin: #e9b98c;
  --hair: #4a2f1b;
  --font-ui: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-px: "Jersey 10", "Nunito", ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111712; --bg-dot: #18201a; --surface: #1b231d; --surface-2: #222c24;
    --ink: #e8f0e9; --ink-soft: #a3b3a7; --edge: #56665a;
    --grass: #4fae3d; --grass-hi: #75c95a; --grass-dark: #2f7a23; --on-grass: #ffffff;
    --gold: #f2b52f; --gold-hi: #ffd468; --gold-dark: #b98100; --on-gold: #1b241d;
    --red: #f0665b; --red-soft: #3a1f1d; --green-soft: #1d3319;
    --stone: #4d554f; --stone-2: #424944; --stone-ink: #cfd6d0;
    --human: #19303f; --human-edge: #5fb2e6; --focus: #ffb347;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111712; --bg-dot: #18201a; --surface: #1b231d; --surface-2: #222c24;
  --ink: #e8f0e9; --ink-soft: #a3b3a7; --edge: #56665a;
  --grass: #4fae3d; --grass-hi: #75c95a; --grass-dark: #2f7a23; --on-grass: #ffffff;
  --gold: #f2b52f; --gold-hi: #ffd468; --gold-dark: #b98100; --on-gold: #1b241d;
  --red: #f0665b; --red-soft: #3a1f1d; --green-soft: #1d3319;
  --stone: #4d554f; --stone-2: #424944; --stone-ink: #cfd6d0;
  --human: #19303f; --human-edge: #5fb2e6; --focus: #ffb347;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; scroll-padding-bottom: 90px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--surface); padding: 8px 12px; border: 3px solid var(--edge); border-radius: 6px; }
.skip:focus { top: 8px; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

.gutter, .topbar-in, main, .foot {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 3px solid var(--edge); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 0; cursor: pointer; font-family: var(--font-px); font-size: 1.31rem; font-weight: 400; }
.brand b { color: var(--gold-dark); }
:root[data-theme="dark"] .brand b { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand b { color: var(--gold); } }
.brand-cube { width: 20px; height: 20px; background: linear-gradient(var(--grass-hi) 0 35%, var(--dirt) 35% 100%); border: 2px solid var(--edge); border-radius: 3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.mini-link { font-weight: 800; font-size: .875rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; background: var(--surface-2); border: 3px solid var(--edge); border-radius: 6px; box-shadow: var(--shadow-sm); cursor: pointer; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.icon-btn:disabled { opacity: .35; cursor: default; }

main { max-width: 1180px; margin: 0 auto; padding-top: 16px; padding-bottom: 32px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  background: var(--surface); color: var(--ink);
  border: 3px solid var(--edge); border-radius: 8px; box-shadow: var(--shadow);
  font-weight: 800; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .08s, box-shadow .08s, background-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn-go { background: var(--grass); color: var(--on-grass); text-shadow: 0 2px 0 var(--grass-dark); }
.btn-go:hover { background: var(--grass-hi); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .9rem; box-shadow: var(--shadow-sm); }
.btn-xl { flex-direction: column; gap: 0; padding: 12px 28px; font-family: var(--font-px); font-size: 1.75rem; line-height: 1.15; }
.btn-xl small { font-family: var(--font-ui); font-size: .85rem; font-weight: 700; text-shadow: none; opacity: .95; }

/* ---------- avatars (inline blocky SVG) ---------- */
.avatar { display: inline-block; width: 44px; height: 44px; flex: none; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.xs { width: 26px; height: 26px; }
.avatar svg { width: 100%; height: 100%; display: block; }

/* ---------- title ---------- */
.hero { text-align: center; padding: 8px 0 4px; }
.eyebrow { margin: 0 0 6px; font-size: .9rem; color: var(--ink-soft); }
.title { margin: 0; font-family: var(--font-px); font-weight: 400; line-height: 1; font-size: clamp(3rem, 15vw, 5.8rem); font-weight: 400; letter-spacing: .01em; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .1em .25em; }
.t-you { color: var(--grass-dark); }
.t-bot { color: var(--gold-dark); }
:root[data-theme="dark"] .t-you { color: var(--grass-hi); }
:root[data-theme="dark"] .t-bot { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-you { color: var(--grass-hi); } :root:not([data-theme="light"]) .t-bot { color: var(--gold); } }
.t-vs { display: inline-grid; place-items: center; font-size: .45em; padding: .15em .35em .25em; background: var(--red); color: #fff; border: 3px solid var(--edge); border-radius: 6px; box-shadow: var(--shadow); transform: rotate(-6deg); }
.tagline { margin: 12px auto 0; max-width: 32ch; font-size: clamp(1.3rem, 5.4vw, 1.75rem); font-weight: 900; }
.hero-faces { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.face-chip { width: 52px; height: 52px; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.face-chip.human { animation-delay: .3s; }
.face-chip.bot { animation-delay: .6s; }
.face-chip svg { width: 100%; height: 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.rules { list-style: none; margin: 20px auto 0; padding: 0; display: grid; gap: 10px; max-width: 920px; }
.rules li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 3px solid var(--edge); border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; font-weight: 700; }
.rule-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; background: var(--gold); color: var(--on-gold); border: 2px solid var(--edge); border-radius: 4px; font-family: var(--font-px); font-weight: 400; }
@media (min-width: 720px) { .rules { grid-template-columns: repeat(3, 1fr); } }

.start-row { display: flex; justify-content: center; margin: 22px 0 6px; }
.picker { max-width: 920px; margin: 18px auto 0; text-align: center; }
.h2 { font-family: var(--font-px); font-size: 1.88rem; margin: 0; }
.h3 { font-family: var(--font-px); font-size: 1.44rem; margin: 0 0 8px; }
.picker > p { margin: 4px 0 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px;
  background: var(--surface); border: 3px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .1s, background-color .15s;
}
.cat:hover { transform: translateY(-2px); }
.cat:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.cat[aria-pressed="true"] { background: var(--green-soft); outline: 3px solid var(--grass); outline-offset: -8px; }
.cat svg { width: 44px; height: 44px; }
.cat-name { font-family: var(--font-px); font-size: 1.5rem; font-weight: 400; }
.cat-meta { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.cat.random { background: var(--gold); color: var(--on-gold); }
.cat.random .cat-meta { color: var(--on-gold); opacity: .8; }
.round-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; padding: 12px; background: var(--surface-2); border: 3px dashed var(--stone); border-radius: 10px; }
.round-pills p { width: 100%; margin: 0 0 2px; font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; background: var(--surface); border: 3px solid var(--edge); border-radius: 999px; box-shadow: var(--shadow-sm); font-weight: 800; cursor: pointer; }
.pill:active { transform: translateY(2px); box-shadow: none; }
.pill .res { font-size: .72rem; padding: 1px 6px; border-radius: 999px; border: 2px solid var(--edge); }
.res.win { background: var(--grass); color: var(--on-grass); }
.res.tie { background: var(--gold); color: var(--on-gold); }
.res.loss { background: var(--stone); color: var(--stone-ink); }

.options { display: flex; justify-content: center; margin: 22px auto 0; max-width: 920px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; width: 46px; height: 26px; background: var(--stone); border: 3px solid var(--edge); border-radius: 6px; position: relative; transition: background-color .15s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 3px; transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--red); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 3px; }

.tally { text-align: center; margin: 18px auto 0; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.tally b { color: var(--ink); }
.tally .t-w { color: var(--grass-dark); }
.tally .t-l { color: #b3261e; }
:root[data-theme="dark"] .tally .t-w { color: var(--grass-hi); }
:root[data-theme="dark"] .tally .t-l { color: var(--red); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tally .t-w { color: var(--grass-hi); } :root:not([data-theme="light"]) .tally .t-l { color: var(--red); } }
.tally .linkish { background: none; border: 0; padding: 0 2px; text-decoration: underline; cursor: pointer; color: var(--ink-soft); font-weight: 700; font-size: inherit; }
.load-msg { max-width: 640px; margin: 18px auto; padding: 12px; background: var(--red-soft); border: 3px solid var(--red); border-radius: 8px; font-weight: 700; }

/* ---------- round ---------- */
.statusbar {
  position: sticky; top: 55px; z-index: 15;
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  margin: -16px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 12px;
  padding: 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface-2); border-bottom: 3px solid var(--edge);
}
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-k { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.stat-v { font-family: var(--font-px); font-size: 1.88rem; font-weight: 400; line-height: 1; }
.stat-q .stat-v.bump { animation: bump .35s ease-out; }
.stat-hearts { align-items: center; }
.stat-left { align-items: flex-end; }
.hearts { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.heart { width: 21px; height: 18px; }
.heart rect { fill: var(--red); }
.heart.empty rect { fill: var(--stone); }
.heart.lost { animation: heartlose .5s ease-out; }
@keyframes heartlose { 0% { transform: scale(1.5); } 60% { transform: scale(.8); } 100% { transform: scale(1); } }
.pips { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.pip { width: 12px; height: 12px; background: var(--grass); border: 2px solid var(--edge); border-radius: 2px; transition: background-color .3s, transform .3s; }
.pip.out { background: var(--stone); transform: scale(.75); }
@keyframes bump { 0% { transform: scale(1.5); color: var(--red); } 100% { transform: scale(1); } }

.scene { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bubble { position: relative; display: inline-block; padding: 8px 12px; border: 3px solid var(--edge); border-radius: 10px; background: var(--surface); font-weight: 700; box-shadow: var(--shadow-sm); max-width: 100%; }
.bubble-human { background: var(--human); }
.bubble-you { background: var(--green-soft); }
#request-bubble { font-size: 1.15rem; }
.rival { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; background: var(--surface); border: 3px solid var(--gold-dark); border-radius: 999px; font-size: .85rem; font-weight: 800; }
.rival-q { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; background: var(--gold); color: var(--on-gold); border: 2px solid var(--edge); border-radius: 4px; font-family: var(--font-px); }

.board { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .board-side { position: sticky; top: 140px; }
}
.board-hint { margin: 0 0 8px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .cards, .cards.dense { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .cards, .cards.dense { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); } }

.card { perspective: 900px; min-width: 0; }
.card-inner { position: relative; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.card.out .card-inner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 3px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.front { display: flex; flex-direction: column; }
.back {
  position: absolute; inset: 0; transform: rotateY(180deg); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 6px;
  color: var(--stone-ink);
  background-color: var(--stone);
  background-image:
    linear-gradient(45deg, var(--stone-2) 25%, transparent 25%, transparent 75%, var(--stone-2) 75%),
    linear-gradient(45deg, var(--stone-2) 25%, transparent 25%, transparent 75%, var(--stone-2) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
.back .x { width: 30px; height: 30px; fill: var(--stone-ink); opacity: .9; }
.back-txt { font-family: var(--font-px); font-size: 1.25rem; font-weight: 400; background: var(--stone-2); padding: 1px 6px; border-radius: 4px; }
.back-why { font-size: .75rem; font-weight: 700; background: var(--stone-2); padding: 1px 6px; border-radius: 4px; max-width: 100%; }
.photo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-bottom: 3px solid var(--edge); background: var(--surface-2); cursor: zoom-in; }
.photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s; }
.photo:hover img { transform: scale(1.04); }
.photo:focus-visible { outline-offset: -5px; }
.tag { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; background: var(--surface); color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; font-family: var(--font-px); font-weight: 400; font-size: 1.31rem; }
.back .tag { position: static; }
.nviews { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; background: rgba(0,0,0,.66); color: #fff; border-radius: 4px; font-size: .72rem; font-weight: 800; }
.nviews svg { width: 11px; height: 11px; fill: #fff; }
.go { margin: 6px; min-height: 38px; border: 3px solid var(--edge); border-radius: 6px; background: var(--surface-2); font-weight: 900; cursor: pointer; box-shadow: var(--shadow-sm); }
.go:hover { background: var(--grass); color: var(--on-grass); }
.go:active { transform: translateY(2px); box-shadow: none; }
.cards.dense .go { font-size: .85rem; margin: 4px; min-height: 34px; }
.card.win .front { border-color: var(--gold-dark); box-shadow: 0 0 0 4px var(--gold), var(--shadow); animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 7px var(--gold-hi), var(--shadow); } }
.card.shake .card-inner { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.card .minus { position: absolute; left: 50%; top: 30%; transform: translate(-50%, 0); z-index: 5; pointer-events: none; font-family: var(--font-px); font-weight: 400; font-size: 1.75rem; color: #fff; background: var(--red); border: 2px solid var(--edge); border-radius: 4px; padding: 0 6px; animation: floatup 1s ease-out forwards; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }

.chat { display: flex; flex-direction: column; gap: 8px; min-height: 0; margin-bottom: 12px; }
.chat:empty { display: none; }
.msg { display: flex; align-items: flex-start; gap: 8px; }
.msg-human { flex-direction: row-reverse; }
.msg .bubble { animation: pop .28s cubic-bezier(.3, 1.6, .5, 1); }
.msg-human .bubble-human { font-family: var(--font-px); font-size: 1.44rem; }
.msg-human .bubble-human.long { font-family: var(--font-ui); font-size: 1rem; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.bank { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; text-align: left;
  background: var(--surface); border: 3px solid var(--edge); border-radius: 8px; box-shadow: var(--shadow-sm);
  font-weight: 800; cursor: pointer; transition: transform .08s, background-color .15s;
}
.chip:hover:not(:disabled) { background: var(--green-soft); transform: translateY(-1px); }
.chip:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.chip:disabled { cursor: default; }
.chip.asked { background: var(--surface-2); color: var(--ink-soft); box-shadow: none; border-style: dashed; }
.chip .ans { font-family: var(--font-px); font-size: 1.0rem; padding: 0 6px; border: 2px solid var(--edge); border-radius: 4px; color: var(--ink); }
.ans.yes { background: var(--grass); color: var(--on-grass); }
.ans.no { background: var(--red); color: #fff; }
.chip .dud { font-size: .72rem; font-weight: 800; color: var(--ink-soft); }
.bank.locked .chip:not(.asked) { opacity: .45; }
.chip.leaving { animation: chipout .32s ease-in forwards; pointer-events: none; }
@keyframes chipout { 30% { transform: scale(1.06); } 100% { opacity: 0; transform: scale(.5); } }
.asked-log { list-style: none; margin: 0 0 12px; padding: 8px; display: grid; gap: 6px; background: var(--surface-2); border: 2px dashed var(--stone); border-radius: 8px; }
.asked-log li { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; }
.asked-log .qn { font-family: var(--font-px); font-size: 1.1rem; color: var(--ink-soft); }
.asked-log .lt { flex: 1; min-width: 0; }
.asked-log .ans { font-family: var(--font-px); font-size: 1rem; padding: 0 6px; border: 2px solid var(--edge); border-radius: 4px; }
.asked-log .rm { font-size: .78rem; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.asked-log .rm.dud { color: var(--red); }
.bank-note { margin: 10px 0 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 40;
  transform: translate(-50%, 140%); opacity: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 18px; background: var(--surface); border: 3px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-big { font-family: var(--font-px); font-size: 1.88rem; font-weight: 400; line-height: 1.1; }
.toast-small { font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.toast.good { background: var(--green-soft); }
.toast.good .toast-big { color: var(--grass-dark); }
.toast.meh { background: var(--surface-2); }
.toast.bad { background: var(--red-soft); }
:root[data-theme="dark"] .toast.good .toast-big { color: var(--grass-hi); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast.good .toast-big { color: var(--grass-hi); } }

/* ---------- result ---------- */
.verdict { text-align: center; padding: 18px 12px 16px; margin-bottom: 18px; background: var(--surface); border: 3px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow); }
.verdict.win { background: var(--green-soft); }
.verdict.tie { background: var(--surface); }
.verdict.loss { background: var(--red-soft); }
.verdict-h { margin: 0; font-family: var(--font-px); font-size: clamp(2.4rem, 11vw, 4rem); font-weight: 400; line-height: 1.05; }
.verdict-h:focus { outline: none; }
.verdict.reveal-anim .verdict-h { animation: slam .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.verdict-line { margin: 8px auto 12px; font-weight: 800; font-size: 1.05rem; max-width: 40ch; }
.score { display: flex; justify-content: center; align-items: center; gap: 14px; }
.score-side { display: grid; justify-items: center; gap: 2px; }
.score-name { font-weight: 800; font-size: .85rem; }
.score-n { display: grid; place-items: center; min-width: 58px; height: 58px; padding: 0 6px; font-family: var(--font-px); font-size: 2.75rem; font-weight: 400; border: 3px solid var(--edge); border-radius: 8px; box-shadow: var(--shadow); }
.score-side.you .score-n { background: var(--grass); color: var(--on-grass); }
.score-side.you .score-n.bad { background: var(--red); color: #fff; }
.score-side.bot .score-n { background: var(--gold); color: var(--on-gold); }
.score-vs { font-family: var(--font-px); font-size: 1.5rem; font-weight: 400; color: var(--ink-soft); }

.reveal { display: grid; gap: 16px; }
@media (min-width: 900px) { .reveal { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }
.target-fig { margin: 0; padding: 12px; background: var(--surface); border: 3px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow); }
.target-fig > figcaption { font-family: var(--font-px); font-size: 1.44rem; font-weight: 400; margin-bottom: 8px; }
.target-photos { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .target-photos { grid-template-columns: 1fr; } }
.tp { margin: 0; position: relative; }
.tp img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 4px solid var(--grass); border-radius: 8px; }
.tp.wrong img { border-color: var(--red); }
.tp figcaption { font-size: .8rem; font-weight: 800; margin-top: 4px; }

.replay { padding: 12px; background: var(--surface); border: 3px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.replay-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.replay-head .h3 { margin: 0; }
.paths { display: grid; gap: 14px; }
@media (min-width: 620px) { .paths { grid-template-columns: 1fr 1fr; } }
.path { min-width: 0; }
.path-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--font-px); font-size: 1.31rem; }
.path.you .path-h { color: var(--grass-dark); }
.path.bot .path-h { color: var(--gold-dark); }
:root[data-theme="dark"] .path.you .path-h { color: var(--grass-hi); }
:root[data-theme="dark"] .path.bot .path-h { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .path.you .path-h { color: var(--grass-hi); } :root:not([data-theme="light"]) .path.bot .path-h { color: var(--gold); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { padding: 8px; background: var(--surface-2); border: 2px solid var(--edge); border-radius: 8px; transition: opacity .35s, transform .35s; }
.step.pending { opacity: 0; transform: translateY(8px); }
.step-q { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 800; font-size: .92rem; }
.step-q .qn { font-family: var(--font-px); color: var(--ink-soft); }
.step-q .ans { font-family: var(--font-px); font-size: 1.0rem; padding: 0 6px; border: 2px solid var(--edge); border-radius: 4px; }
.step-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.step-left { font-size: .8rem; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.step-left.dud { color: var(--red); }
.tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tile { position: relative; width: 38px; flex: none; }
.tile img { width: 38px; height: 29px; object-fit: cover; border: 2px solid var(--edge); border-radius: 3px; }
.tile span { position: absolute; left: 1px; top: 1px; font-size: .62rem; font-weight: 900; line-height: 1; padding: 1px 2px; background: var(--surface); color: var(--ink); border-radius: 2px; }
.tile.out img { filter: grayscale(1); opacity: .28; }
.tile.target img { border-color: var(--grass); box-shadow: 0 0 0 2px var(--grass); }
.step.final { background: var(--green-soft); }
.step.final.bad { background: var(--red-soft); }

.lesson { margin: 18px 0 0; padding: 14px 16px; background: var(--gold); color: var(--on-gold); border: 3px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow); }
.lesson-big { margin: 0 0 6px; font-weight: 900; font-size: 1.1rem; }
.lesson .small { margin: 0 0 10px; }
.lesson .links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.lesson .btn-ghost { background: rgba(255,255,255,.55); color: var(--on-gold); }
.lesson .btn-ghost:hover { background: #fff; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- lightbox ---------- */
.lightbox { padding: 0; border: 3px solid var(--edge); border-radius: 12px; background: var(--surface); color: var(--ink); width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 6px 0 var(--edge); }
.lightbox::backdrop { background: rgba(10, 14, 11, .72); }
.lb-in { padding: 12px; display: grid; gap: 8px; }
.lb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lb-title { margin: 0; font-family: var(--font-px); font-size: 1.62rem; }
.lb-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.lb-stage img { width: 100%; max-height: min(58dvh, 480px); object-fit: contain; background: var(--surface-2); border: 3px solid var(--edge); border-radius: 8px; }
.lb-count { margin: 0; text-align: center; }
.lb-thumbs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lb-thumbs button { padding: 0; border: 3px solid var(--edge); border-radius: 4px; background: none; cursor: pointer; opacity: .6; }
.lb-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--grass); }
.lb-thumbs img { width: 56px; height: 42px; object-fit: cover; }
.lb-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.foot { max-width: 1180px; margin: 0 auto; padding-top: 8px; padding-bottom: 28px; font-size: .8rem; color: var(--ink-soft); text-align: center; }
.foot p { margin: 0 auto; max-width: 70ch; }
.noscript { text-align: center; font-weight: 800; }

/* ---------- phones ---------- */
@media (max-width: 420px) {
  .statusbar { gap: 6px; }
  .heart { width: 17px; height: 15px; }
  .rival { font-size: .78rem; }
  #request-bubble { font-size: 1.05rem; }
  .chip { font-size: .92rem; padding: 7px 10px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .card-inner { transform: none !important; }
  .back { transform: none; opacity: 0; }
  .card.out .back { opacity: 1; }
  .card.out .front { visibility: hidden; }
  .card.win .front { animation: none; }
}

/* Jersey 10 ships one weight: never faux-bold it. */
.h2, .h3, .path-h, .lb-title, .rival-q, .step-q .qn, .btn-xl > span, .t-vs { font-weight: 400; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- share ---------- */
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.card-preview { display: block; width: 100%; max-width: 420px; height: auto; margin: 16px auto 0; border: 3px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow-sm); }
.btn-share { background: var(--gold); color: var(--on-gold); min-width: 200px; }
.btn-share:hover { background: var(--gold-hi); }
.btn-share svg { width: 18px; height: 18px; fill: currentColor; }
.share-box { max-width: 460px; margin: 12px auto 0; text-align: left; font-weight: 800; font-size: .9rem; }
.share-box textarea { display: block; width: 100%; margin-top: 6px; padding: 10px; font: 600 .95rem/1.4 var(--font-ui); color: var(--ink); background: var(--surface); border: 3px solid var(--edge); border-radius: 8px; resize: vertical; }
.verdict .tally { margin-top: 12px; }

/* ---------- round time ---------- */
.score-box { width: min(100%, 420px); margin: 10px auto 0; padding: 4px 14px 14px; background: var(--surface); border: 3px solid var(--edge); border-radius: 10px; }
.score-box .verdict-line { margin: 8px auto 10px; white-space: pre-line; }   /* scores, then the outcome on its own line */
.time-race { width: min(100%, 420px); margin: 14px auto 0; padding: 0 14px; text-align: center; }
.time-race .tr-h { font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.time-race .tr-tiles { display: flex; justify-content: center; align-items: center; gap: 12px; }
.time-race .tr-side { display: grid; justify-items: center; gap: 3px; }
.time-race .tr-name { font-weight: 800; font-size: .78rem; }
.time-race .tr-n { display: grid; place-items: center; min-width: 78px; height: 38px; padding: 0 8px; font-weight: 900; font-size: 1.15rem;
  font-variant-numeric: tabular-nums; border: 2px solid var(--edge); border-radius: 6px; }
.time-race .you .tr-n { background: var(--grass); color: #161616; }
.time-race .bot .tr-n { background: var(--gold); color: var(--on-gold); }
.time-race .tr-vs { font-family: var(--font-px); font-size: 1.05rem; color: var(--ink-soft); margin-top: 14px; }
.time-race .tr-cap { margin: 8px 0 2px; font-weight: 400; font-size: .9rem; }
.time-race .tnote { margin: 0; font-size: .74rem; color: var(--ink-soft); }
