/* ═══════════════════════════════════════════
   COSYlanguages — Mobile-first CSS additions
   Apply to practice.html and events.html
   ═══════════════════════════════════════════ */

/* ── Layout tokens ── */
:root {
  /* safe area insets for iPhone notch/home bar */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ── Bottom navigation bar (mobile only) ── */
.mobile-nav {
  display: none;
}

/* ── Game Setup Sheet (Mobile only) ── */
.game-setup-sheet {
  display: none;
}


@media (max-width: 768px) {
  /* Show bottom nav */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 500;
    background: rgba(253,248,240,.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    padding-bottom: max(var(--safe-bottom), 8px);
    box-shadow: 0 -4px 24px rgba(46,74,51,.08);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    gap: 4px;
    text-decoration: none;
    color: var(--muted);
    font-family:var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    position: relative;
    min-height: 56px;
    transition: color .18s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item .mn-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform .18s;
  }

  .mobile-nav-item:active .mn-icon {
    transform: scale(0.88);
  }

  .mobile-nav-item.active {
    color: var(--cosy-signal-ink);
  }

  .mobile-nav-item .mn-badge {
    position: absolute;
    top: 6px; right: calc(50% - 18px);
    background: #e24b4a;
    color: var(--cosy-on-brand);
    font-size: 9px;
    font-weight: 900;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--cream);
  }

  /* Push page content above bottom nav */
  body {
    padding-bottom: calc(64px + var(--safe-bottom));
  }

  /* Hide desktop nav on mobile */
  nav .nav-links {
    display: none;
  }

  /* Simplify desktop nav to just logo + wa button */
  nav {
    justify-content: space-between;
    height: 56px;
    padding: 0 1rem;
  }

  nav .nav-wa {
    display: flex;
    font-size: .78rem;
    padding: .3rem .75rem;
  }

  .nav-lang-switcher {
    display: none;
  }
}

/* ══════════════════════════════════
   PRACTICE PAGE — mobile redesign
   ══════════════════════════════════ */

