/* ═══════════════════════════════════════════════════════════════════
   LEXIS // NOVA v2 — Premium Word Search
   Deep-space glassmorphism · sci-fi luxury · cinematic
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-0:           #050709;
  --bg-1:           #080b14;
  --glass-0:        rgba(8, 12, 26, 0.92);
  --glass-1:        rgba(14, 20, 44, 0.72);
  --glass-2:        rgba(22, 30, 62, 0.48);
  --border-0:       rgba(60, 90, 200, 0.10);
  --border-1:       rgba(80, 120, 255, 0.22);
  --border-2:       rgba(100, 150, 255, 0.40);
  --red:            #ef4444;
  --red-bright:     #f87171;
  --red-deep:       #dc2626;
  --red-glow:       rgba(239, 68, 68, 0.45);
  --gold:           #f59e0b;
  --gold-bright:    #fbbf24;
  --gold-glow:      rgba(245, 158, 11, 0.50);
  --cyan:           #22d3ee;
  --cyan-dim:       rgba(34, 211, 238, 0.18);
  --cyan-glow:      rgba(34, 211, 238, 0.35);
  --green:          #4ade80;
  --green-glow:     rgba(74, 222, 128, 0.40);
  --text-0:         rgba(242, 246, 255, 0.96);
  --text-1:         rgba(190, 205, 240, 0.75);
  --text-2:         rgba(130, 150, 200, 0.52);
  --text-found:     rgba(252, 165, 165, 0.88);
  --cell-size:      52px;
  --board-size:     calc(var(--cell-size) * 10);
  --f-ui:           'Syne', sans-serif;
  --f-board:        'Rajdhani', sans-serif;
  --f-mono:         'IBM Plex Mono', monospace;
  --ease-expo:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-circ:      cubic-bezier(0.0, 0.55, 0.45, 1);
}

@media (max-width: 580px) {
  :root { --cell-size: calc((100vw - 28px) / 10); }
}
@media (min-width: 1200px) {
  :root { --cell-size: 56px; }
}

/* ── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  height: 100vh;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--f-ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button { border: none; outline: none; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ── BACKGROUND ─────────────────────────────────────────────────── */
#bg-canvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

.nebula {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 1;
  filter: blur(90px); will-change: opacity;
}
.nebula-1 {
  width: 560px; height: 560px;
  background: radial-gradient(ellipse, rgba(88, 28, 135, 0.55) 0%, transparent 70%);
  top: -220px; left: -180px;
  animation: nebPulse 9s ease-in-out infinite alternate;
}
.nebula-2 {
  width: 640px; height: 480px;
  background: radial-gradient(ellipse, rgba(23, 37, 120, 0.60) 0%, transparent 70%);
  bottom: -160px; right: -200px;
  animation: nebPulse 11s ease-in-out infinite alternate-reverse;
}
.nebula-3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(180, 30, 30, 0.28) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: nebPulse 7s ease-in-out infinite alternate;
}
@keyframes nebPulse {
  from { opacity: 0.6; }
  to   { opacity: 1.0; }
}

/* ── FLOAT LAYER (point popups) ─────────────────────────────────── */
#float-layer {
  position: fixed; inset: 0;
  z-index: 4000; pointer-events: none;
}
.float-text {
  position: absolute;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 15px; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 0 14px var(--gold-glow), 0 0 28px rgba(245,158,11,0.35);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: floatUp 1.55s var(--ease-expo) forwards;
}
.float-text.streak-bonus {
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-glow), 0 0 28px rgba(34,211,238,0.3);
}
@keyframes floatUp {
  0%   { opacity: 0;  transform: translate(-50%, -50%) scale(0.7); }
  18%  { opacity: 1;  transform: translate(-50%, -60%) scale(1.12); }
  55%  { opacity: 1;  transform: translate(-50%, -110%) scale(1.0); }
  100% { opacity: 0;  transform: translate(-50%, -170%) scale(0.85); }
}

/* ── APP SHELL ──────────────────────────────────────────────────── */
#app {
  position: relative; z-index: 10;
  height: 100vh; display: flex; flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────────────────── */
