/* ==========================================================================
   R2 PLAY - ULTRA MODERN DARK GLASSMORPHISM THEME
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-surface: #0e131f;
  --bg-card: rgba(16, 22, 36, 0.72);
  --bg-card-hover: rgba(24, 33, 54, 0.9);
  --bg-glass: rgba(14, 19, 31, 0.85);

  --accent-cyan: #00f0ff;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 240, 255, 0.25);
  --shadow-player: 0 -10px 35px rgba(0, 0, 0, 0.6);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* Space for sticky bottom player */
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
}

/* ==========================================================================
   NAVBAR (With Full Safe Area & Standalone PWA Support)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: calc(12px + constant(safe-area-inset-top)); /* iOS 11.0-11.2 */
  padding-top: calc(12px + env(safe-area-inset-top, 0px)); /* Modern iOS & Android */
  padding-bottom: 12px;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Standalone PWA (Installed App on iOS/Android) */
@media all and (display-mode: standalone) {
  .navbar {
    padding-top: max(calc(12px + env(safe-area-inset-top, 0px)), 50px);
  }
}

html.is-standalone .navbar,
body.is-standalone .navbar {
  padding-top: max(calc(12px + env(safe-area-inset-top, 0px)), 50px);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
  flex-shrink: 0;
}

.brand-icon i {
  color: #fff;
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

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

.brand-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-btn {
  display: none; /* Shown via JS when installable */
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(139, 92, 246, 0.25));
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pwa-install-btn:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   HERO / ACTIVE PLAYER STAGE
   ========================================================================== */
.hero-stage {
  padding: 28px 0 20px;
}

.stage-card {
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.85), rgba(12, 17, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.stage-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
}

/* Stage Vinyl Record (Disco de Vinil Girando Estilo Retrô) */
.stage-vinyl-wrap {
  width: 104px;
  height: 104px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65));
  transition: filter 0.4s ease;
}

.stage-card.playing .stage-vinyl-wrap {
  filter: drop-shadow(0 10px 25px rgba(0, 240, 255, 0.28)) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.8));
}

.vinyl-disc {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f131a 0%, #171c26 15%, #080a0f 25%, #1b202c 40%, #0c0f14 55%, #1b202c 70%, #080a0f 85%, #050608 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 0 10px rgba(0, 0, 0, 0.9), 0 12px 28px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: spinVinyl 3.5s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.stage-card.playing .vinyl-disc {
  animation-play-state: running;
}

@keyframes spinVinyl {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.vinyl-groove {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  opacity: 0.7;
}

.vinyl-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 45deg at 50% 50%,
    rgba(255, 255, 255, 0.12) 0deg,
    transparent 40deg,
    rgba(255, 255, 255, 0.02) 90deg,
    rgba(255, 255, 255, 0.14) 135deg,
    transparent 180deg,
    rgba(255, 255, 255, 0.12) 225deg,
    transparent 270deg,
    rgba(255, 255, 255, 0.14) 315deg,
    transparent 360deg
  );
  pointer-events: none;
  mix-blend-mode: screen;
}

.vinyl-label {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff007a 0%, #7928ca 70%, #431268 100%);
  border: 2px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(255, 0, 122, 0.4), inset 0 0 6px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.vinyl-icon {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0.95;
}

.vinyl-label-text {
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  margin-top: 1px;
  text-transform: uppercase;
}

.vinyl-center-hole {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.9);
}

.stage-info {
  min-width: 0;
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.stage-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.stage-quality {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stage-name {
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.stage-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 4px;
}

/* Now Playing Live Badge in Stage Card */
.stage-track-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.30);
  border-radius: 20px;
  padding: 4px 12px;
  margin-top: 10px;
  max-width: 100%;
  animation: fadeInTrack 0.3s ease;
}

@keyframes fadeInTrack {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-emerald);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.stage-track-badge i {
  width: 13px;
  height: 13px;
}

.stage-track-text,
.stage-track-clone {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

/* Status Row: Visualizer Bars & Sleep Timer (Desktop: close together at Point 2) */
.stage-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-top: 14px;
  gap: 20px;
}

