/* Fonts live in the project: no request to third parties (licence in fonts/OFL.txt) */
@font-face {
    font-family: 'Fredoka';
    src: url('fonts/fredoka-latin-ext.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Fredoka';
    src: url('fonts/fredoka-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Nunito';
    src: url('fonts/nunito-latin-ext.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Nunito';
    src: url('fonts/nunito-latin.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* LetterHop — orange theme, light + dark */
:root {
  --primary: #E8590C;
  --primary-strong: #C2410C;
  --primary-soft: #FFE3CC;
  --on-primary-soft: #6B2A05;
  --bg: #FFF8F1;
  --surface: #FFFFFF;
  --surface-2: #FDF0E3;
  --surface-3: #F6E3D0;
  --text: #2A1A10;
  --muted: #7A6656;
  --line: #EBD9C8;
  --wrong: #DC2626;
  --wrong-bg: #FDE7E7;
  --ok: #15803D;
  --ok-bg: #DCFCE7;
  --tip: #7C3AED;
  --tip-bg: #EDE6FE;
  --tile: #FFFFFF;
  --tile-end: #FFE3CC;
  --shadow: 0 1px 2px rgba(42, 26, 16, .06), 0 6px 20px rgba(42, 26, 16, .06);
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #FB923C; --primary-strong: #F97316; --primary-soft: #4A2610; --on-primary-soft: #FFE3CC;
    --bg: #16100B; --surface: #211811; --surface-2: #2A1F17; --surface-3: #3A2B20; --text: #F6EBE0; --muted: #B7A493;
    --line: #3F3025; --wrong: #F87171; --wrong-bg: #3B1520; --ok: #4ADE80; --ok-bg: #12321F; --tip: #A78BFA; --tip-bg: #2A2145;
    --tile: #2A1F17; --tile-end: #4A2610; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --primary: #FB923C; --primary-strong: #F97316; --primary-soft: #4A2610; --on-primary-soft: #FFE3CC;
    --bg: #16100B; --surface: #211811; --surface-2: #2A1F17; --surface-3: #3A2B20; --text: #F6EBE0; --muted: #B7A493;
    --line: #3F3025; --wrong: #F87171; --wrong-bg: #3B1520; --ok: #4ADE80; --ok-bg: #12321F; --tip: #A78BFA; --tip-bg: #2A2145;
    --tile: #2A1F17; --tile-end: #4A2610; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 16px/1.5 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--primary); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 14px; border: 0; font-weight: 800; cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-strong); }
:root[data-theme="dark"] .btn-primary { color: #2A1204; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #2A1204; } }
.btn-soft { background: var(--primary-soft); color: var(--on-primary-soft); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Home ---------- */
.home { max-width: 980px; margin: 0 auto; padding: 28px 20px 40px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; gap: 6px; }
.topbar { align-items: center; }
.topbar .theme-tabs { display: none; margin-right: auto; }
.theme-tabs button { padding: 7px 13px; }
@media (min-width: 641px) { .topbar .theme-tabs { display: flex; } .topbar .theme-cycle { display: none; } }
.lang-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .85rem; }
.hero { text-align: center; padding: 24px 0 26px; }
.hero .logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 14px 36px color-mix(in srgb, var(--primary) 35%, transparent); }
.hero h1 { font-size: 2.6rem; font-weight: 900; letter-spacing: -.03em; margin: 16px 0 4px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 440px; }
.home-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .home-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.05rem; margin: 0 0 14px; font-weight: 800; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.level { position: relative; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.level:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.level.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.level strong { display: block; font-size: 1rem; }
.level .dots { display: flex; gap: 3px; margin: 6px 0 4px; }
.level .dots i { width: 14px; height: 5px; border-radius: 3px; background: var(--surface-3); }
.level .dots i.on { background: var(--primary); }
.level small { color: var(--muted); font-size: .78rem; }
.resume-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--primary-soft); color: var(--on-primary-soft); margin-bottom: 12px; cursor: pointer; border: 0; width: 100%; text-align: left; }
.resume-wrap { position: relative; margin-bottom: 12px; }
.resume-wrap .resume-card { margin-bottom: 0; padding-right: 54px; }
.resume-discard { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--on-primary-soft); display: grid; place-items: center; cursor: pointer; }
.resume-discard:hover { background: color-mix(in srgb, var(--on-primary-soft) 14%, transparent); }
.resume-card .mini { width: 48px; height: 48px; flex: none; }
.resume-card strong { display: block; }
.resume-card span { font-size: .85rem; opacity: .85; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.howto li { display: flex; gap: 12px; margin-bottom: 14px; }
.howto ol { list-style: none; padding: 0; margin: 0; }
.howto .n { width: 30px; height: 30px; border-radius: 10px; background: var(--primary-soft); color: var(--on-primary-soft); display: grid; place-items: center; font-weight: 900; flex: none; }
.howto p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.footer { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
@font-face { font-family: 'Stack Sans Notch'; src: url('/fonts/StackSansNotch.ttf') format('truetype'); font-weight: normal; font-style: normal; font-display: swap; }
.credit-block { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.credit { color: var(--muted); text-decoration: none; display: inline-flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.credit-name { font-family: 'Stack Sans Notch', 'Nunito', sans-serif; font-size: 1.08rem; color: var(--text); letter-spacing: .01em; transition: color .15s; }
.credit:hover .credit-name, .credit:focus-visible .credit-name { color: var(--primary); }
.credit-ai { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); opacity: .8; }
.credit-ai svg { color: var(--primary); }
@media (max-width: 560px) { .footer { flex-direction: column; } .credit-block { align-items: center; } }
.footer-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.donate-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 12px; text-decoration: none; cursor: pointer; font-size: .8rem; color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
}
.donate-btn svg.i { width: 14px; height: 14px; color: #E5484D; stroke-width: 2.2; transition: transform .2s; }
.donate-btn:hover { color: var(--text); border-color: #E5484D; background: rgba(229, 72, 77, 0.12); }
.donate-btn:hover svg.i { transform: scale(1.15); }
.version-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: .8rem; color: var(--muted); transition: color .2s, border-color .2s; }
.version-btn:hover { color: var(--text); border-color: var(--primary); }

/* Donate modal */
.donate-modal-icon { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: rgba(229, 72, 77, 0.12); display: flex; align-items: center; justify-content: center; color: #E5484D; }
.donate-modal-icon svg.i { width: 28px; height: 28px; stroke-width: 2.2; }
.donate-reasons { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 20px; text-align: left; }
.donate-reason { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.donate-reason-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: rgba(229, 72, 77, 0.12); color: #E5484D; display: flex; align-items: center; justify-content: center; }
.donate-reason-icon svg.i { width: 17px; height: 17px; }
.donate-reason strong { display: block; font-size: .88rem; margin-bottom: 2px; }
.donate-reason p { color: var(--muted); font-size: .8rem; line-height: 1.4; margin: 0; }
.donate-cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 44px; font-weight: 800; font-size: .95rem; }

.hero h1 { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; letter-spacing: -.01em; }
.total { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 800; font-size: .88rem; }
.total svg.i { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.levels { grid-template-columns: repeat(3, 1fr); }
.level { padding: 12px 10px; }
.level small { display: block; line-height: 1.3; }
.panel h2 + .seg { margin-bottom: 18px; }
.btn.play { height: 52px; font-size: 1.05rem; }
.example { display: flex; flex-direction: column; gap: 5px; align-items: center; margin: 0 0 18px; }
.example-row { display: flex; gap: 5px; }
.example-row span { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font: 600 1.05rem 'Fredoka', 'Nunito', sans-serif; background: var(--surface-2); color: var(--text); }
.example-row span.changed { background: var(--primary); color: #fff; }

/* ---------- Game ---------- */
.game { max-width: 560px; margin: 0 auto; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.game-bar { display: flex; align-items: center; gap: 6px; padding: 2px 0 4px; flex: none; }
.game-bar .title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.game-bar .title img { width: 28px; height: 28px; border-radius: 8px; }
.game-bar .title strong { font: 600 1.15rem 'Fredoka', 'Nunito', sans-serif; }
@media (max-width: 340px) { .game-bar .title img { display: none; } }
.badge { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--on-primary-soft); white-space: nowrap; }
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: .82rem; font-weight: 700; margin-bottom: 8px; flex: none; }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.stats b.over { color: var(--wrong); }

/* --rows: start, minimum words and end. Tiles shrink so that the whole ladder fits when it can */
.board { --n: 5; --rows: 6; --tile-size: clamp(30px, min(calc((min(100vw, 560px) - 84px - (var(--n) - 1) * 5px) / var(--n)), calc((100dvh - 352px) / var(--rows) - 6px)), 54px); position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ladder { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; scrollbar-width: thin; }
.ladder::before, .ladder::after { content: ''; margin: auto 0; }
.ladder-end { flex: none; padding-top: 6px; border-top: 2px dashed var(--line); }
.row { display: grid; grid-template-columns: 24px auto 24px; align-items: center; justify-content: center; gap: 6px; flex: none; }
.row-n { width: 22px; flex: none; text-align: right; font-size: .74rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-n svg.i { width: 23px; height: 23px; color: var(--primary); display: block; margin-left: auto; }
.tiles { display: flex; gap: 5px; }
.tile { width: var(--tile-size); height: var(--tile-size); border-radius: 11px; display: grid; place-items: center; padding: 0; border: 2px solid var(--line); background: var(--tile); color: var(--text); font: 600 calc(var(--tile-size) * .52) 'Fredoka', 'Nunito', sans-serif; line-height: 1; user-select: none; transition: background .12s, border-color .12s, transform .12s; }
.tile.match { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.tile.changed { border-color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.row.first .tile { background: var(--surface-2); }
.row.last .tile { background: var(--tile-end); border-color: var(--primary); color: var(--on-primary-soft); }
.row.won .tile { background: var(--ok); border-color: var(--ok); color: #fff; animation: hopIn .45s ease backwards; }
.row.won .tile:nth-child(2) { animation-delay: .05s; } .row.won .tile:nth-child(3) { animation-delay: .1s; } .row.won .tile:nth-child(4) { animation-delay: .15s; } .row.won .tile:nth-child(5) { animation-delay: .2s; } .row.won .tile:nth-child(6) { animation-delay: .25s; }
@keyframes hopIn { 40% { transform: translateY(-12px); } }
.row.current .tile { cursor: pointer; border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.row.current .tile:hover:not(:disabled) { transform: translateY(-2px); }
.row.current .tile.sel { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 35%, transparent); transform: translateY(-3px); }
.row.current .tile.tip:not(.sel) { border-color: var(--tip); background: var(--tip-bg); }
.row.current .tile.wrong { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }
.row.shake .tiles { animation: shake .38s ease; }
.row.nudge .tile { animation: nudge .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes nudge { 40% { transform: translateY(-5px); } }
.row.slot .tile.empty { border-style: dashed; background: transparent; }
.row.slot .row-n { opacity: .55; }
.paused .tile { color: transparent !important; }
.pause-cover { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); border-radius: 14px; padding: 20px; }
.pause-cover h3 { margin: 0 0 4px; font-size: 1.4rem; }
.pause-cover p { margin: 0 0 14px; color: var(--muted); }

.side { flex: none; display: flex; flex-direction: column; gap: 7px; padding-top: 7px; }
.prompt { margin: 0; text-align: center; font-size: .85rem; font-weight: 700; color: var(--muted); min-height: 1.3em; }
.prompt.go { color: var(--primary); }
.keyboard { display: flex; flex-direction: column; gap: 5px; }
.key-row { display: flex; justify-content: center; gap: 4px; }
.key { flex: 1 1 0; min-width: 0; max-width: 46px; height: clamp(38px, 5.6dvh, 50px); padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: 600 1.05rem 'Fredoka', 'Nunito', sans-serif; cursor: pointer; display: grid; place-items: center; touch-action: manipulation; }
.key:hover { border-color: var(--primary); }
.key:active { background: var(--primary-soft); }
.key.wide { flex: 1.5 1 0; max-width: 70px; }
.key:disabled { opacity: .4; cursor: default; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 800; color: var(--text); }
.tool:hover { border-color: var(--primary); }
.tool:disabled { opacity: .45; cursor: default; }
.tool.off, .btn.off { opacity: .45; }
.tool.on { background: var(--tip-bg); border-color: var(--tip); }
.tool .pill { font-size: .68rem; font-weight: 900; background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 1px 6px; }
.tip-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-radius: 14px; padding: 9px 12px; background: var(--tip-bg); border: 1px solid color-mix(in srgb, var(--tip) 40%, transparent); }
.tip-card h3 { margin: 0; font-size: .92rem; display: flex; align-items: center; gap: 6px; }
.tip-card h3 svg.i { color: var(--tip); width: 18px; height: 18px; }
.tip-card p { margin: 0; font-size: .88rem; }
.row-actions { display: flex; gap: 6px; margin-left: auto; }
.tip-card .btn { height: 36px; padding: 0 12px; font-size: .84rem; }

/* ---------- Sheets / dialogs ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 23, .45); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal .box { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: 24px; padding: 22px; box-shadow: 0 24px 64px rgba(0,0,0,.3); animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@media (max-width: 560px) { .modal { align-items: flex-end; padding: 0; } .modal .box { border-radius: 24px 24px 0 0; max-height: 90dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); } }
.modal h3 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 900; }
.modal p.muted { color: var(--muted); margin: 0 0 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.menu-list { display: flex; flex-direction: column; margin: 0 -8px; }
.menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: transparent; padding: 12px; border-radius: 12px; cursor: pointer; text-align: left; font-weight: 700; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list button svg.i { color: var(--muted); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-weight: 700; cursor: pointer; }
.setting + .setting { border-top: 1px solid var(--line); }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 22px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 7px 6px; font-weight: 800; font-size: .82rem; color: var(--muted); cursor: pointer; }
.seg button.sel { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.rules h4 { margin: 14px 0 2px; }
.rules p { margin: 0; color: var(--muted); }
.release h4 { margin: 12px 0 4px; }
.release ul { margin: 0; padding-left: 18px; color: var(--muted); }
.win-box { text-align: center; }
.win-box .trophy { width: 76px; height: 76px; border-radius: 24px; margin: 4px auto 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.win-box .trophy svg.i { width: 40px; height: 40px; }
.win-box .record { display: inline-block; margin-top: 8px; font-weight: 900; color: var(--tip); }
.lang-list button { justify-content: space-between; }

.toast { position: fixed; left: 50%; top: calc(58px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 90; background: #0F172A; color: #F1F5F9; padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: .9rem; transition: all .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--wrong); color: #fff; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.win-box .stars { display: flex; justify-content: center; gap: 4px; margin: 2px 0 8px; }
.stars span { color: var(--surface-3); }
.stars span.on { color: #F59E0B; }
.stars svg.i { width: 40px; height: 40px; fill: currentColor; stroke: none; }
.stars span:nth-child(2) svg.i { width: 50px; height: 50px; }
.score { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin: 2px 0 6px; }
.score b { font: 600 2.6rem 'Fredoka', 'Nunito', sans-serif; color: var(--primary); line-height: 1; }
.score span { color: var(--muted); font-weight: 800; }
.win-box p.muted { margin: 0 0 4px; }
.win-box p.penalty { margin: 0; font-size: .86rem; font-weight: 700; color: var(--wrong); }
.win-box h4 { margin: 14px 0 6px; font-size: .84rem; color: var(--muted); }
.chain { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 6px; font: 500 .98rem 'Fredoka', 'Nunito', sans-serif; }
.chain .end { color: var(--primary); }
.chain-arrow { color: var(--muted); }