#header {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 22px;
  background: rgba(5, 7, 14, 0.75);
  border-bottom: 1px solid var(--border-1);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  gap: 10px; flex-wrap: wrap;
}

#branding { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
#brand-name {
  font-family: var(--f-ui); font-weight: 800;
  font-size: 19px; letter-spacing: 0.14em;
  color: var(--text-0); text-transform: uppercase;
}
.brand-slash { color: var(--red); }
#brand-sub {
  font-family: var(--f-mono); font-size: 9px;
  color: var(--text-2); letter-spacing: 0.22em; text-transform: uppercase;
}

/* ── LANGUAGE TOGGLE ────────────────────────────────────────────── */
#lang-toggle {
  display: flex; align-items: center; gap: 0;
  background: rgba(10, 14, 30, 0.65);
  border: 1px solid var(--border-1);
  border-radius: 5px; overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  font-family: var(--f-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; padding: 7px 12px;
  color: var(--text-2);
  background: transparent;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.lang-btn.active {
  color: var(--text-0);
  background: rgba(80, 120, 255, 0.16);
  box-shadow: inset 0 0 12px rgba(80, 120, 255, 0.10);
}
.lang-btn:not(.active):hover { color: var(--text-1); background: rgba(255,255,255,0.04); }
.lang-sep {
  width: 1px; height: 20px;
  background: var(--border-1);
  display: block;
}

/* ── NAV BUTTONS ────────────────────────────────────────────────── */
#header-controls { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.btn {
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 12px;
  border: 1px solid var(--border-1); border-radius: 4px;
  background: var(--glass-1); color: var(--text-1);
  cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.18s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); box-shadow: 0 0 18px var(--cyan-glow); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.96); }

.btn-primary { border-color: rgba(220,38,38,0.45); color: var(--red-bright); background: rgba(220,38,38,0.08); }
.btn-primary:hover { border-color: var(--red); background: rgba(239,68,68,0.14); box-shadow: 0 0 20px rgba(220,38,38,0.30); color: #fca5a5; }

.btn.muted { border-color: var(--border-0); color: var(--text-2); background: transparent; opacity: 0.6; }
.btn.muted:hover { color: var(--text-1); border-color: var(--border-1); background: var(--glass-1); box-shadow: none; }

/* Music button with animated wave indicator */
#music-btn { display: flex; align-items: center; gap: 6px; }
.music-waves { display: none; align-items: flex-end; gap: 2px; height: 12px; }
#music-btn.active .music-label { color: var(--cyan); }
#music-btn.active { border-color: var(--cyan); background: var(--cyan-dim); box-shadow: 0 0 18px var(--cyan-glow); }
#music-btn.active .music-waves { display: flex; }
.wave {
  width: 2px; background: var(--cyan);
  border-radius: 2px; display: block;
  transform-origin: bottom;
}
.w1 { height: 5px;  animation: waveAnim 0.9s ease-in-out infinite; }
.w2 { height: 10px; animation: waveAnim 0.9s ease-in-out infinite 0.15s; }
.w3 { height: 7px;  animation: waveAnim 0.9s ease-in-out infinite 0.3s; }
.w4 { height: 4px;  animation: waveAnim 0.9s ease-in-out infinite 0.45s; }
@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.4); }
  50%       { transform: scaleY(1.0); }
}

/* ── NOVA POINTS BAR ────────────────────────────────────────────── */
#nova-bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 22px;
  background: rgba(4, 6, 14, 0.70);
  border-bottom: 1px solid var(--border-0);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  gap: 16px;
}

#rank-display {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#rank-icon {
  font-size: 20px; color: var(--gold);
  text-shadow: 0 0 12px var(--gold-glow);
  transition: color 0.4s, text-shadow 0.4s;
  flex-shrink: 0;
}
#rank-info { display: flex; flex-direction: column; gap: 3px; }
#rank-name {
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.22em; color: var(--gold);
  text-transform: uppercase; text-shadow: 0 0 10px rgba(245,158,11,0.4);
  transition: color 0.4s;
  white-space: nowrap;
}
#rank-xp-track {
  width: 88px; height: 2px;
  background: rgba(50, 60, 100, 0.40);
  border-radius: 2px; overflow: hidden;
}
#rank-xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #b45309, var(--gold), #fde68a);
  border-radius: 2px;
  transition: width 0.7s var(--ease-expo);
  box-shadow: 0 0 8px var(--gold-glow);
}

