:root {
    color-scheme: light;
    --ink: #172520;
    --muted: #68756f;
    --line: #d6ded8;
    --paper: #f4f6f2;
    --white: #fff;
    --green: #0b826b;
    --green-hover: #096f5c;
    --green-dark: var(--green);
    --green-score: #159f7b;
    --red: #c34332;
    --gold: #a36900;
    --gold-score: #b98200;
    --blue: #3677b5;
    --blue-hover: #2d6399;
    --blue-score: #4c91d0;
    --positive-border: var(--green);
    --warn-ink: var(--gold);
    --error-ink: var(--red);
    --selection: var(--blue);
    --font: 'Manrope', 'Avenir Next', sans-serif;
    --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--font); background: var(--paper); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#app { min-height: 100svh; }
.shell { width: min(100% - 40px, 860px); margin-inline: auto; }
.topbar { height: 70px; padding: 0 max(24px, calc((100% - 1080px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55); }
.wordmark { text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: 0; }
.wordmark span { color: var(--green); }
.brand-tools { display: flex; align-items: center; gap: 10px; }
.wordmark-image { display: block; width: 122px; height: auto; }
.theme-toggle { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 0; border-radius: 10px; background: var(--surface-soft, #e8eeea); color: var(--ink); font-size: 23px; font-weight: 900; line-height: 1; cursor: pointer; transition: transform .18s, background .18s; }
@media (hover: hover) { .theme-toggle:hover { transform: rotate(-9deg) scale(1.08); } }
.auth-logo { display: block; width: min(100%, 260px); height: auto; margin-bottom: 38px; }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.text-button, .icon-button { border: 0; padding: 8px 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px; }
.text-button { white-space: nowrap; }
.topbar .pause-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--green); border-radius: 4px; background: var(--green); color: white; font-size: 11px; font-weight: 800; }
@media (hover: hover) { .topbar .pause-button:hover { background: var(--green-hover); color: white; } }
@media (hover: hover) { .text-button:hover { color: var(--green-dark); } }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; font-size: 17px; }
.eyebrow { margin: 0 0 10px; color: var(--green-dark); font: 500 11px/1.4 var(--mono); letter-spacing: 0; }
.welcome { padding: 53px 0 31px; animation: rise-in .5s both; }
.welcome h1, .subpage h1 { margin: 0; font-size: 42px; line-height: 1.13; font-weight: 800; }
.welcome > p:last-child, .subpage > p:not(.eyebrow) { color: var(--muted); margin: 11px 0 0; font-size: 14px; }
.score-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); padding: 19px 0 18px; margin-bottom: 45px; animation: rise-in .55s .04s both; }
.score-strip > div { display: flex; flex-direction: column; gap: 4px; padding-left: 20px; border-left: 1px solid var(--line); }
.score-strip > div:first-child { padding-left: 0; border-left: 0; }
.score-value { font-size: 27px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-value.is-high-score, .profile-record-grid .is-high-score { color: var(--gold-score); }
.score-value.is-best-time, .profile-record-grid .is-best-time { color: var(--green-score); }
.score-value.is-puzzles-played, .profile-record-grid .is-puzzles-played { color: var(--blue-score); }
.score-value small { color: #97a39d; font-size: 14px; }
.score-label { color: var(--muted); font: 500 9px/1.4 var(--mono); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2, .slot-heading h2 { margin: 0; font-size: 19px; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; border: 1px solid var(--line); border-radius: 4px; padding: 0 16px; background: var(--white); font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
@media (hover: hover) { .button:hover { transform: translateY(-1px); } }
.button-primary { color: white; background: var(--green); border-color: var(--green); }
@media (hover: hover) { .button-primary:hover { background: var(--green-hover); } }
.button-blue, .button-practice { color: white; background: var(--blue); border-color: var(--blue); }
@media (hover: hover) { .button-blue:hover, .button-practice:hover { background: var(--blue-hover); border-color: var(--blue-hover); } }
.button-neutral { color: white; background: #68736d; border-color: #68736d; }
@media (hover: hover) { .button-neutral:hover { background: #535e58; border-color: #535e58; } }
.button-gold { color: white; background: var(--gold); border-color: var(--gold); }
@media (hover: hover) { .button-gold:hover { background: #805500; border-color: #805500; } }
.nav-action { min-height: 36px; padding-inline: 12px; font-size: 11px; }
.button-secondary { color: var(--muted); background: var(--surface-soft, #e8eeea); border-color: var(--line); }
@media (hover: hover) { .button-secondary:hover { background: var(--surface-hover, #dce4de); } }
.button-outline { color: var(--green-dark); background: transparent; border-color: var(--green); }
@media (hover: hover) { .button-outline:hover { background: color-mix(in srgb, var(--green) 9%, transparent); } }
.button-quiet { background: transparent; }
.day-list { animation: rise-in .55s .1s both; }
.today-puzzle { margin-bottom: 15px; }
.past-puzzles { border-top: 1px solid var(--line); }
.day-row { width: 100%; min-height: 52px; display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 7px 12px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
@media (hover: hover) { .day-row:hover:not(:disabled) { background: #e8f0eb; } }
.day-row:disabled { cursor: default; color: #68756f; }
.day-row.is-complete:not(.is-today) { background: #e7f1eb; }
@media (hover: hover) { .day-row.is-complete:not(.is-today):hover { background: #dcebe2; } }
.day-row.is-today { min-height: 88px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; background: var(--white); }
.day-row.is-today.is-complete { background: #e7f1eb; }
.day-row.is-today .day-date b { font-size: 16px; }
.day-row.is-today .day-stats { font-size: 12px; }
html[data-theme='light'] .day-row.is-today,
html[data-theme='light'] .day-row.is-today.is-complete { background: #021e25; color: #fff; }
@media (hover: hover) { html[data-theme='light'] .day-row.is-today:hover:not(:disabled) { background: #021e25; color: #fff; } }
html[data-theme='light'] .day-row.is-today .day-date small,
html[data-theme='light'] .day-row.is-today .day-stats,
html[data-theme='light'] .day-row.is-today .day-stat.is-week-best,
html[data-theme='light'] .day-row.is-today .personal-best-note { color: #fff; }
html[data-theme='light'] .day-row.is-today .day-action.button-outline { color: #fff; border-color: #fff; }
.day-date, .day-stats { display: flex; flex-direction: column; gap: 3px; }
.day-date b { font-size: 13px; }
.day-date small, .day-stats { color: var(--muted); font-size: 11px; }
.day-stat { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; line-height: 1.2; }
.day-stat-value { display: inline-flex; align-items: center; gap: 4px; }
.day-stat.is-week-best { color: var(--gold); font-weight: 800; }
.personal-best-note { color: var(--green-dark); font-size: 8px; font-weight: 800; line-height: 1.2; }
.best-star { color: var(--gold); font-size: 12px; line-height: 1; }
.day-action { color: var(--green-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }
.day-action.imported-day-action { color: var(--muted); font: 500 9px var(--mono); text-transform: uppercase; }
.day-action.button-outline { min-width: 68px; min-height: 31px; padding: 0 10px; border-radius: 4px; font-size: 11px; }
.day-action.button { min-height: 34px; padding: 0 12px; font-size: 11px; }
.day-action.button-primary { color: white; }
.day-row.is-today .day-action.button { min-height: 43px; padding-inline: 16px; font-size: 12px; }
.day-row:disabled .day-action { color: var(--muted); font-weight: 600; }
.day-complete-check { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0; color: var(--slot-color); background: transparent; font-size: 18px; }
.player-profile { max-width: 700px; padding-top: 34px; padding-bottom: 40px; }
.profile-scorecard { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); animation: rise-in .45s both; }
.profile-card-heading { display: block; }
.profile-share-button { width: 100%; margin-top: 12px; }
.profile-card-kicker, .profile-record-label, .profile-record-grid small { font-family: var(--mono); }
.profile-card-kicker { margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.profile-card-heading h1 { margin: 0; overflow-wrap: anywhere; font-size: 40px; line-height: 1.1; font-weight: 800; }
.profile-player-letter { color: var(--letter-color); }
.profile-edit-button { display: block; margin-top: 7px; padding: 5px 0; color: var(--ink); font-size: 11px; }
.profile-record-grid { display: grid; grid-template-columns: 1fr 1fr .7fr; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.profile-record-grid > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-left: 18px; border-left: 1px solid var(--line); }
.profile-record-grid > div:first-child { padding-left: 0; border-left: 0; }
.profile-record-label { color: var(--muted); font-size: 10px; }
.profile-record-grid strong { max-width: 100%; overflow-wrap: anywhere; font-size: 34px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.profile-record-grid small { color: var(--muted); font-size: 8px; }
.profile-best-games { margin-top: 30px; }
.profile-best-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.profile-best-heading .eyebrow { margin-bottom: 4px; }
.profile-best-heading h2 { margin: 0; font-size: 21px; }
.profile-best-toggle { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.profile-best-toggle button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 600 10px var(--mono); cursor: pointer; }
.profile-best-toggle button.is-active { background: var(--green-dark); color: var(--white); }
.profile-best-list { display: grid; gap: 8px; margin-top: 14px; }
.profile-best-card { min-height: 68px; display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(76px, .65fr) minmax(70px, .6fr); align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 5px; background: var(--white); }
.profile-best-rank { color: var(--gold); font: 700 13px var(--mono); }
.profile-best-date { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-best-date span, .profile-best-date small, .profile-best-metric > span { color: var(--muted); font: 500 9px var(--mono); }
.profile-best-date b { font-size: 14px; }
.profile-best-date small { color: var(--green-dark); }
.profile-best-metric { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-best-metric strong { font: 600 15px var(--mono); font-variant-numeric: tabular-nums; }
.profile-history { margin-top: 37px; }
.profile-history-heading .eyebrow { margin-bottom: 4px; }
.profile-history-heading h2 { margin: 0; font-size: 21px; }
.profile-game-list { display: grid; gap: 9px; margin-top: 15px; }
.profile-game-card { min-height: 74px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .8fr) minmax(70px, .6fr); align-items: center; gap: 14px; padding: 11px 15px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 5px; background: var(--white); animation: rise-in .35s both; }
.profile-game-date { display: flex; flex-direction: column; gap: 3px; }
.profile-game-date span, .profile-game-stat > span { color: var(--muted); font: 500 9px var(--mono); }
.profile-game-date b { font-size: 14px; }
.profile-game-imported { color: var(--muted); font: 500 10px var(--mono); text-transform: uppercase; }
.profile-game-stat { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 5px; row-gap: 2px; }
.profile-game-stat > span:first-child { grid-column: 1 / -1; }
.profile-game-stat strong { grid-column: 1; font: 500 16px var(--mono); font-variant-numeric: tabular-nums; }
.profile-game-stat .best-star { grid-column: 2; justify-self: start; }
.profile-game-stat.is-personal-best { color: var(--gold); }
.profile-game-stat.is-week-best { color: var(--green-dark); }
.profile-game-stat .best-star { flex: 0 0 auto; }
.profile-empty { padding: 22px 0; color: var(--muted); font-size: 12px; }
.profile-home { color: var(--green-dark); font-weight: 800; text-decoration: none; }
.dashboard-footnote { max-width: 570px; color: var(--muted); font-size: 11px; line-height: 1.6; margin: 15px 0 50px; }
.dashboard-footer-actions { display: grid; gap: 10px; padding-bottom: 24px; }
.player-profile .dashboard-footer-actions { margin-top: 24px; }
.dashboard-footer-actions .dashboard-exit { width: 100%; min-height: 48px; }
.dashboard-footer-actions .dashboard-save-app { width: 100%; min-height: 48px; }
.page-bottom-action { width: 100%; min-height: 48px; margin-top: 18px; }
.completion-praise { margin: 5px 0 8px; color: var(--green-dark); font-size: 15px; font-weight: 800; line-height: 1.4; }
.found-word-path { opacity: 1; }
.found-word-path-new { opacity: 0; animation: found-path-fade .22s calc(var(--path-order) * .035s) ease-out forwards; }
.guest-save-prompt { display: grid; gap: 10px; max-width: 320px; }
.guest-save-prompt p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-screen .button + .button { margin-top: 8px; }
.player-name-form { display: grid; gap: 8px; max-width: 320px; margin-top: 12px; }
.player-name-form label { color: var(--muted); font-size: 11px; font-weight: 700; }
.player-name-form input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); font: 500 14px var(--font); }
.player-name-form > div { display: flex; gap: 8px; }
.player-name-form[hidden], .player-name-form [hidden] { display: none; }
.auth-screen { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; width: min(100% - 44px, 390px); margin: auto; padding: 50px 0; }
.auth-mark { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 38px; transform: rotate(-3deg); }
.auth-mark span { width: max-content; color: white; background: var(--green); border-radius: 40px; padding: 2px 13px; font-size: 30px; line-height: 1.05; letter-spacing: 6px; font-weight: 800; }
.auth-mark span:nth-child(2) { margin-left: 17px; }
.auth-mark span:nth-child(3) { margin-left: 33px; }
.auth-copy { max-width: 320px; color: var(--muted); font-size: 14px; line-height: 1.7; margin: 14px 0 25px; }
.auth-screen .button { width: 100%; justify-content: space-between; display: flex; align-items: center; padding-inline: 18px; }
.small { font-size: 11px !important; }
.muted { color: var(--muted); }
.auth-screen .muted { margin-top: 13px; line-height: 1.55; }
.notice { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--red); background: #f8e9e4; color: var(--error-ink); font-size: 12px; line-height: 1.6; }
.subpage { padding-top: 55px; }
.subpage > p:not(.eyebrow) { max-width: 540px; line-height: 1.65; }
.preset-list { margin-top: 31px; border-top: 1px solid var(--line); }
.preset { width: 100%; display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 14px; min-height: 80px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.preset.is-loading { display: flex; justify-content: center; align-items: center; gap: 1px; text-align: center; }
.button.is-loading { display: flex; width: 100%; justify-content: center; gap: 1px; }
.text-button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 1px; }
button.is-loading { cursor: wait; }
.loading-dots { display: inline-flex; min-width: 1.1em; }
.loading-dots span { opacity: 0; animation: loading-dot .9s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
@media (hover: hover) { .preset:hover { background: #e8f0eb; } }
.preset-grid { width: 52px; height: 52px; display: grid; place-items: center; background: #e0ebe5; color: var(--green-dark); font: 500 13px var(--mono); }
.preset b, .preset small { display: block; }
.preset b { font-size: 13px; }
.preset small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.mode-label { color: var(--muted); font: 500 10px var(--mono); }
.game-page { padding-top: 30px; padding-bottom: 55px; }
.game-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 15px; }
.game-heading .eyebrow { margin-bottom: 6px; }
.game-heading h1 { font-size: 34px; }
.game-metrics { display: flex; gap: 23px; padding-bottom: 2px; }
.game-metrics > div { display: flex; flex-direction: column; align-items: end; gap: 3px; }
.metric-value { font: 500 19px var(--mono); font-variant-numeric: tabular-nums; }
.game-page #clock, .game-page #score { color: var(--red); font-size: 34px; font-weight: 700; line-height: 1; }
.game-page #score { color: var(--gold-score); }
.game-hint { height: 76px; min-height: 76px; flex: 0 0 76px; display: flex; align-items: center; padding: 9px 12px; margin: 0 0 13px; border-left: 3px solid #a4b3ad; background: #e8eeea; color: #50615a; font-size: 12px; line-height: 1.4; transition: background .2s; }
.game-hint.is-close { border-color: var(--red); background: #fae4df; color: var(--error-ink); font-weight: 800; animation: nudge .28s ease-in-out 2; }
.game-hint.is-info { border-color: var(--gold); background: #fff1cf; color: var(--warn-ink); }
.game-hint.is-success { border-color: var(--green); background: #e0f1e9; color: var(--green-dark); font-weight: 800; }
.game-hint.is-selecting { justify-content: center; font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.board-wrap { padding: clamp(12px, 3vw, 22px); border: 1px solid var(--line); background: #fff; }
.board { position: relative; isolation: isolate; width: min(100%, 520px); margin-inline: auto; aspect-ratio: var(--cols) / var(--rows); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: clamp(3px, 1vw, 7px); touch-action: none; user-select: none; }
.word-path-layer { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.word-path-layer path { stroke-linecap: round; stroke-linejoin: round; }
.word-path-layer .active-word-path { stroke: var(--active-path-color, var(--selection)); }
.cell { position: relative; z-index: 1; min-width: 0; min-height: 0; aspect-ratio: 1; border: 1px solid #e3e8e4; border-radius: 50%; background: #f8faf8; font: 800 30px var(--font); cursor: crosshair; touch-action: none; transition: color .15s, background .15s, transform .12s; }
.cell.is-start { border-width: 3px; border-color: var(--slot-color); color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 9%, white); }
.cell.is-selected { z-index: 1; color: white; background: var(--active-path-color, var(--selection)); border-color: var(--active-path-color, var(--selection)); transform: scale(.94); }
.cell.is-solved { color: white; background: var(--slot-color); border-color: var(--slot-color); }
.cell-length { position: absolute; right: 5px; bottom: 3px; color: var(--slot-color); font: 700 10px/1 var(--mono); pointer-events: none; }
.cell.is-hint { color: var(--slot-color); }
.game-page.is-complete .board,
.game-page.is-complete .board .cell { touch-action: pan-y; }
.slots-section { margin-top: 24px; }
.slot-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.slot-heading h2 { font-size: 15px; }
.slot-heading > span { color: var(--muted); font: 400 10px var(--mono); }
.word-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 15px; }
.word-slot { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.slot-index { width: 19px; flex: 0 0 19px; color: var(--slot-color); font: 400 9px var(--mono); }
.slot-letters { display: flex; min-width: 0; gap: 3px; }
.letter-tile { width: clamp(17px, 5vw, 25px); height: 27px; flex: 0 1 25px; display: grid; place-items: center; border: 1px solid #dbe2dd; border-radius: 2px; color: #a4aea8; font: 500 12px var(--mono); }
.letter-tile:first-child { background: color-mix(in srgb, var(--slot-color) 12%, white); color: var(--slot-color); border-color: color-mix(in srgb, var(--slot-color) 42%, white); font-weight: 500; }
.letter-tile.has-letter:not(:first-child) { color: var(--ink); background: white; }
.word-slot.is-solved .letter-tile { border-color: var(--slot-color); color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 8%, white); }
.word-slot.is-solved .letter-tile:first-child { border-color: var(--slot-color); color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 8%, white); }
.slot-check { margin-left: auto; color: var(--slot-color); font-weight: 800; }
.results { margin-top: 34px; padding: 21px 0 0; border-top: 2px solid var(--ink); scroll-margin-top: 12px; animation: rise-in .45s both; }
.results-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; align-items: flex-start; flex-direction: column; }
.results-top > * { min-width: 0; }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.results-top .eyebrow { margin-bottom: 6px; }
.results-top h2 { margin: 0; font-size: 32px; line-height: 1.1; }
.results-top h2 small { font-size: 13px; }
.results-top .muted { margin: 7px 0 0; font-size: 11px; }
.personal-best { width: max-content; max-width: 100%; padding: 5px 8px; margin: 9px 0 0; border-left: 3px solid var(--gold); background: transparent; color: var(--gold); font: 700 10px var(--mono); }
.results-top .button { flex: 0 0 auto; }
.results-top .share-actions .button { width: auto; min-width: 0; flex: 1 1 132px; }
.timeline-heading { display: flex; justify-content: space-between; align-items: baseline; margin-top: 25px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.timeline-heading h3 { margin: 0; font-size: 13px; }
.timeline-heading span { color: var(--muted); font: 400 8px var(--mono); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { min-height: 43px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 104px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.history-index, .history-time { color: var(--muted); font: 400 10px var(--mono); }
.history-word { font-size: 12px; font-weight: 800; }
.history-points { display: flex; flex-direction: column; align-items: end; text-align: right; color: var(--green-dark); font: 500 10px var(--mono); }
.history-points small { color: var(--muted); font: 400 7px var(--mono); white-space: nowrap; }
.timeline li.is-miss .history-word, .timeline li.is-miss .history-points { color: var(--red); }
.results-home { margin-top: 17px; }
.modal { --modal-edge: max(16px, env(safe-area-inset-top)); position: fixed; top: var(--modal-edge); bottom: var(--modal-edge); width: min(calc(100% - 30px), 510px); max-height: min(calc(100dvh - var(--modal-edge) - var(--modal-edge)), 820px); padding: 27px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #152a2233; }
.modal::backdrop { background: #10221d99; backdrop-filter: blur(3px); }
.modal h2 { margin: 0 0 12px; font-size: 24px; }
.modal p:not(.eyebrow) { max-width: 410px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal .small { margin-top: 15px; }
.modal .install-done { margin-top: 8px; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; }
.tutorial-demo { position: relative; width: min(100%, 410px); margin: 18px auto; padding: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--white); }
.tutorial-board { position: relative; width: 100%; margin-inline: auto; aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 4px; }
.tutorial-cell { position: relative; z-index: 1; display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--tile-border, #e3e8e4); border-radius: 50%; background: var(--tile, #f8faf8); color: var(--ink); font-size: clamp(24px, 8vw, 30px); font-weight: 800; }
.tutorial-cell > span { position: relative; z-index: 2; }
.tutorial-cell.is-start { border: 3px solid var(--slot-color); color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 10%, var(--tile, white)); }
.tutorial-path-layer { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.tutorial-path { fill: none; stroke: var(--slot-color); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .8; }
.tutorial-demo.is-playing .tutorial-path { animation: tutorial-draw .55s var(--path-delay) ease-out forwards; }
.tutorial-demo.is-playing .tutorial-cell.is-path { animation: tutorial-select .25s var(--select-delay) both; }
.tutorial-demo.is-playing .tutorial-cell.is-start.is-path { animation-name: tutorial-select-start; }
.game-confetti, .tutorial-confetti { pointer-events: none; overflow: hidden; }
.game-confetti { position: fixed; z-index: 30; inset: 0; overflow: clip; contain: paint; --confetti-fall-distance: 100vh; }
.tutorial-confetti { position: absolute; z-index: 2; inset: 0; --confetti-fall-distance: 48vh; }
.confetti-piece { position: absolute; top: -14px; left: var(--confetti-left); width: 8px; height: 12px; border-radius: 2px; background: var(--confetti-color); opacity: 0; }
.game-confetti .confetti-piece,
.tutorial-demo.is-playing .tutorial-confetti .confetti-piece { animation: confetti-fall 2.6s var(--confetti-delay) ease-in both; }
.toast { position: fixed; z-index: 10; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 13px 16px; background: var(--ink); color: white; font-size: 12px; box-shadow: 0 5px 20px #0002; animation: rise-in .18s both; }
.toast-error { background: var(--red); }
.toast-info { background: var(--green-dark); }

@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nudge { 0%,100% { transform: translateX(0); } 35% { transform: translateX(4px); } 70% { transform: translateX(-3px); } }
@keyframes tutorial-select {
    from { color: var(--ink); background: var(--tile, #f8faf8); border-color: var(--tile-border, #e3e8e4); transform: scale(1); }
    to { color: white; background: var(--slot-color); border-color: var(--slot-color); transform: scale(.93); }
}
@keyframes tutorial-select-start {
    from { color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 10%, var(--tile, white)); border-color: var(--slot-color); transform: scale(1); }
    to { color: white; background: var(--slot-color); border-color: var(--slot-color); transform: scale(.93); }
}
@keyframes tutorial-reveal {
    from { color: transparent; background: var(--tile, #f8faf8); border-color: var(--tile-border, #dbe2dd); }
    to { color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 12%, var(--tile, white)); border-color: color-mix(in srgb, var(--slot-color) 55%, var(--tile-border, white)); }
}
@keyframes tutorial-draw { to { stroke-dashoffset: 0; } }
@keyframes found-path-fade { to { opacity: 1; } }
.boot-screen { min-height: 100svh; display: flex; align-items: center; justify-content: center; }
.boot-loader { --boot-size: 22px; --boot-gap: 17px; --boot-cycle: 2.4s; display: flex; align-items: center; transform: translateY(-20svh); }
.boot-dot { position: relative; z-index: 1; box-sizing: border-box; width: var(--boot-size); height: var(--boot-size); flex: none; border: 2px solid var(--line); border-radius: 50%; background: transparent; }
.boot-dot:nth-child(1) { animation: boot-dot-1 var(--boot-cycle) linear infinite; }
.boot-dot:nth-child(3) { animation: boot-dot-2 var(--boot-cycle) linear infinite; }
.boot-dot:nth-child(5) { animation: boot-dot-3 var(--boot-cycle) linear infinite; }
.boot-link { position: relative; z-index: 0; width: var(--boot-gap); height: 7px; flex: none; margin-inline: -2px; background: var(--green); clip-path: inset(0 100% 0 0); }
.boot-link:nth-child(2) { animation: boot-link-1 var(--boot-cycle) linear infinite; }
.boot-link:nth-child(4) { animation: boot-link-2 var(--boot-cycle) linear infinite; }
@keyframes boot-dot-1 { 0%, 10% { background: transparent; border-color: var(--line); } 12%, 50% { background: var(--green); border-color: var(--green); } 52%, 100% { background: transparent; border-color: var(--line); } }
@keyframes boot-dot-2 { 0%, 25% { background: transparent; border-color: var(--line); } 27%, 65% { background: var(--green); border-color: var(--green); } 67%, 100% { background: transparent; border-color: var(--line); } }
@keyframes boot-dot-3 { 0%, 40% { background: transparent; border-color: var(--line); } 42%, 80% { background: var(--green); border-color: var(--green); } 82%, 100% { background: transparent; border-color: var(--line); } }
@keyframes boot-link-1 { 0%, 15% { clip-path: inset(0 100% 0 0); } 25%, 55% { clip-path: inset(0 0 0 0); } 65% { clip-path: inset(0 0 0 100%); } 65.01%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes boot-link-2 { 0%, 30% { clip-path: inset(0 100% 0 0); } 40%, 70% { clip-path: inset(0 0 0 0); } 80% { clip-path: inset(0 0 0 100%); } 80.01%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes loading-dot { 0%, 15% { opacity: 0; } 45%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes confetti-fall {
    0% { opacity: 0; transform: translate3d(0, -16px, 0) rotate(0); }
    10% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--confetti-drift), var(--confetti-fall-distance), 0) rotate(var(--confetti-rotation)); }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 28px, 860px); }
    .topbar { height: 48px; padding-inline: 12px; }
    .topbar nav { gap: 8px; }
    .mode-label { display: none; }
    .wordmark { font-size: 13px; }
    .wordmark-image { width: 92px; }
    .theme-toggle { width: 30px; height: 30px; font-size: 20px; }
    .topbar nav { gap: 6px; }
    .topbar .text-button { padding-block: 5px; font-size: 10px; }
    .topbar .pause-button, .nav-action { min-height: 30px; padding: 0 8px; font-size: 10px; }
    .welcome { padding-top: 34px; }
    .welcome h1, .subpage h1 { font-size: 30px; }
    .score-strip { margin-bottom: 31px; padding-block: 15px; }
    .score-strip > div { padding-left: 10px; }
    .score-value { font-size: 22px; }
    .score-label { font-size: 8px; }
    .day-row { min-height: 48px; grid-template-columns: minmax(68px, .8fr) minmax(0, 1fr) auto; gap: 5px; padding-inline: 8px; }
    .day-row.is-today { min-height: 78px; padding: 11px 10px; }
    .day-row.is-today .day-date b { font-size: 14px; }
    .day-date b, .day-action { font-size: 11px; }
    .day-stats, .day-date small { font-size: 10px; }
    .day-action.button { min-height: 31px; padding-inline: 9px; font-size: 10px; }
    .player-profile { padding-top: 22px; }
    .profile-scorecard { padding: 20px 17px; }
    .profile-card-kicker { font-size: 8px; }
    .profile-card-heading h1 { font-size: 30px; }
    .profile-record-grid { grid-template-columns: 1fr 1fr .65fr; margin-top: 12px; padding-top: 10px; }
    .profile-record-grid > div { padding-left: 10px; }
    .profile-record-grid strong { font-size: 25px; }
    .profile-record-label { font-size: 9px; }
    .profile-best-games { margin-top: 25px; }
    .profile-best-heading h2 { font-size: 19px; }
    .profile-best-toggle button { min-height: 28px; padding-inline: 9px; font-size: 9px; }
    .profile-best-card { min-height: 62px; grid-template-columns: 23px minmax(0, 1fr) minmax(65px, .65fr) minmax(54px, .6fr); gap: 7px; padding: 8px; }
    .profile-best-date span, .profile-best-date small, .profile-best-metric > span { font-size: 8px; }
    .profile-best-date b { font-size: 12px; }
    .profile-best-metric strong { font-size: 12px; }
    .profile-history { margin-top: 30px; }
    .profile-game-card { min-height: 66px; grid-template-columns: minmax(0, 1fr) minmax(82px, .8fr) minmax(63px, .6fr); gap: 8px; padding: 9px 10px; }
    .profile-game-stat { column-gap: 3px; }
    .profile-game-stat strong { font-size: 13px; }
    .profile-game-stat > span:first-child, .profile-game-date span { font-size: 8px; }
    .profile-game-date b { font-size: 12px; }
    .game-page { padding-top: 12px; }
    .game-heading { align-items: center; }
    .game-heading { gap: 8px; margin-bottom: 8px; }
    .game-heading .eyebrow { margin-bottom: 2px; font-size: 9px; }
    .game-heading h1 { font-size: 24px; }
    .game-metrics { gap: 10px; }
    .metric-value { font-size: 14px; }
    .game-metrics .score-label { font-size: 8px; }
    .game-hint { padding: 6px 9px; margin-bottom: 8px; font-size: 10px; line-height: 1.3; }
    .game-hint.is-selecting { font-size: 18px; }
    .board-wrap { padding: 8px; }
    .board { gap: 3px; }
    .word-slots { gap: 5px 9px; }
    .word-slot { gap: 4px; }
    .slot-index { width: 15px; flex-basis: 15px; }
    .letter-tile { width: clamp(15px, 4.7vw, 21px); height: 24px; font-size: 10px; }
    .share-actions { width: 100%; flex-direction: column; align-items: stretch; }
    .results-top .button { width: 100%; }
    .results-top .share-actions .button { width: 100%; flex: 0 0 auto; }
    .timeline-heading span { font-size: 7px; }
    .timeline li { grid-template-columns: 24px minmax(0, 1fr) auto 96px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
    .tutorial-demo.is-playing .tutorial-path,
    .tutorial-demo.is-playing .tutorial-cell.is-path { animation-delay: 0s !important; }
    .game-confetti, .tutorial-confetti { display: none; }
    .boot-dot:nth-child(n) { background: var(--green); border-color: var(--green); animation: none; }
    .boot-link:nth-child(n) { clip-path: none; animation: none; }
}

html[data-theme='dark'] {
    color-scheme: dark;
    --ink: #edf3f6;
    --muted: #aabac4;
    --line: #27434f;
    --paper: #021e25;
    --white: #0b2b37;
    --surface-soft: #0b2b37;
    --surface-hover: #123744;
    --tile: #1b383d;
    --tile-border: #455c61;
    --positive-soft: #123d3c;
    --warn-soft: #40351d;
    --error-soft: #442a2d;
    --hint-ink: #c2d1d8;
    --subtle: #98adba;
}

html[data-theme='dark'] .button-outline { border-color: var(--green); color: var(--green-dark); }
@media (hover: hover) { html[data-theme='dark'] .button-outline:hover { background: var(--surface-hover); } }
@media (hover: hover) { html[data-theme='dark'] .button-secondary:hover,
html[data-theme='dark'] .day-row:hover:not(:disabled),
html[data-theme='dark'] .preset:hover { background: var(--surface-hover); } }
html[data-theme='dark'] .day-row:disabled { color: var(--muted); }
html[data-theme='dark'] .day-row.is-complete:not(.is-today) { background: var(--positive-soft); }
html[data-theme='dark'] .day-row.is-today { background: #fff; color: #172520; }
@media (hover: hover) { html[data-theme='dark'] .day-row.is-today:hover:not(:disabled) { background: #fff; color: #172520; } }
html[data-theme='dark'] .day-row.is-today .day-date small,
html[data-theme='dark'] .day-row.is-today .day-stats,
html[data-theme='dark'] .day-row.is-today .day-stat.is-week-best,
html[data-theme='dark'] .day-row.is-today .personal-best-note { color: #172520; }
html[data-theme='dark'] .notice { background: var(--error-soft); color: var(--error-ink); }
html[data-theme='dark'] .preset-grid { background: var(--surface-soft); }
html[data-theme='dark'] .game-hint { border-left-color: #60756a; background: var(--surface-soft); color: var(--hint-ink); }
html[data-theme='dark'] .game-hint.is-close { border-color: var(--red); background: var(--error-soft); color: var(--error-ink); }
html[data-theme='dark'] .game-hint.is-info { border-color: var(--gold); background: var(--warn-soft); color: var(--warn-ink); }
html[data-theme='dark'] .game-hint.is-success { border-color: var(--green); background: var(--positive-soft); color: var(--green-dark); }
html[data-theme='dark'] .word-path-layer .active-word-path { stroke: var(--active-path-color, #9ab3bd); }
html[data-theme='dark'] .letter-tile { border-color: var(--tile-border); color: var(--muted); }
html[data-theme='dark'] .letter-tile:first-child { background: color-mix(in srgb, var(--slot-color) 18%, var(--white)); border-color: color-mix(in srgb, var(--slot-color) 55%, var(--white)); }
html[data-theme='dark'] .letter-tile.has-letter:not(:first-child) { background: var(--white); color: var(--ink); }
html[data-theme='dark'] .word-slot.is-solved .letter-tile { background: color-mix(in srgb, var(--slot-color) 20%, var(--white)); }
html[data-theme='dark'] .word-slot.is-solved .letter-tile:first-child { border-color: var(--slot-color); color: var(--slot-color); background: color-mix(in srgb, var(--slot-color) 20%, var(--white)); }
html[data-theme='dark'] .tutorial-demo { background: var(--white); }
html[data-theme='dark'] .player-name-form input { border-color: var(--line); background: var(--white); color: var(--ink); }
html[data-theme='dark'] .profile-record-grid { border-color: #ffffff35; }
button, a, [role="button"], summary, label, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }


/* ===== v3 ===== */
.box { --ink: #172520; --muted: #68756f; --line: #d6ded8; --white: #fff; --surface-soft: #eef2ef; background: #fff; color: #172520; border: 0; border-radius: 22px; padding: 22px; box-shadow: 0 2px 14px rgba(23, 37, 32, .08); }
html[data-theme='dark'] .box { box-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.page { position: relative; width: min(100% - 32px, 440px); margin: 0 auto; padding: 66px 0 40px; min-height: 100svh; display: flex; flex-direction: column; align-items: stretch; }
.player-profile { max-width: 440px; }
.corner-nav { position: absolute; z-index: 20; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0; border: 0; background: none; pointer-events: none; }
.corner-nav > * { pointer-events: auto; }
.nav-icon, .corner-nav .theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.nav-icon svg, .corner-nav .theme-toggle svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.corner-nav .theme-toggle:hover, .nav-icon:hover { transform: none; opacity: .7; }
.nav-icon:disabled { opacity: .4; }
.button { min-height: 46px; border-radius: 18px; padding: 0 22px; letter-spacing: .06em; text-transform: uppercase; }
.button-large { width: 100%; min-height: 54px; font-size: 14px; }
.text-button { border-radius: 14px; }
.home-page, .auth-page { align-items: center; text-align: center; }
.home-logo { display: block; width: min(80%, 260px); height: auto; margin: 6px auto 14px; }
.home-logo.is-small { width: 180px; }
.page-logo { display: block; align-self: center; margin-bottom: 14px; }
.page-logo img { display: block; width: 130px; height: auto; }
.home-date { margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.howto, .auth-box { width: 100%; text-align: left; }
.howto-title { margin: 0 0 10px; font-size: 18px; }
.howto-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.howto-list li + li { margin-top: 8px; }
.howto-list .sub { margin-top: 6px; }
.home-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.home-note { margin: 22px 0 0; color: var(--muted); line-height: 1.5; }
.auth-box { text-align: center; }
.auth-box .button { width: 100%; margin-top: 8px; }
.auth-box h1 { margin: 4px 0 10px; font-size: 26px; }
.subpage { align-items: stretch; }
.footer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.footer-actions .button { width: 100%; }
.profile-scorecard { padding: 24px 20px; }
.game-page { padding-top: 66px; }
.game-heading { flex-direction: column; align-items: center; text-align: center; }
.game-heading h1 { font-size: 26px; }
.game-page:not(.is-complete) .game-metrics, .game-metrics { flex-direction: row; justify-content: center; gap: 30px; }
.game-metrics > div { align-items: center; }
.board-wrap { padding: clamp(12px, 3vw, 20px); }
.board { width: 100%; }
.cell { border: 0; border-radius: 50%; background: transparent; color: #172520; }
.cell.is-start { border: 3px solid var(--slot-color); color: var(--slot-color); background: transparent; }
.cell.is-selected { color: #fff; background: var(--active-path-color, var(--selection)); }
.cell.is-solved { color: #fff; background: transparent; }
.cell.is-solved.is-start { background: transparent; }
.howto-link { align-self: center; margin-top: 16px; text-decoration: underline; }
.results { margin-top: 22px; border-top: 0; }
.results .button { width: 100%; }
.dashboard-page { padding-top: 54px; }
.dashboard-heading { margin-bottom: 20px; }
.dashboard-heading h1 { font-size: 34px; }
.dashboard-today-result { margin-top: 0; }
.dashboard-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dashboard-result-header .eyebrow { margin: 0; }
.dashboard-result-metrics { display: flex; align-items: flex-start; gap: 30px; margin-top: 6px; }
.dashboard-result-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.dashboard-result-metric strong { font-size: 32px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.dashboard-result-points strong { color: var(--gold-score); }
.dashboard-result-time strong { color: var(--blue-score); }
.dashboard-result-metric span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.dashboard-practice { width: 100%; margin-top: 12px; }
.dashboard-today-prompt { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.dashboard-today-prompt .eyebrow, .dashboard-today-prompt h2 { margin: 0; }
.dashboard-history { margin-top: 32px; }
.dashboard-history-heading { margin-bottom: 12px; }
.dashboard-history-heading h2 { font-size: 22px; }
.dashboard-history-list { display: grid; gap: 8px; }
.dashboard-day { grid-template-columns: minmax(115px, .7fr) minmax(0, 1fr) auto; text-align: left; cursor: default; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.dashboard-day.is-complete:not(.is-today) { background: var(--white); }
.dashboard-day .day-stats { color: var(--ink); }
.dashboard-day .day-action { min-width: 82px; }
@media (max-width: 560px) { .page { width: min(100% - 24px, 440px); } .box { padding: 18px; } }
@media (max-width: 560px) {
    .dashboard-heading { align-items: center; }
    .dashboard-heading h1 { font-size: 26px; }
    .dashboard-day { grid-template-columns: minmax(86px, .8fr) minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
    .dashboard-day .day-action.button { min-width: 72px; padding-inline: 8px; font-size: 10px; }
}
.auth-box .auth-copy { margin: 0 0 18px; max-width: none; }

/* v3 board, path and word slots */
.box { --tile: #eef2ef; --tile-border: transparent; }
.board { gap: 0; }
.cell { background: transparent; border: 0; transform: none; }
.cell::before { content: ''; position: absolute; z-index: -1; inset: 15%; border-radius: 50%; background: transparent; }
.cell.is-start { border: 0; background: transparent; }
.cell.is-start::before { inset: 15%; border: 3px solid var(--slot-color); }
.cell.is-selected, .cell.is-solved, .cell.is-solved.is-start { background: transparent; transform: none; color: #fff; }
.cell.is-selected::before { background: var(--active-path-color, var(--selection)); }
.cell.is-solved.is-start::before { border: 0; }
.slots-section { margin-top: 18px; }
.slot-heading h2 { font-size: 16px; }
.slots-section { padding: 22px 20px; }
.slot-heading { margin-bottom: 16px; }
.word-slots { gap: 18px 16px; }
.word-slot { padding: 0; border: 0; gap: 6px; }
.slot-index { font-size: 10px; }
.slot-letters { gap: 3px; }
.letter-tile, html[data-theme='dark'] .letter-tile { height: 28px; border: 0; border-radius: 9px; background: var(--tile); color: #a9b4ae; font: 700 12px var(--mono); }
.letter-tile:first-child, html[data-theme='dark'] .letter-tile:first-child { background: color-mix(in srgb, var(--slot-color) 16%, #fff); color: var(--slot-color); border: 0; font-weight: 800; }
.letter-tile.has-letter:not(:first-child), html[data-theme='dark'] .letter-tile.has-letter:not(:first-child) { background: var(--tile); color: #172520; }
.word-slot.is-solved .letter-tile, .word-slot.is-solved .letter-tile:first-child,
html[data-theme='dark'] .word-slot.is-solved .letter-tile, html[data-theme='dark'] .word-slot.is-solved .letter-tile:first-child { border: 0; background: var(--slot-color); color: #fff; }
.tutorial-demo, html[data-theme='dark'] .tutorial-demo { border: 0; background: var(--tile); border-radius: 16px; }
.tutorial-cell { border: 0; background: transparent; }
.tutorial-cell.is-start { border: 3px solid var(--slot-color); background: transparent; }
.auth-box .auth-copy { margin: 0 auto 18px; text-align: center; }
.auth-box .muted { text-align: center; }
.auth-box > * { text-align: center; }

.letter-tile, html[data-theme='dark'] .letter-tile { height: 30px; }
.slot-letters { gap: 4px; }
.word-slot { gap: 8px; }
.game-page .game-metrics { align-items: flex-end; }

/* v3 stacked word slots */
.word-slots { grid-template-columns: 1fr; gap: 14px; }
.slot-letters { flex: 1; }
.letter-tile, html[data-theme='dark'] .letter-tile { flex: 0 1 34px; height: 34px; }

/* v3 tutorial animation matches the game board */
.tutorial-board { gap: 0; }
.tutorial-cell, .tutorial-cell.is-start { border: 0; background: transparent; }
.tutorial-cell.is-start::before { content: ''; position: absolute; z-index: -1; inset: 15%; border-radius: 50%; border: 3px solid var(--slot-color); }
.tutorial-cell { font-size: clamp(22px, 7.5vw, 30px); }
.tutorial-path { stroke-width: 70; opacity: 1; }
.tutorial-demo.is-playing .tutorial-cell.is-path, .tutorial-demo.is-playing .tutorial-cell.is-start.is-path { animation-name: tutorial-select-v3; }
.tutorial-demo.is-playing .tutorial-cell.is-start.is-path::before { border-color: transparent; transition: border-color .2s var(--select-delay); }
@keyframes tutorial-select-v3 { from { color: var(--ink); } to { color: #fff; } }

/* v3 subtle preset hover */
.box .preset { border-radius: 12px; transition: background .15s; }
.box .preset-grid { border-radius: 10px; background: #eef2ef; }
@media (hover: hover) {
    .box .preset:hover, html[data-theme='dark'] .box .preset:hover { background: #f5f8f6; }
}

/* v3 compact header with centered logo */
.corner-nav { top: 8px; }
.corner-nav .page-logo { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 0; align-self: center; }
.corner-nav .page-logo > a { display: block; line-height: 0; }
.corner-nav .page-logo img { width: 118px; }
.page-version { color: var(--muted); font: 400 7px/1 var(--mono); letter-spacing: .04em; }
.version-mismatch-notice { position: fixed; z-index: 1000; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; display: flex; align-items: center; justify-content: space-between; gap: 14px; width: min(620px, calc(100% - 32px)); padding: 14px; transform: translateX(-50%); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.version-mismatch-notice span { font-size: 12px; line-height: 1.5; }
.version-mismatch-notice .button { flex-shrink: 0; }
@media (max-width: 520px) { .version-mismatch-notice { align-items: stretch; flex-direction: column; } }
.nav-spacer { width: 44px; height: 44px; }
.page { padding-top: 58px; }
.game-page { padding-top: 54px; }
.game-heading { gap: 2px; margin-bottom: 6px; }
.game-heading .eyebrow { margin: 0; font-size: 10px; }
.game-heading h1 { font-size: 20px; margin: 0; line-height: 1.2; }
.game-page .game-metrics { gap: 26px; margin-top: 2px; padding: 0; }
.game-page #clock, .game-page #score { font-size: 28px; }
.game-metrics > div { gap: 1px; }
.game-hint { margin: 0 0 8px; padding: 6px 10px; font-size: 12px; }
.game-page .board-wrap { padding: 8px; }
.game-page .slots-section { margin-top: 12px; }
.game-page .slots-section { display: none; }
@media (max-width: 560px) { .game-page #clock, .game-page #score { font-size: 28px; } .game-heading h1 { font-size: 20px; } }
.howto > .tutorial-demo { margin: 6px auto 16px; }
.pause-bottom { width: 100%; margin-top: 14px; }

.cell.is-typed { color: #fff; }
.cell.is-typed::before { background: var(--type-color, var(--selection)); border-color: var(--type-color, var(--selection)); }
.cell.is-bounce { animation: key-bounce .35s ease-out; }
.board.is-shaking { animation: board-shake .4s ease-in-out; }
@keyframes key-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-30%) scale(1.12); } 60% { transform: translateY(0) scale(.95); } 80% { transform: translateY(-8%); } }
@keyframes board-shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-10px); } 30% { transform: translateX(9px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(6px); } 75% { transform: translateX(-3px); } 90% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .cell.is-bounce, .board.is-shaking { animation: none; } }
