/* ═══════════════════════════════════════════════
   WordForge — Futuristic Chrome/LED Design System
   ═══════════════════════════════════════════════ */

/* Fonts ship with the game (SIL Open Font License, texts in fonts/) */
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/orbitron.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/rajdhani-400.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/rajdhani-500.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/rajdhani-600.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/rajdhani-700.woff2') format('woff2'); }

/* ── CSS Variables ── */
:root {
  /* Chrome/White LED palette */
  --bg:           #F0F4F8;
  --bg2:          #E4EAF0;
  --surface:      #FFFFFF;
  --surface2:     #F5F7FA;
  --border:       rgba(0,0,0,0.08);
  --border2:      rgba(0,0,0,0.14);

  /* Neon accents */
  --cyan:         #00D4FF;
  --cyan-dark:    #0095CC;
  --cyan-glow:    rgba(0,212,255,0.35);
  --pink:         #FF6B9D;
  --pink-glow:    rgba(255,107,157,0.35);
  --gold:         #FFD700;
  --green:        #00FF88;
  --orange:       #FF8C42;
  --purple:       #B44FFF;

  /* Text */
  --text:         #1A2B3C;
  --text2:        #B0C4DE; /* Light Steel Blue - much clearer */
  --text3:        #7A8C99; /* Higher contrast muted gray */
  --text-inv:     #FFFFFF;

  /* Chrome effect */
  --chrome-top:   #FFFFFF;
  --chrome-mid:   #E8ECF0;
  --chrome-bot:   #C8D0D8;
  --chrome-edge:  rgba(255,255,255,0.9);

  /* Cell states */
  --cell-bg:      linear-gradient(145deg, #FFFFFF 0%, #E8ECF2 50%, #D4DBE4 100%);
  --cell-active:  linear-gradient(145deg, #DAEFFE 0%, #B8E4FF 50%, #98D4F8 100%);
  --cell-border:  rgba(180,200,220,0.6);
  --cell-shadow:  0 4px 12px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);

  /* Timer colors */
  --timer-ok:     #00FF88;
  --timer-warn:   #FFD700;
  --timer-danger: #FF6B9D;

  /* Spacing */
  --gap:          12px;
  --radius:       12px;
  --radius-sm:    8px;

  /* Fonts */
  --font-display: 'Orbitron', monospace;
  --font-body:    'Rajdhani', sans-serif;
}

/* Dark mode override */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0A0F1A;
    --bg2:          #0D1520;
    --surface:      #111E2E;
    --surface2:     #162030;
    --border:       rgba(255,255,255,0.06);
    --border2:      rgba(255,255,255,0.12);
    --text:         #E8F4FF;
    --text2:        #8AAABB;
    --text3:        #506070;
    --cell-bg:      linear-gradient(145deg, #1E2D3D 0%, #162438 50%, #0F1C2E 100%);
    --cell-active:  linear-gradient(145deg, #0A2A3D 0%, #0D3A52 50%, #0A2A3D 100%);
    --cell-border:  rgba(100,150,200,0.2);
    --cell-shadow:  0 4px 12px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.07);
  }
}

/* Manual dark class for toggle */
body.dark-mode {
  --bg:           #0A0F1A;
  --bg2:          #0D1520;
  --surface:      #111E2E;
  --surface2:     #162538; /* Slightly lighter to separate from bg */
  --border:       rgba(255,255,255,0.1);
  --border2:      rgba(255,255,255,0.18);
  
  /* Text Refinements */
  --text:         #F0F8FF; /* Alice Blue - crisp white-blue */
  --text2:        #A5C0D0; /* Balanced mid-tone */
  --text3:        #6B8595; /* Minimum legible contrast */
  
  /* Cell States */
  --cell-bg:      linear-gradient(145deg, #243447 0%, #162438 50%, #0D1525 100%);
  --cell-active:  linear-gradient(145deg, #0D3A52 0%, #145A7A 50%, #0D3A52 100%);
  --cell-border:  rgba(0, 212, 255, 0.2); /* Use a hint of cyan in the border */
}
/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; }
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Starfield background ── */
#starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Layout ── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--cyan) 0%, #FFFFFF 40%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  position: relative;
}
.logo::after {
  content: 'DAILY';
  display: block;
  font-size: 8px;
  letter-spacing: 5px;
  font-weight: 400;
  color: var(--text3);
  margin-top: -4px;
  -webkit-text-fill-color: var(--text3);
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.icon-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* ── Main layout ── */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 400px) 1fr;
  grid-template-rows: auto;
  gap: var(--gap);
  padding: var(--gap) 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* Left panel */
