/* ============================================
   BIKE JOCKEY — Dark Cycling Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c26;
  --bg-elevated: #1e1e28;
  --border: #2a2a3a;
  --border-light: #353548;

  --text-primary: #f0f0f8;
  --text-secondary: #9090b0;
  --text-muted: #5a5a78;

  --accent: #ff6b2b;
  --accent-glow: rgba(255, 107, 43, 0.3);

  /* Zone colors */
  --z1-recovery: #3b82f6;
  --z2-endurance: #22c55e;
  --z3-tempo: #eab308;
  --z4-threshold: #f97316;
  --z5-max: #ef4444;

  --z1-bg: rgba(59, 130, 246, 0.15);
  --z2-bg: rgba(34, 197, 94, 0.15);
  --z3-bg: rgba(234, 179, 8, 0.15);
  --z4-bg: rgba(249, 115, 22, 0.15);
  --z5-bg: rgba(239, 68, 68, 0.15);

  --spotify-green: #1db954;
  --spotify-dark: #121212;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --glow-accent: 0 0 40px rgba(255, 107, 43, 0.2);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Header ---- */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #ff9a3c);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--glow-accent);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 4px;
  align-self: flex-end;
  margin-bottom: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-spotify {
  background: var(--spotify-green);
  color: #000;
}
.btn-spotify:hover { background: #1ed760; box-shadow: 0 0 20px rgba(29, 185, 84, 0.4); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #ff8040; box-shadow: var(--accent-glow); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---- Auth Screen ---- */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 107, 43, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(34, 197, 94, 0.06) 0%, transparent 50%);
}

.auth-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  font-size: 56px;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.auth-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
}

/* ---- Main App ---- */
#main-app {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

#main-app.visible { display: flex; }

/* ---- Loading ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.loading-overlay.hidden { display: none; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* ---- Stage Selector ---- */
#stage-selector {
  padding: 32px 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}

.stage-card[data-type="sprint"]::before { background: linear-gradient(90deg, var(--z5-max), var(--z4-threshold)); }
.stage-card[data-type="mountain"]::before { background: linear-gradient(90deg, var(--z2-endurance), var(--z5-max)); }
.stage-card[data-type="tt"]::before { background: linear-gradient(90deg, var(--z3-tempo), var(--z4-threshold)); }
.stage-card[data-type="mountain_tt"]::before { background: linear-gradient(90deg, var(--z4-threshold), var(--z5-max)); }

.stage-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stage-card:hover::before { opacity: 1; }

.stage-card.active {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.stage-card.active::before { opacity: 1; }

.stage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stage-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stage-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-sprint { background: var(--z5-bg); color: var(--z5-max); }
.badge-mountain { background: var(--z2-bg); color: var(--z2-endurance); }
.badge-tt { background: var(--z3-bg); color: var(--z3-tempo); }
.badge-mountain_tt { background: var(--z4-bg); color: var(--z4-threshold); }

.stage-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.stage-card-route {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stage-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

.stat-value {
  font-size: 16px;
  font-weight: 700;
  display: block;
}

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

.stage-mini-profile {
  height: 40px;
  margin-bottom: 16px;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.stage-mini-profile canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ---- Main Stage View ---- */
#stage-view {
  display: none;
  flex: 1;
  flex-direction: column;
}

#stage-view.visible {
  display: flex;
}

.stage-view-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px 0;
}

.back-btn:hover { color: var(--text-primary); }

.stage-view-title {
  flex: 1;
}

.stage-view-title h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.stage-view-title .stage-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stage-view-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  height: calc(100vh - 128px);
  overflow: hidden;
}

/* ---- Main Content Area ---- */
.stage-main-content {
  display: flex;
  flex-direction: column;
  height: 100%; /* fills the grid cell from .stage-view-body */
  overflow: hidden;
  min-height: 0; /* required for flex children with overflow */
}

.stage-sticky-top {
  flex-shrink: 0;
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stage-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

/* ---- Chart Container ---- */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-wrapper {
  position: relative;
  height: 220px;
}

/* ---- Now Playing ---- */
.now-playing-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.track-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg-elevated);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.track-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.track-bpm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 20px;
}

.track-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.zone-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.zone-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

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

/* ---- Segments Playlist ---- */
.segments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.segment-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.segment-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.segment-item.z1::before { background: var(--z1-recovery); }
.segment-item.z2::before { background: var(--z2-endurance); }
.segment-item.z3::before { background: var(--z3-tempo); }
.segment-item.z4::before { background: var(--z4-threshold); }
.segment-item.z5::before { background: var(--z5-max); }

