/* ============================================================
   SPEEDMASTER v2 – Premium Dark Gaming Design
   ============================================================ */

:root {
  --bg:       #07090f;
  --bg2:      #0c0f18;
  --bg3:      #111520;
  --surface:  #161b27;
  --surface2: #1c2235;
  --border:   #252d42;
  --border2:  #2e3a55;

  --cyan:     #00e5ff;
  --purple:   #8b5cf6;
  --pink:     #ec4899;
  --amber:    #f59e0b;
  --green:    #22c55e;
  --red:      #ef4444;

  --text:     #e4eaf4;
  --text-dim: #8899bb;
  --text-muted: #4a5878;

  --sidebar-w: 248px;
  --radius: 14px;

  --glow-cyan:   0 0 24px rgba(0,229,255,0.25);
  --glow-purple: 0 0 24px rgba(139,92,246,0.25);

  --font-ui:      'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-display: 'Rajdhani', sans-serif;

  --grad-main:   linear-gradient(135deg, #00e5ff, #8b5cf6);
  --grad-warm:   linear-gradient(135deg, #f59e0b, #ec4899);
  --grad-green:  linear-gradient(135deg, #22c55e, #00e5ff);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 80%, rgba(0,229,255,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse { from { opacity: 0.6; } to { opacity: 1; } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
  position: relative;
  margin-bottom: 6px;
}
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-main);
}
.logo-icon { font-size: 1.5rem; display: inline-block; animation: logoPulse 3s ease-in-out infinite; }
@keyframes logoPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 4px 8px 8px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
}
.sidebar-user:hover { border-color: var(--cyan); background: var(--surface2); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-main);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: var(--bg);
  flex-shrink: 0; box-shadow: var(--glow-cyan);
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-info span { font-size: 0.83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 0.68rem !important; color: var(--text-muted) !important; font-weight: 400 !important; }
.nav-section-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 2.5px;
  color: var(--text-muted); padding: 14px 16px 4px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; margin: 1px 8px; border-radius: 10px;
  cursor: pointer; font-size: 0.86rem; font-weight: 500;
  color: var(--text-dim); text-decoration: none;
  transition: all 0.18s; border: 1px solid transparent;
  position: relative; overflow: hidden;
}
.nav-item::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-main); border-radius: 0 3px 3px 0;
  transform: scaleY(0); transition: transform 0.2s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item:hover::before { transform: scaleY(1); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(0,229,255,0.1), rgba(139,92,246,0.05));
  color: var(--cyan); border-color: rgba(0,229,255,0.2);
}
.nav-item.active::before { transform: scaleY(1); }
.nav-icon { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem;
  cursor: pointer; transition: all 0.2s; align-items: center; justify-content: center;
}
.hamburger:hover { background: var(--cyan); color: var(--bg); border-color: var(--cyan); }

/* ===== MAIN ===== */
#mainContent { margin-left: var(--sidebar-w); min-height: 100vh; position: relative; z-index: 1; }

/* ===== PAGES ===== */
.page { display: none; padding: 36px 44px; max-width: 1100px; margin: 0 auto; }
.page.active { display: block; animation: pageIn 0.35s cubic-bezier(0.4,0,0.2,1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(20px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.1rem; font-weight: 700; letter-spacing: 0.5px;
  background: var(--grad-main); background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 6px;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.page-header p { color: var(--text-muted); font-size: 0.92rem; }

/* ===== CONTROLS ===== */
.test-controls {
  display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 22px;
  padding: 18px 20px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.control-group { display: flex; flex-direction: column; gap: 7px; }
.control-group label { font-size: 0.65rem; font-weight: 700; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.ctrl-btn {
  padding: 7px 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 8px; cursor: pointer;
  font-size: 0.83rem; font-weight: 600; font-family: var(--font-ui); transition: all 0.18s;
}
.ctrl-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.ctrl-btn.active {
  background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(139,92,246,0.15));
  border-color: var(--cyan); color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,229,255,0.15);
}

/* ===== STATS BAR ===== */
.stats-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 85px; transition: all 0.2s; position: relative; overflow: hidden;
}
.stat-chip::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-main); transform: scaleX(0); transition: transform 0.3s;
}
.stat-chip:hover::after { transform: scaleX(1); }
.stat-chip span {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700;
  color: var(--cyan); line-height: 1; transition: color 0.2s;
}
.stat-chip small { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

/* ===== TYPING AREA ===== */
.typing-area-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 16px;
  position: relative; transition: border-color 0.2s, box-shadow 0.2s;
}
.typing-area-wrap:focus-within {
  border-color: rgba(0,229,255,0.4);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.06), inset 0 0 40px rgba(0,229,255,0.02);
}

