:root {
  --bg: #0b0b0d;
  --fg: #f6f4ef;
  --fg-muted: rgba(246, 244, 239, 0.72);
  --fg-dim: rgba(246, 244, 239, 0.5);
  --accent: #e8b87d;
  --accent-rgb: 232, 184, 125;
  --accent-ink: #17120c;
  --scrim-left: rgba(14, 11, 8, 0.88);
  --scrim-mid: rgba(14, 11, 8, 0.45);
  --scrim-bottom: rgba(10, 8, 6, 0.86);
  --glass: rgba(18, 16, 14, 0.54);
  --glass-strong: rgba(20, 18, 16, 0.82);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.24);
  --live: #4ade80;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", "Playfair Display", Georgia, serif;
  --transition: 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-theme="office-lounge"] {
  --accent: #e8b87d;
  --accent-rgb: 232, 184, 125;
  --accent-ink: #1a1209;
  --scrim-left: rgba(16, 12, 8, 0.88);
  --scrim-mid: rgba(18, 13, 9, 0.44);
  --scrim-bottom: rgba(12, 9, 6, 0.88);
  --glass: rgba(22, 17, 13, 0.56);
}

body[data-theme="dinner-lounge"] {
  --accent: #e09f7d;
  --accent-rgb: 224, 159, 125;
  --accent-ink: #1c0f0a;
  --scrim-left: rgba(18, 9, 10, 0.9);
  --scrim-mid: rgba(20, 11, 12, 0.44);
  --scrim-bottom: rgba(12, 6, 7, 0.92);
  --glass: rgba(24, 14, 15, 0.58);
}

body[data-theme="christmas-lounge"] {
  --accent: #d4a373;
  --accent-rgb: 212, 163, 115;
  --accent-ink: #14120c;
  --scrim-left: rgba(9, 15, 13, 0.9);
  --scrim-mid: rgba(11, 18, 15, 0.44);
  --scrim-bottom: rgba(7, 11, 10, 0.92);
  --glass: rgba(14, 21, 18, 0.58);
}

body[data-theme="summer-lounge"] {
  --accent: #f4c27a;
  --accent-rgb: 244, 194, 122;
  --accent-ink: #1b1407;
  --scrim-left: rgba(18, 14, 9, 0.88);
  --scrim-mid: rgba(20, 16, 11, 0.4);
  --scrim-bottom: rgba(12, 9, 6, 0.9);
  --glass: rgba(24, 19, 13, 0.54);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === Fullscreen Stage === */
.stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}

/* === Crossfading Hero Backdrop === */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}

.backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1), transform 18s ease-out;
  will-change: opacity, transform;
}

.backdrop-img.is-active {
  opacity: 1;
  transform: scale(1);
}

.backdrop-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(95deg, var(--scrim-left) 0%, var(--scrim-mid) 52%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0.15) 68%, var(--scrim-bottom) 100%);
  transition: background var(--transition);
}

.backdrop-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 18% 72%, rgba(var(--accent-rgb), 0.16), transparent 48%);
  transition: background var(--transition);
}

/* === Top Bar === */
.topbar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(20px, 4vw, 56px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.9);
  transition: background var(--transition), box-shadow var(--transition);
}

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

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* === Station Tabs === */
.station-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 100%;
  overflow-x: auto;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-muted);
  white-space: nowrap;
  transition: color 220ms ease, background 220ms ease, transform 220ms ease;
}

.tab-btn:hover {
  color: var(--fg);
}

.tab-btn.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.tab-dot.is-live {
  background: var(--live);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.85);
}

.tab-soon {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-dim);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  transition: border-color 200ms ease, background 200ms ease, transform 180ms ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ghost-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

/* === Main Hero === */
.hero {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1440px;
  margin: auto;
  padding: clamp(24px, 5vh, 56px) clamp(20px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-inner {
  max-width: 680px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  position: relative;
}

.pulse-dot.is-live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--live);
  animation: pulseRing 2.2s infinite ease-out;
}

.pulse-dot.is-soon {
  background: var(--accent);
}

@keyframes pulseRing {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.spec-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.1rem, 7.6vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.hero-desc {
  margin: 0 0 28px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 540px;
}

/* === Player Card === */
.player-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  transition: background var(--transition), border-color var(--transition);
}

.player-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.play-btn {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.36);
  transition: transform 180ms ease, background var(--transition), box-shadow var(--transition), opacity 180ms ease;
}

.play-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(var(--accent-rgb), 0.5);
}

.play-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.play-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.play-btn svg {
  width: 24px;
  height: 24px;
}

.play-btn.is-buffering .icon-play,
.play-btn.is-buffering .icon-pause {
  display: none;
}

.play-btn .icon-spinner {
  display: none;
  animation: spin 0.9s linear infinite;
}

.play-btn.is-buffering .icon-spinner {
  display: block;
}

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

.now-playing {
  min-width: 0;
  flex: 1;
}

.np-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
  font-weight: 600;
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}

.eq-bars span {
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  transition: height 200ms ease;
}

.eq-bars.is-playing span:nth-child(1) {
  animation: eq1 0.85s ease-in-out infinite alternate;
}
.eq-bars.is-playing span:nth-child(2) {
  animation: eq2 0.65s ease-in-out infinite alternate;
}
.eq-bars.is-playing span:nth-child(3) {
  animation: eq3 0.95s ease-in-out infinite alternate;
}
.eq-bars.is-playing span:nth-child(4) {
  animation: eq2 0.72s ease-in-out infinite alternate-reverse;
}

@keyframes eq1 { from { height: 3px; } to { height: 12px; } }
@keyframes eq2 { from { height: 5px; } to { height: 11px; } }
@keyframes eq3 { from { height: 3px; } to { height: 10px; } }

.np-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  flex-wrap: wrap;
}

.volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 180ms ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

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

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  transition: background 180ms ease, border-color 180ms ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--border-strong);
}

.chip-btn.is-accent {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--fg);
}

.chip-btn svg {
  width: 14px;
  height: 14px;
}

.vibe-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.vibe-tag {
  font-size: 12px;
  color: var(--fg-muted);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

/* === Bottom Bar === */
.bottombar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 56px) clamp(18px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.rights-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  line-height: 1.45;
}

.rights-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--accent);
}

.contact-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 1px;
  transition: border-color 180ms ease, color 180ms ease;
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* === Drawers / Modals === */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 5, 8, 0.65);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: min(560px, calc(100vw - 32px));
  border-radius: 24px;
  background: rgba(15, 16, 20, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 28px));
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.drawer-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  transition: background 180ms ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.drawer-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.url-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.url-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
  padding: 9px 12px;
  border-radius: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-mini {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 500;
  transition: background 160ms ease;
}

.copy-mini:hover {
  background: rgba(255, 255, 255, 0.2);
}

.device-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.device-tab {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-muted);
  transition: all 180ms ease;
}

.device-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.guide-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.guide-panel.is-active {
  display: flex;
}

.guide-panel h4 {
  margin: 0;
  font-size: 15px;
  color: var(--fg);
}

.guide-panel ol,
.guide-panel ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-panel code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--fg);
}

.guide-pre {
  margin: 4px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #e5e7eb;
  overflow-x: auto;
}

.rights-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  font-size: 14px;
  line-height: 1.65;
}

.rights-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--fg);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 80;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(20, 22, 26, 0.94);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(16px);
  font-size: 13px;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 780px) {
  .topbar {
    gap: 12px;
  }
  .station-tabs {
    order: 3;
    width: 100%;
  }
  .player-main {
    gap: 14px;
  }
  .play-btn {
    width: 56px;
    height: 56px;
  }
  .drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
  }
}
