:root {
  --ink: #f8f4ee;
  --muted: #b6aaa0;
  --orange: #ef6b2e;
  --orange-bright: #ff8a42;
  --red: #db352d;
  --panel: rgba(34, 27, 22, 0.9);
  --line: rgba(255, 255, 255, 0.11);
  --focus: #ffd37b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(239, 107, 46, 0.19), transparent 32rem),
    radial-gradient(circle at 85% 82%, rgba(163, 35, 29, 0.16), transparent 36rem),
    linear-gradient(135deg, #17110d 0%, #080706 100%);
  font-family: "Trebuchet MS", Arial, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: repeating-linear-gradient(115deg, transparent 0, transparent 34px, rgba(255,255,255,.025) 35px, transparent 36px);
}

button { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
  padding: clamp(22px, 4vw, 72px);
  position: relative;
}

.brand {
  position: absolute;
  top: 32px;
  right: 40px;
  top: clamp(20px, 4vw, 52px);
  right: clamp(20px, 4vw, 60px);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.28;
  transform: rotate(4deg);
}

.brand-mark {
  width: 68px;
  height: 68px;
  border: 5px solid var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 900 42px/1 Arial, sans-serif;
  color: var(--orange);
}

.brand-lines { width: 76px; height: 42px; border-top: 5px solid var(--orange); border-bottom: 5px solid var(--orange); }

.player-card {
  width: 100%;
  max-width: 1050px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 52px;
  padding: clamp(28px, 5vw, 68px);
  background: linear-gradient(145deg, rgba(43, 33, 27, .96), rgba(20, 16, 13, .96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255,255,255,.06);
  position: relative;
  overflow: hidden;
}

.player-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -110px;
  bottom: -145px;
  border-radius: 50%;
  border: 42px solid rgba(239, 107, 46, .06);
  pointer-events: none;
}

.station-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 26px; }
.eyebrow, .label { margin: 0; letter-spacing: .19em; font-weight: 800; color: var(--orange-bright); }
.eyebrow { font-size: 14px; font-size: clamp(12px, 1.4vw, 16px); }
h1 { margin: 7px 0 0; font: 900 72px/.9 Arial, sans-serif; font-size: clamp(48px, 8vw, 94px); letter-spacing: -.055em; }
h1 span { color: var(--orange); }
.tagline { margin: 12px 0 0; color: var(--muted); font-size: 20px; font-size: clamp(17px, 2vw, 24px); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(0,0,0,.22);
  color: #d8cec5;
  font-weight: 800;
  white-space: nowrap;
}