/* ===== TYPING DISPLAY – FIX: NO OVERFLOW ===== */
.typing-display {
  font-size: 1.2rem;
  line-height: 2;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 20px;
  min-height: 96px;
  max-height: 156px;       /* fixed height – text stays inside */
  overflow: hidden;        /* clips content */
  word-break: break-word;
  white-space: normal;     /* wraps */
  user-select: none;
}
.typing-display .char { transition: color 0.07s; }
.typing-display .char.correct { color: var(--text); }
.typing-display .char.wrong {
  color: var(--red);
  background: rgba(239,68,68,0.12);
  border-radius: 2px;
}
.typing-display .char.current {
  color: var(--cyan);
  border-bottom: 2px solid var(--cyan);
  animation: cursorBlink 0.9s step-end infinite;
}
@keyframes cursorBlink {
  0%,100% { border-color: var(--cyan); }
  50%     { border-color: transparent; }
}

.typing-real-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 18px; color: var(--text);
  font-size: 1.05rem; font-family: var(--font-ui);
  outline: none; transition: all 0.2s; caret-color: var(--cyan);
}
.typing-real-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.08);
  background: var(--surface2);
}
.typing-real-input.code-font { font-family: var(--font-mono); font-size: 0.92rem; }
.code-font { font-family: var(--font-mono) !important; }
.blind-overlay { filter: blur(5px); transition: filter 0.4s; }

/* ===== RESULT CARD ===== */
.result-card {
  background: linear-gradient(135deg, rgba(0,229,255,0.05), rgba(139,92,246,0.05));
  border: 1px solid rgba(0,229,255,0.3); border-radius: var(--radius);
  padding: 32px; margin-top: 20px; text-align: center;
  animation: resultPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
  position: relative; overflow: hidden;
}
.result-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-main);
}
@keyframes resultPop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.result-card h2 {
  font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 20px;
  background: var(--grad-main); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.result-grid { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.result-stat .val {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
  background: var(--grad-main); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.result-stat .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

/* ===== CPS ARENA ===== */
.cps-arena {
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: 20px; height: 340px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all 0.15s; user-select: none;
}
.cps-arena:hover { border-color: var(--cyan); box-shadow: 0 0 40px rgba(0,229,255,0.1); }
.cps-arena.active-click { background: var(--surface); border-color: var(--cyan); box-shadow: 0 0 60px rgba(0,229,255,0.2); }
.cps-center-text {
  font-family: var(--font-display); font-size: 2.8rem; font-weight: 700;
  background: var(--grad-main); background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  pointer-events: none; letter-spacing: 3px; transition: transform 0.1s;
  animation: shimmer 3s linear infinite;
}
.cps-arena.active-click .cps-center-text { transform: scale(0.95); }
.ripple {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,0.4), transparent);
  pointer-events: none; animation: rippleAnim 0.55s ease-out forwards;
}
@keyframes rippleAnim { from { transform: scale(0); opacity: 1; } to { transform: scale(8); opacity: 0; } }

/* ===== AIM ARENA ===== */
.aim-arena, .tracking-arena, .precision-arena {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); height: 460px;
  position: relative; overflow: hidden; cursor: crosshair;
}
.aim-arena::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(139,92,246,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(0,229,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.aim-start-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,9,15,0.88); backdrop-filter: blur(4px); z-index: 10;
}
.btn-big-start {
  background: var(--grad-main); border: none; color: var(--bg);
  padding: 18px 52px; border-radius: 14px;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  cursor: pointer; letter-spacing: 2px; transition: all 0.25s;
  box-shadow: 0 0 40px rgba(0,229,255,0.3), 0 4px 20px rgba(0,0,0,0.5);
  animation: startPulse 2s ease-in-out infinite;
}
@keyframes startPulse {
  0%,100% { box-shadow: 0 0 30px rgba(0,229,255,0.3), 0 4px 20px rgba(0,0,0,0.5); }
  50%     { box-shadow: 0 0 60px rgba(0,229,255,0.5), 0 4px 20px rgba(0,0,0,0.5); }
}
.btn-big-start:hover { transform: scale(1.05); }

