/* ============================================================
   NEON TAP RUSH — style.css
   Design language: "arcade cabinet in a dark room" — deep navy
   void, glassmorphic panels, four neon accent colors borrowed
   straight from the in-game orb palette so the UI and the game
   feel like one continuous object rather than a menu bolted onto
   a canvas.
   ============================================================ */

:root {
  --bg-deep: #060814;
  --bg-deep-2: #0b1024;
  --panel: rgba(20, 25, 46, 0.72);
  --panel-solid: #141a30;
  --panel-border: rgba(255, 255, 255, 0.08);
  --cyan: #00f0ff;
  --magenta: #ff2e88;
  --amber: #ffb800;
  --lime: #39ff88;
  --violet: #9d4eff;
  --text-1: #f2f4ff;
  --text-2: #9aa2c4;
  --text-3: #5c6389;
  --danger: #ff4d5e;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-display: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Roboto Mono', 'Courier New', monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-1);
  font-family: var(--font-display);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  transition: background 0.4s ease, color 0.4s ease;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(0, 240, 255, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(255, 46, 136, 0.10), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(157, 78, 255, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

#bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------------------------- screens ---------------------------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
}

.screen.active {
  display: flex;
  animation: screenIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fade-target { animation: panelRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes panelRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------- loading ---------------------------- */

.loading-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }

.logo-ring {
  width: 108px; height: 108px; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--cyan);
  border-right-color: var(--magenta);
  display: flex; align-items: center; justify-content: center;
  animation: spin 1.1s linear infinite;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25);
}
.logo-core {
  width: 78px; height: 78px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a2140, #0b0e1c);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; letter-spacing: 1px;
  color: var(--cyan);
  animation: spin-rev 1.1s linear infinite;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.8);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }

.loading-title {
  font-size: 22px; letter-spacing: 4px; font-weight: 800; margin: 6px 0 0;
  color: var(--text-1);
}
.loading-title span { color: var(--magenta); text-shadow: 0 0 18px rgba(255, 46, 136, 0.6); }

.loading-bar { width: 220px; height: 6px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; }
.loading-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 12px rgba(0,240,255,0.6);
  transition: width 0.25s ease;
}
.loading-tip { font-size: 13px; color: var(--text-2); letter-spacing: 0.4px; }

/* ---------------------------- light theme ---------------------------- */

html[data-theme="light"] {
  --bg-deep: #eef1f9;
  --bg-deep-2: #e4e9f7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-border: rgba(18, 22, 42, 0.09);
  --text-1: #12162a;
  --text-2: #5a6088;
  --text-3: #8a90b0;
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(0, 240, 255, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(255, 46, 136, 0.08), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(157, 78, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
}

html[data-theme="light"] .text-input,
html[data-theme="light"] .btn,
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .hud-btn,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .btn-back,
html[data-theme="light"] .home-step {
  background: rgba(18, 22, 42, 0.045);
}

html[data-theme="light"] .hud-timebar-track,
html[data-theme="light"] .goal-track,
html[data-theme="light"] .loading-bar,
html[data-theme="light"] .toggle-track {
  background: rgba(18, 22, 42, 0.1);
}

html[data-theme="light"] .game-stage {
  background: radial-gradient(circle at 50% 30%, rgba(18, 22, 42, 0.035), transparent 60%), rgba(18, 22, 42, 0.02);
}

html[data-theme="light"] .text-input {
  color: var(--text-1);
}

html[data-theme="light"] .btn-primary {
  color: #ffffff;
}

html[data-theme="light"] .btn-exit {
  color: #c23145;
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(18, 22, 42, 0.35);
}

html[data-theme="light"] .countdown-overlay {
  background: rgba(238, 241, 249, 0.7);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(18, 22, 42, 0.18) !important;
}

/* ---------------------------- home / landing ---------------------------- */

.home-wrap {
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 4px 2px;
}

.home-badge { margin-bottom: 10px; }
.logo-ring.small { width: 76px; height: 76px; border-width: 2px; }
.logo-core.small { width: 54px; height: 54px; font-size: 16px; }

.home-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
  margin-bottom: 6px;
}

.home-title { font-size: 26px; letter-spacing: 4px; font-weight: 800; margin: 4px 0 0; }
.home-title span { color: var(--magenta); text-shadow: 0 0 18px rgba(255, 46, 136, 0.6); }
.home-tagline { color: var(--text-1); font-size: 14px; font-weight: 700; letter-spacing: 0.3px; margin: 8px 0 16px; }

.home-brief {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0 0 20px;
  padding: 0 4px;
}

.home-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
}
.home-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  text-align: left;
}
.home-step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--cyan), #0091ff);
  color: #041018;
}

