.game-wrap { width:min(100% - 48px,1120px); margin-inline:auto; }
.game-heading { display:flex; align-items:end; justify-content:space-between; gap:24px; padding:36px 0 32px; }
.game-heading h1 { font-size:40px; line-height:1.15; }
.game-heading p { margin-top:8px; color:var(--muted); }
.game-page h2 { font-size:28px; line-height:1.25; }
.game-page button,.game-page select,.game-page input { font:inherit; font-size:16px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:6px; min-height:44px; padding:9px 12px; }
.game-page button { cursor:pointer; }
.game-page button:disabled { color:var(--muted); cursor:default; background:var(--soft); }
.game-page button:hover:not(:disabled) { border-color:var(--accent); }
.game-page input { caret-color:var(--accent); }
.game-page input::placeholder { color:var(--muted); opacity:1; }
.game-page :focus-visible { outline-offset:2px; }
.game-page .game-primary { background:var(--accent); color:var(--on-accent); border-color:var(--accent); font-weight:600; }
.language-choice { display:grid; gap:6px; font-size:14px; min-width:190px; }
.challenge { border-top:1px solid var(--line); padding-top:28px; }
.challenge-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 24px; }
.challenge-heading p { margin-top:8px; color:var(--muted); }
#load-status { margin:24px 0; }
#game-setup { margin-top:24px; border-top:1px solid var(--line); }
#game-setup summary { padding-block:16px; }
#game-setup summary::after { top:10px; }
#selection-summary { display:inline-block; margin-left:16px; color:var(--muted); font-size:14px; font-weight:400; }
#setup-form { padding-bottom:24px; }
#setup-form p { padding:0; }
.setup-note { margin-bottom:20px; }
.setup-presets { margin:0 0 24px; padding:0 0 20px; border:0; border-bottom:1px solid var(--line); min-width:0; }
.setup-presets legend { font-weight:600; margin-bottom:10px; }
.setup-presets > div,.selection-actions,.setup-start { display:flex; flex-wrap:wrap; gap:8px; }
.setup-presets p,.setup-hint { color:var(--muted); font-size:14px; line-height:1.5; margin-top:8px; }
.setup-count { color:var(--muted); font-weight:400; font-size:14px; margin-left:8px; white-space:nowrap; }
.selection-actions { margin-bottom:12px; }
.game-page .selection-actions button { min-height:44px; padding:6px 10px; font-size:14px; }
#verb-filter-note { margin:0 0 8px; }
#setup-coverage { margin:0 0 12px; }
.setup-columns { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.setup-columns fieldset { margin:0; padding:0; border:0; min-width:0; }
.setup-columns legend { margin-bottom:12px; font-weight:600; }
.search-label { display:block; font-size:14px; margin-bottom:4px; }
#verb-search { width:100%; margin-bottom:8px; }
.game-options { max-height:240px; overflow:auto; padding:4px; border:1px solid var(--line); border-radius:6px; }
.game-options label { display:flex; gap:10px; align-items:center; padding:4px 8px; min-height:44px; font-size:15px; }
.game-options input { width:18px; height:18px; min-height:18px; flex-shrink:0; accent-color:var(--accent); }
.game-options label:has(input:checked) { background:var(--soft); }
#setup-status { margin:12px 0; }
.round-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px 24px; margin:20px 0; font-size:14px; color:var(--muted); }
.worksheet { margin-bottom:24px; }
.worksheet h3 { font:400 23px/1.3 var(--serif); margin-bottom:12px; }
.matrix-scroll { overflow:auto; max-height:68vh; border:1px solid var(--line); scroll-padding-left:120px; }
.game-matrix { border-collapse:separate; border-spacing:0; width:100%; table-layout:fixed; font-size:15px; }
.game-matrix col:first-child { width:120px; }
.game-matrix col:not(:first-child) { width:190px; }
.game-matrix th,.game-matrix td { padding:12px; text-align:left; vertical-align:top; border-bottom:1px solid var(--line); border-right:1px solid var(--line); }
.game-matrix tr:last-child > * { border-bottom:0; }
.game-matrix tr > *:last-child { border-right:0; }
.game-matrix thead th { background:var(--soft); position:sticky; top:0; z-index:2; font-weight:400; }
.game-matrix thead th:not(:first-child) { font:400 23px/1.25 var(--serif); }
.game-matrix small { display:block; color:var(--muted); font:400 13px/1.4 var(--sans); margin-top:4px; }
.game-matrix th:first-child { position:sticky; left:0; z-index:1; background:var(--paper); font-weight:400; }
.game-matrix thead th:first-child { z-index:3; background:var(--soft); }
.game-matrix input { width:100%; min-width:0; scroll-margin-block:100px 24px; }
.game-matrix input[aria-invalid="true"] { border-style:dashed; border-color:var(--game-error); }
.game-page { --game-error:#a13c24; }
@media(prefers-color-scheme:dark) { .game-page { --game-error:#f0b29d; } }
.cell-feedback { margin-top:8px; font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
.cell-feedback:empty { display:none; }
.cell-feedback .result-label { display:block; font-size:12px; color:var(--muted); }
.cell-feedback[data-result="incorrect"] .result-label { color:var(--game-error); }
.cell-feedback .standard-form { display:block; font-size:18px; font-family:var(--serif); }
.cell-feedback strong { color:var(--accent); font-weight:700; }
.game-page .listen-answer { display:inline-flex; gap:6px; align-items:center; padding:4px 0; border:0; background:transparent; color:var(--accent); font-size:13px; min-height:44px; }
.listen-answer svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.6; }
.round-actions { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:16px 0 max(16px,env(safe-area-inset-bottom)); background:var(--paper); border-block:1px solid var(--line); }
.round-actions p { font-size:14px; font-variant-numeric:tabular-nums; }
#round-progress { color:var(--muted); }
#round-result:empty { display:none; }
.round-actions button { flex-shrink:0; }
.secondary-actions { display:flex; gap:8px 12px; flex-wrap:wrap; margin-top:20px; }
.practice-note { font-size:14px; color:var(--muted); margin:16px 0; max-width:72ch; }
#voice-options { max-width:720px; }
#voice-options p { font-size:14px; padding:0 0 16px; }
.voice-controls { display:flex; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.voice-controls label { display:grid; gap:6px; font-size:14px; min-width:0; max-width:100%; }
.voice-controls select { max-width:100%; }
.more-practice { margin:48px 0; }
.more-practice h2 { margin-bottom:12px; }
.more-practice a { margin-right:24px; }
.game-footer { display:flex; justify-content:space-between; gap:24px; border-top:1px solid var(--line); padding:24px 0; color:var(--muted); font-size:14px; }
.game-footer a { text-decoration:underline; text-underline-offset:4px; }
@media(max-width:767px) {
  .game-wrap { width:calc(100% - 40px); }
  .game-heading { display:grid; grid-template-columns:1fr 132px; align-items:center; gap:12px; padding:20px 0; }
  .game-heading h1 { font-size:32px; }
  .game-heading p { display:none; }
  .language-choice { min-width:0; margin:0; font-size:12px; }
  .game-page h2 { font-size:26px; }
  .challenge-heading p { font-size:15px; }
  .challenge-heading { gap:4px; }
  .challenge { padding-top:20px; }
  #selection-summary { display:block; margin:4px 0 0; }
  .setup-columns { grid-template-columns:1fr; }
  .round-meta { margin-block:12px; gap:4px; font-size:13px; }
  .game-matrix col:first-child { width:88px; }
  .game-matrix col:not(:first-child) { width:166px; }
  .game-matrix th,.game-matrix td { padding:10px; }
  .matrix-scroll { scroll-padding-left:88px; }
  .round-actions { gap:10px; }
  .round-actions p { font-size:13px; }
  .round-actions button { padding:9px 10px; font-size:14px; }
  .secondary-actions button { font-size:14px; }
}

/* Local concept gallery: examples, not playable controls. */
.game-jumps { display:flex; flex-wrap:wrap; gap:8px 28px; margin-bottom:20px; }
.game-jumps a { display:inline-flex; align-items:center; min-height:44px; color:var(--accent); text-decoration:underline; text-underline-offset:5px; }
#challenge-title,#game-ideas { scroll-margin-top:24px; }
.game-ideas { margin-top:64px; border-top:1px solid var(--line); padding-top:32px; }
.ideas-heading { max-width:70ch; margin-bottom:24px; }
.ideas-heading > p { margin-top:10px; }
.concept-status { color:var(--muted); font-size:14px; }
.game-concept { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:48px; padding-block:32px; border-bottom:1px solid var(--line); }
.game-ideas h3 { font:400 27px/1.25 var(--serif); margin:0 0 12px; }
.concept-copy > p { max-width:65ch; margin:0 0 12px; }
.concept-purpose { color:var(--muted); font-size:15px; }
.concept-copy details { margin-top:16px; }
.concept-copy summary { min-height:44px; font-size:15px; padding:10px 30px 10px 0; }
.concept-copy summary::after { top:5px; }
.concept-copy details p { padding:0; margin:12px 0; font-size:15px; }
.concept-preview { min-width:0; margin:0; }
.concept-preview figcaption { font-size:14px; color:var(--muted); margin-top:14px; }
.memory-sketch { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.memory-card { min-height:96px; display:grid; place-items:center; padding:12px; border:1px solid var(--line); border-radius:8px; font:400 24px/1.2 var(--serif); text-align:center; }
.memory-back { background:var(--soft); color:var(--muted); font-size:30px; }
.memory-revealed { color:var(--accent); border-color:var(--accent); }
.phrase-sketch > div { display:flex; align-items:center; gap:12px; flex-wrap:wrap; font:400 27px/1.3 var(--serif); }
.phrase-sketch > div > span:not(.phrase-join) { padding:14px 20px; background:var(--soft); border-radius:6px; }
.phrase-join { color:var(--muted); }
.phrase-sketch > p { font:400 24px/1.35 var(--serif); margin-top:24px; }
.phrase-sketch figcaption { margin-top:6px; }
.crossing-sketch ol { list-style:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 24px; margin:0; padding:0; counter-reset:step; }
.crossing-sketch li { counter-increment:step; padding:16px; border:1px solid var(--accent); border-radius:6px; font:400 24px/1.25 var(--serif); }
.crossing-sketch li::before { content:counter(step); display:block; margin-bottom:10px; font:400 13px/1 var(--sans); color:var(--muted); }
.further-ideas { display:grid; grid-template-columns:1fr 1fr; gap:48px; padding-block:32px; border-bottom:1px solid var(--line); }
.further-ideas p { margin:0 0 12px; max-width:65ch; }
.game-direction { max-width:72ch; margin-top:32px; }
.game-direction p { margin-bottom:16px; }
.game-direction .text-link { display:inline-flex; align-items:center; min-height:44px; }
@media(max-width:767px) {
  .game-jumps { gap:4px 20px; margin-bottom:12px; font-size:14px; }
  .game-ideas { margin-top:40px; padding-top:24px; }
  .game-concept,.further-ideas { grid-template-columns:1fr; gap:24px; padding-block:24px; }
  .game-ideas h3 { font-size:24px; }
  .memory-card { min-height:80px; font-size:20px; padding:8px; }
  .phrase-sketch > div { gap:8px; font-size:24px; }
  .phrase-sketch > div > span:not(.phrase-join) { padding:12px 14px; }
  .crossing-sketch ol { gap:12px; }
  .crossing-sketch li { font-size:21px; padding:12px; }
}

/* Playable Memory: isolated from the conjugation worksheet and account state. */
#memory, #phrase-title { scroll-margin-top:24px; }
.memory-game { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:48px; margin-top:64px; padding-top:32px; border-top:1px solid var(--line); }
.memory-intro > p { margin-top:16px; }
.memory-intro > p:first-of-type { font-size:20px; line-height:1.4; }
.memory-intro .memory-deck-note { font-size:14px; color:var(--accent); }
.memory-workspace { min-width:0; }
.memory-progress { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; margin-bottom:12px; }
.memory-board { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; list-style:none; padding:0; margin:0; }
.game-page .memory-tile { display:flex; flex-direction:column; align-items:center; justify-content:space-between; gap:8px; width:100%; height:100%; min-height:126px; padding:12px 8px; background:var(--soft); border-radius:8px; }
.memory-kind,.memory-card-note { font-size:12px; line-height:1.25; color:var(--muted); }
.memory-face { font:400 25px/1.2 var(--serif); overflow-wrap:anywhere; }
.memory-tile[data-state="down"] .memory-face { color:var(--muted); font-size:32px; }
.game-page .memory-tile[data-state="up"] { background:var(--surface); border-color:var(--accent); }
.game-page .memory-tile[data-state="matched"] { background:var(--paper); border-color:var(--accent); color:var(--accent); }
.memory-tile[data-state="matched"] .memory-card-note { color:var(--accent); }
.memory-tile[aria-disabled="true"] { cursor:default; }
.memory-controls { margin-top:16px; }
#memory-status { font-size:15px; min-height:48px; max-width:65ch; }
.memory-controls button { margin-top:12px; }
.memory-workspace h3 { font:400 27px/1.25 var(--serif); margin-bottom:16px; }
#memory-recall { scroll-margin-top:24px; }
#memory-recall > p { margin-bottom:20px; max-width:55ch; }
#memory-recall-form label { display:block; font-size:18px; margin-bottom:12px; }
#memory-prompt { font:400 27px/1.3 var(--serif); }
#memory-answer { width:100%; max-width:400px; }
#memory-answer[aria-invalid="true"] { border-style:dashed; border-color:var(--game-error); }
#memory-recall-feedback { margin-top:12px; min-height:52px; max-width:55ch; }
.memory-recall-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:16px; }
#memory-summary > p { max-width:60ch; margin-bottom:16px; }
#memory-summary-counts { list-style:none; margin:24px 0; padding:0; }
#memory-summary-counts li { padding:8px 0; }
#memory-summary-counts strong { display:inline-block; min-width:24px; color:var(--accent); font-variant-numeric:tabular-nums; }
#memory-summary .text-link { display:flex; width:fit-content; margin-top:12px; }
@media(max-width:900px) {
  .memory-game { grid-template-columns:1fr; gap:24px; }
  .memory-intro > p { max-width:65ch; }
}
@media(max-width:767px) {
  .memory-game { margin-top:40px; padding-top:24px; }
  .memory-intro > p { margin-top:12px; }
  .memory-intro .practice-note { font-size:13px; }
  .memory-board { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .game-page .memory-tile { min-height:112px; }
  .memory-face { font-size:22px; }
  .memory-kind,.memory-card-note { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .memory-game *, .memory-game { animation:none; transition:none; scroll-behavior:auto; }
}

/* Keep the shared language control touch-sized in WebKit native-select rendering. */
.language-choice { position:relative; }
.game-page #game-language { appearance:none; height:44px; padding-right:32px; width:100%; }
.language-choice::after { content:""; position:absolute; right:12px; bottom:16px; width:12px; height:10px; pointer-events:none; background:var(--ink); mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M2 3l4 4 4-4' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* The board stays visible while its compact controls wait for a deliberate start. */
.memory-settings { display:flex; align-items:center; flex-wrap:wrap; gap:8px 20px; margin:0 0 12px; }
.memory-settings label { display:flex; align-items:center; gap:8px; min-height:44px; font-size:14px; cursor:pointer; }
.memory-settings #memory-start { margin-left:auto; }
.game-page .memory-settings input { flex-shrink:0; width:18px; height:18px; min-height:18px; padding:0; accent-color:var(--accent); }
#memory[data-phase="ready"] .memory-controls { display:none; }
#memory-round { scroll-margin-top:16px; }
.memory-round-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px 20px; margin-bottom:12px; }
.memory-round-bar .memory-progress,.memory-clock { margin:0; font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; }
.memory-round-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.memory-clock span { color:var(--ink); }
.memory-paused { padding:48px 0; max-width:45ch; }
.game-page .memory-tile[data-state="preview"] { background:var(--surface); border-color:var(--accent); }
@media(max-width:767px) {
  .memory-settings { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 8px; }
  .memory-settings #memory-start { grid-column:2; grid-row:1 / span 2; margin-left:0; }
  .memory-round-bar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; min-height:88px; }
  .memory-round-bar p { line-height:1.2; }
  .memory-round-actions { grid-column:2; grid-row:1 / span 2; margin-left:0; }
  #memory-round .memory-face { font-size:18px; }
  #memory-round .memory-tile { min-height:112px; gap:6px; }
}