/* Moving target */
.aim-target {
  position: absolute; border-radius: 50%; cursor: crosshair;
  display: flex; align-items: center; justify-content: center;
}
.aim-target-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid currentColor;
  animation: ringPulse 0.9s ease-in-out infinite alternate;
}
@keyframes ringPulse {
  from { opacity: 0.5; transform: scale(0.88); }
  to   { opacity: 1;   transform: scale(1.04); }
}
.aim-target-inner { width: 28%; height: 28%; border-radius: 50%; background: white; opacity: 0.9; }
.aim-target.hit-anim { animation: hitPop 0.15s ease-out forwards; }
@keyframes hitPop { 0% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }

.aim-score-popup {
  position: absolute; font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700; color: var(--cyan);
  pointer-events: none; animation: scoreFloat 0.7s ease-out forwards;
  z-index: 20; text-shadow: 0 0 10px var(--cyan);
}
@keyframes scoreFloat {
  from { opacity: 1; transform: translateY(0) scale(1.2); }
  to   { opacity: 0; transform: translateY(-50px) scale(0.8); }
}

/* ===== TRACKING ===== */
.tracking-dot {
  position: absolute; border-radius: 50%; pointer-events: none;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, white 0%, var(--cyan) 40%, rgba(0,229,255,0.2) 70%, transparent 100%);
  box-shadow: 0 0 24px var(--cyan), 0 0 48px rgba(0,229,255,0.3);
}
.track-cursor {
  position: absolute; border: 2px solid var(--amber); border-radius: 50%;
  pointer-events: none; transform: translate(-50%,-50%);
  box-shadow: 0 0 10px var(--amber);
}

/* ===== REFLEX ===== */
.reflex-arena {
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: var(--radius); height: 360px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s; user-select: none;
}
.reflex-arena.wait   { background: var(--bg2); }
.reflex-arena.ready  {
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(0,229,255,0.05));
  border-color: var(--green); box-shadow: 0 0 60px rgba(34,197,94,0.2);
}
.reflex-arena.too-soon { background: rgba(239,68,68,0.08); border-color: var(--red); }
.reflex-instructions { font-family: var(--font-display); font-size: 1.7rem; color: var(--text-dim); text-align: center; }

/* ===== PRECISION ===== */
.prec-target {
  position: absolute; border-radius: 50%; cursor: crosshair;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, var(--purple) 40%, rgba(139,92,246,0.2) 70%, transparent 100%);
  box-shadow: 0 0 20px var(--purple);
  animation: precPulse 1.2s ease-in-out infinite;
}
@keyframes precPulse {
  0%,100% { box-shadow: 0 0 14px var(--purple); }
  50%     { box-shadow: 0 0 34px var(--purple); }
}

/* ===== SCROLL ===== */
.scroll-test-wrap { display: flex; gap: 12px; align-items: flex-start; }
.scroll-arena {
  flex: 1; height: 420px; overflow-y: scroll;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.scroll-content { display: flex; flex-direction: column; gap: 10px; }
.scroll-row {
  background: var(--surface); border-radius: 10px; padding: 14px 18px;
  border-left: 3px solid var(--cyan);
  font-size: 0.88rem; color: var(--text-dim); transition: transform 0.15s;
}
.scroll-row:hover { transform: translateX(4px); }
.scroll-progress-bar {
  width: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; height: 420px; overflow: hidden; flex-shrink: 0;
}
#scrollProgressFill {
  width: 100%; height: 0%;
  background: var(--grad-main); border-radius: 5px; transition: height 0.12s;
}

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.stats-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: all 0.2s;
  position: relative; overflow: hidden;
}
.stats-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-main); transform: scaleX(0); transition: transform 0.3s; transform-origin: left;
}
.stats-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stats-card:hover::before { transform: scaleX(1); }
.stats-card h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--cyan); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.stats-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.85rem; }
.stats-row .val { font-weight: 700; color: var(--text); }
.stats-row .key { color: var(--text-muted); }

