/* === FocusForge · v3 design system ====================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+Sinhala:wght@400;500;600;700;800&family=Noto+Sans+Tamil:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Surface ---------------------------------------------------------- */
  --bg-0: #06060a;
  --bg-1: #0c0c14;
  --bg-2: #13131e;
  --bg-3: #1c1c2c;
  --bg-4: #25253a;
  --glass: rgba(20, 20, 32, 0.72);
  --glass-strong: rgba(8, 8, 14, 0.85);

  /* ---- Lines ------------------------------------------------------------ */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.22);

  /* ---- Text ------------------------------------------------------------- */
  --fg: #eef0f5;
  --fg-dim: #9499ad;
  --fg-mute: #5a5e72;

  /* ---- Accent system ---------------------------------------------------- */
  --primary: #00ffb2;
  --primary-soft: rgba(0, 255, 178, 0.14);
  --primary-glow: rgba(0, 255, 178, 0.38);
  --primary-press: #00d99a;

  --violet: #8b7fff;
  --violet-soft: rgba(139, 127, 255, 0.18);

  --warn: #ffb800;
  --warn-soft: rgba(255, 184, 0, 0.16);

  --danger: #ff3d71;
  --danger-soft: rgba(255, 61, 113, 0.18);
  --danger-glow: rgba(255, 61, 113, 0.4);

  /* ---- Typography ------------------------------------------------------- */
  --sans: 'Inter', 'Noto Sans Sinhala', 'Noto Sans Tamil', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-quick: cubic-bezier(0.4, 0, 0.2, 1);
  --d-fast: 150ms;
  --d-med: 240ms;
  --d-slow: 420ms;

  /* ---- Elevation -------------------------------------------------------- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 60px -10px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 16px 40px -10px var(--primary-glow);
  --shadow-danger: 0 16px 40px -10px var(--danger-glow);

  /* ---- Radius ----------------------------------------------------------- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
}

/* === Reset =============================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; transition: color var(--d-fast) var(--ease-quick); }
a:hover { color: var(--primary-press); }
::selection { background: var(--primary-soft); color: var(--fg); }

/* === Focus rings (a11y) =================================================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* === Backgrounds ========================================================= */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 178, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 178, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 80%);
}

.bg-orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.55;
  border-radius: 50%;
}
.bg-orb.a { width: 520px; height: 520px; background: radial-gradient(circle, var(--primary) 0%, transparent 70%); top: -180px; left: -120px; }
.bg-orb.b { width: 420px; height: 420px; background: radial-gradient(circle, var(--violet) 0%, transparent 70%); top: 20vh; right: -160px; opacity: 0.35; }

/* === Hub: Hero =========================================================== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 100px 24px 50px;
  max-width: 880px;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(0, 255, 178, 0.35);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 28px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero h1 {
  font-size: clamp(54px, 10vw, 112px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #fff 0%, #a8aebd 75%, #6b7080 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.tagline {
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--fg-dim);
  margin: 0 auto 44px;
  max-width: 560px;
  line-height: 1.55;
}

.hero-stats {
  display: inline-flex;
  gap: 4px;
  padding: 8px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 28px;
  position: relative;
}
.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: var(--line);
}

.stat-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum', 'zero';
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-top: 6px;
  font-weight: 500;
}

/* === Hub: Grid =========================================================== */
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 48px 24px;
  max-width: 1240px;
  margin: 0 auto;
}

.card {
  position: relative;
  display: block;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 22px 20px;
  color: var(--fg);
  text-decoration: none;
  transition:
    transform var(--d-med) var(--ease-spring),
    border-color var(--d-fast) var(--ease-quick),
    box-shadow var(--d-med) var(--ease-out),
    background var(--d-med) var(--ease-out);
  overflow: hidden;
  cursor: pointer;
  animation: cardIn 600ms var(--ease-out) backwards;
}
.card:nth-child(1)  { animation-delay: 0ms; }
.card:nth-child(2)  { animation-delay: 40ms; }
.card:nth-child(3)  { animation-delay: 80ms; }
.card:nth-child(4)  { animation-delay: 120ms; }
.card:nth-child(5)  { animation-delay: 160ms; }
.card:nth-child(6)  { animation-delay: 200ms; }
.card:nth-child(7)  { animation-delay: 240ms; }
.card:nth-child(8)  { animation-delay: 280ms; }
.card:nth-child(9)  { animation-delay: 320ms; }
.card:nth-child(10) { animation-delay: 360ms; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 255, 178, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity var(--d-med) var(--ease-out);
  pointer-events: none;
  border-radius: inherit;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-3); background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%); box-shadow: var(--shadow-lg); text-decoration: none; }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-2px); }

