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

:root {
  --cyan:   #00ffff;
  --purple: #a855f7;
  --pink:   #ff1493;
  --amber:  #ffaa00;
  --green:  #00ff88;
  --blue:   #4488ff;
  --bg:     #060610;
  --surface:       rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.09);
  --border:        rgba(255,255,255,0.1);
  --text:     #e0e0f0;
  --text-dim: rgba(224,224,240,0.45);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}

canvas#canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* ─── Screens ──────────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.screen.active {
  opacity: 1; pointer-events: all;
}
.ui-hidden { display: none !important; }

.screen-content {
  background: rgba(8, 8, 30, 0.9);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  width: min(420px, 92vw);
  max-height: 94vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  gap: 16px; align-items: center;
  box-shadow:
    0 0 0 1px rgba(0,200,255,0.05),
    0 0 60px rgba(0,60,180,0.14),
    0 24px 80px rgba(0,0,0,0.65);
}

/* Slide-up entrance when screen becomes active */
.screen.active .screen-content {
  animation: slideUp 0.42s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ─── Logo ─────────────────────────────────────────────────────── */
.logo { text-align: center; margin-bottom: 4px; }
.logo h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 900; letter-spacing: 0.04em; color: #fff;
  text-shadow: 0 0 16px rgba(0,200,255,0.4), 0 0 40px rgba(0,100,255,0.2);
}
.logo h1 span {
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan), 0 0 36px rgba(0,255,255,0.5), 0 0 70px rgba(0,255,255,0.2);
}
.tagline {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem; letter-spacing: 0.28em;
  color: var(--text-dim); margin-top: 8px; text-transform: uppercase;
}

/* ─── Coin bar ──────────────────────────────────────────────────── */
.coin-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 0;
}
#coin-display {
  font-size: 1rem; font-weight: 700; color: #ffaa00;
  text-shadow: 0 0 10px rgba(255,170,0,0.5);
  font-family: 'Orbitron', monospace;
}
.coin-hint { font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.1em; }

/* ─── Shop ───────────────────────────────────────────────────────── */
.shop-label {
  font-size: 0.6rem; letter-spacing: 0.18em; color: var(--text-dim);
  text-align: center; text-transform: uppercase;
}
.shop-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; width: 100%;
}
.shop-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: all 0.18s ease;
  text-align: center;
}
.shop-card:active { transform: scale(0.95); }
.shop-card.equipped {
  border-color: var(--card-color, #00ffff);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 14px color-mix(in srgb, var(--card-color, #00ffff) 30%, transparent);
}
.shop-card.locked { opacity: 0.45; }
.shop-icon { font-size: 1.5rem; line-height: 1; }
.shop-name { font-size: 0.68rem; font-weight: 700; color: var(--text); letter-spacing: 0.05em; }
.shop-desc { font-size: 0.58rem; color: var(--text-dim); line-height: 1.35; }
.shop-cost { font-size: 0.68rem; font-weight: 700; font-family: 'Orbitron', monospace; }

/* ─── Menu Stats ────────────────────────────────────────────────── */
.menu-stats {
  display: flex; gap: 32px; width: 100%; justify-content: center;
  padding: 14px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stat-label { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.stat-value {
  font-family: 'Orbitron', monospace; font-size: 1.15rem; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 10px rgba(0,255,255,0.55);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 15px 24px;
  background: linear-gradient(135deg, #00e5ff 0%, #0077cc 100%);
  border: none; border-radius: 12px;
  color: #000; font-family: 'Orbitron', monospace;
  font-size: 0.9rem; font-weight: 900; letter-spacing: 0.15em;
  cursor: pointer; transition: all 0.2s ease; text-transform: uppercase;
  box-shadow: 0 0 20px rgba(0,229,255,0.2), 0 4px 14px rgba(0,0,0,0.3);
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0,229,255,0.45), 0 6px 20px rgba(0,0,0,0.4); }
.btn-primary:active { transform: scale(0.97); }

.btn-glow { animation: btnGlow 2.4s ease infinite; }
@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(0,229,255,0.2), 0 4px 14px rgba(0,0,0,0.3); }
  50%       { box-shadow: 0 0 40px rgba(0,229,255,0.55), 0 4px 20px rgba(0,0,0,0.4); }
}

.btn-secondary {
  width: 100%; padding: 15px 24px;
  background: linear-gradient(135deg, #a855f7 0%, #6600cc 100%);
  border: none; border-radius: 12px;
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 0.85rem; font-weight: 900; letter-spacing: 0.12em;
  cursor: pointer; transition: all 0.2s ease; text-transform: uppercase;
  box-shadow: 0 0 18px rgba(168,85,247,0.2), 0 4px 14px rgba(0,0,0,0.3);
}
.btn-secondary:hover  { transform: translateY(-2px); box-shadow: 0 0 28px rgba(168,85,247,0.45); }
.btn-secondary:active { transform: scale(0.97); }

.btn-ghost {
  width: 100%; padding: 12px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-dim);
  font-family: 'Orbitron', monospace; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.12em;
  cursor: pointer; transition: all 0.18s ease; text-transform: uppercase;
}
.btn-ghost:hover  { background: var(--surface-hover); color: var(--text); border-color: rgba(255,255,255,0.22); }
.btn-ghost:active { transform: scale(0.97); }

.btn-share {
  width: 100%; padding: 13px 24px;
  background: linear-gradient(135deg, #00cc66 0%, #006633 100%);
  border: none; border-radius: 12px;
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em;
  cursor: pointer; transition: all 0.2s ease; text-transform: uppercase;
  box-shadow: 0 0 16px rgba(0,204,102,0.2);
}
.btn-share:hover  { transform: translateY(-2px); box-shadow: 0 0 28px rgba(0,204,102,0.4); }
.btn-share:active { transform: scale(0.97); }

/* ─── HUD ───────────────────────────────────────────────────────── */
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none; }

#hud-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 14px 0; gap: 8px;
}

