/* ── SPOEX 2026 Preview – Shared Styles ── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --primary: #5252FA;
  --accent: #BAFC27;
  --bg: #0a0a0f;
  --surface: #111113;
  --surface2: #1a1a1f;
  --text: #f0f0f5;
  --text-dim: #8888aa;
  --radius: 16px;
  --max-w: 440px;
}

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

html { font-size: 16px; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-bar .logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.top-bar .logo span { color: var(--accent); }

/* ── Auto-play toggle ── */
.auto-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  color: var(--text-dim);
}

.auto-toggle input[type=checkbox] { display: none; }

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--surface2);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
}

.toggle-track::after {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--text-dim);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .2s, background .2s;
}

.auto-toggle input:checked + .toggle-track {
  background: var(--primary);
}

.auto-toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* ── Steps Container ── */
.steps-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.step.active {
  opacity: 1;
  visibility: visible;
}

/* ── Bottom Nav ── */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 20px;
  gap: 12px;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  flex-shrink: 0;
}

.nav-btn:active { background: var(--surface2); }
.nav-btn:disabled { opacity: .3; pointer-events: none; }

.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex: 1;
}

.step-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface2);
  transition: background .3s, transform .3s;
}

.step-dots .dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
}

.card-glow {
  box-shadow: 0 0 40px rgba(82,82,250,.15), 0 0 80px rgba(186,252,39,.05);
}

/* ── Typography ── */
.title-lg { font-size: 1.8rem; font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
.title-md { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.title-sm { font-size: 1rem; font-weight: 600; }
.label { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.big-number { font-size: 3.5rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; }

.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-dim { color: var(--text-dim); }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-center { text-align: center; }

/* ── Gauge ── */
.gauge-wrap {
  width: 100%;
  height: 18px;
  background: var(--surface2);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.gauge-fill {
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width .3s ease-out;
}

/* ── Leaderboard ── */
.lb-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface2);
  gap: 12px;
  font-size: .9rem;
}

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

.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lb-row.highlight {
  background: rgba(186,252,39,.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-bottom-color: transparent;
}

.lb-row.highlight .lb-rank { color: var(--accent); }

.lb-name { flex: 1; }
.lb-score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Metric Row ── */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-item {
  background: var(--surface2);
  border-radius: 12px;
  padding: 14px;
  opacity: 0;
  transform: translateY(12px);
}

.metric-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: .7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.metric-item.full { grid-column: 1 / -1; }

/* ── Speed bar (VBT live) ── */
.speed-bar-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speed-bar-track {
  width: 100%;
  height: 48px;
  background: var(--surface2);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.speed-bar-fill {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--bg);
  transition: width .15s ease-out;
}

.speed-zones {
  display: flex;
  justify-content: space-between;
  font-size: .65rem;
  color: var(--text-dim);
  padding: 0 4px;
}

/* ── Zone Indicator ── */
.zone-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  gap: 2px;
}

.zone-bar > div { flex: 1; border-radius: 4px; }
.zone-strength { background: #ff4444; }
.zone-hypertrophy { background: #ffaa00; }
.zone-power { background: var(--accent); }

.zone-marker {
  position: relative;
}

/* ── AI Comment ── */
.ai-comment {
  background: rgba(82,82,250,.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
  font-size: .85rem;
  line-height: 1.5;
}

/* ── QR Mock ── */
.qr-mock {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(8,1fr);
  grid-template-rows: repeat(8,1fr);
  gap: 2px;
  padding: 8px;
  margin: 0 auto;
}

.qr-mock > div {
  border-radius: 1px;
}

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Landing page ── */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 20px;
  text-align: center;
  gap: 32px;
}

.landing-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: var(--max-w);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-card:active { transform: scale(.97); }

.landing-card .icon {
  font-size: 2.5rem;
  line-height: 1;
}

.landing-card .desc {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.landing-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-date {
  background: rgba(82,82,250,.15);
  color: var(--primary);
}

/* ── Countdown ── */
.countdown-num {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 60px rgba(186,252,39,.3);
}

/* ── Band curve chart area ── */
.chart-container {
  width: 100%;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
}

/* ── Responsive ── */
@media (min-width: 600px) {
  .app { border-left: 1px solid var(--surface2); border-right: 1px solid var(--surface2); }
}

@media (min-width: 1024px) {
  :root { --max-w: 480px; }
}

/* ── Animations ── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(82,82,250,.2); }
  50% { box-shadow: 0 0 40px rgba(82,82,250,.4); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
