/* ==========================================================================
   Lessgames — Editorial Puzzle Design System (Vanilla CSS)
   ========================================================================== */

:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-subtle: #f1eee7;
  --ink: #161614;
  --ink-muted: #615e56;
  --border: #e4dfd4;
  --border-strong: #cfc9bc;
  --shadow-sm: 0 1px 2px rgba(22, 22, 20, 0.05);
  --shadow-md: 0 8px 24px rgba(22, 22, 20, 0.07);

  --primary-bg: #181816;
  --primary-fg: #fbfaf7;
  --primary-hover: #2d2d29;

  --tile-correct: #2b8a56;
  --tile-present: #d99b26;
  --tile-absent: #77746c;
  --accent-coral: #cf4a37;
  --accent-teal: #1d7f7a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme='dark'] {
  --bg: #0c0d0f;
  --surface: #17181c;
  --surface-subtle: #23252b;
  --ink: #f3f4f6;
  --ink-muted: #8e929c;
  --border: #2a2d35;
  --border-strong: #3e424e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);

  --primary-bg: #f3f4f6;
  --primary-fg: #0c0d0f;
  --primary-hover: #e2e5ea;

  --tile-correct: #46b932;
  --tile-present: #e5b822;
  --tile-absent: #4a4d55;
  --accent-coral: #e53935;
  --accent-teal: #2ea19b;
}

[data-theme='solarized-light'] {
  --bg: #fdf6e3;
  --surface: #f7efda;
  --surface-subtle: #eee8d5;
  --ink: #073642;
  --ink-muted: #586e75;
  --border: #dcd4be;
  --border-strong: #c5bc9f;
  --shadow-sm: 0 1px 2px rgba(7, 54, 66, 0.06);
  --shadow-md: 0 8px 24px rgba(7, 54, 66, 0.09);

  --primary-bg: #268bd2;
  --primary-fg: #fdf6e3;
  --primary-hover: #1e77b8;

  --tile-correct: #859900;
  --tile-present: #b58900;
  --tile-absent: #93a1a1;
  --accent-coral: #dc322f;
  --accent-teal: #2aa198;
}

[data-theme='solarized-dark'] {
  --bg: #002b36;
  --surface: #073642;
  --surface-subtle: #0c4452;
  --ink: #eee8d5;
  --ink-muted: #93a1a1;
  --border: #175261;
  --border-strong: #266778;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.42);

  --primary-bg: #2aa198;
  --primary-fg: #002b36;
  --primary-hover: #35b5ab;

  --tile-correct: #859900;
  --tile-present: #b58900;
  --tile-absent: #586e75;
  --accent-coral: #dc322f;
  --accent-teal: #268bd2;
}

[data-theme='tokyo-night'] {
  --bg: #1a1b26;
  --surface: #24283b;
  --surface-subtle: #2f3549;
  --ink: #c0caf5;
  --ink-muted: #828bb8;
  --border: #3b4261;
  --border-strong: #545c7e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.44);

  --primary-bg: #7aa2f7;
  --primary-fg: #1a1b26;
  --primary-hover: #8db0fa;

  --tile-correct: #9ece6a;
  --tile-present: #e0af68;
  --tile-absent: #565f89;
  --accent-coral: #f7768e;
  --accent-teal: #73daca;
}

[data-theme='colorblind-light'] {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-subtle: #eef2f6;
  --ink: #0f172a;
  --ink-muted: #475569;
  --border: #cbd5e1;
  --border-strong: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);

  --primary-bg: #0072b2;
  --primary-fg: #ffffff;
  --primary-hover: #005b8f;

  --tile-correct: #0072b2;
  --tile-present: #e69f00;
  --tile-absent: #64748b;
  --accent-coral: #d55e00;
  --accent-teal: #56b4e9;
}

[data-theme='colorblind-dark'] {
  --bg: #0f131a;
  --surface: #181e29;
  --surface-subtle: #232c3b;
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --border: #334155;
  --border-strong: #475569;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);

  --primary-bg: #56b4e9;
  --primary-fg: #0f131a;
  --primary-hover: #74c2ee;

  --tile-correct: #56b4e9;
  --tile-present: #e69f00;
  --tile-absent: #475569;
  --accent-coral: #d55e00;
  --accent-teal: #009e73;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted-text {
  color: var(--ink-muted);
}

/* ---------- Top Navigation Bar ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary-bg);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 800;
}

.top-game-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.top-game-nav::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.nav-pill:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-pill.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
}

.nav-check {
  color: var(--tile-correct);
  font-weight: 800;
  font-size: 0.78rem;
}

.nav-pill.active .nav-check {
  color: #7ee3a8;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.daily-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.daily-pill.all-done {
  background: color-mix(in srgb, var(--tile-correct) 16%, transparent);
  color: var(--tile-correct);
  border-color: color-mix(in srgb, var(--tile-correct) 35%, transparent);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.icon-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ---------- Main Container & Shared Controls ---------- */

.app-main {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border: 1px solid var(--primary-bg);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active {
  transform: scale(0.97);
}

.text-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent);
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Hub View ---------- */

.hub-hero {
  text-align: center;
  max-width: 620px;
  margin: 14px auto 38px;
}

.hub-date {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.hub-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  font-weight: 700;
}

.hub-sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hub-card {
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.hub-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hub-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.hub-icon svg {
  width: 100%;
  height: 100%;
}

.hub-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
}

.hub-card-title {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}

.hub-card-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  flex: 1;
}

.hub-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.hub-status.status-done {
  color: var(--tile-correct);
}

.hub-status.status-prog {
  color: var(--tile-present);
}

.hub-status.status-open {
  color: var(--ink);
}

.hub-arrow {
  transition: transform 0.16s ease;
}

.hub-card:hover .hub-arrow {
  transform: translateX(4px);
}

/* ---------- Game Stage Shell ---------- */

.stage-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stage-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-title-group h1 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.stage-tagline {
  font-size: 0.9rem;
}

