/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 11px 18px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--primary {
  color: #06040f;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 8px 22px rgba(155, 107, 255, 0.35);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:active { transform: scale(0.96); }
.btn--big { padding: 15px 34px; font-size: 16px; letter-spacing: 0.06em; }
.btn--ghost {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn--ghost:active { transform: scale(0.96); }
.btn--full { width: 100%; }

.menu-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(3, 2, 10, 0.72); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 18px 18px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal__header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--text-light);
}
.modal__close {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.modal__close:hover { color: var(--text-light); }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tab.active { color: #06040f; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); border-color: transparent; }

/* Leaderboard */
.leaderboard-list { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.lb-loading, .lb-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px 0; }
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.lb-row.me { border-color: rgba(77, 243, 255, 0.5); background: rgba(77, 243, 255, 0.08); }
.lb-row.top1 .lb-rank { color: #ffd166; }
.lb-row.top2 .lb-rank { color: #d6d6ff; }
.lb-row.top3 .lb-rank { color: #e0a56f; }
.lb-rank { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-dim); }
.lb-name { font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--neon-cyan); }

/* Skins grid */
.skins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skin-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  cursor: pointer;
}
.skin-card.selected { border-color: var(--neon-cyan); box-shadow: 0 0 0 2px rgba(77, 243, 255, 0.3); }
.skin-card.locked { opacity: 0.45; cursor: default; }
.skin-card__swatch { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 14px currentColor; }
.skin-card__name { font-size: 10.5px; color: var(--text-light); text-align: center; }
.skin-card__req { font-size: 9px; color: var(--text-dim); text-align: center; }
.skin-card__lock { position: absolute; top: 6px; right: 6px; font-size: 12px; }

/* Achievement toast */
/* Sits below the top ad banner + header on every breakpoint so an
   achievement popping in never visually overlaps (or risks miscueing a
   click near) the ad slot — concept section 37 explicitly warns against
   any UI that could cause an accidental ad click. */
.achievement-toast { position: fixed; top: 96px; right: 14px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 28px); }
.achv-item {
  min-width: 220px;
  max-width: 280px;
  background: rgba(10, 8, 28, 0.94);
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: achvSlide 4.2s ease forwards;
}
.achv-item__icon { font-size: 20px; }
.achv-item__title { font-family: var(--font-ui); font-weight: 700; font-size: 12px; color: var(--neon-gold); }
.achv-item__desc { font-size: 11px; color: var(--text-dim); }
@keyframes achvSlide {
  0% { transform: translateX(120%); opacity: 0; }
  8% { transform: translateX(0); opacity: 1; }
  88% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* Settings switches */
.settings-body { display: flex; flex-direction: column; gap: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-light); }
.switch-row input[type="checkbox"] { width: 42px; height: 24px; appearance: none; background: rgba(255,255,255,0.12); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.15s ease; }
.switch-row input[type="checkbox"]::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform 0.15s ease; }
.switch-row input[type="checkbox"]:checked { background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); }
.switch-row input[type="checkbox"]:checked::before { transform: translateX(18px); }

.howto-body { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.howto-body strong { color: var(--text-light); }

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 8, 28, 0.95);
  border: 1px solid rgba(255, 84, 112, 0.4);
  color: var(--text-light);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  z-index: 90;
  max-width: 90vw;
  text-align: center;
}

@media (max-width: 480px) {
  .stat-block { padding: 8px 4px; }
  .stat-block__value { font-size: 18px; }
  .skins-grid { grid-template-columns: repeat(3, 1fr); }
}
