/* STOP THE BUS — game styles. Site typography (Bricolage Grotesque, JetBrains Mono, Caveat), game's own colours. */
:root {
  --bg: #FFF7EC; --dots: #F3E3CC; --ink: #161C40; --muted: #555E82; --card: #FFFFFF; --rule: #EAD9C2; --soft: #FFF0DC;
  --red: #E5383B; --red-dark: #B21E29; --yellow: #FFC75A; --navy: #161C40; --good: #1E9E62; --bad: #D33A3A; --maybe: #E39A12;
  --lift: 0 6px 0 rgba(22,28,64,.10), 0 22px 40px -22px rgba(22,28,64,.45);
  --f-display: "Bricolage Grotesque", system-ui, sans-serif; --f-mono: "JetBrains Mono", ui-monospace, monospace; --f-hand: "Caveat", cursive;
  color-scheme: light;
}
html[data-gf-dark] {
  --bg: #11142B; --dots: #1C2146; --ink: #EEF1FA; --muted: #A9B2D0; --card: #1A1F3D; --rule: #2E3560; --soft: #222851;
  --lift: 0 6px 0 rgba(0,0,0,.35), 0 22px 40px -22px rgba(0,0,0,.8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-display); -webkit-font-smoothing: antialiased; }
.stb {
  min-height: 100vh; padding: 0 0 72px; overflow-x: clip;
  background-image: radial-gradient(var(--dots) 1.6px, transparent 1.7px); background-size: 22px 22px;
}
.stb-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .stb-wrap { padding: 0 32px; } }
.stb :focus-visible { outline: 3px solid #2F80ED; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input { font: inherit; color: inherit; }
.hand { font-family: var(--f-hand); font-weight: 700; }
.mono { font-family: var(--f-mono); }
.kick { font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* ---------- buttons: chunky party-game pills ---------- */
.b {
  --c: var(--navy); --fg: #fff; --edge: rgba(0,0,0,.28);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--c); color: var(--fg); cursor: pointer; text-decoration: none;
  font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: -.01em;
  box-shadow: 0 5px 0 var(--edge), 0 14px 22px -14px rgba(22,28,64,.6);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s;
}
.b:hover { filter: brightness(1.06); transform: translateY(-1px); }
.b:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge), 0 6px 12px -10px rgba(22,28,64,.6); }
.b:disabled { cursor: not-allowed; filter: grayscale(.6) opacity(.55); transform: none; }
.b-red { --c: var(--red); }
.b-yellow { --c: var(--yellow); --fg: var(--navy); }
.b-white { --c: var(--card); --fg: var(--ink); --edge: var(--rule); }
html[data-gf-dark] .b:not(.b-red):not(.b-yellow):not(.b-white) { --c: var(--yellow); --fg: var(--navy); }
.b-sm { min-height: 42px; padding: 0 16px; font-size: 15px; }
.b-ghost { background: transparent; box-shadow: none; color: var(--ink); border: 2px solid var(--rule); min-height: 44px; font-size: 15px; }
.b-ghost:active { transform: translateY(1px); box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--rule); background: var(--card); cursor: pointer; font-size: 20px; display: inline-grid; place-items: center; }