.game-shell {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-moreless,
.game-bee {
  max-width: 780px;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.pill-btn.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: var(--primary-bg);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.result-banner > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-win {
  border-color: color-mix(in srgb, var(--tile-correct) 45%, var(--border));
  background: color-mix(in srgb, var(--tile-correct) 9%, var(--surface));
}

.result-lose {
  border-color: color-mix(in srgb, var(--accent-coral) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-coral) 8%, var(--surface));
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 1. Wordless ---------- */

.wl-custom-panel {
  padding: 16px;
}

.wl-custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wl-board {
  display: grid;
  gap: 7px;
  width: 100%;
  max-width: 332px;
  margin: 4px auto;
}

.wl-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.wl-tile {
  aspect-ratio: 1;
  border: 2px solid var(--border-strong);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.15rem, 5.2vw, 1.7rem);
  font-weight: 800;
  background: var(--surface);
  user-select: none;
  transition: border-color 0.12s, transform 0.12s;
}

.wl-tile.tile-filled {
  border-color: var(--ink);
  animation: pop-in 0.12s ease;
}

.wl-tile.tile-correct {
  background: var(--tile-correct);
  border-color: var(--tile-correct);
  color: #ffffff;
}

.wl-tile.tile-present {
  background: var(--tile-present);
  border-color: var(--tile-present);
  color: #ffffff;
}

.wl-tile.tile-absent {
  background: var(--tile-absent);
  border-color: var(--tile-absent);
  color: #ffffff;
}

.wl-keyboard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(540px, 100%);
  margin: 10px auto 0;
  padding: 0 2px;
}

.wl-kb-row,
.kb-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.wl-key,
.kb-key {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 2px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.02rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.08s, border-color 0.12s;
}

.wl-key:hover,
.kb-key:hover {
  filter: brightness(1.08);
  border-color: var(--ink-muted);
}

.wl-key:active,
.kb-key:active {
  transform: scale(0.94);
}

.wl-key.key-wide,
.kb-key.key-wide {
  flex: 1.55;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.wl-key.key-correct,
.kb-key.key-correct {
  background: var(--tile-correct);
  border-color: var(--tile-correct);
  color: #ffffff;
}

.wl-key.key-present,
.kb-key.key-present {
  background: var(--tile-present);
  border-color: var(--tile-present);
  color: #18181b;
}

.wl-key.key-absent,
.kb-key.key-absent {
  background: var(--tile-absent);
  border-color: var(--tile-absent);
  color: #ffffff;
  opacity: 0.65;
}

/* ---------- 2. Songless ---------- */

.sl-slots {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sl-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
}

.sl-slot-active {
  border-color: var(--ink);
}

.sl-slot-correct {
  background: color-mix(in srgb, var(--tile-correct) 14%, var(--surface));
  border-color: var(--tile-correct);
}

.sl-slot-artist {
  background: color-mix(in srgb, var(--tile-present) 14%, var(--surface));
  border-color: var(--tile-present);
}

.sl-slot-wrong {
  background: color-mix(in srgb, var(--accent-coral) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent-coral) 45%, var(--border));
}

.sl-slot-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sl-player {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sl-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
}

.sl-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
}

.sl-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.sl-eq span {
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--accent-coral);
  transition: height 0.15s;
}

.sl-eq.playing span {
  animation: eq-bounce 0.55s ease-in-out infinite alternate;
}

.sl-eq.playing span:nth-child(2) { animation-delay: 0.1s; }
.sl-eq.playing span:nth-child(3) { animation-delay: 0.2s; }
.sl-eq.playing span:nth-child(4) { animation-delay: 0.12s; }
.sl-eq.playing span:nth-child(5) { animation-delay: 0.26s; }

.sl-timeline {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
  border: 1px solid var(--border);
}

.sl-unlocked {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--ink) 15%, transparent);
  transition: width 0.25s ease;
}

.sl-progress {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-coral);
}

.sl-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--surface);
  opacity: 0.85;
}

.sl-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sl-search-wrap {
  position: relative;
}

.sl-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 25;
  overflow: hidden;
}

.sl-dropdown.open {
  display: flex;
  flex-direction: column;
}