#hud-score, #hud-combo {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(6,6,20,0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 14px; min-width: 82px;
}
.hud-label {
  font-family: 'Orbitron', monospace; font-size: 0.48rem;
  letter-spacing: 0.22em; color: var(--text-dim);
}
.hud-value {
  font-family: 'Orbitron', monospace; font-size: 1.05rem; font-weight: 700; color: #fff;
  transition: transform 0.15s ease, color 0.2s ease; letter-spacing: 0.04em;
}
.score-pop {
  animation: scorePop 0.25s ease-out;
}
@keyframes scorePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); color: #00ffff; }
  100% { transform: scale(1); }
}

#hud-center {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding-top: 8px;
}
.wave-dots { display: flex; gap: 7px; align-items: center; }
.wave-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.35s ease;
}
.wave-dot.done {
  background: var(--cyan); border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(0,255,255,0.5);
}
.wave-dot.current {
  background: var(--cyan); border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan), 0 0 14px rgba(0,255,255,0.3);
  animation: dotPulse 1.1s ease infinite;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.45); }
}

.timer-display {
  display: flex; align-items: baseline; gap: 4px;
  font-family: 'Orbitron', monospace; font-weight: 700;
  background: rgba(6,6,20,0.7); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px;
}
#timer-value {
  font-size: 1.4rem; color: #fff;
  transition: color 0.3s;
}
#timer-value.urgent { color: #ff4422; animation: timerPulse 0.5s ease infinite; }
.timer-label { font-size: 0.55rem; letter-spacing: 0.18em; color: var(--text-dim); }
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