.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 30px;
  padding: 2px 0;
}

.bar {
  width: 4px;
  height: 6px;
  background: rgba(0, 240, 255, 0.4);
  border-radius: var(--radius-full);
  transition: height 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}

/* Subtle pleasant idle waveform when paused */
.bar:nth-child(1)  { height: 6px; }
.bar:nth-child(2)  { height: 10px; }
.bar:nth-child(3)  { height: 16px; }
.bar:nth-child(4)  { height: 8px; }
.bar:nth-child(5)  { height: 14px; }
.bar:nth-child(6)  { height: 18px; }
.bar:nth-child(7)  { height: 12px; }
.bar:nth-child(8)  { height: 20px; }
.bar:nth-child(9)  { height: 14px; }
.bar:nth-child(10) { height: 22px; }
.bar:nth-child(11) { height: 16px; }
.bar:nth-child(12) { height: 10px; }
.bar:nth-child(13) { height: 18px; }
.bar:nth-child(14) { height: 14px; }
.bar:nth-child(15) { height: 8px; }
.bar:nth-child(16) { height: 14px; }
.bar:nth-child(17) { height: 10px; }
.bar:nth-child(18) { height: 6px; }

/* Dynamic Multi-frequency Equalizer Waveform when playing */
.stage-card.playing .bar {
  animation: equalizeWave 1.1s ease-in-out infinite alternate;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.stage-card.playing .bar:nth-child(1)  { animation-duration: 0.75s; animation-delay: 0.05s; }
.stage-card.playing .bar:nth-child(2)  { animation-duration: 1.05s; animation-delay: 0.20s; }
.stage-card.playing .bar:nth-child(3)  { animation-duration: 0.85s; animation-delay: 0.12s; }
.stage-card.playing .bar:nth-child(4)  { animation-duration: 1.25s; animation-delay: 0.35s; }
.stage-card.playing .bar:nth-child(5)  { animation-duration: 0.70s; animation-delay: 0.08s; }
.stage-card.playing .bar:nth-child(6)  { animation-duration: 1.15s; animation-delay: 0.28s; }
.stage-card.playing .bar:nth-child(7)  { animation-duration: 0.90s; animation-delay: 0.15s; }
.stage-card.playing .bar:nth-child(8)  { animation-duration: 1.30s; animation-delay: 0.40s; }
.stage-card.playing .bar:nth-child(9)  { animation-duration: 0.80s; animation-delay: 0.10s; }
.stage-card.playing .bar:nth-child(10) { animation-duration: 1.20s; animation-delay: 0.30s; }
.stage-card.playing .bar:nth-child(11) { animation-duration: 0.85s; animation-delay: 0.18s; }
.stage-card.playing .bar:nth-child(12) { animation-duration: 1.10s; animation-delay: 0.25s; }
.stage-card.playing .bar:nth-child(13) { animation-duration: 0.95s; animation-delay: 0.12s; }
.stage-card.playing .bar:nth-child(14) { animation-duration: 1.35s; animation-delay: 0.45s; }
.stage-card.playing .bar:nth-child(15) { animation-duration: 0.75s; animation-delay: 0.06s; }
.stage-card.playing .bar:nth-child(16) { animation-duration: 1.15s; animation-delay: 0.32s; }
.stage-card.playing .bar:nth-child(17) { animation-duration: 0.90s; animation-delay: 0.14s; }
.stage-card.playing .bar:nth-child(18) { animation-duration: 1.05s; animation-delay: 0.22s; }

@keyframes equalizeWave {
  0% {
    height: 6px;
    background: var(--accent-cyan);
  }
  30% {
    height: 24px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
  }
  65% {
    height: 12px;
    background: var(--accent-purple);
  }
  100% {
    height: 28px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-pink));
  }
}

/* Stage Player Side: Actions on top, Volume Slider directly below */
.stage-controls-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Stage Actions */
.stage-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  box-sizing: border-box;
}

.btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-circle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.btn-circle.active {
  color: var(--accent-pink);
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.15);
}

.btn-main-play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
  transition: var(--transition-normal);
}

.btn-main-play:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.65);
}