.sl-option {
  border: none;
  background: transparent;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sl-option:last-child {
  border-bottom: none;
}

.sl-option:hover,
.sl-option.selected {
  background: var(--surface-subtle);
}

/* ---------- 3. Spelling Bee ---------- */

.sb-rank-bar {
  padding: 14px 16px;
}

.sb-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.sb-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.sb-progress-fill {
  height: 100%;
  background: var(--tile-present);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.sb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.sb-play-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sb-input-display {
  min-height: 44px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-placeholder {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
}

.sb-ch-center {
  color: var(--tile-present);
}

.sb-ch-bad {
  color: var(--ink-muted);
  opacity: 0.45;
}

.sb-caret {
  display: inline-block;
  width: 2.5px;
  height: 1.5rem;
  background: var(--tile-present);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

.sb-hive {
  width: 256px;
  height: 252px;
  user-select: none;
}

.sb-hex {
  cursor: pointer;
}

.sb-hex polygon {
  transition: transform 0.1s ease, filter 0.15s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.sb-hex:active polygon {
  transform: scale(0.92);
}

.sb-hex-outer polygon {
  fill: var(--surface-subtle);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.sb-hex-outer:hover polygon {
  filter: brightness(0.95);
}

.sb-hex-center polygon {
  fill: var(--tile-present);
}

.sb-hex text {
  font-size: 22px;
  font-weight: 800;
  fill: var(--ink);
  pointer-events: none;
}

.sb-hex-center text {
  fill: #1a160c;
}

.sb-actions {
  display: flex;
  gap: 8px;
}

.sb-words-col {
  padding: 16px;
  min-height: 280px;
}

.sb-words-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sb-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sb-word-chip {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-subtle);
  font-size: 0.84rem;
  font-weight: 600;
}

.sb-word-chip.sb-pangram {
  background: color-mix(in srgb, var(--tile-present) 24%, var(--surface));
  border: 1px solid var(--tile-present);
  font-weight: 800;
}

/* ---------- 4. More/less ---------- */

.ml-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ml-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ml-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--border);
}

.ml-dot.dot-cur {
  background: var(--ink);
  transform: scale(1.15);
}

.ml-dot.dot-win {
  background: var(--tile-correct);
}

.ml-dot.dot-lose {
  background: var(--accent-coral);
}

.ml-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
}

.ml-card {
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 268px;
  transition: border-color 0.2s, background 0.2s;
}

.ml-card-right {
  border-color: color-mix(in srgb, var(--tile-correct) 55%, var(--border));
}

.ml-card-wrong {
  border-color: color-mix(in srgb, var(--accent-coral) 55%, var(--border));
}

.ml-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.ml-card-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 0 0 6px;
}

.ml-card-sub {
  margin: 0 0 20px;
  font-size: 0.88rem;
}

.ml-card-value {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ml-card-unit {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 4px;
}

.ml-vs {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.ml-vs.vs-right {
  background: var(--tile-correct);
  border-color: var(--tile-correct);
  color: #fff;
  transform: scale(1.12);
}

.ml-vs.vs-wrong {
  background: var(--accent-coral);
  border-color: var(--accent-coral);
  color: #fff;
  transform: scale(1.12);
}

.ml-prompt {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.ml-choice-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-more,
.btn-less {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, filter 0.15s;
}

.btn-more {
  background: var(--tile-correct);
  color: #fff;
}

.btn-less {
  background: var(--accent-coral);
  color: #fff;
}

.btn-more:hover,
.btn-less:hover {
  filter: brightness(1.06);
}

.btn-more:active,
.btn-less:active {
  transform: scale(0.96);
}

.ml-summary {
  padding: 36px 24px;
  text-align: center;
}

.ml-summary-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.ml-summary-score {
  font-size: 2.5rem;
  margin: 0 0 8px;
}

/* ---------- 5. Clueless ---------- */

.cl-latest-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cl-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cl-row {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  min-height: 44px;
}

.cl-row-latest {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.cl-bar {
  position: absolute;
  inset: 0 auto 0 0;
  opacity: 0.24;
  transition: width 0.35s ease;
}

.cl-bar.heat-solved { background: var(--tile-correct); opacity: 0.38; }
.cl-bar.heat-hot { background: var(--tile-correct); }
.cl-bar.heat-warm { background: var(--tile-present); }
.cl-bar.heat-mid { background: #e07b39; }
.cl-bar.heat-cold { background: var(--tile-absent); opacity: 0.2; }

.cl-row-content {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.cl-hint-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  margin-left: 6px;
}

.cl-empty {
  padding: 36px 24px;
  text-align: center;
}

.cl-empty-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--tile-correct);
  margin-bottom: 8px;
}

.cl-neighbors {
  padding: 16px;
}

.cl-neighbors-title {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.cl-neighbor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cl-nchip {
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-subtle);
  font-size: 0.8rem;
  font-weight: 600;
}

.cl-nchip em {
  font-style: normal;
  color: var(--ink-muted);
  margin-left: 3px;
}

/* ---------- 6. Guessless ---------- */

.gl-score-pill {
  font-size: 0.86rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.gl-card {
  padding: 26px 24px;
}

.gl-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.84rem;
}

.gl-cat-chip {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--surface-subtle);
}

.gl-question {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1.25;
  margin: 0 0 22px;
}

.gl-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.gl-input {
  padding-right: 110px;
  font-size: 1.1rem;
  font-weight: 600;
}

.gl-unit-badge {
  position: absolute;
  right: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
  pointer-events: none;
}

.gl-preview {
  min-height: 22px;
  margin: 8px 0 16px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.gl-reveal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gl-reveal-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gl-stat-box {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}

.gl-stat-box strong {
  font-size: 1.1rem;
}

.gl-stat-actual strong {
  color: var(--tile-correct);
}

.gl-stat-pts strong {
  color: var(--tile-present);
}

.gl-scale {
  padding: 24px 10px 6px;
}

.gl-scale-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
}

.gl-scale-diff {
  position: absolute;
  top: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--tile-present) 45%, transparent);
}

.gl-pin {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.gl-pin span {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.gl-pin-actual {
  background: var(--tile-correct);
}

.gl-pin-guess {
  background: var(--ink);
}

.gl-accuracy-tag {
  font-weight: 700;
  font-size: 0.95rem;
}

.gl-explain {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.gl-final-card {
  padding: 22px;
}

.gl-final-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.gl-sum-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gl-sum-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.gl-sum-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.gl-sum-q {
  font-weight: 600;
  margin: 4px 0;
  font-size: 0.94rem;
}

.gl-sum-pts {
  font-weight: 800;
  color: var(--tile-correct);
  white-space: nowrap;
}

/* ---------- Modals & Toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 10, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 0;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.94rem;
}

.stats-banner {
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  margin-bottom: 14px;
}

.stats-table {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.stats-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 14px);
  background: var(--primary-bg);
  color: var(--primary-fg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Animations ---------- */

@keyframes pop-in {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes flip-tile {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}

.anim-flip {
  animation: flip-tile 0.45s ease both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.anim-shake {
  animation: shake 0.34s ease;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes eq-bounce {
  0% { height: 4px; }
  100% { height: 17px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .top-game-nav {
    display: none;
  }
  .sb-layout {
    grid-template-columns: 1fr;
  }
  .ml-arena {
    grid-template-columns: 1fr;
  }
  .ml-vs {
    margin: -6px auto;
  }
}

@media (max-width: 540px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .header-inner {
    padding: 10px 14px;
  }
  .app-main {
    padding: 18px 14px 48px;
  }
  .gl-reveal-nums {
    grid-template-columns: 1fr;
  }
  .wl-key {
    height: 44px;
    font-size: 0.8rem;
  }
  .arc-stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- Archive Calendar ---------- */

button.daily-pill {
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

button.daily-pill:hover,
button.daily-pill.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: var(--primary-bg);
}

.arc-shell {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.arc-stat {
  padding: 16px;
  text-align: center;
}

.arc-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.arc-cal-card {
  padding: 20px;
}

.arc-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}

.arc-cal-month {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}

.arc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.arc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.arc-day {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.12s, border-color 0.14s, background 0.14s;
}

.arc-day:hover:not(:disabled) {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.arc-day.arc-today {
  border-color: var(--ink);
  border-width: 2px;
}

.arc-day.arc-done {
  background: color-mix(in srgb, var(--tile-correct) 18%, var(--surface));
  border-color: var(--tile-correct);
  color: var(--tile-correct);
}

.arc-day.arc-prog {
  background: color-mix(in srgb, var(--tile-present) 16%, var(--surface));
  border-color: var(--tile-present);
}

.arc-day:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.arc-day-sub {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.arc-blank {
  aspect-ratio: 1;
}

/* ---------- Playful Minimalist Graphics, Motion & Phone Ergonomics ---------- */

button,
.hub-card,
.sb-hex,
.wl-key {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hub-hero {
  position: relative;
}

.hero-doodles {
  position: absolute;
  inset: -12px -10px auto -10px;
  height: 140px;
  pointer-events: none;
  overflow: visible;
}

.doodle {
  position: absolute;
  width: 34px;
  height: 34px;
  animation: float-soft 5.5s ease-in-out infinite;
}

.doodle-1 { top: 8px; left: 4%; animation-delay: 0s; }
.doodle-2 { top: 18px; right: 6%; animation-delay: 1.4s; }
.doodle-3 { top: 86px; left: 12%; width: 24px; height: 24px; animation-delay: 2.6s; }

.hub-ring-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.progress-ring {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.hub-ring-meta {
  text-align: left;
}

.hub-ring-meta .hub-date {
  margin: 0;
  font-size: 0.76rem;
}

.live-meta-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--tile-correct);
  animation: pulse-soft 2s ease-in-out infinite;
}

.live-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tile-correct) 14%, transparent);
  color: var(--tile-correct);
}

.anim-card-in {
  animation: card-rise 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hub-card:hover .hub-icon-wordless svg { animation: wobble 0.45s ease; }
.hub-card:hover .hub-icon-songless svg { animation: bounce-mini 0.45s ease; }
.hub-card:hover .hub-icon-spelling-bee svg { transform: rotate(18deg); transition: transform 0.28s ease; }
.hub-card:hover .hub-icon-more-less svg { animation: bounce-mini 0.45s ease; }
.hub-card:hover .hub-icon-clueless svg { transform: scale(1.08); transition: transform 0.22s ease; }
.hub-card:hover .hub-icon-guessless svg { transform: translateX(3px); transition: transform 0.22s ease; }

.gl-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gl-chip {
  flex: 1;
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.14s;
}

.gl-chip:hover {
  background: var(--border);
}

.gl-chip:active {
  transform: scale(0.95);
}

.gl-slider-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.gl-slider-box input[type='range'] {
  flex: 1;
  accent-color: var(--primary-bg);
  height: 28px;
}

.ml-swipe-hint {
  font-size: 0.74rem;
  margin-top: 10px;
}

.spinning {
  opacity: 0.65;
  pointer-events: none;
}

/* Mobile Sticky Bottom Dock */
.mobile-dock {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: 68px;
  }
  .text-input {
    font-size: 16px;
  }
  #btn-archive,
  #btn-sync {
    display: none;
  }
  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .dock-btn {
    border: none;
    background: transparent;
    color: var(--ink-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05rem;
  }
  .dock-btn em {
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .dock-btn.active {
    color: var(--ink);
    background: var(--surface-subtle);
  }
  .toast {
    bottom: 78px;
  }
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(6deg); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}

@keyframes bounce-mini {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-4px); }
}

/* ---------- Clean Studio Illustrations & Framing ---------- */

.clean-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}

[data-theme='dark'] .clean-art-img,
[data-theme='solarized-dark'] .clean-art-img,
[data-theme='tokyo-night'] .clean-art-img,
[data-theme='colorblind-dark'] .clean-art-img {
  filter: brightness(0.9) contrast(1.04);
}

.hub-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  margin-bottom: 14px;
}

.hub-card:hover .hub-card-media .clean-art-img {
  transform: scale(1.04);
}

.hub-card-media .hub-tag {
  position: absolute;
  top: 9px;
  right: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #18181b;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(24, 24, 27, 0.08);
}

.stage-thumb {
  width: 44px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sl-player-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.sl-art-wrap {
  width: 84px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sl-art-wrap.playing {
  transform: scale(1.03);
  box-shadow: 0 0 0 2px var(--accent-coral);
}

.sl-player-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sl-player-meta .sl-player-top {
  margin-bottom: 0;
}

.ml-cat-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.ml-cat-art-wrap {
  width: 80px;
  height: 46px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ml-cat-eyebrow {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

/* ---------- Antigravity Settings Theme Picker ---------- */

.theme-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 14px 0 8px;
}

.theme-group-label:first-child {
  margin-top: 0;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 480px) {
  .theme-picker-grid {
    grid-template-columns: 1fr;
  }
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}

.theme-option:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-option.active {
  border-color: var(--primary-bg);
  box-shadow: 0 0 0 1px var(--primary-bg);
  background: var(--surface);
}

.theme-option-name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.theme-option-desc {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.theme-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, 0.28);
}




/* ==========================================================================
   .whatdagame v2 — Screenshot-faithful Shell, Sidebar & 9-Game Polish
   ========================================================================== */

.wdg-shell {
  display: flex;
  min-height: 100vh;
}

.wdg-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), margin-left 0.24s ease;
}

.wdg-sidebar.collapsed {
  margin-left: -248px;
}

.wdg-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
}

.wdg-wordmark {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 1.32rem;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-decoration: none;
}

.wdg-side-close {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.wdg-side-close:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.wdg-side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wdg-side-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: -0.03em;
  padding: 10px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.wdg-side-item:hover {
  background: var(--surface-subtle);
}

.wdg-side-item.active {
  background: var(--surface-subtle);
  color: var(--tile-correct);
}

.wdg-chev {
  color: var(--ink-muted);
  font-weight: 600;
}

.wdg-side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
}

.wdg-act-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.wdg-act-pills {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 10px;
}

.wdg-day-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wdg-day-dot.today {
  border-color: var(--ink);
  color: var(--ink);
}

.wdg-day-dot.done {
  background: var(--tile-correct);
  border-color: var(--tile-correct);
  color: #fff;
}

.wdg-act-note {
  font-size: 0.72rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.wdg-side-scrim {
  display: none;
}

.wdg-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wdg-header {
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

.wdg-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wdg-hero-title {
  font-family: var(--font-sans) !important;
  font-weight: 900 !important;
  font-size: clamp(2.4rem, 5vw, 3.6rem) !important;
  letter-spacing: -0.055em !important;
  margin: 8px 0 8px !important;
}

.wdg-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.wdg-stage-title {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  letter-spacing: -0.05em;
  margin: 0;
  line-height: 1.05;
}

@media (max-width: 1023px) {
  .wdg-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-105%);
    margin-left: 0 !important;
  }
  .wdg-sidebar.mobile-open {
    transform: translateX(0);
  }
  .wdg-side-scrim.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 45;
  }
}

/* ---------- Visual How-to-Play Modal Cards ---------- */
.wdg-modal {
  max-width: 440px;
}

.htp-sub {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.86rem;
  margin: 0 0 14px;
}

.htp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.htp-tiles {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.htp-t {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.htp-g { background: var(--tile-correct); }
.htp-y { background: var(--tile-present); color: #18181b; }
.htp-x { background: var(--tile-absent); }
.htp-r { background: var(--accent-coral); }
.htp-empty { background: var(--surface-subtle); border: 1px solid var(--border); }

.htp-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
}

.htp-legend > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.htp-mini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  flex-shrink: 0;
}

.htp-dot-g {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--tile-correct);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.htp-pill-demo {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.htp-segs {
  display: flex;
  gap: 4px;
  height: 18px;
  margin-bottom: 14px;
}

.htp-segs span {
  border-radius: 4px;
  background: var(--surface-subtle);
}

.htp-duel-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.htp-duel-box {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}

.htp-duel-box span {
  font-size: 0.8rem;
}

/* ---------- Wordless v2 Control Bar (Custom | - len + | Results) ---------- */
.wl-hard-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.wl-custom-box {
  display: flex;
  gap: 8px;
  padding: 12px;
  max-width: 440px;
  margin: 0 auto 14px;
}

.wl-bar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 440px;
  margin: 16px auto 14px;
}

.wl-strip-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.wl-strip-btn:hover { filter: brightness(1.08); }

.wl-strip-green {
  background: var(--tile-correct);
  border-color: var(--tile-correct);
  color: #fff;
}

.wl-len-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wl-step-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.wl-step-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.wl-step-val {
  width: 40px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.96rem;
}

/* ---------- Songless v2 (Apple Music + Segmented Timeline) ---------- */
.game-songless-v2 {
  max-width: 660px;
  margin: 0 auto;
}

.sl-tabs-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 440px;
  margin: 0 auto 18px;
  flex-wrap: wrap;
}

.sl-tab {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.sl-tab.active {
  background: var(--surface-subtle);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.sl-reveal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sl-cover-wrap {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sl-slots-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.sl-slot-bar {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 600;
}

.sl-slot-cur { border-color: var(--border-strong); }
.sl-slot-correct { border-color: var(--tile-correct); background: color-mix(in srgb, var(--tile-correct) 14%, var(--surface)); }
.sl-slot-artist { border-color: var(--tile-present); background: color-mix(in srgb, var(--tile-present) 14%, var(--surface)); }
.sl-slot-wrong { border-color: var(--accent-coral); background: color-mix(in srgb, var(--accent-coral) 12%, var(--surface)); }

.sl-slot-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.76rem;
  color: #fff;
  background: var(--tile-absent);
}

.sl-dot-correct { background: var(--tile-correct); }
.sl-dot-artist { background: var(--tile-present); color: #18181b; }
.sl-dot-wrong { background: var(--accent-coral); }

.sl-player-v2 {
  margin: 10px 0 18px;
}

.sl-pointer-row {
  position: relative;
  height: 30px;
}

.sl-pointer {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: left 0.3s ease;
}

.sl-pointer-tri {
  font-size: 0.65rem;
  line-height: 1;
  color: var(--ink-muted);
}

.sl-track-bar {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sl-track-unlocked {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--surface-subtle);
  transition: width 0.3s ease;
}

.sl-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--tile-correct);
}

.sl-seg-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bg);
}

.sl-play-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.sl-big-play {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: none;
  background: var(--tile-correct);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--tile-correct) 40%, transparent);
  transition: transform 0.14s ease;
}