.home-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 22px;
}
.home-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
}
.home-feature span { font-size: 16px; }

.btn-play {
  max-width: 260px;
  font-size: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  animation: playPulse 2.4s ease-in-out infinite;
}
@keyframes playPulse {
  0%, 100% { box-shadow: 0 8px 26px rgba(0, 240, 255, 0.28); }
  50% { box-shadow: 0 8px 36px rgba(0, 240, 255, 0.5); }
}

.home-footnote { font-size: 11px; color: var(--text-3); letter-spacing: 0.3px; }

/* ---------------------------- panels & buttons ---------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  width: 100%;
  max-width: 380px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  text-align: center;
}
.panel.narrow { max-width: 340px; }
.panel-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.panel-sub { margin: 0 0 20px; color: var(--text-2); font-size: 14px; line-height: 1.5; }

.text-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,240,255,0.15); }

.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:last-child { margin-bottom: 0; }
.btn:active { transform: scale(0.96); }
.btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.18), transparent 60%);
  opacity: 0; transition: opacity 0.25s;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0091ff);
  color: #041018;
  border-color: transparent;
  box-shadow: 0 8px 26px rgba(0, 240, 255, 0.28);
}
.btn-primary:active { box-shadow: 0 4px 14px rgba(0, 240, 255, 0.22); }
.btn-ghost { background: rgba(255,255,255,0.03); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.14); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #b3202f); color: #fff; border-color: transparent; }
.btn:disabled { opacity: 0.35; pointer-events: none; }

.btn-exit { border-color: rgba(255, 77, 94, 0.25); color: #ffb3ba; }

/* ---------------------------- main menu ---------------------------- */

.menu-wrap { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.brand { text-align: center; }
.brand-badge {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 10px;
  background: linear-gradient(135deg, rgba(0,240,255,0.18), rgba(255,46,136,0.18));
  border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: var(--cyan);
  box-shadow: 0 0 30px rgba(0,240,255,0.25);
  animation: floaty 3.2s ease-in-out infinite;
}
@keyframes floaty { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-6px);} }
.brand-title { font-size: 21px; letter-spacing: 3px; font-weight: 800; margin: 0; }
.brand-title span { color: var(--magenta); }
.brand-player { color: var(--text-2); font-size: 13px; margin: 6px 0 0; }

.menu-list { width: 100%; display: flex; flex-direction: column; }
.btn-menu { text-align: center; }

/* ---------------------------- subpages ---------------------------- */

.subpage {
  width: 100%;
  max-width: 460px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.subpage-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; flex-shrink: 0;
}
.subpage-header h2 { margin: 0; font-size: 18px; letter-spacing: 0.5px; flex: 1; text-align: center; }
.header-spacer { width: 34px; }
.btn-back {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border);
  color: var(--text-1); font-size: 18px; flex-shrink: 0;
}
.btn-back:active { transform: scale(0.9); }

/* ---------------------------- level path ---------------------------- */