.card[data-difficulty="hard"]:hover { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 184, 0, 0.35); }
.card[data-difficulty="brutal"]:hover { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 61, 113, 0.4); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-mute);
  letter-spacing: 0.18em;
}

.icon-tile {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--primary);
  position: relative;
  transition: all var(--d-med) var(--ease-out);
}
.card:hover .icon-tile { background: linear-gradient(135deg, var(--primary-soft), var(--bg-4)); border-color: var(--primary); box-shadow: 0 0 20px rgba(0, 255, 178, 0.25); transform: rotate(-3deg); }
.icon-tile svg { width: 26px; height: 26px; }
.card[data-difficulty="hard"] .icon-tile { color: var(--warn); }
.card[data-difficulty="brutal"] .icon-tile { color: var(--danger); }
.card[data-difficulty="hard"]:hover .icon-tile { background: linear-gradient(135deg, var(--warn-soft), var(--bg-4)); border-color: var(--warn); box-shadow: 0 0 20px rgba(255, 184, 0, 0.25); }
.card[data-difficulty="brutal"]:hover .icon-tile { background: linear-gradient(135deg, var(--danger-soft), var(--bg-4)); border-color: var(--danger); box-shadow: 0 0 20px rgba(255, 61, 113, 0.3); }

.card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.card p {
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 18px;
  line-height: 1.5;
  min-height: 2.6em;
}

.card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  padding: 4px 8px;
  border-radius: 5px;
}

.pips {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}
.pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bg-4);
}
.pip.on { background: var(--primary); box-shadow: 0 0 6px var(--primary-glow); }
.card[data-difficulty="hard"] .pip.on { background: var(--warn); box-shadow: 0 0 6px rgba(255, 184, 0, 0.6); }
.card[data-difficulty="brutal"] .pip.on { background: var(--danger); box-shadow: 0 0 6px var(--danger-glow); }

/* === Hub: Why ============================================================ */
.why {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 80px auto;
  padding: 0 24px;
}
.why h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.why-grid > div {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 22px;
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.55;
  transition: border-color var(--d-fast) var(--ease-quick), background var(--d-fast) var(--ease-quick);
}
.why-grid > div:hover { border-color: var(--line-2); background: var(--bg-2); }
.why-grid strong {
  color: var(--fg);
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px 72px;
  color: var(--fg-mute);
  font-size: 13px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  transition: color var(--d-fast) var(--ease-quick);
}
.link-btn:hover { color: var(--primary-press); }

/* === Game page chrome ==================================================== */
body.game {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: all var(--d-fast) var(--ease-quick);
  text-transform: uppercase;
}
.back-btn:hover { color: var(--fg); background: var(--bg-2); text-decoration: none; }
.back-btn svg { width: 14px; height: 14px; transition: transform var(--d-fast) var(--ease-spring); }
.back-btn:hover svg { transform: translateX(-3px); }

.game-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.game-title .ic {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  border: 1px solid rgba(0, 255, 178, 0.3);
  border-radius: 8px;
  color: var(--primary);
}
.game-title .ic svg { width: 16px; height: 16px; }

.game-score {
  display: inline-flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
}
.game-score .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  color: var(--fg-dim);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.game-score .chip b {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 60px;
  gap: 24px;
}

.prompt {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--fg-dim);
  text-align: center;
  max-width: 600px;
  min-height: 2em;
  line-height: 1.5;
  transition: color var(--d-fast) var(--ease-quick);
}
.prompt strong { color: var(--primary); font-weight: 600; }

/* === Buttons ============================================================= */
.btn {
  position: relative;
  background: var(--primary);
  color: #001a10;
  border: none;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--r-md);
  cursor: pointer;
  transition:
    transform var(--d-fast) var(--ease-spring),
    box-shadow var(--d-med) var(--ease-out),
    background var(--d-fast) var(--ease-quick);
  font-family: var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary); background: var(--primary-press); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { background: var(--bg-2); border-color: var(--primary); color: var(--primary); box-shadow: none; }

.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger:hover { box-shadow: var(--shadow-danger); background: #ff2659; }

/* === Result ============================================================== */
.result { text-align: center; }
.result h2 { font-size: 36px; margin-bottom: 8px; letter-spacing: -0.03em; font-weight: 800; }
.result .big {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin: 16px 0 8px;
  font-variant-numeric: tabular-nums;
}
.result.fail .big { color: var(--danger); }
.result p { color: var(--fg-dim); margin-bottom: 24px; }
.result .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Reduced motion ====================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .badge::before { animation: none; }
}