.sl-big-play:hover { transform: scale(1.06); }
.sl-big-play.playing { animation: pulse-soft 1s ease-in-out infinite; }

.sl-source-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sl-bottom-search {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.sl-search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}

.sl-search-input {
  padding-left: 38px !important;
}

.sl-skip-btn {
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ---------- Spelling Bee v2 (Audio Bee 5 Rounds) ---------- */
.game-bee-audio {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.sb-mode-switch {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 14px;
}

.sb-round-label {
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.sb-rounds-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sb-round-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.sb-round-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.sb-r-cur {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: var(--primary-bg);
}

.sb-r-ok { background: var(--tile-correct); color: #fff; border-color: var(--tile-correct); }
.sb-r-bad { background: var(--accent-coral); color: #fff; border-color: var(--accent-coral); }
.sb-round-tri { font-size: 0.65rem; color: var(--ink); }

.sb-speaker-zone {
  margin: 12px 0 18px;
}

.sb-big-speaker {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  border: none;
  background: var(--tile-correct);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--tile-correct) 42%, transparent);
  transition: transform 0.14s ease;
}

.sb-big-speaker:hover { transform: scale(1.06); }
.sb-big-speaker.speaking { animation: pulse-soft 0.75s ease-in-out infinite; }

.sb-audio-tiles {
  min-height: 52px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}

.sb-letter-tile {
  width: 42px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  animation: pop-tile 0.12s ease;
}

.sb-tile-ok { background: var(--tile-correct); }
.sb-tile-typed { background: var(--surface-subtle); color: var(--ink); border: 1px solid var(--border-strong); }
.sb-prompt-placeholder { font-size: 1.35rem; font-weight: 600; opacity: 0.7; }

.sb-clue-card {
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  text-align: left;
}

.sb-clue-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.sb-white-btn {
  padding: 13px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.sb-white-btn:hover { opacity: 0.9; }
.sb-white-btn.active { background: var(--surface-subtle); color: var(--ink); }

/* ---------- More/less v2 (Side-by-Side Photo Duel Cards) ---------- */
.game-moreless-v2 {
  max-width: 860px;
  margin: 0 auto;
}

.ml-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.ml-cat-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ml-cat-tab {
  min-width: 40px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.ml-cat-tab.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: var(--primary-bg);
  padding: 0 16px;
}

.ml-duel-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}

.ml-photo-card {
  position: relative;
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ml-photo-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.ml-photo-card.ml-pick-ok { border-color: var(--tile-correct); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile-correct) 35%, transparent); }
.ml-photo-card.ml-pick-bad { border-color: var(--accent-coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-coral) 35%, transparent); }

.ml-photo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ml-photo-card:hover:not(:disabled) .ml-photo-bg { transform: scale(1.05); }

.ml-photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 12, 16, 0.28) 0%, rgba(10, 12, 16, 0.72) 100%);
}

