:root {
  color-scheme: dark;
  --gold: #f1aa24;
  --gold-light: #ffd369;
  --ink: #090806;
  --panel: #15130f;
  --muted: #b9b5ad;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 50% 28%, rgba(127, 73, 11, .34), transparent 36%),
    linear-gradient(180deg, #17140f 0, #080706 72%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

button,
a { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  width: min(100%, 560px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  padding: max(18px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-header {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
}

.round-link {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #5e421b;
  border-radius: 50%;
  background: rgba(16, 14, 11, .82);
  color: var(--gold-light);
  text-decoration: none;
  font-size: 22px;
  cursor: pointer;
}

.round-link:hover,
.round-link:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(241, 170, 36, .38);
  outline: 0;
}

.share-button { justify-self: end; }

.mini-brand {
  justify-self: center;
  text-align: center;
  line-height: .82;
  transform: skew(-4deg);
}

.mini-brand span {
  display: block;
  color: #dedbd4;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 4px;
}

.mini-brand strong {
  color: var(--gold);
  font-size: 35px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 #4a2b07, 0 0 18px rgba(241, 170, 36, .25);
}

.radio-card {
  width: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 8px;
}

.cover {
  position: relative;
  width: min(72vw, 330px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #9b6516;
  border-radius: 28px;
  background: #111;
  box-shadow: 0 20px 55px #000, 0 0 34px rgba(241, 170, 36, .22);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 201, 97, .18) 50%, transparent 68%);
  transform: translateX(-130%);
  animation: cover-light 7s ease-in-out infinite;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.02);
  animation: cover-motion 8s ease-in-out infinite alternate;
}

.live-pill {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(0,0,0,.74);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f02018;
  box-shadow: 0 0 0 5px rgba(240,32,24,.16);
  animation: live-pulse 1.3s ease-in-out infinite;
}

.now-playing {
  width: 100%;
  margin-top: 20px;
  text-align: center;
}

.now-playing span,
.now-playing small {
  display: block;
  color: var(--muted);
}

.now-playing span {
  font-size: 13px;
  font-weight: 700;
}

.now-playing strong {
  display: block;
  margin: 5px 0;
  color: #fff;
  font-size: clamp(18px, 5vw, 25px);
}

.now-playing small {
  font-size: 12px;
}

.visualizer {
  height: 25px;
  margin: 13px 0 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.visualizer i {
  width: 4px;
  height: 20%;
  border-radius: 4px;
  background: linear-gradient(#ffd05e, #dc8d11);
  opacity: .4;
  animation: bars .75s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.visualizer.playing i {
  opacity: 1;
  animation-play-state: running;
}

.visualizer i:nth-child(2n) { animation-delay: -.4s; }
.visualizer i:nth-child(3n) { animation-delay: -.2s; }
.visualizer i:nth-child(4n) { animation-delay: -.6s; }

.pwa-play {
  position: relative;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle, #2f2619, #080808 68%);
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  box-shadow: inset 0 0 0 5px #69420c, 0 0 22px rgba(241, 170, 36, .68), 0 12px 28px #000;
}

.pwa-play::before,
.pwa-play::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(241, 170, 36, .55);
  border-radius: 50%;
  opacity: 0;
}

.pwa-play.playing::before { animation: play-wave 1.7s ease-out infinite; }
.pwa-play.playing::after { animation: play-wave 1.7s .75s ease-out infinite; }

.play-symbol {
  margin-left: 7px;
  line-height: 1;
}

.pause-symbol {
  display: none;
  margin-left: -5px;
  letter-spacing: -8px;
  line-height: 1;
}

.pwa-play.playing .play-symbol { display: none; }
.pwa-play.playing .pause-symbol { display: block; }

.player-status {
  min-height: 16px;
  margin-top: 12px;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.volume-control {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-control input {
  width: 110px;
  accent-color: var(--gold);
}

.pwa-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 18px;
}

.pwa-socials a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(0,0,0,.45);
  transition: transform .2s ease;
}

.pwa-socials a:hover { transform: translateY(-3px); }
.pwa-socials .wa { background: #1fb358; }
.pwa-socials .ig { background: linear-gradient(135deg, #7048c6, #e33178, #f2a83b); }
.pwa-socials .yt { padding-left: 3px; border-radius: 13px; background: #ed111d; }
.pwa-socials .tk { background: #050505; text-shadow: -2px 0 #25f4ee, 2px 0 #fe2c55; }

.install-primary {
  width: min(100%, 410px);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid #ffcf69;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffc758, #d98912);
  color: #231304;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 22px rgba(241,170,36,.16);
}

.install-primary > span:first-child {
  font-size: 25px;
}

.install-primary strong,
.install-primary small {
  display: block;
  text-align: left;
}

.install-primary strong { font-size: 14px; }
.install-primary small { margin-top: 3px; font-size: 10px; }

footer {
  margin-top: 15px;
  color: #817d76;
  font-size: 10px;
  text-align: center;
}

.install-sheet[hidden] { display: none; }

.install-sheet {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
}

.install-panel {
  position: relative;
  width: min(100%, 460px);
  padding: 22px;
  border: 1px solid #8b5a15;
  border-radius: 24px;
  background: linear-gradient(160deg, #211b13, #0b0a08 68%);
  text-align: center;
  box-shadow: 0 20px 55px #000;
  animation: sheet-in .32s ease-out both;
}

.install-panel img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 8px 18px #000;
}

.install-panel h2 { margin: 12px 0 7px; color: var(--gold-light); }
.install-panel p { margin: 0 auto 18px; color: #ccc6bb; font-size: 13px; line-height: 1.45; }

.install-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}

.install-confirm {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(#ffc859, #d88b14);
  color: #261600;
  font-weight: 900;
  cursor: pointer;
}

.install-help {
  display: block;
  min-height: 14px;
  margin-top: 10px;
  color: #aaa49b;
  font-size: 10px;
}

.dialog-open { overflow: hidden; }

@keyframes cover-motion {
  to { transform: scale(1.07) translate3d(-3px, -2px, 0); }
}

@keyframes cover-light {
  0%, 60% { transform: translateX(-130%); opacity: 0; }
  72% { opacity: 1; }
  90%, 100% { transform: translateX(130%); opacity: 0; }
}

@keyframes live-pulse {
  50% { opacity: .45; box-shadow: 0 0 0 8px rgba(240,32,24,.08); }
}

@keyframes bars {
  from { height: 15%; }
  to { height: 100%; }
}

@keyframes play-wave {
  from { opacity: .8; transform: scale(.93); }
  to { opacity: 0; transform: scale(1.38); }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(35px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 760px) {
  .app {
    width: min(100%, 980px);
  }

  .cover {
    width: 310px;
  }

  .radio-card {
    padding-top: 8px;
  }

  .install-sheet {
    align-items: center;
  }
}

@media (max-height: 720px) {
  .cover {
    width: min(54vw, 230px);
  }

  .now-playing {
    margin-top: 12px;
  }

  .pwa-play {
    width: 72px;
    height: 72px;
    font-size: 29px;
  }

  .visualizer {
    margin-top: 8px;
  }

  .pwa-socials {
    margin-bottom: 10px;
  }
}

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