/* ═══════════════════════════════════════════════════════
   PEAK: Rise to the Top — Stylesheet
   Clean, competitive, modern, motivational
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:         #f5efe6;
  --bg-card:    #f5efe6;
  --bg-hover:   #f5efe6;
  --border:     #f5efe6;
  --border-lit: rgba(255,255,255,0.15);

  --accent:     #97252C;
  --accent-dim: #f5efe6;
  --accent-glow:rgba(91,26,26,0.35);
  --gold:       #ffd700;
  --gold-dim:   rgba(255,215,0,0.15);
  --danger:     #ff4757;
  --success:    #2ed573;

  --text-primary:   #97252C;
  --text-secondary: #8888a8;
  --text-muted:     #44445a;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 32px rgba(120,30,30,0.12);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCREENS ──────────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Grid background texture */
.screen-bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ─── START SCREEN ─────────────────────────────────── */
.start-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.peak-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 100px;
  opacity: 0.85;
}

.logo-lockup {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(80px, 22vw, 140px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-shadow:
    0 0 60px rgba(120,30,30,0.75),
    0 0 120px rgba(0,229,255,0.15);
  user-select: none;
}

.game-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.title-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 8px auto;
}

.game-tagline {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Controls preview */
.controls-preview {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  width: 100%;
}

.ctrl-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ctrl-key {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.ctrl-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ctrl-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* Platform legend */
.platform-legend {
  display: flex;
  gap: 20px;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-plat {
  width: 32px;
  height: 8px;
  border-radius: 4px;
}

.static-plat  { background: #4a9eff; }
.moving-plat  { background: #a855f7; }
.crumble-plat { background: orange; }

/* Buttons */
.btn-primary {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 14px 48px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 30px var(--accent-glow);
  width: 100%;
}

.btn-primary:hover {
  background: #c2a85a;
  transform: translateY(-2px);
  box-shadow: 0 0 48px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: var(--radius);
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.btn-secondary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-secondary:hover {
  background: rgba(255, 60, 60, 0.2);
  border-color: rgba(255, 60, 60, 0.8);
  color: #97252C;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(255, 60, 60, 0.2);
}

.btn-outline {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  color: var(--bg); /* white-ish text */
  background: linear-gradient(135deg, #E7C547, #ECCD3F); /* maroon gradient */
  border: none;
  border-radius: var(--radius);
  padding: 16px 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  box-shadow: 
    0 0 30px rgba(91,26,26,0.35),  /* soft maroon glow */
    0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.btn-outline::before {
  content: '↑';
  margin-right: 10px;
  display: inline-block;
  animation: bounce-up 1.2s ease-in-out infinite;
  color: #5b1a1a; /* gold arrow for emphasis */
}

.btn-outline:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 0 50px rgba(91,26,26,0.55),  /* stronger glow on hover */
    0 8px 30px rgba(0,0,0,0.4);
}

.btn-outline:active {
  transform: translateY(0);
}

@keyframes bounce-up {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

.btn-ghost {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.2s;
  flex: 1;
}

.btn-ghost:hover { color: var(--accent); }

.btn-ghost-sm {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.btn-ghost-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ─── GAME SCREEN ──────────────────────────────────── */
#game-screen {
  padding: 0;
  background: #f5efe6;
  flex-direction: column;
}

#game-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(to bottom, rgba(6,6,13,0.95), transparent);
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 80px;
}

.hud-right { align-items: flex-end; }

.hud-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

#hud-score, #hud-best {
  font-family: var(--font-display);
  font-size: 67px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1;
  text-shadow:
    0 0 8px rgba(255,215,0,0.8),  /* glow */
    0 0 16px rgba(91,26,26,0.5);   /* maroon outline for depth */
}
}

#hud-score {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0,229,255,0.5);
}

.hud-center .peak-watermark {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.08);
  user-select: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Touch Controls */
#touch-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  height: 250px;
  z-index: 200;
  pointer-events: none;
}

@media (pointer: coarse) {
  #touch-controls { display: flex; }
}

.touch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  opacity: 0.25;
  transition: opacity 0.1s;
  cursor: pointer;
  user-select: none;
}

.touch-btn:active, .touch-btn.pressed {
  opacity: 0.6;
  background: rgba(0,229,255,0.08);
}

.touch-btn svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

/* ─── GAME OVER SCREEN ─────────────────────────────── */
.gameover-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.go-eyebrow {
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: 0.3em;
  color: var(--danger);
  text-transform: uppercase;
}

.go-score-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 48px;
}

.go-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.go-score-display {
  position: relative;
}

#go-score {
  font-family: var(--font-display);
  font-size: clamp(100px, 22vw, 130px);
  line-height: 1;
  background: linear-gradient(135deg, #97252C, #97252C, #97252C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(255, 60, 60, 0.5));
  letter-spacing: 0.04em;
  position: relative;
}

.go-score-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.go-score-display::before {
  content: 'PEAK';
  position: absolute;
  font-family: var(--font-display);
  font-size: 120px;
  color: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.2em;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.rank-badge {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  border: none;
  border-radius: 100px;
  padding: 8px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #7a4a00;
  letter-spacing: 0.12em;
  animation: pulse-gold 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.rank-label::before {
  content: '🏆 ';
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(255,215,0,0); }
}

.hidden { display: none !important; }

/* Share box */
.share-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.share-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.5;
}

/* Nickname form */
.nickname-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.form-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.nickname-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

.nickname-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.nickname-input::placeholder {
  color: var(--text-muted);
}

.submit-status {
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: 0.08em;
  color: #04A94F;
  min-height: 18px;
  text-align: center;
}

.submit-status.error { color: var(--danger); }

/* Nearby players */
.nearby-players {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.nearby-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.nearby-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  border-radius: 6px;
  margin-bottom: 2px;
}

.nearby-row:last-child { border-bottom: none; }

.nearby-row.highlight {
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.25);
  color: #97252C;
  font-weight: 700;
}