#nova-pts-center {
  display: flex; align-items: center; gap: 20px; flex: 1;
  justify-content: center;
}

#streak-display {
  display: flex; flex-direction: column; align-items: center;
  gap: 1px; opacity: 0.5;
  transition: opacity 0.4s, transform 0.4s;
}
#streak-display.active { opacity: 1; }
#streak-display.popped {
  animation: streakPop 0.4s var(--ease-expo);
}
@keyframes streakPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
#streak-count {
  font-family: var(--f-ui); font-size: 17px; font-weight: 800;
  color: var(--cyan); letter-spacing: 0.04em;
  text-shadow: 0 0 14px var(--cyan-glow);
}
#streak-label {
  font-family: var(--f-mono); font-size: 7.5px;
  letter-spacing: 0.26em; color: var(--text-2);
  text-transform: uppercase;
}

#session-pts-display {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
#session-pts {
  font-family: var(--f-ui); font-size: 20px; font-weight: 800;
  color: var(--text-0); letter-spacing: 0.04em;
  transition: color 0.3s;
  min-width: 50px; text-align: center;
}
#session-pts.gain {
  animation: ptsGain 0.5s var(--ease-expo);
}
@keyframes ptsGain {
  0%   { transform: scale(1); color: var(--gold-bright); }
  45%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.pts-sublabel {
  font-family: var(--f-mono); font-size: 7.5px;
  letter-spacing: 0.24em; color: var(--text-2);
  text-transform: uppercase;
}

#total-pts-display {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; flex-shrink: 0;
}
#total-pts {
  font-family: var(--f-ui); font-size: 17px; font-weight: 700;
  color: var(--gold); letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(245,158,11,0.30);
  min-width: 50px; text-align: right;
  transition: color 0.3s;
}
#total-pts.gain { animation: ptsGain 0.5s var(--ease-expo); }

/* ── MAIN ───────────────────────────────────────────────────────── */
#main {
  flex: 1; min-height: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 20px 24px; gap: 32px;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
}

@media (max-width: 800px) {
  #main { flex-direction: column; align-items: center; padding: 14px 14px 36px; gap: 14px; }
}

/* ── BOARD SECTION ──────────────────────────────────────────────── */
#board-section { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }

#board-frame {
  position: relative;
  padding: 13px;
  border-radius: 12px;
  background: rgba(8, 11, 24, 0.88);
  border: 1px solid var(--border-1);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 24px 64px rgba(0,0,0,0.75),
    0 0 100px rgba(80, 120, 255, 0.06),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(20px); overflow: hidden;
}

.scan-beam {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(34,211,238,0.06) 20%,
    rgba(34,211,238,0.20) 50%, rgba(34,211,238,0.06) 80%, transparent 100%);
  top: -4px;
  animation: scanBeam 8s linear infinite;
  pointer-events: none; z-index: 20;
}
@keyframes scanBeam {
  0%   { top: -4px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 0.6; }
  100% { top: calc(100% + 4px); opacity: 0; }
}

.frame-corner {
  position: absolute; width: 18px; height: 18px;
  border-color: var(--cyan); border-style: solid;
  z-index: 20; pointer-events: none;
}
.fc-tl { top: 7px; left: 7px;  border-width: 2px 0 0 2px; border-top-left-radius: 3px; }
.fc-tr { top: 7px; right: 7px; border-width: 2px 2px 0 0; border-top-right-radius: 3px; }
.fc-bl { bottom: 7px; left: 7px;  border-width: 0 0 2px 2px; border-bottom-left-radius: 3px; }
.fc-br { bottom: 7px; right: 7px; border-width: 0 2px 2px 0; border-bottom-right-radius: 3px; }