.wave-label {
  font-family: 'Orbitron', monospace; font-size: 0.78rem;
  letter-spacing: 0.16em; color: var(--text-dim);
  background: rgba(6,6,20,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; white-space: nowrap;
}

#hud-sub {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 4px; pointer-events: none;
}
.crystals-left-text {
  font-family: 'Orbitron', monospace; font-size: 0.72rem;
  letter-spacing: 0.18em; color: rgba(255,255,255,0.5);
  transition: opacity 0.3s;
}
#hud-actions { display: flex; gap: 8px; pointer-events: all; align-items: center; }
.hud-icon-btn {
  width: 44px; height: 44px;
  background: rgba(6,6,20,0.75); border: 1px solid var(--border);
  border-radius: 10px; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.hud-icon-btn:hover  { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.hud-icon-btn:active { transform: scale(0.9); }
.hud-icon-btn.muted  { opacity: 0.4; }
.hud-powerup-badge {
  height: 34px; padding: 0 10px;
  background: rgba(6,6,20,0.75); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; display: flex; align-items: center; gap: 5px;
  font-family: 'Orbitron', monospace; font-size: 0.58rem; color: var(--text-dim);
  white-space: nowrap; pointer-events: none;
}

/* ─── Overlays (shared) ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.25s ease both;
}
.overlay.ui-hidden { display: none !important; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Tutorial ──────────────────────────────────────────────────── */
.tutorial-card {
  background: rgba(8,8,30,0.96);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 24px;
  padding: 36px 32px; width: min(380px, 90vw);
  display: flex; flex-direction: column; gap: 20px; align-items: center;
  box-shadow: 0 0 60px rgba(0,60,180,0.18), 0 24px 80px rgba(0,0,0,0.6);
  animation: cardIn 0.4s cubic-bezier(0.34,1.5,0.64,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tut-steps-wrap { width: 100%; min-height: 160px; position: relative; }
.tut-step {
  display: none; flex-direction: column; align-items: center;
  gap: 12px; text-align: center; animation: stepIn 0.3s ease both;
}
.tut-step.active { display: flex; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.tut-icon {
  width: 90px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; position: relative; margin-bottom: 4px;
}

.tut-crystal {
  width: 44px; height: 44px;
  background: rgba(0,255,255,0.12);
  border: 2px solid var(--cyan);
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
  box-shadow: 0 0 16px rgba(0,255,255,0.5);
  animation: crystalPulse 1.2s ease infinite;
}
@keyframes crystalPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0,255,255,0.4); }
  50%       { box-shadow: 0 0 24px rgba(0,255,255,0.7); }
}

.tut-finger {
  position: absolute; right: 4px; bottom: 0; font-size: 1.6rem;
  animation: fingerTap 1.2s ease infinite;
}
@keyframes fingerTap {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.tut-swipe-crystals { font-size: 1.4rem; letter-spacing: 4px; }
.tut-swipe-arrow {
  font-size: 1.8rem; color: var(--cyan);
  animation: arrowSlide 1s ease infinite;
}
@keyframes arrowSlide {
  0%   { transform: translateX(-8px); opacity: 0.5; }
  50%  { transform: translateX(8px);  opacity: 1; }
  100% { transform: translateX(-8px); opacity: 0.5; }
}
.tut-finger-swipe { position: relative; font-size: 1.5rem; }

.tut-chain-row {
  font-size: 1.3rem; letter-spacing: 3px;
  animation: chainPulse 0.8s ease infinite alternate;
}
@keyframes chainPulse {
  from { filter: brightness(1); }
  to   { filter: brightness(1.6) drop-shadow(0 0 8px rgba(255,200,0,0.8)); }
}

.tut-step h3 {
  font-family: 'Orbitron', monospace; font-size: 1rem;
  font-weight: 900; color: var(--cyan); letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(0,255,255,0.5);
}
.tut-step p { font-size: 0.88rem; color: var(--text-dim); line-height: 1.55; max-width: 280px; }

.tut-dots { display: flex; gap: 10px; }
.tut-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; transition: all 0.25s;
}
.tut-dot.active {
  background: var(--cyan); border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,255,255,0.6);
  transform: scale(1.2);
}

.tut-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* ─── Countdown ─────────────────────────────────────────────────── */
.countdown-wrap {
  display: flex; align-items: center; justify-content: center;
}
.countdown-num {
  font-family: 'Orbitron', monospace; font-weight: 900;
  font-size: clamp(5rem, 20vw, 10rem);
  color: #fff; letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(0,255,255,0.6), 0 0 80px rgba(0,200,255,0.3);
  animation: countIn 0.4s cubic-bezier(0.34,1.6,0.64,1) both;
}
.countdown-num.go {
  color: var(--green);
  text-shadow: 0 0 40px rgba(0,255,136,0.7), 0 0 80px rgba(0,255,100,0.3);
}
@keyframes countIn {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes countOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.8); }
}
.countdown-num.out { animation: countOut 0.3s ease forwards; }