.ml-photo-content {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 360px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ml-photo-pill {
  background: rgba(235, 236, 240, 0.92);
  color: #111215;
  padding: 9px 22px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ml-photo-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-weight: 600;
}

.ml-photo-val {
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.ml-photo-unit {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
}

.ml-tap-cue {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
}

.ml-duel-or {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .ml-duel-grid { grid-template-columns: 1fr; }
  .ml-photo-card, .ml-photo-content { min-height: 210px; }
  .ml-duel-or { margin: -6px auto; z-index: 4; }
}

/* ---------- Clueless v2 (Vivid Solid Heat Bars) ---------- */
.game-clueless-v2 {
  max-width: 580px;
  margin: 0 auto;
}

.cl-search-bar-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cl-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
}

.cl-search-box:focus-within { border-color: var(--ink); }
.cl-search-ico { opacity: 0.5; margin-right: 10px; }
.cl-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-size: 0.95rem;
  outline: none;
}

.cl-hash-badge {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.cl-menu-wrap { position: relative; }

.cl-dots-btn {
  width: 46px;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.cl-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 6px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cl-popover button {
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.cl-popover button:hover { background: var(--surface-subtle); }

.cl-section-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.cl-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.cl-vivid-row {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.cl-vivid-latest {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.cl-vivid-fill {
  position: absolute;
  inset: 0 auto 0 0;
  transition: width 0.35s ease;
}

.cl-bar-win, .cl-bar-green { background: var(--tile-correct); }
.cl-bar-orange { background: #e87a1e; }
.cl-bar-red { background: var(--accent-coral); }

.cl-vivid-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.cl-hint-badge {
  margin-left: 8px;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
}

.cl-empty-v2 {
  padding: 36px 20px;
  text-align: center;
}

.cl-empty-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--tile-correct);
  margin-bottom: 6px;
}

/* ---------- Guessless v2 (5-Icon Bar + Card + Mini Calculator) ---------- */
.game-guessless-v2 {
  max-width: 580px;
  margin: 0 auto;
}

.gl-icon-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0 auto 18px;
  display: flex;
  width: fit-content;
}

.gl-icon-step {
  width: 48px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--ink-muted);
}

.gl-icon-step.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
}

.gl-icon-step.done {
  color: var(--tile-correct);
}

.gl-v2-card {
  padding: 22px 24px 26px;
  border-radius: 18px;
}

.gl-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.gl-v2-cat {
  font-weight: 700;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gl-live-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tile-correct) 16%, transparent);
  color: var(--tile-correct);
  font-size: 0.72rem;
  font-weight: 800;
}

