:root {
  --ink: #243331;
  --muted: #76817e;
  --paper: #f7f4ed;
  --card: #fffdfa;
  --mint: #74b9a6;
  --mint-dark: #438d7b;
  --mint-soft: #dcefe9;
  --line: #e4e1d9;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Avenir Next", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #e8ece9; color: var(--ink); font-family: var(--font-ui); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(68,142,123,.3); outline-offset: 2px; }
.game-shell { width: min(100%, 430px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(30px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 0 70px rgba(30,45,40,.1); overflow: hidden; }
.game-topbar { height: calc(66px + env(safe-area-inset-top)); padding: calc(14px + env(safe-area-inset-top)) 20px 8px; display: grid; grid-template-columns: 40px 1fr 48px; align-items: center; }
.back-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); text-decoration: none; }
.back-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.game-brand { text-align: center; font: 800 18px/1 var(--font-display); letter-spacing: -.5px; }
.club-streak { height: 34px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid #e1ddd5; border-radius: 999px; background: #fffdfa; font-size: 11px; font-weight: 800; }
.club-streak span:first-child { color: #ec826c; }
.game-main { padding: 20px 21px 30px; }
.eyebrow { margin: 0 0 5px; color: var(--accent, var(--mint-dark)); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; }
h1, h2 { font-family: var(--font-display); }
h1 { margin: 0; font-size: 29px; line-height: 1.08; letter-spacing: -1.1px; }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.game-card { margin-top: 20px; padding: 18px; border: 1px solid rgba(216,214,205,.85); border-radius: 21px; background: var(--card); box-shadow: 0 18px 45px rgba(54,65,62,.1); }
.status-line { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.progress-track { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #e5e3dc; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--accent, var(--mint)); transition: width .4s cubic-bezier(.2,.8,.2,1); }
.primary-button { width: 100%; height: 49px; border: 0; border-radius: 15px; color: white; background: var(--ink); font-weight: 800; transition: transform .12s ease; }
.primary-button:active { transform: scale(.975); }
.secondary-button { height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 700; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 30px; padding: 10px 16px; color: white; background: rgba(36,50,48,.94); border-radius: 99px; font-size: 11px; font-weight: 700; opacity: 0; transform: translate(-50%,12px); pointer-events: none; transition: .25s ease; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.complete-card { text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.complete-mark { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; color: white; background: var(--accent,var(--mint)); border-radius: 50%; font-size: 27px; box-shadow: 0 10px 25px rgba(62,132,112,.25); }
.complete-card h2 { margin: 0; font-size: 24px; }
.complete-card p { color: var(--muted); font-size: 12px; }
.how-to-play { margin-top: 25px; padding: 20px 18px; border-top: 1px solid var(--line); }
.instruction-kicker { margin: 0 0 5px; color: var(--accent, var(--mint-dark)); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.how-to-play h2 { margin: 0; font-size: 18px; letter-spacing: -.45px; }
.how-to-play ol { margin: 13px 0 0; padding-left: 22px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.how-to-play li { padding-left: 3px; }
.how-to-play li + li { margin-top: 6px; }
.ladder-example { margin-top: 16px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
.ladder-example span { padding: 7px 8px; border: 1px solid #d9dce5; border-radius: 8px; color: #5c6f98; background: #f2f3f7; font: 800 10px var(--font-display); letter-spacing: 1px; }
.ladder-example i { color: #a1a7ad; font-size: 10px; font-style: normal; }
.example-note { margin: 8px 0 0; color: var(--muted); text-align: center; font-size: 9px; }
@keyframes pop { from { opacity: 0; transform: scale(.88); } }
@media (min-width:431px) { body { padding:16px 0; } .game-shell { min-height:calc(100dvh - 32px); border-radius:28px; } }

.game-completion-dialog{width:min(420px,calc(100% - 28px));max-height:calc(100dvh - 32px);padding:0;border:0;border-radius:25px;background:var(--paper);color:var(--ink);box-shadow:0 25px 70px #16221f40;overscroll-behavior:contain}
.game-completion-dialog::backdrop{background:rgba(28,43,39,.48);backdrop-filter:blur(4px)}
.game-completion-dialog .complete-card{margin:0;padding:28px 22px;border:0;box-shadow:none}
.game-completion-dialog .complete-card p{font-size:.9375rem;line-height:1.45}
.completion-close{width:100%;margin-top:14px;font-size:.875rem}.completion-reopen{margin-top:20px}
@media(prefers-reduced-motion:reduce){.complete-card{animation:none}}