/* ===== LEADERBOARD ===== */
.leaderboard-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.lb-entry {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s; animation: pageIn 0.3s ease both;
}
.lb-entry:hover { border-color: var(--border2); transform: translateX(4px); }
.lb-rank { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; width: 38px; text-align: center; color: var(--text-muted); }
.lb-rank.gold   { color: #fbbf24; text-shadow: 0 0 12px #fbbf2488; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #f97316; }
.lb-name { flex: 1; font-weight: 600; }
.lb-score {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== LOGIN WALL ===== */
.login-wall { background: var(--surface); border: 1px dashed var(--border2); border-radius: var(--radius); padding: 60px; text-align: center; }
.login-wall-inner h2 {
  margin: 14px 0 8px; font-family: var(--font-display); font-size: 1.7rem;
  background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-wall-inner p { color: var(--text-muted); margin-bottom: 22px; }

/* ===== AUTH MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.82);
  backdrop-filter: blur(6px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 18px; padding: 34px; width: 100%; max-width: 420px;
  position: relative; animation: pageIn 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 80px rgba(0,0,0,0.6), 0 0 30px rgba(0,229,255,0.05);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--red); color: white; border-color: var(--red); }
.modal-tabs { display: flex; margin-bottom: 26px; background: var(--surface); border-radius: 10px; padding: 4px; }
.modal-tabs .tab-btn {
  flex: 1; padding: 9px; background: transparent; border: none;
  color: var(--text-muted); border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; font-family: var(--font-ui); transition: all 0.2s;
}
.modal-tabs .tab-btn.active { background: var(--grad-main); color: var(--bg); }
.modal-title {
  font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 22px;
  background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.input-group { margin-bottom: 12px; }
.input-group input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 16px; color: var(--text);
  font-size: 0.97rem; font-family: var(--font-ui); outline: none; transition: all 0.2s;
}
.input-group input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.08); background: var(--surface2); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.eye-toggle { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 1.1rem; opacity: 0.5; transition: opacity 0.2s; user-select: none; }
.eye-toggle:hover { opacity: 1; }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-muted); font-size: 0.78rem; }
.divider::before, .divider::after { content:''; flex:1; height:1px; background: var(--border); }
.auth-msg { margin-top: 12px; font-size: 0.84rem; text-align: center; min-height: 20px; }
.auth-msg.error   { color: var(--red); }
.auth-msg.success { color: var(--green); }
.verify-box { text-align: center; }
.verify-icon { font-size: 3.5rem; margin-bottom: 14px; animation: bounce 1s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-7px); } }
.verify-box h2 { margin-bottom: 8px; font-family: var(--font-display); font-size: 1.5rem; }
.verify-box p  { color: var(--text-muted); margin-bottom: 20px; font-size: 0.88rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%; background: var(--grad-main); border: none; color: var(--bg);
  padding: 13px; border-radius: 10px; font-size: 1rem; font-weight: 700;
  font-family: var(--font-ui); cursor: pointer; transition: all 0.2s; letter-spacing: 0.5px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(0,229,255,0.35), 0 4px 14px rgba(0,0,0,0.4); }
.btn-secondary {
  width: 100%; background: transparent; border: 1px solid var(--border2);
  color: var(--text); padding: 12px; border-radius: 10px;
  font-size: 0.95rem; font-family: var(--font-ui); cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-google {
  width: 100%; background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); padding: 12px; border-radius: 10px; font-size: 0.93rem;
  font-family: var(--font-ui); cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { border-color: #4285f4; background: rgba(66,133,244,0.1); transform: translateY(-1px); }
.btn-restart {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px 26px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600; transition: all 0.2s;
}
.btn-restart:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,0.15); }
.btn-auth {
  width: 100%;
  background: linear-gradient(135deg, rgba(0,229,255,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(0,229,255,0.3); color: var(--cyan);
  padding: 10px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.87rem; transition: all 0.2s;
}
.btn-auth:hover { background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(139,92,246,0.2)); }
.btn-logout {
  width: 100%; background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 9px; border-radius: 9px; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.83rem; transition: all 0.2s; margin-top: 6px;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }
.test-actions { margin-top: 12px; display: flex; gap: 10px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 12px; padding: 13px 22px; font-size: 0.9rem;
  color: var(--text); z-index: 9999;
  animation: slideIn 0.3s cubic-bezier(0.4,0,0.2,1); max-width: 320px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== WORD SPANS (words mode) ===== */
.word-span { border-radius: 3px; padding: 1px 3px; transition: background 0.1s; }
.word-span.correct { color: #e4eaf4; }
.word-span.wrong { color: var(--red); background: rgba(239,68,68,0.12); }
.word-span.current-word { border-bottom: 2px solid var(--cyan); color: #e4eaf4; }

/* ===== HELPERS ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.6); }
  .hamburger { display: flex; }
  #mainContent { margin-left: 0; }
  .page { padding: 64px 20px 28px; }
  .typing-display { max-height: 200px; font-size: 1rem; }
}
@media (max-width: 600px) {
  .cps-arena { height: 230px; }
  .aim-arena, .tracking-arena, .precision-arena { height: 300px; }
  .stats-grid { grid-template-columns: 1fr; }
  .result-stat .val { font-size: 2rem; }
}