.gl-v2-prompt {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0 0 36px;
}

.gl-v2-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 4px 16px;
  background: var(--bg);
}

.gl-v2-input-wrap:focus-within { border-color: var(--ink); }

.gl-v2-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.gl-v2-unit {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding-left: 10px;
}

.gl-v2-action-row {
  display: flex;
  gap: 10px;
  max-width: 340px;
  margin: 16px auto 0;
}

.gl-calc-toggle {
  width: 56px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.2rem;
  cursor: pointer;
}

.gl-calc-toggle.active {
  border-color: var(--ink);
  background: var(--surface-subtle);
}

.gl-v2-guess-btn {
  flex: 1;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
}

.gl-v2-guess-btn:hover {
  background: var(--primary-bg);
  color: var(--primary-fg);
}

.gl-calc-pop {
  max-width: 280px;
  margin: 12px auto 0;
  padding: 12px;
}

.gl-calc-disp {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  overflow-x: auto;
}

.gl-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.gl-calc-key {
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.gl-rev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.gl-rev-box {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-subtle);
}

/* ---------- New Games: Linkless, Mathless, Flagless ---------- */
.game-linkless { max-width: 560px; margin: 0 auto; }
.lk-mistakes { display: flex; align-items: center; gap: 8px; }
.lk-dots { display: flex; gap: 5px; }
.lk-dot { width: 11px; height: 11px; border-radius: 99px; background: var(--border); }
.lk-dot.active { background: var(--ink); }
.lk-solved-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.lk-solved-bar { padding: 14px 16px; border-radius: 12px; text-align: center; color: #111215; }
.lk-tier-0 { background: #f3d35c; }
.lk-tier-1 { background: #7dd38e; }
.lk-tier-2 { background: #89baf4; }
.lk-tier-3 { background: #c59cf2; }
.lk-solved-title { font-weight: 900; font-size: 0.86rem; letter-spacing: 0.04em; }
.lk-solved-words { font-size: 0.84rem; font-weight: 600; margin-top: 2px; }
.lk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.lk-tile {
  aspect-ratio: 1.35 / 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  font-size: clamp(0.7rem, 2.2vw, 0.86rem);
  cursor: pointer;
  padding: 6px;
  transition: transform 0.1s, background 0.15s, color 0.15s;
}
.lk-tile.selected { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); transform: scale(0.96); }
.lk-actions { display: flex; justify-content: center; gap: 10px; }

.game-mathless { max-width: 520px; margin: 0 auto; }
.ml-eq-board { display: flex; flex-direction: column; gap: 6px; max-width: 440px; margin: 0 auto 16px; }
.ml-eq-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.ml-eq-tile { font-size: clamp(1rem, 3.2vw, 1.35rem) !important; font-family: var(--font-mono); }

.game-flagless { max-width: 540px; margin: 0 auto; }
.fl-card { padding: 24px; text-align: center; }
.fl-stage { display: flex; justify-content: center; margin-bottom: 14px; }
.fl-flag-svg {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.fl-hints { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fl-hint-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
}
.fl-miss { color: var(--accent-coral); }
.fl-summary { padding: 24px; text-align: center; }
.fl-recap-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.fl-recap-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-subtle); }
.fl-mini-svg { width: 42px; height: 28px; border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0; }

/* ==========================================================================
   Audit Fixes, Cross-Theme Contrast & Phone-First Polish
   ========================================================================== */

html,
body {
  overflow-x: clip;
}

.hub-view,
.stage-view,
.game-wordless {
  width: 100%;
  min-width: 0;
}

.wdg-header-brand {
  white-space: nowrap;
}

.wdg-side-right {
  display: inline-flex;
  align-items: center;
}

/* Spelling Bee Honeycomb interactive hexes */
.hex-btn {
  cursor: pointer;
  touch-action: manipulation;
}

.hex-btn polygon {
  transition: transform 0.1s ease, filter 0.15s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.hex-btn:hover polygon {
  filter: brightness(0.93);
}

.hex-btn:active polygon {
  transform: scale(0.92);
}

/* Songless & Flagless search + dropdown polish */
.sl-search-wrap {
  position: relative;
  min-width: 0;
}

.sl-search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.sl-slot-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sl-dropdown {
  max-height: 240px;
  overflow-y: auto;
  z-index: 42;
}

.fl-reveal {
  margin-top: 14px;
}

.fl-reveal-title {
  font-size: 1rem;
  font-weight: 800;
}

/* Clueless high-contrast dark track in ALL themes (including Light & Solarized Light) */
.cl-vivid-row {
  background: #272a33;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='light'] .cl-vivid-row,
[data-theme='solarized-light'] .cl-vivid-row,
[data-theme='colorblind-light'] .cl-vivid-row {
  background: #474d5a;
}

.cl-vivid-word {
  font-weight: 800;
}

.cl-vivid-rank {
  font-weight: 800;
}

/* Shake animation for invalid Wordless/Mathless/Spelling Bee inputs */
@keyframes row-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: row-shake 0.34s ease;
}

/* Phone-friendly polish (<= 640px & <= 420px) */
@media (max-width: 640px) {
  .header-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .header-actions {
    gap: 6px;
  }
  /* Keep top bar super clean on phones — Archive, Live & Stats live in the bottom dock */
  #btn-sync,
  #btn-archive,
  #btn-stats {
    display: none !important;
  }
  .app-main {
    padding: 14px 12px 92px;
  }
  .wdg-game-top {
    margin-bottom: 12px;
    gap: 8px;
  }
  .wdg-game-top > div:last-child {
    width: 48px !important;
  }
  .wdg-stage-title {
    font-size: 1.75rem;
  }
  input[type='text'],
  input[type='password'],
  .cl-search-box input,
  .gl-v2-input-wrap input {
    font-size: 16px !important;
  }

  /* Crisp, large thumb-friendly on-screen keyboard */
  .wl-keyboard {
    gap: 6px;
    padding: 0;
  }
  .wl-kb-row,
  .kb-row {
    gap: 4px;
  }
  .wl-key,
  .kb-key {
    height: 50px;
    font-size: 0.96rem;
    border-radius: 7px;
  }
  .wl-key.key-wide,
  .kb-key.key-wide {
    flex: 1.48;
    font-size: 0.7rem;
  }

  /* Wordless 3-7L stepper strip on phone */
  .wl-bar-strip {
    gap: 8px;
    margin: 12px auto;
  }
  .wl-strip-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  .wl-step-btn,
  .wl-step-val {
    width: 36px;
    height: 36px;
  }

  /* Spelling Bee tiles & buttons on phone */
  .sb-letter-tile {
    width: 32px;
    height: 36px;
    font-size: 1rem;
  }
  .sb-big-speaker {
    width: 68px;
    height: 68px;
    font-size: 1.7rem;
  }
  .sb-white-btn {
    padding: 11px 10px;
    font-size: 0.84rem;
  }

  /* Songless & Flagless search bar on phone */
  .sl-tabs-bar {
    gap: 3px;
    padding: 3px;
  }
  .sl-tab {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .sl-bottom-search {
    gap: 8px;
  }
  .sl-skip-btn {
    padding: 0 14px;
    font-size: 0.82rem;
  }
  .sl-search-row {
    flex-wrap: wrap;
  }
  .sl-search-row .sl-search-wrap {
    flex: 1 1 100%;
  }
  .sl-search-row > button {
    flex: 1;
    min-height: 42px;
  }

  /* More/less compact phone cards */
  .ml-photo-card,
  .ml-photo-content {
    min-height: 192px;
  }
  .ml-photo-pill {
    font-size: 1.05rem;
    padding: 7px 16px;
  }
  .ml-photo-val {
    font-size: 1.65rem;
  }

  /* Guessless phone layout */
  .gl-icon-step {
    width: 40px;
    height: 34px;
  }
  .gl-v2-card {
    padding: 18px 16px 20px;
  }
  .gl-v2-prompt {
    font-size: 1.28rem;
    margin-bottom: 22px;
  }
  .gl-calc-key {
    padding: 12px 0;
  }

  /* Linkless & Mathless on phone */
  .lk-grid {
    gap: 6px;
  }
  .lk-tile {
    min-height: 58px;
    aspect-ratio: auto;
    padding: 6px 4px;
    line-height: 1.15;
    word-break: break-word;
    font-size: 0.74rem;
  }
  .ml-eq-row {
    gap: 4px;
  }
  .ml-eq-tile {
    font-size: 0.98rem !important;
    border-radius: 6px;
  }

  /* Archive stats stay 3-up compact on phone */
  .arc-stats {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }
  .arc-stat {
    padding: 10px 6px;
  }
  .arc-stat-val {
    font-size: 1.15rem;
  }

  /* Modal breathes nicely on phone */
  .modal-dialog {
    width: calc(100vw - 24px);
    max-height: 86vh;
    overflow-y: auto;
    padding: 16px;
  }
}

@media (max-width: 370px) {
  .wl-key,
  .kb-key {
    height: 46px;
    font-size: 0.88rem;
  }
  .wl-key.key-wide,
  .kb-key.key-wide {
    font-size: 0.64rem;
  }
}

/* ==========================================================================
   Mathless Big-Tile Fix + Immersive Atmosphere, Cursor Glow & Audio Viz
   ========================================================================== */

/* Fix Mathless empty blocks starting small: force full width + generous square tile sizing */
.game-mathless {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.ml-eq-board {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px auto 18px;
}

.ml-eq-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
}

.ml-eq-tile {
  width: 100%;
  min-height: 54px;
  aspect-ratio: 1;
  font-size: clamp(1.15rem, 3.6vw, 1.55rem) !important;
  border-radius: 10px;
}

.wl-row {
  width: 100%;
}

.wl-tile {
  width: 100%;
  min-height: 52px;
}

@media (max-width: 640px) {
  .ml-eq-board {
    gap: 5px;
    margin: 4px auto 14px;
  }
  .ml-eq-row {
    gap: 4px;
  }
  .ml-eq-tile {
    min-height: 40px;
    font-size: 1.05rem !important;
    border-radius: 7px;
  }
  .wl-tile {
    min-height: 44px;
  }
}

/* Active input tile breathing glow */
@keyframes cursor-breathe {
  0%, 100% {
    border-color: var(--tile-correct);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tile-correct) 26%, transparent);
  }
  50% {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tile-correct) 14%, transparent);
  }
}

