:root {
    --bg: #f4f0e6;
    --bg-accent: #e5ddd0;
    --card: rgba(255, 250, 243, 0.78);
    --card-edge: rgba(69, 85, 97, 0.14);
    --brand: #0077b6;
    --brand-deep: #0d4f7a;
    --signal: #f2b34f;
    --text: #18232d;
    --muted: #61707c;
    --soft: #e8ecef;
    --warning: #b98500;
    --danger: #c65252;
    --ok: #2d8f61;
    --shadow: 0 30px 80px rgba(39, 53, 62, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.82), transparent 26%),
    linear-gradient(140deg, #fcf8f1 0%, #eef2f4 48%, #e6eef4 100%);
  position: relative;
  overflow: hidden;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}

.ambient-blob,
.ambient-grid,
.ambient-glow {
  position: absolute;
}

.ambient-blob {
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.8;
  mix-blend-mode: multiply;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-blob-one {
  top: -12rem;
  left: -10rem;
  width: 38rem;
  height: 38rem;
  background: radial-gradient(circle at 35% 35%, rgba(0, 119, 182, 0.34), rgba(0, 119, 182, 0.06) 48%, rgba(0, 119, 182, 0) 74%);
}

.ambient-blob-two {
  right: -8rem;
  bottom: -12rem;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(circle at 40% 40%, rgba(242, 179, 79, 0.26), rgba(242, 179, 79, 0.05) 48%, rgba(242, 179, 79, 0) 74%);
  animation-duration: 22s;
}

.ambient-bg .ambient-blob:nth-of-type(3) {
  display: none;
}

.ambient-blob-one::before,
.ambient-blob-two::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ambient-blob-one::after,
.ambient-blob-two::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1px solid rgba(24, 35, 45, 0.06);
}

.ambient-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 35, 45, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 35, 45, 0.022) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.8;
  mask-image: radial-gradient(circle at center, black 18%, rgba(0, 0, 0, 0.72) 52%, transparent 100%);
}

.ambient-glow {
  inset: auto 12% 8%;
  height: 14rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  filter: blur(54px);
}

.ambient-bg::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(70vw, 40rem);
  height: min(70vw, 40rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.08) 34%, rgba(255, 255, 255, 0) 68%);
  border: 1px solid rgba(13, 79, 122, 0.07);
  box-shadow:
    0 0 0 2rem rgba(13, 79, 122, 0.04),
    0 0 0 6rem rgba(13, 79, 122, 0.022),
    0 0 120px rgba(255, 255, 255, 0.28);
}

.ambient-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.24), transparent 28%),
    conic-gradient(from 180deg at 50% 50%, rgba(0, 119, 182, 0.08), rgba(255, 255, 255, 0), rgba(242, 179, 79, 0.08), rgba(255, 255, 255, 0), rgba(0, 119, 182, 0.08));
  opacity: 0.7;
  filter: blur(18px);
}

.player-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2rem, 1.5rem, 0) scale(1.06);
  }
}

@keyframes livePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(45, 143, 97, 0);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 0 8px rgba(45, 143, 97, 0.08);
  }
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.player-card {
  width: min(100%, 332px);
  padding: 1.25rem;
  border: 1px solid var(--card-edge);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(145%);
  position: relative;
}

.player-topline {
  margin-bottom: 0.9rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #476270;
  text-align: center;
}

.cover-shell {
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
/*  background: rgb(19, 79, 174);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 34px rgba(22, 55, 69, 0.18);*/
}

.cover-art {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 0.2rem;
}

.title-block {
  display: none;
  text-align: center;
  margin-bottom: 1.15rem;
  gap: 0.28rem;
  justify-items: center;
}

h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.2;
}

.controls-panel,
.status-card {
  border: 1px solid rgba(19, 79, 174, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.controls-panel {
  padding: 0.9rem;
}

.control-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 0.75rem;
  align-items: center;
}

.icon-button,
.play-button {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7f9fa, #e9edf0);
  color: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
}

.is-hidden {
  display: none;
}

.play-button {
  min-height: 48px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  padding: 0 0.9rem;
  box-shadow: 0 10px 24px rgba(19, 79, 174, 0.22);
}

.volume-wrap {
  display: grid;
  gap: 0.55rem;
  margin: 0.95rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(19, 79, 174, 0.08);
}

.control-label,
.status-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c7080;
}

.volume-wrap input {
  width: 100%;
  accent-color: var(--brand);
}

.volume-wrap input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), rgba(19, 79, 174, 0.45) 70%, #d4dde2);
}

.volume-wrap input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
}

.volume-wrap input::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), rgba(19, 79, 174, 0.45) 70%, #d4dde2);
}

.volume-wrap input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
}

.status-block {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  text-align: center;
}

.status-card {
  margin-top: 0.95rem;
  padding: 0.9rem;
}

.status-pill {
  width: 100%;
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(23, 33, 41, 0.05);
  border: 1px solid rgba(23, 33, 41, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.status-pill.is-live {
  color: #1f5f40;
  background: rgba(45, 143, 97, 0.12);
  border-color: rgba(45, 143, 97, 0.22);
  animation: livePulse 2.4s ease-in-out infinite;
}

.status-pill.is-retrying {
  color: #8a6400;
  background: rgba(185, 133, 0, 0.11);
  border-color: rgba(185, 133, 0, 0.22);
}

.status-pill.is-error {
  color: #a04040;
  background: rgba(198, 82, 82, 0.11);
  border-color: rgba(198, 82, 82, 0.22);
}

.sr-only-player {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button:hover,
.play-button:hover {
  filter: brightness(0.96);
}

.icon-button:active,
.play-button:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .ambient-blob,
  .status-pill.is-live {
    animation: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 1rem;
  }

  .player-card {
    width: min(100%, 340px);
  }

  .ambient-blob-one {
    width: 24rem;
    height: 24rem;
    top: -5rem;
    left: -7rem;
  }

  .ambient-blob-two {
    width: 22rem;
    height: 22rem;
    right: -8rem;
    bottom: -10rem;
  }

  .ambient-grid {
    background-size: 56px 56px;
  }

  .ambient-glow {
    inset: auto 8% 14%;
    height: 9rem;
  }

  .ambient-bg::before {
    width: min(92vw, 24rem);
    height: min(92vw, 24rem);
  }
}