.panel-left {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-top: 4px;
}

/* Center column — game */
.game-col {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Right panel */
.panel-right {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-top: 4px;
}

/* ── Timer Ring ── */
.timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--cell-shadow);
}

.timer-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}
.timer-ring-wrap svg {
  transform: rotate(-90deg);
  width: 80px;
  height: 80px;
}
.timer-ring-bg {
  fill: none;
  stroke: var(--border2);
  stroke-width: 5;
}
.timer-ring-fill {
  fill: none;
  stroke: var(--timer-ok);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.4s ease;
  filter: drop-shadow(0 0 6px currentColor);
}
.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.timer-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text3);
  font-family: var(--font-display);
}

/* ── Score display ── */
.score-display {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--cell-shadow);
}
.score-display .sd-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text3);
  font-family: var(--font-display);
  margin-bottom: 4px;
}
.score-display .sd-val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.score-display .sd-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

/* ── Word found indicator ── */
.words-progress {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--cell-shadow);
}
.wp-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text3);
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.wp-bar-bg {
  height: 6px;
  background: var(--border2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.wp-counts {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
}
.wp-counts span { color: var(--cyan); font-weight: 600; font-family: var(--font-display); }

/* ── Word slots / found list ── */
.word-list-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--cell-shadow);
  max-height: 350px;
  overflow-y: auto;
}
.wlp-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text3);
  font-family: var(--font-display);
  margin-bottom: 10px;
}
.word-found-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 3px;
  animation: wordSlide 0.3s cubic-bezier(0.34,1.56,0.64,1);
  background: var(--surface2);
  border: 1px solid var(--border);
}
@keyframes wordSlide {
  from { opacity:0; transform: translateX(-16px) scale(0.95); }
  to   { opacity:1; transform: translateX(0) scale(1); }
}
.wfi-word {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.wfi-word.rarity-common    { color: var(--text); }
.wfi-word.rarity-uncommon  { color: var(--cyan); }
.wfi-word.rarity-rare      { color: var(--gold); text-shadow: 0 0 8px rgba(255,215,0,0.6); }
.wfi-pts {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* Target slots: one box per target, a row per word length */
.slot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.slot-len { font-family: var(--font-display); font-size: 12px; color: var(--text3); width: 14px; }
.slot {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px dashed var(--text3);
  color: var(--text3);
  background: var(--surface2);
}
.slot.found  { border-style: solid; border-color: var(--green); color: var(--green); }
.slot.missed { border-style: solid; border-color: var(--pink); color: var(--pink); }
/* Bonus words score but aren't targets, so they get a quieter color */
.wfi-word.bonus { color: var(--text2); }
/* How to play, in three lines, on the start screen */
.ss-howto { max-width: 420px; margin: 0 auto 18px; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--text2); text-align: left; }
/* Endless and live, under the daily button */
.ss-modes { display: flex; gap: 10px; width: 100%; margin-top: 12px; }
.btn-mode { flex: 1; padding: 14px; font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; }
.ss-modes-note { margin: 10px auto 0; max-width: 460px; font-size: 13px; color: var(--text2); text-align: center; line-height: 1.5; }
/* After today's scored round: the result and the wait for tomorrow's board */
.ss-today { font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; color: var(--cyan); margin: 0 0 14px; min-height: 1em; text-align: center; }
.sd-label.practice { color: var(--pink); }
.result-missed { font-size: 12px; color: var(--pink); text-align: center; margin: 8px 0 12px; letter-spacing: 1px; }

/* ── Current word display ── */
.current-word-bar {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--cell-shadow);
  position: relative;
  overflow: hidden;
}
.current-word-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
  transform: translateX(-100%);
  transition: transform 0s;
}
.current-word-bar.has-word::before {
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}
.cw-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  min-height: 30px;
  color: var(--text);
  transition: color 0.2s;
}
.cw-text.valid    { color: var(--cyan); text-shadow: 0 0 16px var(--cyan-glow); }
.cw-text.invalid  { color: var(--pink); }
.cw-hint {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 1px;
}

/* ── Grid canvas container ── */
.grid-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 440px;
}
.grid-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  background: var(--bg2);
}
#grid-canvas { z-index: 1; cursor: crosshair; }
/* The overlay sits on top of the letters, so it has to stay see-through */
#overlay-canvas { z-index: 2; cursor: crosshair; pointer-events: none; background: transparent; box-shadow: none; }
/* Overlay gets pointer events for drag */
.grid-wrap #overlay-canvas { pointer-events: all; }