.wl-tile.tile-cursor {
  animation: cursor-breathe 1.6s ease-in-out infinite;
  background: color-mix(in srgb, var(--tile-correct) 6%, var(--surface));
}

/* Per-game subtle ambient atmospheric stage aura */
.wdg-content {
  position: relative;
  isolation: isolate;
}

.wdg-content::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 100vw);
  height: 420px;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.14;
  filter: blur(72px);
  background: radial-gradient(circle, var(--stage-aura, var(--tile-correct)) 0%, transparent 70%);
  transition: background 0.55s ease, opacity 0.4s ease;
}

body[data-game='hub'] { --stage-aura: #46b932; }
body[data-game='wordless'] { --stage-aura: #46b932; }
body[data-game='songless'] { --stage-aura: #e53935; }
body[data-game='spelling-bee'] { --stage-aura: #e5b822; }
body[data-game='more-less'] { --stage-aura: #3b82f6; }
body[data-game='clueless'] { --stage-aura: #22c55e; }
body[data-game='guessless'] { --stage-aura: #7aa2f7; }
body[data-game='linkless'] { --stage-aura: #a855f7; }
body[data-game='mathless'] { --stage-aura: #2aa198; }
body[data-game='flagless'] { --stage-aura: #2563eb; }

/* Smooth spring stage entrance */
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stage-enter {
  animation: stage-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Hub Quick-Launch CTA & Card Spotlight */
.wdg-hero-cta-row {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.wdg-next-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tile-correct) 45%, var(--border));
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tile-correct) 22%, transparent);
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.16s ease;
}

.wdg-next-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--tile-correct) 32%, transparent);
}

.wdg-next-cta:active {
  transform: scale(0.97);
}

.hub-card {
  position: relative;
  overflow: hidden;
}

.hub-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tile-correct) 14%, transparent), transparent 70%);
  transition: opacity 0.25s ease;
}

.hub-card:hover::after {
  opacity: 1;
}