.btn-main-play i {
  width: 28px;
  height: 28px;
  margin-left: 2px; /* optical center */
}

/* Stage Volume Group right below play buttons */
.stage-vol-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

.stage-vol-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: transform 0.15s ease;
}

.stage-vol-btn:hover {
  transform: scale(1.15);
}

.stage-volume-slider {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.stage-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.stage-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.stage-volume-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Status Row Actions: Side by side Mute + Timer chips */
.stage-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-mute-btn {
  padding: 5px 10px;
  min-width: 36px;
  justify-content: center;
}

.stage-mute-btn i {
  width: 16px;
  height: 16px;
}

/* By default (Desktop & Android), hide status row mute button (it's in stage-vol-group) */
#stageIosMuteBtn {
  display: none !important;
}

/* iOS Adaptive Mode: Hide bottom slider group, show mute chip next to timer */
.is-ios .stage-vol-group {
  display: none !important;
}

.is-ios .volume-slider-box {
  display: none !important;
}

.is-ios #stageIosMuteBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.stage-timer-btn.stage-mute-btn.active {
  color: var(--accent-pink);
  border-color: rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.15);
}

/* Sleep Timer Button at Point 4 */
.stage-timer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 13px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.stage-timer-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.stage-timer-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

/* ==========================================================================
   SEARCH & FILTERS
   ========================================================================== */
.controls-bar {
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.95rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
  background: rgba(20, 28, 48, 0.9);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Category Pills Grid - 6 columns on desktop, 4 on tablet, 2 on mobile */
.category-pills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  width: 100%;
  padding: 4px 0 14px;
  transition: opacity 0.2s ease;
}

.category-pills.search-hidden {
  display: none !important;
}

.pill-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  text-align: center;
}

.pill-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.pill-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(139, 92, 246, 0.25));
  border-color: var(--accent-cyan);
  color: var(--text-main);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.pill-btn .count {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.pill-btn.active .count {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
}

/* ==========================================================================
   STATIONS GRID & CARDS
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.station-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.station-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.9), rgba(16, 22, 36, 0.9));
}

.station-card.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-cyan);
}

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

.card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  transition: var(--transition-fast);
}

.station-card:hover .card-icon-wrap {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
}

.station-card.active .card-icon-wrap {
  background: var(--accent-cyan);
  color: #07090e;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.card-fav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.card-fav-btn.is-fav {
  color: var(--accent-pink);
}

.card-body {
  flex-grow: 1;
  margin-bottom: 12px;
  min-width: 0;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category {
  font-size: 0.72rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.card-live-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.card-live-indicator .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state i {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ==========================================================================
   STICKY BOTTOM PLAYER (MINI PLAYER)
   ========================================================================== */
.sticky-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-player);
  padding: 7px 0;
}

.player-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: center;
  gap: 20px;
}

/* Left: Track info */
.player-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.player-text {
  min-width: 0;
}