/* === Responsive ========================================================== */
@media (max-width: 720px) {
  .hero { padding: 60px 20px 36px; }
  .hero-stats { padding: 6px; }
  .stat { padding: 10px 18px; }
  .stat-num { font-size: 22px; }
  .grid { padding: 28px 14px; gap: 14px; }
  .game-header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .game-title { font-size: 13px; order: -1; flex: 1 0 100%; justify-content: center; }
  .game-score { flex-wrap: wrap; justify-content: center; }
  .why { margin: 50px auto; }
  .why h2 { font-size: 24px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 52px; }
  .hero-stats { flex-direction: row; }
  .stat { padding: 8px 14px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 9px; }
}

/* ========================================================================== */
/* === v3 additions: lang switcher, XP bar, daily streak, toast, confetti === */
/* ========================================================================== */

/* --- Top bar layout fix: we now reserve space for top-right controls ----- */
.hub-topbar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-pill {
  display: inline-flex;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
}
.lang-pill button {
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-quick);
  min-width: 36px;
}
.lang-pill button:hover { color: var(--fg); }
.lang-pill button.on {
  background: var(--primary);
  color: #001a10;
  box-shadow: 0 0 18px var(--primary-glow);
}

/* --- XP bar (hub) -------------------------------------------------------- */
.xp-bar-wrap {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto 8px;
  padding: 0 24px;
}
.xp-bar {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.xp-meta { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.xp-meta .xp-level {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
}
.xp-meta .xp-level b { color: var(--primary); font-weight: 700; font-size: 14px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.xp-meta .xp-count { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }
.xp-track {
  flex: 1;
  height: 8px;
  background: var(--bg-3);
  border-radius: var(--r-pill);
  position: relative;
  overflow: hidden;
}
.xp-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: linear-gradient(90deg, var(--violet) 0%, var(--primary) 100%);
  border-radius: var(--r-pill);
  transition: right var(--d-slow) var(--ease-out);
  box-shadow: 0 0 12px var(--primary-glow);
}
.xp-fill::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 14px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
  border-radius: var(--r-pill);
  animation: xpShine 1.8s linear infinite;
}
@keyframes xpShine { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

.daily {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(255,184,0,0.3);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.daily b { font-variant-numeric: tabular-nums; }
.daily.cold { color: var(--fg-mute); background: var(--bg-2); border-color: var(--line); }

/* --- Toasts -------------------------------------------------------------- */
#ff-toasts {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: center;
}
.ff-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(20px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-30px) scale(0.95);
  opacity: 0;
  transition: all 320ms var(--ease-spring);
  pointer-events: auto;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.ff-toast.on { transform: translateY(0) scale(1); opacity: 1; }
.ff-toast .ic { font-size: 18px; line-height: 1; color: var(--primary); }
.ff-toast.best { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-glow), var(--shadow-lg); }
.ff-toast.best .ic { color: var(--primary); text-shadow: 0 0 14px var(--primary-glow); }
.ff-toast.level {
  background: linear-gradient(135deg, rgba(139,127,255,0.18), var(--glass-strong));
  border-color: var(--violet);
  box-shadow: 0 0 0 1px rgba(139,127,255,0.4), var(--shadow-lg);
}
.ff-toast.level .ic { color: var(--violet); text-shadow: 0 0 14px rgba(139,127,255,0.7); }
.ff-toast.streak { border-color: var(--warn); }
.ff-toast.streak .ic { color: var(--warn); text-shadow: 0 0 14px rgba(255,184,0,0.7); }

/* --- Confetti canvas overlay -------------------------------------------- */
.ff-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}

/* --- Combo flash (in-game) ---------------------------------------------- */
.combo-burst {
  position: fixed;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 800;
  color: var(--warn);
  text-shadow: 0 0 32px rgba(255,184,0,0.6);
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: all 420ms var(--ease-spring);
  letter-spacing: -0.02em;
}
.combo-burst.on { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
.combo-burst.off { opacity: 0; transform: translate(-50%, -100%) scale(0.9); }

/* --- "Why" section now shows 15 ---------------------------------------- */
/* (no extra css needed — handled by i18n string) */

/* --- Mobile: stack topbar below hero on tiny screens ------------------- */
@media (max-width: 560px) {
  .hub-topbar { top: 12px; right: 12px; }
  .lang-pill button { padding: 6px 8px; min-width: 30px; font-size: 10px; }
  .xp-bar { flex-wrap: wrap; gap: 10px; }
  .xp-meta { min-width: auto; }
  .xp-track { flex-basis: 100%; order: 3; }
  .daily { font-size: 11px; padding: 5px 10px; }
}