/* ---------- welcome ---------- */
.hero { display: grid; gap: 18px; align-items: center; padding-top: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: 5fr 6fr; gap: 28px; padding-top: 44px; } }
.hero h1 { margin: 0; font-size: clamp(56px, 11vw, 116px); line-height: .84; letter-spacing: -.05em; font-weight: 800; font-stretch: 78%; }
.hero h1 .l { display: inline-block; animation: hop .7s cubic-bezier(.3,1.6,.5,1) both; }
.hero h1 .bang { color: var(--red); }
@keyframes hop { from { transform: translateY(40px) scale(.6); opacity: 0; } }
.hero .lede { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--muted); max-width: 30em; margin: 16px 0 24px; }
.hero .note { font-size: 24px; color: var(--red); transform: rotate(-3deg); display: inline-block; margin-top: 14px; }
.scene { margin: 0; border-radius: 28px; overflow: hidden; box-shadow: var(--lift); border: 4px solid var(--card); background: #FFE1B8; aspect-ratio: 12 / 7; }
.scene img { display: block; width: 100%; height: 100%; }

.steps { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--card); border-radius: 22px; padding: 20px; box-shadow: var(--lift); border-top: 8px solid var(--c); }
.step > b { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; font-size: 20px; margin-bottom: 8px; }
.step h3 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); line-height: 1.45; }
.cat-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* ---------- chips & category tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; background: var(--c, var(--soft)); color: #fff; white-space: nowrap; }
.chip.lite { background: var(--soft); color: var(--ink); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--rule); background: var(--card); font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .12s, background .15s; }
.opt input:checked + span { background: var(--c, var(--navy)); border-color: var(--c, var(--navy)); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
html[data-gf-dark] .opt input:not([style]):checked + span { --c: var(--yellow); color: var(--navy); }
.opt input:focus-visible + span { outline: 3px solid #2F80ED; outline-offset: 2px; }

/* ---------- panels & forms ---------- */
.panel { background: var(--card); border-radius: 28px; padding: 22px; box-shadow: var(--lift); margin-top: 24px; }
@media (min-width: 720px) { .panel { padding: 30px; } }
.panel h2 { margin: 0 0 4px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; font-stretch: 85%; }
.field { margin-top: 22px; }
.field > label, .field > .lab { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.text { width: 100%; min-height: 54px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--rule); background: var(--bg); font-size: 20px; font-weight: 700; }
.text:focus { border-color: #2F80ED; outline: none; box-shadow: 0 0 0 4px rgba(47,128,237,.18); }
.code-in { font-family: var(--f-mono); letter-spacing: .5em; text-transform: uppercase; text-align: center; font-size: 30px; max-width: 280px; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatars button { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--rule); background: var(--bg); font-size: 26px; cursor: pointer; transition: transform .12s; }
.avatars button[aria-pressed="true"] { border-color: var(--red); background: #FFE3E0; transform: scale(1.1) rotate(-4deg); }
.err { color: var(--bad); font-weight: 700; min-height: 1.4em; margin: 14px 0 0; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; flex-wrap: wrap; }
.back { background: none; border: 0; cursor: pointer; font-family: var(--f-hand); font-size: 24px; color: var(--muted); padding: 8px 0; }

/* ---------- lobby ---------- */
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.code-tiles { display: flex; gap: 8px; }
.code-tiles span { width: 64px; height: 76px; border-radius: 16px; display: grid; place-items: center; font-size: 46px; font-weight: 800; color: #fff; background: var(--c); box-shadow: 0 5px 0 rgba(0,0,0,.22); }
.code-tiles span:nth-child(even) { transform: rotate(3deg); } .code-tiles span:nth-child(odd) { transform: rotate(-3deg); }
.players { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 14px; }
.pcard { position: relative; background: var(--bg); border-radius: 20px; padding: 16px 12px 14px; text-align: center; border: 2px solid var(--rule); animation: popin .4s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }
.ava { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
.pcard .nm { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.pcard .st { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.pcard .st.ok { color: var(--good); }
.pcard .crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 22px; }
.pcard .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; }
.pcard .mv { margin-top: 8px; border: 0; background: var(--soft); border-radius: 999px; padding: 5px 10px; cursor: pointer; font-family: var(--f-mono); font-size: 11px; }
.teams { display: grid; gap: 16px; margin-top: 14px; }
@media (min-width: 720px) { .teams { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.team { border-radius: 24px; padding: 16px; background: color-mix(in srgb, var(--c) 12%, var(--card)); border: 3px solid var(--c); }
.team h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 22px; color: var(--c); letter-spacing: -.02em; }
html[data-gf-dark] .team h3 { color: #fff; }
.team .players { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.wait { font-family: var(--f-hand); font-size: 26px; color: var(--muted); margin: 0; }
.dots::after { content: "…"; animation: dots 1.4s steps(4) infinite; display: inline-block; width: 1em; text-align: left; }

/* ---------- round ---------- */
.hud { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 2px solid var(--rule); }
.hud .stb-wrap { display: flex; align-items: center; gap: 14px; min-height: 76px; }
.hud .meta { flex: 1; min-width: 0; }
.hud .meta b { display: block; font-size: 20px; letter-spacing: -.02em; }
.hud .meta span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.letter-badge { width: 60px; height: 60px; border-radius: 18px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 40px; font-weight: 800; box-shadow: 0 5px 0 var(--red-dark); transform: rotate(-4deg); flex: none; }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--rule); }
.ring .bar { stroke: var(--good); stroke-linecap: round; transition: stroke .3s; }
.ring.warn .bar { stroke: var(--maybe); }
.ring.hurry .bar { stroke: var(--bad); }
.ring.hurry { animation: throb .5s ease-in-out infinite alternate; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 17px; font-weight: 700; }
@keyframes throb { to { transform: scale(1.08); } }

.sheet-note { margin: 18px 0 0; font-size: 24px; color: var(--muted); }
.cards { display: grid; gap: 14px; margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ccard { --c: #888; background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: var(--lift); border: 3px solid transparent; transition: border-color .2s, transform .2s; }
.ccard:focus-within { border-color: var(--c); transform: translateY(-3px); }
.ccard header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--c); color: #fff; font-weight: 800; font-size: 18px; }
.ccard header .ic { font-size: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.ccard header .ok { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--good); display: grid; place-items: center; font-size: 15px; transform: scale(0); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.ccard.done header .ok { transform: scale(1); }
.ccard input { width: 100%; border: 0; background: transparent; padding: 16px; font-size: 22px; font-weight: 700; min-height: 64px; }
.ccard input:focus { outline: none; }
.ccard .hint { padding: 0 16px 12px; font-family: var(--f-mono); font-size: 11px; color: var(--bad); min-height: 24px; }
.ccard input:disabled { opacity: .7; }

.progress { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.prog { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 2px solid var(--rule); font-weight: 700; font-size: 14px; }
.prog .ava { width: 28px; height: 28px; font-size: 16px; margin: 0; box-shadow: none; }
.prog i { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.prog.full { border-color: var(--good); }

.stop-dock { position: sticky; bottom: 0; z-index: 15; padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); margin-top: 24px; background: linear-gradient(transparent, var(--bg) 40%); }
.stop-btn {
  display: flex; width: 100%; max-width: 560px; margin: 0 auto; min-height: 84px; align-items: center; justify-content: center; gap: 14px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--red); color: #fff; font-family: var(--f-display); font-weight: 800;
  font-size: clamp(24px, 5vw, 34px); letter-spacing: -.02em; box-shadow: 0 8px 0 var(--red-dark), 0 20px 30px -14px rgba(178,30,41,.8);
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.stop-btn .bell { font-size: 1.1em; display: inline-block; }
.stop-btn.ready { animation: ready 1.1s ease-in-out infinite; }
.stop-btn.ready .bell { animation: ring 1.1s ease-in-out infinite; }
.stop-btn:active { transform: translateY(7px); box-shadow: 0 1px 0 var(--red-dark), 0 8px 14px -10px rgba(178,30,41,.8); }
.stop-btn:disabled { cursor: not-allowed; filter: grayscale(.85) opacity(.5); animation: none; font-size: clamp(18px, 4vw, 24px); }
@keyframes ready { 50% { transform: scale(1.03); box-shadow: 0 8px 0 var(--red-dark), 0 0 0 12px rgba(229,56,59,.18); } }
@keyframes ring { 10%, 30% { transform: rotate(-16deg); } 20%, 40% { transform: rotate(16deg); } 50% { transform: none; } }

/* letter reveal + stop announcement overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(17,20,43,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.overlay .kick { color: #FFC75A; font-size: 14px; }
.big-letter { width: min(56vw, 260px); aspect-ratio: 1; margin: 10px auto; border-radius: 42px; background: var(--red); display: grid; place-items: center; font-size: min(40vw, 190px); font-weight: 800; line-height: 1; box-shadow: 0 14px 0 var(--red-dark), 0 40px 80px -20px rgba(0,0,0,.6); }
.big-letter.spin { animation: shake .09s linear infinite; }
.big-letter.land { animation: land .6s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes shake { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes land { from { transform: scale(1.6) rotate(-14deg); } to { transform: rotate(-4deg); } }
.count { font-size: 44px; font-weight: 800; min-height: 1.2em; margin: 18px 0 0; }
.count.pop { animation: pop .5s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } }
.stop-card { max-width: 560px; }
.stop-card .ding { font-size: clamp(56px, 13vw, 110px); font-weight: 800; letter-spacing: -.05em; line-height: .9; color: #FFC75A; animation: slam .55s cubic-bezier(.3,1.7,.5,1) both; }
.stop-card p { font-size: 24px; margin: 14px 0 0; }
.stop-card .mini-bus { width: min(80vw, 420px); margin: 18px auto 0; display: block; border-radius: 18px; animation: brake 1s cubic-bezier(.2,.9,.3,1) both; }
@keyframes slam { from { transform: scale(2.6) rotate(-8deg); opacity: 0; } 60% { transform: scale(.94) rotate(2deg); } }
@keyframes brake { from { transform: translateX(60vw); } 80% { transform: translateX(-12px) rotate(-1.5deg); } }

/* ---------- review ---------- */
.review { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 900px) { .review { grid-template-columns: repeat(2, 1fr); } }
.rcard { background: var(--card); border-radius: 22px; box-shadow: var(--lift); overflow: hidden; }
.rcard header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--c); color: #fff; font-weight: 800; font-size: 18px; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 2px solid var(--rule); }
.rrow:first-of-type { border-top: 0; }
.rrow .who { flex: none; }
.rrow .ava { width: 36px; height: 36px; font-size: 19px; margin: 0; box-shadow: none; }
.rrow .ans { flex: 1; min-width: 0; }
.rrow .ans b { display: block; font-size: 19px; overflow-wrap: anywhere; }
.rrow .ans small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.rrow.no .ans b { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.rrow.blank .ans b { color: var(--muted); font-weight: 600; font-style: italic; }
.tag { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.tag.unique { background: #DDF6E8; color: #116B41; }
.tag.shared { background: #FFF0CC; color: #8A5A00; }
.tag.no { background: #FDE2E2; color: #9C2222; }
.tag.maybe { background: #FFEBC7; color: #8A5A00; }
.judge { display: flex; gap: 6px; }
.judge button { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--rule); background: var(--bg); cursor: pointer; font-size: 17px; font-weight: 800; }
.judge button[aria-pressed="true"].y { background: var(--good); border-color: var(--good); color: #fff; }
.judge button[aria-pressed="true"].n { background: var(--bad); border-color: var(--bad); color: #fff; }
.ai-note { font-size: 12px; color: var(--muted); margin-top: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- scores & podium ---------- */
.board { display: grid; gap: 10px; margin-top: 18px; }
.brow { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 20px; background: var(--card); box-shadow: var(--lift); overflow: hidden; animation: slide .5s cubic-bezier(.2,.9,.3,1) both; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.brow .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--c) 16%, transparent); width: 0; transition: width 1.2s cubic-bezier(.2,.9,.3,1); }
.brow > * { position: relative; }
.brow .rank { font-family: var(--f-mono); font-weight: 700; width: 28px; color: var(--muted); }
.brow .ava { width: 46px; height: 46px; font-size: 24px; margin: 0; }
.brow .nm { flex: 1; font-weight: 800; font-size: 19px; min-width: 0; overflow-wrap: anywhere; }
.brow .plus { font-family: var(--f-mono); font-weight: 700; color: var(--good); }
.brow .tot { font-size: 30px; font-weight: 800; min-width: 2.5em; text-align: right; letter-spacing: -.03em; }
.brow.lead { outline: 4px solid var(--yellow); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-top: 36px; }
.pod { flex: 1; max-width: 200px; text-align: center; }
.pod .ava { width: 74px; height: 74px; font-size: 40px; }
.pod .nm { font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
.pod .title { font-family: var(--f-hand); font-size: 21px; color: var(--muted); line-height: 1.05; min-height: 2.1em; }
.pod .block { margin-top: 8px; border-radius: 18px 18px 0 0; background: var(--c); color: #fff; font-size: 40px; font-weight: 800; display: grid; place-items: center; box-shadow: inset 0 -8px 0 rgba(0,0,0,.15); animation: rise .9s cubic-bezier(.2,.9,.3,1) both; transform-origin: bottom; }
.pod.p1 .block { height: 170px; } .pod.p2 .block { height: 120px; animation-delay: .2s; } .pod.p3 .block { height: 86px; animation-delay: .35s; }
.pod.p1 .ava { animation: bob 1.6s ease-in-out infinite; }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.winner-line { text-align: center; font-size: clamp(34px, 6vw, 60px); font-weight: 800; letter-spacing: -.04em; margin: 22px 0 0; line-height: 1; }
.winner-line .hand { color: var(--red); display: block; font-size: .5em; margin-bottom: 8px; letter-spacing: 0; }

/* learn modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(17,20,43,.6); display: grid; place-items: center; padding: 16px; animation: fade .2s both; }
.modal .panel { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; margin: 0; position: relative; }
.modal .close { position: absolute; top: 14px; right: 14px; }
.learn-cat { margin-top: 18px; }
.learn-cat h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; font-size: 19px; }
.word { padding: 12px 14px; border-radius: 16px; background: var(--bg); margin-top: 8px; border-left: 6px solid var(--c); }
.word b { font-size: 19px; } .word p { margin: 4px 0 0; color: var(--muted); line-height: 1.4; } .word em { display: block; margin-top: 4px; }
.tip { margin-top: 20px; padding: 14px 16px; border-radius: 16px; background: #FFF0CC; color: #5C3D00; font-weight: 600; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--lift); animation: fade .2s both; max-width: calc(100% - 32px); text-align: center; }
@keyframes dots { from { width: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