.segment-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.segment-item.active {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.segment-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-track-info {
  min-width: 0;
}

.segment-track-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-track-artist {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.meta-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.chip-bpm { background: var(--accent-glow); color: var(--accent); }
.chip-duration { background: rgba(144, 144, 176, 0.15); color: var(--text-secondary); }
.chip-cumtime { background: rgba(59, 130, 246, 0.12); color: #6ea8fe; }
.chip-intensity { background: rgba(144, 144, 176, 0.12); color: var(--text-muted); }

.segment-zone-col {
  text-align: right;
  flex-shrink: 0;
}

.segment-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.seg-rpe {
  font-size: 18px;
  font-weight: 900;
}

.seg-rpe-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Sidebar ---- */
.stage-sidebar {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.sidebar-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

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

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  font-size: 14px;
  font-weight: 700;
}

.donut-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-value {
  font-size: 22px;
  font-weight: 800;
}

.donut-center-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zone-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.zone-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.zone-dot-sm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-legend-pct {
  margin-left: auto;
  font-weight: 700;
  font-size: 12px;
}

/* ---- Spotify Status ---- */
.spotify-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.spotify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.spotify-dot.connected { background: var(--spotify-green); }

/* ---- Push Playlist Button ---- */
.push-playlist-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.push-playlist-section p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ---- No Tracks Message ---- */
.no-tracks-msg {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.no-tracks-msg .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-tracks-msg p {
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--z2-endurance); }
.toast.error { border-left: 3px solid var(--z5-max); }
.toast.info { border-left: 3px solid var(--z1-recovery); }

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---- Progress Bar ---- */
.progress-bar-container {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--z2-endurance), var(--accent));
  transition: width 0.3s;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .stage-view-body {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .stage-main-content {
    height: auto;
    overflow: visible;
  }

  .stage-sticky-top {
    position: static;
  }

  .stage-scrollable {
    overflow: visible;
    max-height: none;
  }

  .stage-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .app-header { padding: 0 16px; }
  .logo-tagline { display: none; }

  #stage-selector { padding: 20px 16px; }

  .stage-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stage-view-header { padding: 12px 16px; }
  .stage-sticky-top { padding: 16px 16px 0; }
  .stage-scrollable { padding: 12px 16px 16px; }

  .now-playing-bar {
    flex-wrap: wrap;
  }

  .segment-item {
    grid-template-columns: 28px 1fr;
  }
  .segment-zone-col { display: none; }
}

@media (max-width: 480px) {
  .stage-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .auth-title { font-size: 26px; }
}

/* ---- Spotify Player Bar ---- */
.player-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 200;
  backdrop-filter: blur(12px);
}
.player-bar.hidden { display: none; }
.player-left { display: flex; align-items: center; gap: 12px; width: 240px; min-width: 0; }
.player-album-art { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; }
.player-track-info { min-width: 0; }
.player-track-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.player-controls { display: flex; align-items: center; gap: 16px; }
.player-btn { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px; transition: color 0.15s; }
.player-btn:hover { color: var(--text-primary); }
.player-btn-play { font-size: 22px; color: var(--text-primary); }
.player-progress { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 480px; }
.player-time { font-size: 11px; color: var(--text-muted); min-width: 32px; }
.player-progress-bar { flex: 1; height: 4px; background: var(--bg-elevated); border-radius: 2px; cursor: pointer; position: relative; }
.player-progress-bar:hover { height: 6px; }
.player-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s linear; }
.player-right { width: 160px; display: flex; justify-content: flex-end; }
.device-picker { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; min-width: 220px; }
.device-picker.hidden { display: none; }
.device-picker-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.device-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.device-item:hover { background: var(--bg-elevated); }
.device-name { color: var(--text-primary); flex: 1; }
.device-active { font-size: 10px; color: var(--accent); font-weight: 700; }

/* ---- Rules Card ---- */
.rules-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 24px 0;
  max-width: 800px;
}
.rules-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rules-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }

.zone-text-z1 { color: var(--z1-recovery); }
.zone-text-z2 { color: var(--z2-endurance); }
.zone-text-z3 { color: var(--z3-tempo); }
.zone-text-z4 { color: var(--z4-threshold); }
.zone-text-z5 { color: var(--z5-max); }

.zone-bg-z1 { background: var(--z1-bg); }
.zone-bg-z2 { background: var(--z2-bg); }
.zone-bg-z3 { background: var(--z3-bg); }
.zone-bg-z4 { background: var(--z4-bg); }
.zone-bg-z5 { background: var(--z5-bg); }