/* Songless Reactive 12-Bar Audio Visualizer */
.sl-viz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.sl-viz-side {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
}

.sl-viz-side span {
  width: 4px;
  height: 8px;
  border-radius: 99px;
  background: var(--border-strong);
  transition: height 0.2s ease, background 0.2s ease;
}

@keyframes viz-bounce {
  0%, 100% { height: 7px; }
  50% { height: 32px; }
}

.sl-viz.active .sl-viz-side span {
  background: var(--tile-correct);
  animation: viz-bounce 0.62s ease-in-out infinite;
}

.sl-viz.active .sl-viz-side span:nth-child(2) { animation-delay: 0.11s; }
.sl-viz.active .sl-viz-side span:nth-child(3) { animation-delay: 0.24s; }
.sl-viz.active .sl-viz-side span:nth-child(4) { animation-delay: 0.07s; }
.sl-viz.active .sl-viz-side span:nth-child(5) { animation-delay: 0.31s; }
.sl-viz.active .sl-viz-side span:nth-child(6) { animation-delay: 0.18s; }

/* Floating Celebration Callout Pill */
@keyframes fx-burst-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.84);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.04);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -26px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -46px) scale(0.96);
  }
}

.fx-burst-pill {
  position: fixed;
  top: 42%;
  left: 50%;
  z-index: 96;
  pointer-events: none;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--tile-correct);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--tile-correct) 45%, transparent);
  animation: fx-burst-float 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ==========================================================================
   Phone-First Edge-to-Edge Keyboard & Full-Viewport Ergonomics
   ========================================================================== */

.wdg-game-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.wdg-game-top > :first-child {
  justify-self: start;
}

.wdg-game-top > .wdg-stage-title {
  justify-self: center;
  text-align: center;
}

.wl-keyboard {
  width: min(560px, 100%);
  gap: 8px;
  margin: 10px auto 0;
  padding: 0;
}

.wl-kb-row,
.kb-row {
  gap: 6px;
}

/* Naturally stagger middle QWERTY row (A-L) without affecting 2-row Mathless keyboard */
.wl-keyboard .kb-row:nth-child(2):not(:last-child) {
  padding: 0 4.5%;
}

.wl-key,
.kb-key {
  height: 58px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}

.wl-key:active,
.kb-key:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: none;
}

.wl-key.key-wide,
.kb-key.key-wide {
  flex: 1.52;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .app-main {
    width: 100%;
    padding: 8px 10px 76px;
  }

  /* Edge-to-edge phone keyboard games (Wordless, Spelling Bee, Mathless) */
  body[data-game='wordless'] .app-main,
  body[data-game='spelling-bee'] .app-main,
  body[data-game='mathless'] .app-main {
    padding: 6px 4px 70px;
  }

  body[data-game='wordless'] .wdg-game-top,
  body[data-game='spelling-bee'] .wdg-game-top,
  body[data-game='mathless'] .wdg-game-top {
    padding-inline: 6px;
    margin-bottom: 6px;
  }

  .wdg-game-top {
    margin-bottom: 10px;
  }

  .wdg-game-top > div:last-child {
    width: auto !important;
  }

  .wdg-stage-title {
    font-size: 1.55rem;
  }

  .game-shell {
    gap: 10px;
  }

  body[data-game='wordless'] .game-toolbar,
  body[data-game='mathless'] .game-toolbar {
    padding-inline: 6px;
  }

  /* Compact board & controls above keyboard so ALL 3 keyboard rows sit cleanly above bottom dock */
  .wl-board {
    max-width: min(274px, 75vw) !important;
    gap: 5px;
    margin: 0 auto;
  }

  .wl-board[data-wlen='3'] {
    max-width: min(190px, 54vw) !important;
  }

  .wl-board[data-wlen='4'] {
    max-width: min(236px, 66vw) !important;
  }

  .wl-board[data-wlen='6'],
  .wl-board[data-wlen='7'] {
    max-width: min(352px, 95vw) !important;
  }

  .wl-row {
    gap: 5px;
  }

  .wl-tile {
    min-height: 44px;
    border-radius: 8px;
    font-size: clamp(1.15rem, 5.2vw, 1.5rem);
  }

  .wl-bar-strip {
    gap: 6px;
    margin: 2px auto;
  }

  .wl-strip-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .wl-step-btn,
  .wl-step-val {
    width: 34px;
    height: 34px;
  }

  /* Spelling Bee compact vertical rhythm on phone */
  .sb-mode-switch {
    margin-bottom: 2px;
  }

  .sb-round-label {
    margin-bottom: 2px;
  }

  .sb-rounds-row {
    margin-bottom: 4px;
    gap: 6px;
  }

  .sb-round-box {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
  }

  .sb-speaker-zone {
    margin: 2px 0;
  }

  .sb-big-speaker {
    width: 62px;
    height: 62px;
    font-size: 1.6rem;
  }

  .sb-audio-tiles {
    min-height: 44px;
    margin: 4px 0;
  }

  .sb-clue-btns {
    padding-inline: 6px;
    margin: 2px 0 4px;
  }

  /* Mathless board compact rhythm */
  .ml-eq-board {
    padding-inline: 4px;
    margin: 2px auto 8px;
  }

  /* Large, bold, edge-to-edge thumb-friendly phone keyboard */
  .wl-keyboard {
    width: 100%;
    max-width: 100%;
    gap: 6px;
    margin: 6px auto 0;
    padding: 0;
  }

  .wl-kb-row,
  .kb-row {
    gap: 3px;
  }

  .wl-keyboard .kb-row:nth-child(2):not(:last-child) {
    padding: 0 4.2%;
  }

  .wl-key,
  .kb-key {
    height: 60px;
    font-size: 1.18rem;
    font-weight: 800;
    border-radius: 7px;
    padding: 0;
    line-height: 1;
  }

  .wl-key.key-wide,
  .kb-key.key-wide {
    flex: 1.54;
    font-size: 0.74rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  /* Sleeker mobile dock for extra vertical breathing room */
  .mobile-dock {
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }

  .dock-btn {
    padding: 4px 4px;
    font-size: 0.98rem;
  }
}

@media (max-width: 365px) {
  .wl-key,
  .kb-key {
    height: 56px;
    font-size: 1.08rem;
  }

  .wl-key.key-wide,
  .kb-key.key-wide {
    flex: 1.56;
    font-size: 0.68rem;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .game-shell {
    gap: 7px;
  }

  .wl-board[data-wlen='5'] {
    max-width: min(244px, 68vw) !important;
    gap: 4px;
  }

  .wl-row {
    gap: 4px;
  }

  .wl-tile {
    min-height: 38px;
  }
}