/* ── Submit / action buttons ── */
.action-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--cell-shadow);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-submit {
  background: linear-gradient(135deg, #0095CC, #00D4FF);
  border-color: #00AADD;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0,212,255,0.3), var(--cell-shadow);
}
.btn-submit:hover {
  background: linear-gradient(135deg, #00AADD, #33DDFF);
  box-shadow: 0 4px 24px rgba(0,212,255,0.5), var(--cell-shadow);
}

.btn-clear {
  background: var(--surface2);
  color: var(--text2);
  flex: 0 0 auto;
  padding: 12px 14px;
}

.btn-start {
  background: linear-gradient(135deg, #0095CC, var(--cyan));
  border-color: var(--cyan);
  color: #000;
  font-size: 14px;
  padding: 16px 32px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,212,255,0.4);
  flex: none;
}
.btn-start:hover {
  box-shadow: 0 6px 32px rgba(0,212,255,0.6);
  transform: translateY(-1px);
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: scale(0);
  animation: rippleOut 0.5s linear;
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* ── Achievement badges ── */
.achievements {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--cell-shadow);
}
.ach-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text3);
  font-family: var(--font-display);
  margin-bottom: 10px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ach-badge {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 20px;
  cursor: default;
  transition: all 0.15s;
  position: relative;
}
.ach-badge.unlocked {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}
.ach-badge.unlocked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
  border-radius: 8px;
}
.ach-badge:not(.unlocked) { opacity: 0.35; filter: grayscale(1); }

/* ── Toast notification ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 40px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 600;
  z-index: 999;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  white-space: nowrap;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
#toast.success { border-color: var(--cyan); color: var(--cyan); }
#toast.error   { border-color: var(--pink); color: var(--pink); }
#toast.info    { border-color: var(--gold); color: var(--gold); }

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border2);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); border-color: var(--text2); }

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Result modal specific */
.result-grade {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
  margin: 16px 0 8px;
}
.result-score {
  text-align: center;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.result-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.rs-item {
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  text-align: center;
}
.rs-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.rs-lbl {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text3);
  margin-top: 2px;
}

.result-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  max-height: 120px;
  overflow-y: auto;
}
.rw-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 1px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.rw-chip.rare     { border-color: var(--gold); color: var(--gold); }
.rw-chip.uncommon { border-color: var(--cyan); color: var(--cyan); }

/* Leaderboard */
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.1s;
  font-size: 13px;
}
.lb-row:hover { background: var(--surface2); border-color: var(--border); }
.lb-rank { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--text3); width: 24px; }
.lb-rank.top { color: var(--gold); }
.lb-name { flex: 1; font-weight: 600; color: var(--text); }
.lb-score { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--cyan); }
.lb-grade { width: 24px; text-align: center; font-family: var(--font-display); font-size: 12px; font-weight: 700; }

/* ── Start screen overlay ── */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.ss-logo {
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--cyan) 0%, #FFFFFF 40%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 6px;
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 20px rgba(0,212,255,0.5)); }
  50%      { filter: drop-shadow(0 0 40px rgba(255,107,157,0.5)); }
}
.ss-tagline {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 40px;
}
.ss-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin-bottom: 36px;
}
.ss-feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.ss-feat-icon { font-size: 22px; margin-bottom: 4px; }
.ss-feat-text { font-size: 11px; color: var(--text2); letter-spacing: 1px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    max-width: 480px;
  }
  .panel-left  { grid-column: 1; grid-row: 2; }
  .game-col    { grid-column: 1; grid-row: 1; }
  .panel-right { grid-column: 1; grid-row: 3; }

  .panel-left  { flex-direction: row; flex-wrap: wrap; }
  .panel-left > * { flex: 1 1 140px; }
  .panel-right { flex-direction: row; flex-wrap: wrap; }
  .panel-right > * { flex: 1 1 140px; }
  .word-list-panel { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .header { padding: 10px 14px; }
  .logo { font-size: 18px; }
  .main { padding: 10px; gap: 8px; }
  .grid-wrap { max-width: 100%; }
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { transform:translateY(20px); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes bounce { 0%,100% { transform:scale(1); } 50% { transform:scale(1.08); } }
@keyframes shake {
  0%,100% { transform:translateX(0); }
  20% { transform:translateX(-6px); }
  40% { transform:translateX(6px); }
  60% { transform:translateX(-4px); }
  80% { transform:translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Colorblind mode ── */
body.colorblind {
  --cyan:  #0096FF;
  --pink:  #FF8000;
  --green: #FFDD00;
  --gold:  #FF6600;
}