@media (max-width: 768px) {

  /* Language selector — large circular flags */
  .lang-selector-mobile {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 16px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .lang-selector-mobile::-webkit-scrollbar { display: none; }

  .lang-flag-btn {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--border);
    background: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 28px;
    cursor: pointer;
    transition: border-color .18s, transform .18s, box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .lang-flag-btn .lf-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--muted);
    font-family:var(--font-sans);
  }

  .lang-flag-btn.active {
    border-color: var(--sage);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(107,143,113,.2);
  }

  .lang-flag-btn.soon {
    opacity: .4;
    pointer-events: none;
  }

  .lang-flag-btn:active {
    transform: scale(0.92);
  }

  /* Category buttons — full width pills */
  .category-pills-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 0 16px;
    margin: 12px 0;
  }

  .cat-pill {
    height: 56px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family:var(--font-sans);
    font-weight: 800;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    transition: all .18s;
    -webkit-tap-highlight-color: transparent;
  }

  .cat-pill:focus, .cat-pill:focus-visible, .filter-chip:focus, .filter-chip:focus-visible, .lang-flag-btn:focus, .lang-flag-btn:focus-visible, .start-btn-primary:focus, .start-btn-primary:focus-visible {
    outline: 3px solid var(--sage, #6b8f71);
    outline-offset: 2px;
  }

  .cat-pill .cp-icon { font-size: 18px; }
  .cat-pill.active-vocab { border-color: var(--sage); background: var(--sage-pale); color: var(--sage-dark); }
  .cat-pill.active-grammar { border-color: var(--sage-dark); background: var(--sage-mist); color: var(--sage-deep); }

  /* Speaking — always most prominent */
  .cat-pill.active-speaking,
  .cat-pill.speaking-pill {
    border-color: var(--honey);
    background: var(--honey-pale);
    color: var(--honey-dark);
    border-width: 2px;
  }

  .cat-pill.cat-speaking {
    border-color: rgba(232,168,56,.4);
    background: var(--honey-pale);
  }

  /* Level / Theme — bottom sheet trigger buttons */
  .filter-row-mobile {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin: 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-chip {
    flex-shrink: 0;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--cream);
    font-family:var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .18s;
  }

  .filter-chip.active {
    border-color: var(--sage);
    background: var(--sage-pale);
    color: var(--sage-dark);
  }

  /* Start button — large, full-width, thumb-friendly */
  .start-btn-mobile {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    margin-top: 8px;
  }

  .start-btn-primary {
    flex: 1;
    height: 56px;
    border-radius: 999px;
    background: var(--sage);
    color: var(--cosy-on-brand);
    border: none;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(107,143,113,.35);
    transition: transform .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
  }

  .start-btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(107,143,113,.25);
  }

  .start-btn-review {
    height: 56px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--honey);
    color: var(--cosy-on-brand);
    border: none;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s;
  }

  .start-btn-review:active { transform: scale(0.96); }

  /* ── Practice session UI ── */

  /* Question card */
  .question-card-mobile {
    margin: 16px;
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .question-text {
    font-family:var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--sage-deep);
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .question-sub {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
  }

  /* Answer buttons — full width, large */
  .answers-mobile {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .answer-btn-mobile {
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--cream);
    font-family:var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.35;
  }

  .answer-btn-mobile:active { transform: scale(0.98); }
  .answer-btn-mobile.correct { border-color: #1a6b45; background: var(--cosy-color-green-light); color: var(--cosy-ink-sage); }
  .answer-btn-mobile.incorrect { border-color: #a32d2d; background: var(--cosy-color-rose-light); color: var(--cosy-ink-rose); }

  /* Full-screen correct/incorrect flash */
  .answer-flash {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
  }
  .answer-flash.correct-flash { background: rgba(26,107,69,.15); }
  .answer-flash.incorrect-flash { background: rgba(163,45,45,.12); }
  .answer-flash.show { opacity: 1; pointer-events: all; }

  /* Type input (cloze) */
  .cloze-input-mobile {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--cream);
    font-family:var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    transition: border-color .18s;
  }
  .cloze-input-mobile:focus { border-color: var(--sage); }

  /* Progress bar — top of session */
  .session-progress-mobile {
    height: 6px;
    background: var(--sage-pale);
    position: sticky;
    top: 56px;
    z-index: 50;
    border-radius: 0;
  }
  .session-progress-fill {
    height: 100%;
    background: var(--sage);
    border-radius: 0 3px 3px 0;
    transition: width .3s ease;
  }

  /* Points + streak counter — compact top bar */
  .session-stats-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    font-family:var(--font-sans);
    font-size: 13px;
    font-weight: 800;
    color: var(--sage-dark);
  }

  /* Session summary — celebratory */
  .summary-mobile {
    padding: 32px 24px 24px;
    text-align: center;
    font-family:var(--font-sans);
  }

  .summary-celebrate {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 12px;
    animation: bounce .6s ease both;
  }

  @keyframes bounce {
    0%,100% { transform: translateY(0); }
    40%      { transform: translateY(-16px); }
    70%      { transform: translateY(-8px); }
  }

  .summary-score {
    font-family:var(--font-serif);
    font-size: 48px;
    font-weight: 700;
    color: var(--sage-deep);
    line-height: 1;
    margin-bottom: 4px;
  }

  .summary-label {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
  }

  .summary-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 28px;
  }

  .summary-stat {
    text-align: center;
  }

  .summary-stat .ss-num {
    font-size: 24px;
    font-weight: 900;
    color: var(--sage-dark);
    display: block;
  }

  .summary-stat .ss-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
  }

  .summary-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .summary-btn-primary {
    width: 100%;
    height: 56px;
    border-radius: 999px;
    background: var(--sage);
    color: var(--cosy-on-brand);
    border: none;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .summary-btn-secondary {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--sage-dark);
    border: 2px solid var(--sage);
    font-family:var(--font-sans);
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

}

/* ══════════════════════════════════
   GAMES PAGE — mobile redesign
   ══════════════════════════════════ */