/* BOARD CONTAINER — NEVER ANIMATE OR TRANSFORM THIS */
#board-container {
  position: relative;
  width: var(--board-size); height: var(--board-size);
  flex-shrink: 0; border-radius: 6px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(60, 90, 200, 0.10);
}

/* ── BOARD GRID ─────────────────────────────────────────────────── */
#board {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows:    repeat(10, 1fr);
  user-select: none; -webkit-user-select: none;
}

.cell {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-board);
  font-size: calc(var(--cell-size) * 0.44);
  font-weight: 700; letter-spacing: 0.02em;
  color: rgba(190, 210, 255, 0.68);
  border: 1px solid rgba(50, 70, 140, 0.11);
  cursor: default; position: relative; z-index: 1;
  transition: color 0.14s ease, text-shadow 0.14s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
}
.cell.revealed { animation: cellReveal 0.28s ease forwards; }
@keyframes cellReveal { from { opacity: 0; } to { opacity: 1; } }

.cell.highlighted {
  color: var(--gold-bright);
  text-shadow: 0 0 10px var(--gold-glow), 0 0 22px rgba(245,158,11,0.35);
  z-index: 2;
}
.cell.found {
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 6px rgba(255, 200, 200, 0.90),
    0 0 16px rgba(255, 120, 120, 0.55),
    0 0 2px rgba(0, 0, 0, 0.80);   /* subtle dark halo for contrast on red bg */
  z-index: 3;
}
.cell.hint-flash { animation: hintFlash 1.3s ease-in-out; }
@keyframes hintFlash {
  0%,100% { color: rgba(190,210,255,0.68); text-shadow: none; }
  25%,65%  { color: var(--cyan); text-shadow: 0 0 16px var(--cyan-glow); }
  45%,85%  { color: rgba(190,210,255,0.68); text-shadow: none; }
}

/* found-canvas sits BEHIND the letter grid so cells are always readable */
#found-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
/* drag-canvas floats above everything during an active drag */
#drag-canvas  { position: absolute; inset: 0; pointer-events: none; z-index: 5; }

/* ── STATUS BAR ─────────────────────────────────────────────────── */
#status-bar {
  display: flex; align-items: center; justify-content: space-between;
  width: var(--board-size); padding: 0 2px;
}
#status-text {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.18em; color: var(--text-2); text-transform: uppercase;
  transition: color 0.3s;
}
#status-text.highlight { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }

#progress-container { display: flex; align-items: center; gap: 9px; }
#progress-track {
  width: 88px; height: 3px;
  background: rgba(50, 70, 160, 0.22);
  border-radius: 2px; overflow: hidden;
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red), var(--red-bright));
  border-radius: 2px;
  transition: width 0.55s var(--ease-expo);
  box-shadow: 0 0 10px var(--red-glow);
}
#progress-text {
  font-family: var(--f-mono); font-size: 10px;
  color: var(--text-2); letter-spacing: 0.1em;
  min-width: 36px; text-align: right;
}

/* ── SIDE PANEL ─────────────────────────────────────────────────── */
#side-panel {
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 0; padding-top: 2px;
}
@media (max-width: 800px) { #side-panel { width: var(--board-size); } }

#panel-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-1);
}
.panel-label {
  font-family: var(--f-mono); font-size: 9.5px;
  letter-spacing: 0.28em; color: var(--text-2); text-transform: uppercase;
}
.panel-theme {
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.16em; color: var(--cyan); text-transform: uppercase; opacity: 0.75;
}

