:root {
  --sand: #f6f0e7;
  --sand-dim: rgba(246, 240, 231, 0.78);
  --pink: #ff4db8;
  --teal: #2fd6e8;
  --ink: #07161c;
  --panel: rgba(6, 22, 28, 0.58);
  --font: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--sand);
  background-color: #041116;
  background-image:
    linear-gradient(165deg, rgba(4, 17, 22, 0.35), rgba(4, 17, 22, 0.82)),
    url("https://mosplaceradio.com/background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.ambiance {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(47, 214, 232, 0.18), transparent 42%),
    radial-gradient(circle at 70% 75%, rgba(255, 77, 184, 0.16), transparent 40%);
  animation: drift 14s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-1%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) scale(1.05); }
}

.shell {
  position: relative;
  width: min(24rem, 100%);
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.75rem;
  padding: 1.35rem 1.2rem 1.25rem;
  backdrop-filter: blur(14px) saturate(1.15);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: rise 700ms ease both;
}

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

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(47, 214, 232, 0.35);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-pill.is-on {
  border-color: rgba(255, 77, 184, 0.55);
  color: #fff;
  background: rgba(255, 77, 184, 0.18);
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(47, 214, 232, 0.7);
  animation: pulse 1.6s ease-out infinite;
}

.live-pill.is-on .live-dot {
  background: var(--pink);
  box-shadow: 0 0 0 0 rgba(255, 77, 184, 0.7);
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(47, 214, 232, 0.65); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(47, 214, 232, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(47, 214, 232, 0); }
}

.logo {
  width: min(13.5rem, 72vw);
  height: min(13.5rem, 72vw);
  object-fit: contain;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  background: #000;
  box-shadow:
    0 0 0 4px rgba(47, 214, 232, 0.55),
    0 0 36px rgba(47, 214, 232, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.45);
  animation: logoIn 900ms ease both;
}

@keyframes logoIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.tagline {
  margin: 0 0 1.6rem;
  color: var(--sand-dim);
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 450;
  display: grid;
  gap: 0.35rem;
}

.tagline-main {
  color: var(--sand);
  font-size: 1.15rem;
  font-weight: 700;
}

.tagline-sub {
  color: var(--sand-dim);
  font-size: 0.98rem;
  font-weight: 450;
}