@media (max-width: 768px) {

  /* Game cards — 2-column grid */
  .games-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .game-card {
    border-radius: 14px;
    padding: 14px 12px;
  }

  .gc-icon { font-size: 2rem; }
  .gc-title { font-size: .88rem; }
  .gc-desc { display: none; } /* hide description on mobile — too much text */

  .gc-play-btn {
    width: 100%;
    height: 40px;
    font-size: .85rem;
    text-align: center;
    border-radius: 999px;
    margin-top: 8px;
  }

  /* Bottom sheet for game setup */
  .game-setup-sheet {
    display: block;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 20000;
    background: var(--cream);
    border-radius: 24px 24px 0 0;
    padding: 0 20px calc(20px + var(--safe-bottom));
    box-shadow: 0 -8px 40px rgba(0,0,0,.15);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    max-height: 80vh;
    overflow-y: auto;
  }

  .game-setup-sheet.open {
    transform: translateY(0);
  }

  .gss-handle {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 999px;
    margin: 12px auto 20px;
  }

  .gss-title {
    font-family:var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sage-deep);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .gss-field {
    margin-bottom: 14px;
  }

  .gss-field label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
  }

  /* Large option chips for game settings */
  .gss-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .gss-option {
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: var(--cream);
    font-family:var(--font-sans);
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s;
  }

  .gss-option.active {
    border-color: var(--sage);
    background: var(--sage-pale);
    color: var(--sage-dark);
  }

  .gss-start {
    width: 100%;
    height: 56px;
    border-radius: 999px;
    background: var(--sage);
    color: var(--cosy-on-brand);
    border: none;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 17px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(107,143,113,.35);
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s;
  }

  .gss-start:active { transform: scale(0.97); }

  /* Sheet overlay */
  .sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 19999;
    background: rgba(0,0,0,.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }
  .sheet-overlay.open { opacity: 1; pointer-events: all; }

  /* ── Game-specific mobile layouts ── */

  /* Action Hero — huge timer, massive buttons */
  .action-hero-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: calc(100vh - 128px);
    padding: 24px 16px;
  }

  .ah-word {
    font-family:var(--font-serif);
    font-size: 36px;
    font-weight: 700;
    color: var(--sage-deep);
    text-align: center;
    margin: 20px 0;
    line-height: 1.2;
  }

  .ah-timer {
    font-family:var(--font-serif);
    font-size: 72px;
    font-weight: 700;
    color: var(--sage-dark);
    line-height: 1;
    text-align: center;
  }

  .ah-timer.urgent { color: var(--cosy-ink-rose); }

  .ah-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: auto;
  }

  .ah-btn-correct {
    height: 80px;
    border-radius: var(--radius);
    background: var(--cosy-color-green-light);
    border: 2px solid #1a6b45;
    color: var(--cosy-ink-sage);
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s;
  }
  .ah-btn-correct:active { transform: scale(0.94); background: #1a6b45; color: var(--cosy-on-brand); }

  .ah-btn-incorrect {
    height: 80px;
    border-radius: var(--radius);
    background: var(--cosy-color-rose-light);
    border: 2px solid #a32d2d;
    color: var(--cosy-ink-rose);
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s;
  }
  .ah-btn-incorrect:active { transform: scale(0.94); background: #a32d2d; color: var(--cosy-on-brand); }

  /* Fluency Flow — large spin button */
  .fluency-flow-mobile {
    padding: 24px 20px;
    text-align: center;
  }

  .ff-topic-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 28px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--sage-deep);
    line-height: 1.3;
  }

  .ff-timer-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
  }

  .ff-timer-ring svg {
    transform: rotate(-90deg);
  }

  .ff-timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:var(--font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--sage-dark);
  }

  .ff-spin-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--sage);
    color: var(--cosy-on-brand);
    border: none;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(107,143,113,.4);
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
  }

  .ff-spin-btn .fs-icon { font-size: 32px; }
  .ff-spin-btn:active {
    transform: scale(0.88);
    box-shadow: 0 4px 16px rgba(107,143,113,.3);
  }

  /* Opinion Arena — full screen */
  .opinion-arena-mobile {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .oa-statement {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    font-family:var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--sage-deep);
    line-height: 1.45;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .oa-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
  }

  .oa-agree {
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--sage-pale);
    border: 2px solid var(--sage);
    color: var(--sage-dark);
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .oa-disagree {
    height: 64px;
    border-radius: var(--radius-sm);
    background: #fce8ef;
    border: 2px solid #c45c7a;
    color: #8c2e49;
    font-family:var(--font-sans);
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ══════════════════════════════════
   DARK MODE
   ══════════════════════════════════ */

/* ── Embedded Mode (Standalone App Mode) ── */
body.embedded-mode #main-nav,
body.embedded-mode footer,
body.embedded-mode .practice-header,
body.embedded-mode .events-header,
body.embedded-mode .mobile-nav,
body.embedded-mode .wa-fab {
  display: none;
}

body.embedded-mode main {
  padding-top: max(var(--safe-top), 20px);
  padding-bottom: max(var(--safe-bottom), 20px);
}

/* ── Crossword Game ── */
.cw-main-layout {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.cw-grid-outer {
  background: var(--sage-deep);
  padding: 12px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 4px solid var(--sage-dark);
}

.cw-clues-container {
  flex: 1;
  min-width: 280px;
  max-height: 520px;
  background: var(--surface-color);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.cw-clue-list-scroll {
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
}

.cw-clue-item {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all .18s;
  border: 1px solid transparent;
}

.cw-clue-item:hover {
  background: var(--sage-mist);
}

.cw-clue-item.active {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage-deep);
  font-weight: 700;
}

.cw-cell {
  width: 42px;
  height: 42px;
  border: 1px solid var(--sage-deep);
  position: relative;
  background: var(--surface-color);
  cursor: pointer;
  transition: background .15s;
  border-radius: 4px;
}

.cw-cell.empty {
  background: var(--sage-deep);
  border-color: rgba(255,255,255,0.1);
  border-radius: 0;
}

.cw-cell-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  font-weight: 900;
  color: var(--cosy-ink-sage);
  line-height: 1;
  pointer-events: none;
}

.cw-input {
  width: 100%;
  height: 100%;
  border: none;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  text-transform: uppercase;
  background: transparent;
  caret-color: transparent;
  color: var(--ink);
  font-family:var(--font-serif);
}

@media (max-width: 600px) {
  .cw-cell { width: 30px; height: 30px; }
  .cw-input { font-size: 14px; }
  .cw-clues-container { max-height: none; }
  #cw-sticky-clue-bar {
    position: sticky;
    top: -10px;
    z-index: 100;
    margin-left: -10px;
    margin-right: -10px;
    background: var(--surface-color);
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  #crossword-clue-display {
    border-radius: 0;
    border: none;
    background: transparent;
  }
  .cw-clue-list-scroll { display: none; }
  .cw-main-layout { flex-direction: column-reverse; }
}