.level-path-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 4px 24px; }
.level-path { display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; padding: 10px 0; }
.level-node-row { display: flex; align-items: center; justify-content: center; width: 100%; height: 74px; position: relative; }
.level-node {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  background: var(--panel-solid);
  border: 2px solid var(--panel-border);
  color: var(--text-2);
  position: relative;
  transition: transform 0.15s;
}
.level-node:active { transform: scale(0.92); }
.level-node.unlocked {
  color: #041018;
  background: linear-gradient(135deg, var(--cyan), #0091ff);
  border-color: transparent;
  box-shadow: 0 0 22px rgba(0,240,255,0.35);
}
.level-node.completed {
  background: linear-gradient(135deg, var(--lime), #16b869);
  box-shadow: 0 0 22px rgba(57,255,136,0.35);
}
.level-node.current {
  box-shadow: 0 0 0 4px rgba(255,184,0,0.25), 0 0 24px rgba(255,184,0,0.4);
  border-color: var(--amber);
}
.level-node.locked { opacity: 0.45; }
.level-node .lock-icon { font-size: 18px; }
.level-node .star-badge {
  position: absolute; bottom: -8px; font-size: 10px; background: rgba(0,0,0,0.5);
  padding: 1px 6px; border-radius: 8px; color: var(--amber);
}

/* ---------------------------- profiles ---------------------------- */

.profile-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.profile-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--panel); border: 1px solid var(--panel-border);
  transition: border-color 0.2s;
}
.profile-card.active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(0,240,255,0.25) inset; }
.profile-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 16px;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-meta .pname { font-weight: 700; font-size: 15px; display: block; }
.profile-meta .pstats { font-size: 12px; color: var(--text-2); }
.profile-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--panel-border); color: var(--text-2); font-size: 14px;
}
.new-profile-row { display: flex; gap: 8px; padding-top: 8px; flex-shrink: 0; }
.new-profile-row .text-input { margin-bottom: 0; }
.new-profile-row .btn { width: auto; padding: 13px 18px; margin-bottom: 0; }

/* ---------------------------- settings ---------------------------- */

.settings-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--panel); border: 1px solid var(--panel-border);
}
.setting-label { display: block; font-weight: 700; font-size: 14px; }
.setting-desc { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }

.toggle { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,0.12);
  transition: background 0.25s; display: block;
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.toggle input:checked + .toggle-track { background: linear-gradient(135deg, var(--cyan), #0091ff); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ---------------------------- statistics ---------------------------- */

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow-y: visible; flex-shrink: 0; }
.stat-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md);
  padding: 14px; text-align: center;
}
.stat-card .stat-value { display: block; font-size: 21px; font-weight: 800; font-family: var(--font-mono); color: var(--cyan); }
.stat-card .stat-label { display: block; font-size: 11px; color: var(--text-2); margin-top: 4px; letter-spacing: 0.3px; }

.section-label { font-size: 13px; color: var(--text-2); letter-spacing: 1px; text-transform: uppercase; margin: 16px 0 8px; flex-shrink: 0; }
.achievements-grid { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-bottom: 12px; }
.achievement-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md);
  opacity: 0.4;
}
.achievement-card.unlocked { opacity: 1; border-color: rgba(255,184,0,0.3); }
.achievement-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: rgba(255,184,0,0.12); color: var(--amber);
}
.achievement-card.unlocked .achievement-icon { background: linear-gradient(135deg, var(--amber), #ff7a00); color: #1a0f00; }
.achievement-name { font-weight: 700; font-size: 13px; display: block; }
.achievement-desc { font-size: 11px; color: var(--text-2); display: block; margin-top: 1px; }

/* ---------------------------- credits ---------------------------- */

.credits-body { overflow-y: auto; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.credits-game { font-size: 20px; font-weight: 800; color: var(--text-1); letter-spacing: 2px; }
.credits-list { padding-left: 18px; margin: 12px 0; }
.credits-thanks { color: var(--text-1); margin-top: 16px; }

/* ---------------------------- game screen ---------------------------- */

#screen-game { padding: calc(10px + var(--safe-top)) 12px calc(10px + var(--safe-bottom)); }
.game-shell { width: 100%; max-width: 460px; height: 100%; display: flex; flex-direction: column; gap: 10px; }

.game-hud { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hud-btn {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); color: var(--text-1); font-size: 13px;
}
.hud-center { flex: 1; min-width: 0; }
.hud-level { font-size: 12px; color: var(--text-2); font-weight: 700; letter-spacing: 0.5px; margin-bottom: 5px; }
.hud-timebar-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.08); overflow: hidden; }
.hud-timebar-fill {
  height: 100%; width: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--lime), var(--amber));
  transition: width 0.2s linear;
}
.hud-timebar-fill.danger { background: linear-gradient(90deg, var(--danger), #ff8a00); }
.hud-score {
  font-family: var(--font-mono); font-weight: 800; font-size: 20px; color: var(--text-1);
  min-width: 56px; text-align: right; flex-shrink: 0;
}

.target-banner {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--panel-border);
  font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--text-2);
  align-self: center;
}
.target-swatch {
  width: 16px; height: 16px; border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
  background: var(--cyan);
}
.target-color-name { color: var(--text-1); }