.play {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: min(10.75rem, 62vw);
  height: min(10.75rem, 62vw);
  border-radius: 50%;
  background: linear-gradient(160deg, #fff7ef, #f0e2d2);
  color: var(--ink);
  box-shadow:
    0 0 0 10px rgba(255, 77, 184, 0.16),
    0 16px 34px rgba(0, 0, 0, 0.4);
  display: grid;
  place-content: center;
  gap: 0.45rem;
  margin: 0 auto;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.play:hover { transform: translateY(-2px) scale(1.01); }
.play:active { transform: scale(0.98); }

.play.is-playing {
  background: linear-gradient(160deg, #ff79d0, #ff3fad);
  color: #fff;
  box-shadow:
    0 0 0 12px rgba(255, 77, 184, 0.2),
    0 0 40px rgba(255, 77, 184, 0.35),
    0 16px 34px rgba(0, 0, 0, 0.4);
}

.play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.8rem 0 0.8rem 1.25rem;
  border-color: transparent transparent transparent currentColor;
  margin-left: 0.2rem;
  justify-self: center;
}

.play.is-playing .play-icon {
  width: 1.05rem;
  height: 1.05rem;
  border: 0;
  margin-left: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 0.32rem 100% no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 0.32rem 100% no-repeat;
}

.play-label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eq {
  display: none;
  align-items: end;
  justify-content: center;
  gap: 0.22rem;
  height: 1.35rem;
}

.play.is-playing .eq { display: inline-flex; }
.play.is-playing .play-icon { display: none; }

.eq i {
  display: block;
  width: 0.22rem;
  height: 0.35rem;
  border-radius: 99px;
  background: currentColor;
  animation: eq 0.9s ease-in-out infinite;
}

.eq i:nth-child(1) { animation-delay: 0s; }
.eq i:nth-child(2) { animation-delay: 0.12s; }
.eq i:nth-child(3) { animation-delay: 0.24s; }
.eq i:nth-child(4) { animation-delay: 0.08s; }
.eq i:nth-child(5) { animation-delay: 0.2s; }

@keyframes eq {
  0%, 100% { height: 0.3rem; }
  50% { height: 1.2rem; }
}

.status {
  margin: 1.15rem 0 0;
  min-height: 1.4rem;
  color: var(--sand-dim);
  font-size: 0.95rem;
  font-weight: 600;
}

.status.is-live { color: var(--teal); }

.now-playing {
  margin: 1.2rem auto 0;
  width: min(100%, 20rem);
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(47, 214, 232, 0.22);
}

.np-label {
  margin: 0 0 0.35rem;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.np-title {
  margin: 0;
  color: var(--sand);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.np-artist {
  margin: 0.25rem 0 0;
  color: var(--sand-dim);
  font-size: 0.92rem;
  font-weight: 500;
  min-height: 1.2rem;
}

.actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.action:hover { transform: translateY(-1px); }

.action.request {
  color: var(--ink);
  background: linear-gradient(90deg, var(--teal), #7af0ff);
  border: 0;
}

.action.share {
  color: #fff;
  background: linear-gradient(90deg, #ff4db8, #ff7a3c);
  border: 0;
}

.action.install {
  color: var(--sand);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(246, 240, 231, 0.28);
}

.action.install:hover {
  border-color: rgba(255, 77, 184, 0.65);
}

.share-panel {
  display: none;
  margin-top: 1rem;
  text-align: left;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 77, 184, 0.3);
  border-radius: 1.1rem;
  padding: 1rem 0.95rem 0.95rem;
}

.share-panel.is-open,
.share-panel:not([hidden]) {
  display: block;
  animation: rise 280ms ease both;
}

.share-panel[hidden] {
  display: none !important;
}

.share-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--sand);
}

.share-blurb {
  margin: 0.35rem 0 0.9rem;
  color: var(--sand-dim);
  font-size: 0.92rem;
}

.share-hint {
  margin: 0.35rem 0 0.55rem;
  color: rgba(246, 240, 231, 0.68);
  font-size: 0.82rem;
  line-height: 1.35;
}

.share-field {
  display: grid;
  gap: 0.35rem;
  margin: 0.65rem 0 0.45rem;
  color: var(--sand-dim);
  font-size: 0.88rem;
  font-weight: 600;
}

.share-field input {
  width: 100%;
  border: 1px solid rgba(246, 240, 231, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sand);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 1rem;
}

.share-field input::placeholder {
  color: rgba(246, 240, 231, 0.45);
}

.share-option {
  appearance: none;
  width: 100%;
  min-height: 2.7rem;
  margin-top: 0.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--sand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.share-option:hover {
  background: rgba(255, 255, 255, 0.18);
}

.share-option.quiet {
  background: transparent;
  border: 1px solid rgba(246, 240, 231, 0.25);
}

.share-close {
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--sand-dim);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: 0.55rem;
}

.install-help {
  margin-top: 1.1rem;
  text-align: left;
  color: var(--sand-dim);
  font-size: 0.92rem;
  line-height: 1.45;
  border-radius: 1rem;
  padding: 0.35rem 0.15rem;
}

.install-help summary {
  cursor: pointer;
  list-style: none;
  color: var(--sand);
  font-weight: 700;
  text-align: center;
  padding: 0.55rem;
}

.install-help summary::-webkit-details-marker { display: none; }

.install-help[open] {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 77, 184, 0.28);
  padding: 0.75rem 0.9rem 0.95rem;
}

.install-help.is-highlighted {
  background: rgba(255, 77, 184, 0.14);
  border: 1px solid rgba(255, 77, 184, 0.45);
}

.install-steps {
  margin: 0.55rem 0 0;
  padding-left: 1.3rem;
  color: var(--sand);
}

.install-steps li { margin: 0.5rem 0; }
.install-steps li::marker { color: var(--pink); font-weight: 700; }

.install-note {
  margin-top: 0.8rem;
  color: rgba(246, 240, 231, 0.68);
  font-size: 0.86rem;
}

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

@media (prefers-reduced-motion: reduce) {
  .ambiance, .shell, .logo, .live-dot, .eq i {
    animation: none !important;
  }
}