.cw-cell.active-word {
  background: #fffde7;
}
.cw-cell.active-cell {
  background: #ffeb3b;
}

html[data-theme="dark"] body, body.theme-dark {
  background: var(--cream);
  color: var(--ink);
}

html[data-theme="dark"] .question-card-mobile,
html[data-theme="dark"] .game-card,
html[data-theme="dark"] .game-setup-sheet,
html[data-theme="dark"] .ff-topic-card,
html[data-theme="dark"] .oa-statement,
html[data-theme="dark"] .le-card,
body.theme-dark .question-card-mobile,
body.theme-dark .game-card,
body.theme-dark .game-setup-sheet,
body.theme-dark .ff-topic-card,
body.theme-dark .oa-statement,
body.theme-dark .le-card {
  background: #222b22;
}

html[data-theme="dark"] .mobile-nav,
body.theme-dark .mobile-nav {
  background: rgba(26,31,26,.97);
}

/* ══════════════════════════════════
   TABLET (768px–1024px)
   ══════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1024px) {
  /* Bottom nav hidden on tablet — show condensed top nav */
  .mobile-nav { display: none; }

  /* Practice: 2-column layout for answers */
  .answers-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  /* Games: 3-column grid */
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Adjust hero for tablet */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-teacher, .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-ctas {
    justify-content: center;
  }
}
