/* X FM Naga — bold red & white live radio player */

:root {
  --red: #e4002b;
  --red-bright: #ff2b4d;
  --red-deep: #a3001c;
  --ink: #1b0710;
  --ink-soft: #6b5560;
  --white: #ffffff;
  --white-dim: rgba(255, 255, 255, 0.74);
  --line: rgba(255, 255, 255, 0.28);
  --radius: 28px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --shadow-card: 0 40px 80px -40px rgba(50, 0, 10, 0.7),
    0 2px 0 rgba(255, 255, 255, 0.6) inset;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--white);
  background:
    radial-gradient(1100px 620px at 85% -15%, #ff5570 0%, transparent 62%),
    radial-gradient(900px 500px at -10% 110%, #a3001c 0%, transparent 60%),
    linear-gradient(165deg, #ec1231 0%, #d40024 46%, #9b0018 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Oversized watermark X */
.bg-mark {
  position: fixed;
  inset-block-start: -14vw;
  inset-inline-end: -12vw;
  font-size: 58vw;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.shell,
main,
header {
  position: relative;
  z-index: 1;
}

/* ---------- Top bar ---------- */

.topbar {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: clamp(18px, 3vw, 30px) clamp(18px, 4vw, 44px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  text-decoration: none;
}

/* Station logo sits on a white plaque: the artwork is red on opaque white. */
.brand-logo {
  display: block;
  width: clamp(48px, 6.5vw, 58px);
  height: auto;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 10px 22px -12px rgba(60, 0, 12, 0.8);
}

.brand:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 4px;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  transition: background 0.3s ease, color 0.3s ease;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: pulse 2s infinite;
}

body[data-state="playing"] .live-chip {
  background: var(--white);
  color: var(--red);
  border-color: var(--white);
}

body[data-state="playing"] .live-dot {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(228, 0, 43, 0.5);
  animation: pulse 1.6s infinite;
}

body[data-state="error"] .live-chip {
  background: rgba(0, 0, 0, 0.28);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 7px transparent; opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* ---------- Stage ---------- */

.stage {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 44px) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex: 1;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-dim);
}

.hero-title {
  margin: 0;
  max-width: 100%;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.88;
  text-transform: uppercase;
}

.title-line,
.title-outline {
  display: block;
  font-size: clamp(2.1rem, 7.4vw, 4.9rem);
}

.title-outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.92);
  padding-bottom: 0.06em;
}

@supports not (-webkit-text-stroke: 1px black) {
  .title-outline {
    color: var(--white);
  }
}

/* ---------- Player card ---------- */

.player {
  margin-top: clamp(24px, 4vw, 36px);
  width: min(660px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(16px, 3vw, 24px);
  align-items: center;
  padding: clamp(16px, 2.6vw, 22px);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.art {
  position: relative;
  width: clamp(96px, 15vw, 124px);
  aspect-ratio: 1;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid rgba(27, 7, 16, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 18px 30px -20px rgba(60, 0, 12, 0.5);
}

.art-logo {
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
}

/* Small red equalizer badge so the "playing" state still shows on the logo. */
.eq {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  padding: 4px 5px;
  border-radius: 7px;
  background: var(--red);
  box-shadow: 0 4px 10px -4px rgba(228, 0, 43, 0.95);
}

.eq span {
  display: block;
  width: 2.5px;
  height: 3px;
  border-radius: 2px;
  background: var(--white);
  transition: height 0.3s ease;
}

body[data-state="playing"] .eq span {
  animation: bounce 0.9s ease-in-out infinite alternate;
}

body[data-state="playing"] .eq span:nth-child(1) { animation-delay: -0.1s; }
body[data-state="playing"] .eq span:nth-child(2) { animation-delay: -0.45s; }
body[data-state="playing"] .eq span:nth-child(3) { animation-delay: -0.25s; }
body[data-state="playing"] .eq span:nth-child(4) { animation-delay: -0.6s; }
body[data-state="playing"] .eq span:nth-child(5) { animation-delay: -0.35s; }

@keyframes bounce {
  from { height: 3px; opacity: 0.7; }
  to { height: 10px; opacity: 1; }
}

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

.player-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.onair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--red);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.timer {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.player-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.player-status {
  margin: 4px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
  min-height: 2.6em;
}

/* Controls */

.controls {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 20px);
  margin-top: 12px;
  flex-wrap: wrap;
}

.play-btn {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 26px -14px rgba(228, 0, 43, 0.95);
  transition: transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
}

.play-btn:active {
  transform: scale(0.96);
}

.play-btn:focus-visible,
.mute-btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.play-btn .icon {
  grid-area: 1 / 1;
  width: 26px;
  height: 26px;
}

.icon-pause,
.icon-loading {
  display: none;
}

body[data-state="playing"] .icon-play,
body[data-state="buffering"] .icon-play,
body[data-state="connecting"] .icon-play {
  display: none;
}

body[data-state="playing"] .icon-pause {
  display: block;
}

body[data-state="connecting"] .icon-loading,
body[data-state="buffering"] .icon-loading {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

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

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 160px;
  min-width: 150px;
}

.mute-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(27, 7, 16, 0.06);
  color: var(--red);
  cursor: pointer;
  transition: background 0.2s ease;
}

.mute-btn:hover {
  background: rgba(228, 0, 43, 0.1);
}

.mute-btn .icon {
  grid-area: 1 / 1;
  width: 19px;
  height: 19px;
}

.mute-btn .icon-vol-off {
  display: none;
}

.mute-btn.is-muted .icon-vol {
  display: none;
}

.mute-btn.is-muted .icon-vol-off {
  display: block;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--red) 0 var(--filled, 80%),
    rgba(27, 7, 16, 0.14) var(--filled, 80%) 100%
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(27, 7, 16, 0.28);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(27, 7, 16, 0.28);
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 6px;
}

/* ---------- Facts ---------- */

.facts {
  list-style: none;
  margin: clamp(20px, 3vw, 28px) 0 0;
  padding: 0;
  width: min(660px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.facts li {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.facts span {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-dim);
  margin-bottom: 6px;
}

.facts strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .player {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .art {
    width: 88px;
    border-radius: 18px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }

  .facts span {
    margin-bottom: 0;
  }

  .controls {
    width: 100%;
  }

  .player-status {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  body[data-state="playing"] .eq span {
    height: 8px;
  }
}