.player-title {
  font-size: 0.90rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.player-subtitle {
  font-size: 0.70rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.player-subtitle .badge-live {
  color: var(--accent-emerald);
  font-weight: 700;
  flex-shrink: 0;
}

.player-subtitle .is-track {
  color: #34d399;
  font-weight: 600;
  white-space: nowrap;
}

/* ========================================================
   TRACK MARQUEE (LETREIRO DIGITAL EM LOOP CONTÍNUO)
   ======================================================== */
.track-marquee {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  vertical-align: middle;
}

.track-marquee .marquee-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Sizing for Stage Card Marquee */
.stage-marquee {
  max-width: 380px;
}

@media (max-width: 900px) {
  .stage-marquee {
    max-width: 240px;
  }
}

@media (max-width: 480px) {
  .stage-marquee {
    max-width: 190px;
  }
}

/* Sizing for Bottom Player Marquee */
.bottom-marquee {
  max-width: 280px;
}

@media (max-width: 900px) {
  .player-subtitle .badge-live {
    display: none !important;
  }

  .bottom-marquee {
    max-width: 230px;
  }
}

@media (max-width: 480px) {
  .bottom-marquee {
    max-width: 180px;
  }
}

@media (max-width: 360px) {
  .bottom-marquee {
    max-width: 140px;
  }
}

/* Clones (hidden until scrolling is activated) */
.stage-track-clone,
.bottom-track-clone {
  display: none;
  white-space: nowrap;
}

/* When scrolling is activated (Letreiro loop) */
.track-marquee.is-scrolling {
  mask-image: linear-gradient(90deg, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
}

.track-marquee.is-scrolling .marquee-inner {
  display: inline-flex;
  width: max-content;
  animation: marqueeLoop var(--marquee-speed, 14s) linear infinite;
  will-change: transform;
}

.track-marquee.is-scrolling .stage-track-clone,
.track-marquee.is-scrolling .bottom-track-clone {
  display: inline;
}

.track-marquee.is-scrolling:hover .marquee-inner {
  animation-play-state: paused;
}

@keyframes marqueeLoop {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Actions Row: Controls (center) + Volume & Timer (right) */
.player-actions-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-auto-flow: dense;
  align-items: center;
  gap: 16px;
}

/* Center: Controls */
.player-controls {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-ctrl {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.btn-ctrl:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

.btn-ctrl.active {
  color: var(--accent-cyan);
}

.btn-play-pause {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg-dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  transition: var(--transition-normal);
}

.btn-play-pause:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.player-status-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  height: 12px;
  line-height: 12px;
}

/* Volume on Desktop */
.volume-wrapper {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-volume-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.btn-volume-toggle:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

.volume-slider-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Sleep Timer on Desktop */
.timer-wrapper {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: flex;
  align-items: center;
}

.btn-timer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-timer:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.btn-timer.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

/* ==========================================================================
   BANNER SECTION
   ========================================================================== */
.banner-section {
  margin: 32px 0 24px;
}

.banner-placeholder {
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.5), rgba(14, 19, 31, 0.8));
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   MODAL / POPUPS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.timer-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.timer-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.timer-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

.timer-btn.cancel {
  grid-column: 1 / -1;
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(14, 20, 34, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-toast 0.3s ease-out;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.toast.success { border-color: var(--accent-emerald); }
.toast.info { border-color: var(--accent-cyan); }
.toast.warn { border-color: var(--accent-amber); }

@keyframes slide-toast {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   DISCREET CENTER INSTALL POPUP (MOBILE)
   ========================================================================== */
.popup-install-box {
  position: relative;
  text-align: center;
  max-width: 350px;
  width: 90%;
  background: linear-gradient(135deg, rgba(16, 22, 38, 0.98), rgba(26, 17, 48, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 26px 22px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.2);
  animation: popup-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popup-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.popup-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.popup-close-btn:hover {
  color: #fff;
}

.popup-badge-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.popup-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.popup-badge-pill .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 1.8s infinite;
}

.popup-brand-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
  flex-shrink: 0;
}

.popup-brand-logo i {
  color: #fff;
  width: 34px;
  height: 34px;
}

.popup-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.popup-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
}

.popup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
  transition: var(--transition-fast);
}

.popup-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.6);
}

.popup-btn-primary i {
  width: 16px;
  height: 16px;
}

.popup-btn-secondary {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.popup-btn-secondary:hover {
  color: var(--text-secondary);
}

/* iOS Safari Modal */
.ios-modal {
  max-width: 420px;
}
.ios-intro {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.ios-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.step-desc {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
}
.step-icon {
  margin-top: 4px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
}
.step-icon i {
  width: 14px;
  height: 14px;
}
.ios-ok-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #07090e;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 992px) {
  .category-pills {
    grid-template-columns: repeat(4, 1fr);
  }

  .stage-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .stage-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stage-vinyl-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto;
  }

  .stage-vinyl-wrap .vinyl-disc {
    width: 88px;
    height: 88px;
  }

  .stage-vinyl-wrap .vinyl-label {
    width: 40px;
    height: 40px;
  }

  .stage-meta {
    justify-content: center;
  }

  .stage-actions {
    justify-content: center;
  }

  .stage-controls-side {
    align-items: center;
    width: 100%;
  }

  .stage-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 350px;
    margin: 14px auto 0;
    padding: 0 4px;
  }

  body {
    padding-bottom: calc(135px + env(safe-area-inset-bottom, 0px));
  }

  .sticky-player {
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* 2-Tier Stack */
  .player-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  /* Tier 1: Station Info (Top row - sobreposto) */
  .player-track {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
  }

  .player-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .player-thumb i {
    width: 18px;
    height: 18px;
  }

  .player-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .player-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-subtitle {
    font-size: 0.70rem;
    flex-shrink: 0;
  }

  .player-subtitle .badge-live {
    display: none !important;
  }

  /* Tier 2: Action Row (Volume Left | Controls Center | Timer Right) */
  .player-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    padding: 0 4px;
  }

  /* Left: Volume */
  .volume-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 38px;
  }

  .btn-volume-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: var(--transition-fast);
  }

  .btn-volume-toggle i {
    width: 18px;
    height: 18px;
  }

  .btn-volume-toggle:hover,
  .btn-volume-toggle.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
  }

  /* Floating Volume Slider Capsule above Volume Button */
  .volume-slider-box {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    right: auto;
    background: rgba(14, 20, 36, 0.98);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    white-space: nowrap;
  }

  .volume-slider-box.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .volume-slider-box .volume-slider {
    width: 110px;
    height: 6px;
  }

  .volume-slider-box .volume-pct {
    color: var(--accent-cyan);
    font-weight: 700;
  }

  /* Center: Playback Controls */
  .player-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0 8px;
  }

  .control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .btn-ctrl#bottomShuffleBtn {
    display: none !important;
  }

  .btn-ctrl {
    padding: 6px;
  }

  .btn-ctrl i {
    width: 20px;
    height: 20px;
  }

  .btn-play-pause {
    width: 42px;
    height: 42px;
  }

  .btn-play-pause i {
    width: 20px;
    height: 20px;
  }

  .player-status-text {
    display: none !important;
  }

  /* Right: Sleep Timer */
  .timer-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 38px;
  }

  .btn-timer {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: var(--transition-fast);
  }

  .btn-timer i {
    width: 18px;
    height: 18px;
  }

  .btn-timer .timer-text {
    display: none;
  }

  .btn-timer.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #07090e;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  }
}