#word-list { display: flex; flex-direction: column; gap: 5px; }
@media (max-width: 800px) { #word-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } }

.word-item {
  font-family: var(--f-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.11em; color: var(--text-1);
  padding: 8px 10px 8px 13px;
  border: 1px solid var(--border-0); border-radius: 5px;
  background: var(--glass-1);
  position: relative; overflow: hidden;
  opacity: 0; transform: translateX(-8px);
  animation: wordItemIn 0.35s ease forwards;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.word-item::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--border-2); opacity: 0.45; border-radius: 0 2px 2px 0;
  transition: background 0.3s, opacity 0.3s;
}
@keyframes wordItemIn { to { opacity: 1; transform: translateX(0); } }

.word-item.found {
  color: rgba(252,165,165,0.65);
  background: rgba(220,38,38,0.07);
  border-color: rgba(220,38,38,0.22);
  text-decoration: line-through;
  text-decoration-color: rgba(239,68,68,0.55);
  text-decoration-thickness: 1.5px;
}
.word-item.found::before { background: var(--red-deep); opacity: 0.85; }
.word-item.pop { animation: wordPop 0.45s var(--ease-expo); }
@keyframes wordPop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════════════
   CINEMATIC OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
#cinematic-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: transparent;
  transition: background 0.28s ease, backdrop-filter 0.28s ease;
}
#cinematic-overlay.visible {
  pointer-events: all;
  background: rgba(2, 4, 14, 0.82);
  backdrop-filter: blur(6px) saturate(0.8);
  -webkit-backdrop-filter: blur(6px) saturate(0.8);
}
#cinematic-overlay.fading {
  pointer-events: none; background: transparent;
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  transition: background 0.38s ease, backdrop-filter 0.38s ease;
}

#cinematic-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* Points badge above word */
#cinematic-pts-badge {
  font-family: var(--f-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.18em; color: var(--gold-bright);
  text-shadow: 0 0 18px var(--gold-glow);
  opacity: 0; transform: translateY(-10px);
  transition: opacity 0.3s ease 0.08s, transform 0.3s ease 0.08s;
  text-transform: uppercase;
}
#cinematic-overlay.visible #cinematic-pts-badge { opacity: 1; transform: translateY(0); }

/* Word container */
#cinematic-word-container {
  position: relative; display: flex; align-items: center;
  padding: 14px 24px; overflow: hidden;
}

.cinematic-char {
  font-family: var(--f-board);
  font-size: clamp(56px, 10.5vw, 102px);
  font-weight: 700; letter-spacing: 0.07em;
  color: #fff; display: inline-block;
  opacity: 0; transform: translateX(36px) scale(0.82);
  text-shadow:
    0 0 28px rgba(255,255,255,0.70),
    0 0 70px rgba(220,38,38,0.45),
    0 0 120px rgba(220,38,38,0.20);
  will-change: transform, opacity;
}
.cinematic-char.entering { animation: charIn 0.42s var(--ease-expo) forwards; }
@keyframes charIn { to { opacity: 1; transform: translateX(0) scale(1); } }
.cinematic-char.complete {
  text-shadow:
    0 0 28px rgba(255,255,255,0.80),
    0 0 70px rgba(34,211,238,0.55),
    0 0 130px rgba(34,211,238,0.28);
}

#cinematic-slash {
  position: absolute; top: 50%; left: -10%; height: 5px; width: 0%;
  background: linear-gradient(90deg, transparent 0%, var(--red-deep) 18%, var(--red) 55%, rgba(255,140,140,0.85) 100%);
  border-radius: 3px; transform: translateY(-50%);
  box-shadow: 0 0 14px var(--red), 0 0 30px var(--red-glow);
  will-change: width;
}

#cinematic-category {
  font-family: var(--f-mono); font-size: 11.5px;
  letter-spacing: 0.30em; color: rgba(34,211,238,0.70);
  text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s ease 0.12s, transform 0.35s ease 0.12s;
}
#cinematic-overlay.visible #cinematic-category { opacity: 1; transform: translateY(0); }

#cinematic-streak-badge {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-glow);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s ease 0.22s, transform 0.3s ease 0.22s;
  text-transform: uppercase;
}
#cinematic-overlay.visible #cinematic-streak-badge { opacity: 1; transform: translateY(0); }

/* ── SCROLLBARS ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: 4px; }

/* ── MOBILE ─────────────────────────────────────────────────────── */
#board-container, #board, .cell {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
}

@media (max-width: 580px) {
  #nova-bar { padding: 6px 14px; gap: 10px; }
  #rank-xp-track { width: 60px; }
  #header { padding: 9px 14px; }
  #header-controls { gap: 5px; }
  .btn { padding: 6px 9px; font-size: 9.5px; }
  #session-pts { font-size: 17px; }
  #total-pts  { font-size: 15px; }
}

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