.game-stage {
  flex: 1; position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.04), transparent 60%), rgba(255,255,255,0.02);
  border: 1px solid var(--panel-border);
}
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#game-particles { pointer-events: none; }

.countdown-overlay {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(6,8,20,0.55); backdrop-filter: blur(3px); z-index: 3;
}
.countdown-overlay.active { display: flex; }
#countdown-num {
  font-size: 72px; font-weight: 800; color: var(--cyan);
  text-shadow: 0 0 30px rgba(0,240,255,0.7);
  animation: countPulse 0.7s ease-out;
}
@keyframes countPulse { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.game-footer { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.lives { display: flex; gap: 4px; font-size: 16px; min-width: 60px; }
.lives .life-icon { transition: transform 0.2s, opacity 0.2s; }
.lives .life-icon.lost { opacity: 0.25; transform: scale(0.7); }
.goal-progress { flex: 1; min-width: 0; }
.goal-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.08); overflow: hidden; }
.goal-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--violet), var(--magenta)); transition: width 0.25s ease; }
.goal-label { font-size: 10px; color: var(--text-2); display: block; margin-top: 4px; text-align: center; }
.streak { font-size: 13px; font-weight: 800; font-family: var(--font-mono); min-width: 46px; text-align: right; color: var(--amber); }

/* ---------------------------- result screen ---------------------------- */

.result-panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-lg);
  padding: 30px 26px; width: 100%; max-width: 360px; text-align: center;
  backdrop-filter: blur(18px);
}
.result-icon {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  background: linear-gradient(135deg, var(--lime), #16b869); color: #052012;
  box-shadow: 0 0 40px rgba(57,255,136,0.4);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.result-icon.lose { background: linear-gradient(135deg, var(--danger), #a91c2b); color: #fff; box-shadow: 0 0 40px rgba(255,77,94,0.4); }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-title { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.result-stars { font-size: 22px; letter-spacing: 6px; color: var(--amber); margin-bottom: 16px; min-height: 26px; }
.result-stats { display: flex; justify-content: space-around; margin-bottom: 22px; }
.result-stats div span { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 800; }
.result-stats div label { font-size: 11px; color: var(--text-2); }
.result-actions { display: flex; gap: 10px; }
.result-actions .btn { margin-bottom: 0; }
.result-retry { margin-top: 10px; }

/* ---------------------------- modals ---------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center;
  background: rgba(4,6,14,0.65); backdrop-filter: blur(4px); padding: 20px;
}
.modal-backdrop.active { display: flex; animation: screenIn 0.25s ease; }
.modal-panel {
  width: 100%; max-width: 320px; background: var(--panel-solid); border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg); padding: 26px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-panel h2 { margin: 0 0 14px; font-size: 18px; }
.confirm-message { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: -6px 0 18px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { margin-bottom: 0; }

/* ---------------------------- toasts ---------------------------- */

.toast-stack {
  position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
  width: min(340px, calc(100% - 28px));
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; width: 100%;
  background: linear-gradient(135deg, rgba(255,184,0,0.95), rgba(255,122,0,0.95));
  color: #1a0f00; border-radius: 12px; font-weight: 700; font-size: 13px;
  box-shadow: 0 10px 30px rgba(255,184,0,0.35);
  animation: toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1), toastOut 0.4s ease 2.6s forwards;
}
.toast .toast-icon { font-size: 18px; }
.toast .toast-text small { display: block; font-weight: 600; opacity: 0.85; font-size: 11px; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-16px); opacity: 0; } }

/* ---------------------------- scrollbars ---------------------------- */

.level-path-scroll::-webkit-scrollbar, .profile-list::-webkit-scrollbar,
.achievements-grid::-webkit-scrollbar, .credits-body::-webkit-scrollbar { width: 5px; }
.level-path-scroll::-webkit-scrollbar-thumb, .profile-list::-webkit-scrollbar-thumb,
.achievements-grid::-webkit-scrollbar-thumb, .credits-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14); border-radius: 6px;
}

/* ---------------------------- responsive ---------------------------- */

@media (min-width: 720px) {
  body { display: flex; }
  .screen { padding: 40px; }
}

@media (max-height: 640px) {
  .brand-badge { width: 48px; height: 48px; }
  .brand-title { font-size: 17px; }
  .btn-menu { padding: 11px 16px; font-size: 14px; }
}

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