:root {
  --fondo: #000000;
  --card: #121216;
  --card-2: #0b0b0e;
  --testo: #f3f1ec;
  --tenue: rgba(243, 241, 236, 0.56);
  --debole: rgba(243, 241, 236, 0.3);
  --linea: rgba(255, 255, 255, 0.08);
  --accento: #b9a7ff;
  --accento-scuro: #6f5ce0;
  --notte: #1b1838;
}

* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(13px, min(1.35vw, 2.5vh), 18px); }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(25rem, 88vw);
  padding: 1.15rem 1.15rem 1rem;
  border-radius: 1.6rem;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--linea);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 60px -28px rgba(111, 92, 224, 0.45),
    0 18px 40px -20px rgba(0, 0, 0, 0.9);
  isolation: isolate;
}
.card__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(70% 55% at var(--gx, 20%) var(--gy, 0%), rgba(185, 167, 255, 0.16), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.card__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}
.card__dim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(4, 3, 14, 0.62);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

/* ---- head: cover and titles ---- */
.head { display: flex; align-items: center; gap: 1rem; }
.cover {
  position: relative;
  width: 5.2rem;
  height: 5.2rem;
  flex: none;
}
.cover__art {
  position: absolute;
  inset: 0.32rem;
  border-radius: 0.95rem;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 10%, #3b2f8f 0%, transparent 60%),
    linear-gradient(180deg, #221c55 0%, #0e0c26 100%);
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.cover__moon {
  position: absolute;
  top: 18%;
  right: 20%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff8e6 0%, #e9dcc0 60%, #c8b894 100%);
  box-shadow: 0 0 14px 2px rgba(255, 240, 210, 0.35);
}
.cover__tide {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 14%;
  height: 26%;
  border-top: 1.5px solid rgba(185, 167, 255, 0.55);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.cover__tide--2 { bottom: 4%; border-top-color: rgba(185, 167, 255, 0.3); }

.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring rect { fill: none; stroke-width: 2; }
.ring__track { stroke: rgba(255, 255, 255, 0.06); }
.ring__run {
  stroke: var(--accento);
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(185, 167, 255, 0.55));
}

.titles { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.show { font-size: 0.72rem; letter-spacing: 0.02em; color: var(--accento); font-weight: 560; }
.episode { font-size: 1.12rem; font-weight: 640; font-stretch: 96%; line-height: 1.15; }
.meta { font-size: 0.74rem; color: var(--tenue); display: flex; gap: 0.35rem; font-variant-numeric: tabular-nums; }
.dot-sep { color: var(--debole); }

/* ---- scrubber ---- */
.scrub { margin-top: 1.05rem; }
.scrub__bar {
  position: relative;
  height: 0.28rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.09);
}
.scrub__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
}
.scrub__knob {
  position: absolute;
  top: 50%;
  left: 40%;
  width: 0.7rem;
  height: 0.7rem;
  margin: -0.35rem 0 0 -0.35rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.scrub__times {
  margin-top: 0.42rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--debole);
  font-variant-numeric: tabular-nums;
}

/* ---- controls ---- */
.controls {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
}
.ctl { display: grid; place-items: center; border-radius: 50%; transition: background-color 0.2s; }
.ctl--small { width: 2.5rem; height: 2.5rem; justify-self: center; }
.ctl--small svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: var(--testo); stroke-width: 1.6; stroke-linecap: round; }
.ctl--small svg .fill { fill: var(--testo); stroke: none; }
.ctl--small svg text { fill: var(--testo); stroke: none; font-size: 6.2px; font-weight: 700; font-family: inherit; }
.ctl--play {
  width: 3.6rem;
  height: 3.6rem;
  background: var(--testo);
  color: #121216;
  box-shadow: 0 10px 24px -10px rgba(185, 167, 255, 0.6), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.ctl__in { position: relative; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; }
.ctl__in svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; }
.i-play { opacity: 0; }

.sleep {
  height: 2.5rem;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background-color 0.25s, border-color 0.25s;
}
.sleep__in { display: flex; align-items: center; gap: 0.42rem; }
.moon { width: 1.15rem; height: 1.15rem; fill: var(--testo); overflow: visible; }
.moon .star { fill: var(--accento); opacity: 0; transform-box: fill-box; transform-origin: center; }
.sleep__time { font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.7em; text-align: left; }
.sleep.is-on { background: rgba(185, 167, 255, 0.14); border-color: rgba(185, 167, 255, 0.35); }
.sleep.is-on .sleep__time { color: var(--accento); }

@media (hover: hover) {
  .ctl--small:hover, .sleep:hover { background-color: rgba(255, 255, 255, 0.1); }
}

/* ---- the drawer with the chips ---- */
.drawer { height: 0; overflow: hidden; }
.drawer__in { padding-top: 0.85rem; }
.drawer__label { display: block; font-size: 0.68rem; color: var(--tenue); letter-spacing: 0.02em; margin-bottom: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  height: 2rem;
  padding: 0 0.8rem;
  border-radius: 2rem;
  font-size: 0.76rem;
  font-weight: 560;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.chip.is-picked { background: var(--accento); border-color: var(--accento); color: #15112e; }
@media (hover: hover) {
  .chip:not(.is-picked):hover { background: rgba(255, 255, 255, 0.11); }
}

/* ---- goodnight ---- */
.night {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.8rem);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 2rem;
  background: rgba(27, 24, 56, 0.92);
  border: 1px solid rgba(185, 167, 255, 0.25);
  font-size: 0.78rem;
  font-weight: 560;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.night svg { width: 0.95rem; height: 0.95rem; fill: var(--accento); }

/* ---- the drawn pointer of the autopilot ---- */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  fill: #fff;
  stroke: #111;
  stroke-width: 1.1;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
