/* =============================================
   PLAYER STYLES — matches Threshold design tokens
   ============================================= */

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-2: #16161f;
  --border: #1e1e2a;
  --indigo: #6366f1;
  --indigo-dim: rgba(99,102,241,0.12);
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --text: #e8e8f0;
  --text-dim: #6b6b82;
  --text-muted: #3a3a50;
  --mono: 'DM Mono', 'Courier New', monospace;
  --sans: 'DM Sans', system-ui, sans-serif;
  --display: 'Syne', system-ui, sans-serif;
  --success: #10b981;
  --error: #ef4444;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === SESSION CONTAINER === */
.session-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}

.session-container::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 50% 60% at 30% 60%, rgba(99,102,241,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 70% 30%, rgba(139,92,246,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.session-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

.session-screen.hidden { display: none; }

/* === READY SCREEN === */
.ready-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.ready-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--indigo);
  text-transform: uppercase;
}

.ready-title {
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.ready-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.ready-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.check-icon {
  color: var(--indigo);
  font-size: 10px;
}

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

.back-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

/* === BUTTONS === */
.btn-primary {
  background: var(--indigo);
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: #5558e8; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--indigo); background: var(--indigo-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 12px 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.btn-ghost-sm {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-ghost-sm:hover { color: var(--text-dim); }

.btn-control {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 32px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-control:hover { background: var(--indigo-dim); border-color: var(--indigo); }

/* === PHASE SCREEN === */
.phase-header {
  text-align: center;
  margin-bottom: 32px;
}

.phase-label {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.phase-desc {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* === COHERENCE === */
.coherence-section {
  margin-bottom: 24px;
}

.coherence-track-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coherence-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
}

.coherence-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.coherence-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--amber) 100%);
  border-radius: 3px;
  transition: width 1.5s ease;
}

.coherence-val {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--amber);
  min-width: 30px;
  text-align: right;
}

/* === TIMER === */
.timer-section {
  text-align: center;
  margin-bottom: 28px;
}

.timer-display {
  font-family: var(--display);
  font-size: 72px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

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

/* === WAVE CANVAS === */
.wave-section {
  margin-bottom: 28px;
}

.wave-canvas {
  width: 100%;
  height: 80px;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* === AI COACH === */
.ai-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 28px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--indigo);
}

.ai-message {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  min-height: 44px;
}

/* === CONTROLS === */
.controls-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* === ALERTS === */
.alert-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--indigo-dim);
  border: 1px solid var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  color: var(--indigo);
}

.alert-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.alert-body {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 400px;
  line-height: 1.6;
}

/* === GATED === */
.gated-icon {
  font-size: 32px;
  color: var(--amber);
}

.gated-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.gated-body {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 380px;
  line-height: 1.6;
}

/* === END SCREEN === */
.end-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--success);
  text-transform: uppercase;
}

.end-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.end-stats {
  display: flex;
  gap: 48px;
  margin: 24px 0;
}

.end-stat { text-align: center; }

.end-stat-val {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 800;
  color: var(--indigo);
  line-height: 1;
  letter-spacing: -0.02em;
}

.end-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 8px;
}

.end-body {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 380px;
  line-height: 1.6;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .timer-display { font-size: 56px; }
  .end-stats { gap: 32px; }
  .end-stat-val { font-size: 36px; }
  .controls-section { flex-direction: column; }
}