/* ─── Pause Overlay ─────────────────────────────────────────────── */
.pause-card {
  background: rgba(8,8,30,0.96);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 24px;
  padding: 36px 36px; width: min(360px, 88vw);
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  box-shadow: 0 0 60px rgba(0,60,180,0.18), 0 24px 80px rgba(0,0,0,0.6);
  animation: cardIn 0.3s cubic-bezier(0.34,1.4,0.64,1) both;
}
.pause-title {
  font-family: 'Orbitron', monospace; font-size: 1.8rem; font-weight: 900;
  letter-spacing: 0.12em; color: var(--text);
  text-shadow: 0 0 16px rgba(255,255,255,0.2);
}
.pause-score-row {
  display: flex; gap: 14px; align-items: center; margin-bottom: 4px;
}
.pause-score-label {
  font-family: 'Orbitron', monospace; font-size: 0.65rem; letter-spacing: 0.18em;
  color: var(--text-dim); text-transform: uppercase;
}
.pause-score-val {
  font-family: 'Orbitron', monospace; font-size: 1.3rem; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

/* ─── Wave Clear ────────────────────────────────────────────────── */
#wave-clear {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: rgba(0,0,0,0.28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
#wave-clear.show {
  display: flex;
  animation: waveClearIn 0.38s cubic-bezier(0.34,1.5,0.64,1) forwards;
}
@keyframes waveClearIn {
  from { opacity: 0; transform: scale(0.82) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wave-clear-content {
  background: rgba(6,6,22,0.96);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0,255,255,0.22); border-radius: 22px;
  padding: 32px 44px; text-align: center;
  box-shadow: 0 0 40px rgba(0,255,255,0.1), 0 0 1px rgba(0,255,255,0.3), 0 24px 60px rgba(0,0,0,0.5);
  min-width: min(340px, 88vw);
}
.wave-clear-title {
  font-family: 'Orbitron', monospace; font-size: clamp(1.6rem,6vw,2.2rem);
  font-weight: 900; color: var(--cyan); letter-spacing: 0.12em; margin-bottom: 20px;
  text-shadow: 0 0 14px var(--cyan), 0 0 32px rgba(0,255,255,0.35);
}
.wave-clear-stats { display: flex; flex-direction: column; gap: 8px; }
.clear-stat {
  display: flex; justify-content: space-between; gap: 32px;
  font-size: 0.88rem; color: var(--text-dim); padding: 2px 0;
}
.clear-stat span:last-child { color: var(--text); font-weight: 600; }
.clear-stat.total {
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px;
  font-family: 'Orbitron', monospace; font-weight: 700; font-size: 1rem;
}
.clear-stat.total span { color: var(--cyan); text-shadow: 0 0 10px rgba(0,255,255,0.5); }

/* ─── End Screen ────────────────────────────────────────────────── */
#screen-end h2, #screen-leaderboard h2 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.3rem,5vw,1.8rem); font-weight: 900; letter-spacing: 0.1em; text-align: center;
}
.new-pb {
  font-family: 'Orbitron', monospace; font-size: 0.78rem; font-weight: 700;
  color: var(--amber); letter-spacing: 0.12em; text-align: center;
  padding: 10px 20px; border: 1px solid rgba(255,170,0,0.3);
  border-radius: 8px; background: rgba(255,170,0,0.07); width: 100%;
  text-shadow: 0 0 10px rgba(255,170,0,0.6);
  animation: pulseFade 1.2s ease infinite;
}
@keyframes pulseFade { 0%,100% { opacity:1; } 50% { opacity:0.62; } }