@media (max-width: 768px) {
  .category-pills {
    grid-template-columns: repeat(3, 1fr);
  }

  .stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  }

  .navbar .container {
    gap: 8px;
  }

  /* Extra safe protection for standalone mobile app */
  html.is-standalone .navbar,
  body.is-standalone .navbar {
    padding-top: max(calc(14px + env(safe-area-inset-top, 0px)), 52px);
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-badge {
    font-size: 0.65rem;
  }

  /* Compact Navbar Install Button on Mobile */
  .pwa-install-btn {
    padding: 6px 10px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .pwa-install-btn i {
    width: 14px;
    height: 14px;
  }

  /* 2 Clean Columns for Mobile Categories */
  .category-pills {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .pill-btn {
    padding: 9px 8px;
    font-size: 0.8rem;
    gap: 5px;
  }

  /* Stage Card Fully Responsive on Mobile */
  .stage-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .stage-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stage-name {
    font-size: clamp(1.12rem, 4.6vw, 1.32rem);
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 2px;
    margin-bottom: 6px;
  }

  .stage-desc {
    font-size: 0.84rem;
    line-height: 1.5;
    padding: 0 2px;
    margin: 0 auto 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .stage-track-box {
    box-sizing: border-box;
    max-width: calc(100% - 4px);
    margin: 8px auto 0;
    padding: 3px 10px;
  }

  .stage-marquee {
    max-width: clamp(120px, 45vw, 210px);
  }

  /* Fluid stage actions row - NO BUTTON CUTOFF ON ANY DEVICE */
  .stage-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(5px, 2vw, 10px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 2px;
  }

  .stage-actions .btn-circle {
    width: clamp(34px, 8.8vw, 42px);
    height: clamp(34px, 8.8vw, 42px);
    flex-shrink: 1;
    min-width: 32px;
  }

  .stage-actions .btn-circle i {
    width: clamp(16px, 4.2vw, 19px);
    height: clamp(16px, 4.2vw, 19px);
  }

  .stage-actions .btn-main-play {
    width: clamp(48px, 13vw, 56px);
    height: clamp(48px, 13vw, 56px);
    flex-shrink: 0;
    min-width: 48px;
  }

  .stage-actions .btn-main-play i {
    width: clamp(22px, 6vw, 26px);
    height: clamp(22px, 6vw, 26px);
  }

  /* Stations Grid */
  .stations-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .station-card {
    padding: 14px 12px;
  }

  /* Banner & Controls */
  .banner-section {
    margin: 20px 0 16px;
  }

  .banner-placeholder {
    padding: 12px 10px;
    font-size: 0.78rem;
    gap: 8px;
    line-height: 1.35;
  }

  .controls-bar {
    margin-bottom: 20px;
  }

  .search-input {
    padding: 12px 14px 12px 42px;
    font-size: 0.88rem;
  }

  /* Mobile Bottom Player Tuning for small screens */
  .sticky-player {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .player-track {
    padding: 3px 8px;
    gap: 8px;
  }

  .player-thumb {
    width: 30px;
    height: 30px;
  }

  .player-thumb i {
    width: 15px;
    height: 15px;
  }

  .player-title {
    font-size: 0.82rem;
  }

  .player-subtitle {
    font-size: 0.66rem;
  }

  .control-buttons {
    gap: clamp(8px, 2.5vw, 12px);
  }

  .btn-play-pause {
    width: 38px;
    height: 38px;
  }

  .btn-play-pause i {
    width: 18px;
    height: 18px;
  }

  .btn-timer,
  .btn-volume-toggle {
    width: 34px;
    height: 34px;
  }

  .btn-timer i,
  .btn-volume-toggle i {
    width: 16px;
    height: 16px;
  }

  /* Stage Controls on Mobile */
  .stage-status-row {
    width: 100%;
    max-width: min(320px, 100%);
    box-sizing: border-box;
    gap: 10px;
    margin: 12px auto 0;
    padding: 0 4px;
  }

  .sound-bars {
    gap: 3px;
    flex-shrink: 1;
  }

  .sound-bars .bar {
    width: 3.5px;
  }

  .stage-vol-group {
    width: 100%;
    max-width: min(290px, 100%);
    box-sizing: border-box;
    margin: 0 auto;
    padding: 6px 12px;
    gap: 8px;
  }

  .stage-volume-slider {
    flex: 1;
    min-width: 50px;
  }

  .stage-volume-val {
    font-size: 0.72rem;
    min-width: 30px;
  }

  .stage-timer-btn {
    padding: 6px 12px;
    font-size: 0.76rem;
    gap: 5px;
  }
}

/* Extra Compact Devices (e.g. 320px - 360px Android Screens) */
@media (max-width: 360px) {
  .container {
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
  }

  .stage-card {
    padding: 14px 8px;
  }

  .stage-name {
    font-size: 1.08rem;
  }

  .stage-actions {
    gap: 4px;
  }

  .stage-actions .btn-circle {
    width: 32px;
    height: 32px;
    min-width: 30px;
  }

  .stage-actions .btn-circle i {
    width: 15px;
    height: 15px;
  }

  .stage-actions .btn-main-play {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .stage-actions .btn-main-play i {
    width: 19px;
    height: 19px;
  }

  .stage-vol-group {
    padding: 5px 8px;
    gap: 6px;
  }

  .stage-status-row {
    gap: 6px;
    padding: 0 2px;
  }

  .sound-bars .bar {
    width: 2.5px;
  }

  .category-pills {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .pill-btn {
    padding: 8px 5px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .control-buttons {
    gap: 8px;
  }

  .btn-play-pause {
    width: 36px;
    height: 36px;
  }

  .btn-timer,
  .btn-volume-toggle {
    width: 32px;
    height: 32px;
  }
}

/* Global Mobile Toast Protection */
@media (max-width: 480px) {
  .toast-container {
    top: 14px;
    right: 12px;
    left: 12px;
    align-items: center;
  }

  .toast {
    width: 100%;
    max-width: 350px;
    justify-content: center;
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}
