/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  border-radius: 14px; padding: 14px 20px; letter-spacing: 0.02em;
  transition: transform 0.08s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  color: #0a0a1f;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45);
}
.btn-secondary {
  color: var(--text-light);
  background: var(--panel); border: 1px solid var(--panel-border);
}
.btn-text { color: var(--text-dim); font-size: 13px; font-weight: 600; padding: 8px; }
.btn-play { width: 220px; font-size: 20px; padding: 16px; }
.btn-daily {
  width: 220px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(34,211,238,0.2));
  border: 1px solid var(--panel-border); border-radius: 14px; padding: 10px 16px;
}
.btn-daily-title { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--text-light); }
.btn-daily-sub { font-size: 10px; color: var(--text-dim); }
.btn-rush { background: linear-gradient(135deg, rgba(251,191,36,0.28), rgba(244,114,182,0.22)); }
.menu-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.btn-icon-text {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 8px 14px; color: var(--text-light);
}
.btn-icon-text.active { border-color: var(--cyan); color: var(--cyan); }
.ib-icon { font-size: 13px; }

.ad-slot {
  width: 100%; max-width: 320px; min-height: 50px; margin-top: 10px;
  border: 1px dashed var(--panel-border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 10px; letter-spacing: 0.08em;
}
.ad-slot::before { content: 'AD'; }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(5, 4, 16, 0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay-card {
  width: 100%; max-width: 380px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(28, 22, 60, 0.96), rgba(14, 12, 34, 0.98));
  border: 1px solid var(--panel-border); border-radius: 20px;
  padding: 26px 22px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.overlay-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.overlay-card .btn { width: 100%; }

.how-to-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 4px 0 8px; }
.how-to-item {
  background: rgba(255,255,255,0.04); border-radius: 12px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.how-to-ico { font-size: 22px; }
.how-to-item p { font-size: 11px; color: var(--text-dim); line-height: 1.35; }

.setting-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.setting-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--cyan); }

.revive-copy { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.ad-mock-card { gap: 18px; }
.ad-mock-bar { width: 100%; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ad-mock-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width 0.1s linear; }

/* ---------- Nickname ---------- */
.nickname-desc { color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.nickname-score-preview { font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--gold); }
.nickname-input {
  width: 100%; background: rgba(0,0,0,0.35); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 13px 14px; color: var(--text-light);
  font-size: 16px; font-weight: 600; text-align: center; letter-spacing: 0.03em;
}
.nickname-input:focus { outline: none; border-color: var(--cyan); }
.nickname-error { color: var(--danger); font-size: 12px; font-weight: 600; margin-top: -4px; }

/* ---------- Game Over ---------- */
.gameover-screen { gap: 8px; padding: 16px; }
.new-best-badge {
  color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: 0.05em;
  animation: pulseScale 0.9s ease infinite;
}
@keyframes pulseScale { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.go-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text-dim); letter-spacing: 0.08em; }
.go-score {
  font-family: var(--font-display); font-weight: 800; font-size: 56px;
  text-shadow: 0 0 30px rgba(124,58,237,0.7);
}
.go-label { font-size: 11px; color: var(--text-dim); letter-spacing: 0.12em; margin-top: -8px; }
.go-stats { display: flex; gap: 22px; margin: 10px 0 4px; }
.go-stat { display: flex; flex-direction: column; align-items: center; }
.go-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--cyan); }
.go-stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.08em; margin-top: 2px; }
.go-row { display: flex; gap: 10px; width: 100%; max-width: 300px; }
.go-row .btn { flex: 1; }

/* ---------- Leaderboard ---------- */
.leaderboard-card { max-width: 400px; }
.lb-tabs { display: flex; gap: 6px; width: 100%; flex-wrap: wrap; justify-content: center; }
.lb-tab {
  font-size: 11px; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--text-dim); letter-spacing: 0.03em;
}
.lb-tab.active { background: linear-gradient(90deg, var(--cyan), var(--pink)); color: #0a0a1f; }
.lb-list { width: 100%; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(255,255,255,0.03); border-radius: 10px; font-size: 13px;
}
.lb-row.me { background: rgba(34, 211, 238, 0.14); border: 1px solid rgba(34,211,238,0.4); }
.lb-rank { width: 22px; font-weight: 800; color: var(--text-dim); text-align: center; }
.lb-rank.top1 { color: #ffd54f; } .lb-rank.top2 { color: #cfd8dc; } .lb-rank.top3 { color: #d7a06e; }
.lb-name { flex: 1; text-align: left; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold); }
.lb-loading, .lb-empty, .lb-error { padding: 24px 8px; color: var(--text-dim); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .new-best-badge { animation: none; }
  .btn:active { transform: none; }
}