.end-stats { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.end-stat {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  font-size: 0.88rem; color: var(--text-dim); padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.end-stat:last-child { border-bottom: none; }
.end-stat span:last-child { color: var(--text); font-weight: 600; }
.end-stat .highlight {
  font-family: 'Orbitron', monospace; font-size: 1.2rem; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

/* ─── Leaderboard ───────────────────────────────────────────────── */
#leaderboard-list {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
  max-height: 48vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#leaderboard-list::-webkit-scrollbar { width: 4px; }
#leaderboard-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.lb-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.88rem;
}
.lb-gold   { border-color: rgba(255,215,0,0.4);   background: rgba(255,215,0,0.06); }
.lb-silver { border-color: rgba(192,192,192,0.3); background: rgba(192,192,192,0.04); }
.lb-bronze { border-color: rgba(205,127,50,0.3);  background: rgba(205,127,50,0.05); }

.lb-rank { font-family:'Orbitron',monospace; font-size:0.7rem; color:var(--text-dim); min-width:26px; }
.lb-gold .lb-rank   { color:#ffd700; text-shadow:0 0 8px rgba(255,215,0,0.5); }
.lb-silver .lb-rank { color:#c8c8c8; }
.lb-bronze .lb-rank { color:#cd7f32; }
.lb-score { font-family:'Orbitron',monospace; font-weight:700; flex:1; font-size:0.95rem; }
.lb-details { font-size:0.72rem; color:var(--text-dim); }
.lb-date { font-size:0.65rem; color:rgba(224,224,240,0.28); }
.empty-lb { text-align:center; color:var(--text-dim); font-size:0.88rem; padding:28px 0; line-height:1.65; }

/* ─── Share feedback ────────────────────────────────────────────── */
.share-toast {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  background: rgba(0,204,102,0.18); border: 1px solid rgba(0,204,102,0.4);
  border-radius: 10px; padding: 10px 22px;
  font-family: 'Orbitron', monospace; font-size: 0.72rem;
  color: var(--green); letter-spacing: 0.12em; z-index: 100;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity:0; transform: translateX(-50%) translateY(10px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* ─── Daily row + menu row ──────────────────────────────────────── */
.daily-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.btn-daily-btn { flex: 1; width: auto; }

.streak-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,100,0,0.12); border: 1px solid rgba(255,100,0,0.3);
  border-radius: 10px; padding: 6px 10px; min-width: 48px; gap: 1px;
  flex-shrink: 0;
}
#streak-fire { font-size: 1.2rem; line-height: 1; }
#streak-count {
  font-family: 'Orbitron', monospace; font-size: 0.78rem; font-weight: 700;
  color: #ff8844; text-shadow: 0 0 8px rgba(255,100,0,0.6);
}

.menu-row {
  display: flex; gap: 10px; width: 100%;
}
.btn-half { flex: 1; width: auto; }

/* ─── Stats screen ──────────────────────────────────────────────── */
.stats-list {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
}
.stats-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.88rem;
}
.stats-row-label { color: var(--text-dim); font-size: 0.78rem; }
.stats-row-value {
  font-family: 'Orbitron', monospace; font-weight: 700; color: var(--cyan);
  font-size: 0.95rem; text-shadow: 0 0 8px rgba(0,255,255,0.4);
}

/* ─── Achievements screen ───────────────────────────────────────── */
.ach-progress {
  font-family: 'Orbitron', monospace; font-size: 0.7rem;
  color: var(--text-dim); letter-spacing: 0.12em; margin-bottom: 4px;
}
.achievements-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; width: 100%;
  max-height: 55vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.achievements-grid::-webkit-scrollbar { width: 4px; }
.achievements-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ach-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; transition: all 0.2s;
}
.ach-card.unlocked {
  border-color: rgba(0,255,136,0.35);
  background: rgba(0,255,136,0.06);
  box-shadow: 0 0 12px rgba(0,255,136,0.08);
}
.ach-card.locked { opacity: 0.38; filter: grayscale(0.6); }
.ach-icon { font-size: 1.6rem; line-height: 1; }
.ach-name {
  font-family: 'Orbitron', monospace; font-size: 0.6rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.06em; line-height: 1.2;
}
.ach-desc { font-size: 0.58rem; color: var(--text-dim); line-height: 1.3; }
.ach-unlocked-label {
  font-size: 0.52rem; color: var(--green); font-weight: 700; letter-spacing: 0.1em;
}

/* ─── Achievement toast ─────────────────────────────────────────── */
.achievement-toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(0,20,10,0.95); border: 1px solid rgba(0,255,136,0.4);
  border-radius: 14px; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  z-index: 200; min-width: 260px; max-width: 90vw;
  box-shadow: 0 0 24px rgba(0,255,136,0.15), 0 8px 32px rgba(0,0,0,0.5);
  animation: achToastIn 0.4s cubic-bezier(0.34,1.5,0.64,1) both;
  transition: opacity 0.5s ease;
}
.achievement-toast.out { opacity: 0; }
@keyframes achToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.ach-toast-icon { font-size: 2rem; line-height: 1; }
.ach-toast-title {
  font-family: 'Orbitron', monospace; font-size: 0.52rem;
  letter-spacing: 0.18em; color: var(--green); font-weight: 700;
}
.ach-toast-name {
  font-family: 'Orbitron', monospace; font-size: 0.82rem;
  font-weight: 900; color: #fff; letter-spacing: 0.06em; margin-top: 2px;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-height: 700px) {
  .screen-content { padding: 26px 26px; gap: 12px; }
  .btn-primary, .btn-secondary { padding: 12px 20px; }
  .tutorial-card { padding: 26px 24px; gap: 14px; }
  .tut-steps-wrap { min-height: 140px; }
}
@media (max-width: 380px) {
  .screen-content { padding: 28px 20px; }
  #hud-score, #hud-combo { min-width: 74px; padding: 6px 10px; }
  .hud-value { font-size: 0.95rem; }
  .wave-dot { width: 7px; height: 7px; }
}