.nearby-row .nr-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 36px;
}

.nearby-row.highlight .nr-rank {
  color: #97252C;
}

.nearby-row .nr-name {
  flex: 1;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-row .nr-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* Go actions */
.go-actions {
  display: flex;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── LEADERBOARD SECTION ──────────────────────────── */
#leaderboard-section {
  position: relative;
  z-index: 10;
  padding: 64px 24px;
  min-height: 60vh;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.lb-inner {
  max-width: 680px;
  margin: 0 auto;
}

.lb-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.lb-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  flex: 1;
}

.lb-loading {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 32px;
  text-align: center;
  letter-spacing: 0.08em;
}

.lb-empty {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  padding: 32px;
  text-align: center;
}

/* Leaderboard Table */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.lb-table thead tr {
  background: var(--bg-card);
}

.lb-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.lb-table th:nth-child(3),
.lb-table td:nth-child(3) { text-align: right; }

.lb-table th:nth-child(4),
.lb-table td:nth-child(4) { text-align: right; }

.lb-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.lb-table tbody tr:last-child { border-bottom: none; }
.lb-table tbody tr:hover { background: var(--bg-hover); }

.lb-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Rank special styling */
.lb-table tbody tr:nth-child(1) td { color: var(--gold); }
.lb-table tbody tr:nth-child(2) td { color: #c0c0c0; }
.lb-table tbody tr:nth-child(3) td { color: #cd7f32; }

.rank-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
}

.rank-medal {
  font-size: 16px;
}

.score-val {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}

.lb-table tbody tr:nth-child(1) .score-val {
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
}

.date-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.lb-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.peak-badge-sm {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 480px) {
  .start-content { padding: 32px 20px; gap: 22px; }
  .go-actions { flex-direction: column; }
  .lb-header { flex-direction: column; gap: 8px; }
  .lb-table th:nth-child(4),
  .lb-table td:nth-child(4) { display: none; }
}

/* ─── SCORE POP ANIMATION ───────────────────────────── */
@keyframes score-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); color: #fff; }
  100% { transform: scale(1); }
}

.score-pop {
  animation: score-pop 0.2s ease-out;
}

/* ─── COPY FEEDBACK ─────────────────────────────────── */
.copy-feedback {
  color: var(--success) !important;
}

/* ─── SCROLL ANCHOR ─────────────────────────────────── */
#leaderboard-anchor {
  position: absolute;
  top: -80px;
}

/* ─── LOGO MAIN PAGE ─────────────────────────────────── */
.sg-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 4px;
}


.hud-home-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-lit);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.hud-home-btn:hover {
  background: rgba(0,229,255,0.1);
  border-color: var(--accent);
  color: var(--accent);
}


.lb-table tbody tr.lb-hidden-row {
  display: none;
}

.lb-expand-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.lb-expand-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ─── GAME OVER HIERARCHY & SEPARATORS ─────────────── */
.gameover-content {
  gap: 20px;
}

.go-header {
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.share-box {
  border-color: rgba(255, 60, 60, 0.2);
}

.nickname-form {
  padding-top: 4px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.nearby-players {
  border-color: rgba(255,255,255,0.06);
}

.nearby-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nearby-title::before,
.nearby-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── CHARACTER SELECT ──────────────────────────────── */
.charselect-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.charselect-header {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.charselect-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.charselect-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 400px) {
  .char-grid { grid-template-columns: repeat(3, 1fr); }
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.char-card:hover:not(.char-locked) {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--accent-dim);
}

.char-card.char-selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 24px var(--accent-glow);
}

.char-card.char-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.char-card-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
}

.char-card-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.char-card-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
}

.char-card-unlock {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.05em;
}

.char-lock-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.char-card.char-selected .char-card-label {
  color: var(--accent);
}

/* Selected preview */
.charselect-selected {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  width: 100%;
}

.charselect-preview-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 10px;
}

.charselect-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.charselect-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* ─── POWERUPS ──────────────────────────────────────── */
.powerup-hud {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.powerup-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  animation: pulse-indicator 1s ease-in-out infinite;
}

.powerup-together {
  background: rgba(0, 200, 150, 0.2);
  border: 1px solid rgba(0, 200, 150, 0.5);
  color: #00c896;
}

.powerup-listen {
  background: rgba(205, 125, 1, 1);
  border: 1px solid rgba(255, 200, 0, 0.5);
  color: #ffc800;
}

.powerup-last {
  background: rgba(180, 100, 255, 0.2);
  border: 1px solid rgba(180, 100, 255, 0.5);
  color: #b464ff;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Milestone flash */
.milestone-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 0.12em;
  color: white;
  text-shadow: 0 0 40px rgba(0,229,255,0.8);
  pointer-events: none;
  animation: milestone-anim 1.2s ease-out forwards;
  text-align: center;
  white-space: nowrap;
}

@keyframes milestone-anim {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}



/* ─── POWERUP LEGEND (start screen) ────────────────── */
.powerup-legend {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.powerup-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  flex: 1;
  justify-content: center;
}

.pu-together {
  background: #00c896;
  border-color: #00c896;
}

.pu-listen {
  background: #ffc800;
  border-color: #ffc800;
}

.pu-last {
  background: #b464ff;
  border-color: #b464ff;
}

.pu-icon { font-size: 14px; flex-shrink: 0; }

.pu-name {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  color: #000000;
}

.powerup-legend-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0px;
}

* {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}