.status-dot, .footer-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #8e8278; }
.status-badge.is-live .status-dot { background: #53d486; box-shadow: 0 0 0 5px rgba(83,212,134,.12); animation: pulse 1.8s infinite; }
.status-badge.is-connecting .status-dot { background: #ffbd52; animation: pulse 1s infinite; }
.status-badge.is-error .status-dot { background: #ef5e56; }

.track-artwork { width: 112px; height: 112px; flex: 0 0 112px; border-radius: 14px; overflow: hidden; background: #17110d; box-shadow: 0 14px 30px rgba(0,0,0,.34); }
.track-artwork img { display: block; width: 100%; height: 100%; object-fit: cover; }
.track-copy { min-width: 0; flex: 1; }
.track-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.metadata-updated { color: #8f837a; font-size: 12px; white-space: nowrap; }
.track-copy h2 { margin: 8px 0 5px; font-size: 34px; font-size: clamp(25px, 3.4vw, 40px); line-height: 1.08; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-copy > p:last-child { margin: 0; color: var(--orange-bright); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.now-playing {
  margin: 42px 0;
  padding: 28px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-left: 5px solid var(--orange);
  border-radius: 16px;
  background: rgba(0,0,0,.22);
  display: flex;
  align-items: center;
  gap: 26px;
  gap: clamp(22px, 4vw, 46px);
}

.label { font-size: 12px; }

.controls { display: flex; align-items: stretch; justify-content: space-between; gap: 22px; }
.primary-controls { min-width: 0; flex: 1; display: flex; align-items: stretch; gap: 14px; }
.play-button, .secondary-button { border: 0; cursor: pointer; color: white; transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease; }
.play-button {
  min-width: 360px;
  min-height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 18px 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange-bright), var(--red));
  box-shadow: 0 16px 34px rgba(197, 60, 33, .26);
  font-size: 27px;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 900;
}
.play-button svg { width: 36px; height: 36px; fill: currentColor; }
.pause-icon { display: none; }
.is-playing .play-icon { display: none; }
.is-playing .pause-icon { display: block; }

.playback-visualizer {
  width: 108px;
  min-width: 108px;
  height: 84px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
}
.playback-visualizer i { width: 9px; height: 9px; border-radius: 999px; background: var(--orange); opacity: .38; }
.is-playing .playback-visualizer i { border-radius: 6px; opacity: 1; animation: bars .85s ease-in-out infinite alternate; }
.is-playing .playback-visualizer i:nth-child(2) { animation-delay: -.6s; }
.is-playing .playback-visualizer i:nth-child(3) { animation-delay: -.25s; }
.is-playing .playback-visualizer i:nth-child(4) { animation-delay: -.75s; }
.is-playing .playback-visualizer i:nth-child(5) { animation-delay: -.4s; }

.secondary-controls { display: flex; gap: 12px; }
.secondary-button {
  min-height: 70px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.065);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #e6ddd5;
  font-weight: 800;
}
.secondary-button svg { width: 22px; height: 22px; fill: currentColor; }
.play-button:hover, .play-button:focus { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(197, 60, 33, .36); }
.secondary-button:hover, .secondary-button:focus { background: rgba(255,255,255,.12); }
button:focus-visible { outline: 4px solid var(--focus); outline-offset: 5px; }
button:active { transform: translateY(1px); }

.player-footer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: #91857c; font-size: 14px; }
.player-footer p { margin: 0; }
.footer-dot { width: 7px; height: 7px; margin-right: 8px; background: var(--orange); }
.shortcut strong { color: #d6ccc3; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; }

.recent-section { margin-top: 30px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.18); }
.recent-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 17px; }
.recent-heading h2 { margin: 5px 0 0; font-size: 23px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.recent-item { min-width: 0; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.045); }
.recent-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 9px; background: #17110d; }
.recent-item span { display: block; overflow: hidden; color: #cfc4bc; font-size: 12px; line-height: 1.35; }
.recent-placeholder { grid-column: 1 / -1; padding: 14px; color: #8f837a; text-align: center; }

.install-dialog { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.install-backdrop { position: absolute; inset: 0; background: rgba(5, 4, 3, .78); backdrop-filter: blur(8px); }
.install-panel {
  width: 100%;
  max-width: 470px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px;
  background: linear-gradient(145deg, #2b211b, #14100d);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.install-panel h2 { margin: 8px 42px 22px 0; font-size: 30px; line-height: 1.15; }
.install-panel ol { margin: 0 0 26px; padding-left: 23px; color: #d9cfc7; line-height: 1.55; }
.install-panel li + li { margin-top: 12px; }
.install-close { position: absolute; top: 16px; right: 18px; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #e8ded6; background: rgba(255,255,255,.08); font-size: 28px; cursor: pointer; }
.install-app-icon { width: 68px; height: 68px; margin-bottom: 22px; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.32); }
.install-app-icon img { display: block; width: 100%; height: 100%; }
.dialog-button { width: 100%; min-height: 54px; border: 0; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--orange-bright), var(--red)); font-weight: 900; cursor: pointer; }

@keyframes bars { from { height: 20%; } to { height: 92%; } }
@keyframes pulse { 50% { opacity: .45; } }

@media (max-width: 720px) {
  .app-shell { padding: 14px; }
  .brand { display: none; }
  .player-card { border-radius: 19px; padding: 26px 21px; }
  .station-header { align-items: center; }
  .tagline { display: none; }
  .status-badge { padding: 8px 11px; font-size: 13px; }
  .now-playing { align-items: flex-start; gap: 18px; }
  .track-artwork { width: 82px; height: 82px; flex-basis: 82px; }
  .track-heading { display: block; }
  .metadata-updated { display: block; margin-top: 5px; white-space: normal; }
  .track-copy h2, .track-copy > p:last-child { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .controls { flex-direction: column; }
  .primary-controls { width: 100%; }
  .play-button { min-width: 0; flex: 1; }
  .playback-visualizer { width: 82px; min-width: 82px; }
  .secondary-controls { width: 100%; }
  .secondary-controls { flex-wrap: wrap; }
  .secondary-button { flex: 1; padding: 10px; }
  .install-panel { padding: 28px 24px; }
  .recent-list { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .recent-item { min-width: 132px; }
  .player-footer { flex-direction: column; }
  .shortcut { display: none; }
}

@media (max-width: 360px) {
  h1 { font-size: 42px; }
  .now-playing { display: block; }
  .track-artwork { width: 108px; height: 108px; margin-bottom: 18px; }
  .track-heading { display: flex; align-items: flex-start; }
  .track-copy h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
