:root {
  --card: clamp(78px, 8.2vw, 118px);
  --gap: clamp(10px, 1.1vw, 16px);
  --step: calc(var(--card) + var(--gap));
  --glow: 0 0 6px rgba(255, 255, 255, .9), 0 0 18px rgba(255, 120, 200, .75), 0 0 42px rgba(255, 80, 170, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  overflow: hidden;
  color: #fff;
  font-family: "Montserrat", system-ui, sans-serif;
  background: #2a1d4a;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Fondo ---------- */
.bg {
  position: fixed;
  inset: 0;
  background: url("img/Jason_and_Lucia_Robbery_landscape.09c8a~do21h4p.avif") 62% center / cover no-repeat;
  transform: scale(1.04);
  animation: drift 40s ease-in-out infinite alternate;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(40, 20, 80, .45) 0%, rgba(40, 20, 80, 0) 45%),
    linear-gradient(0deg, rgba(14, 6, 30, .88) 0%, rgba(14, 6, 30, .35) 28%, rgba(14, 6, 30, 0) 45%);
}
@keyframes drift { to { transform: scale(1.09) translateX(-1%); } }

/* ---------- Título ---------- */
.title {
  position: fixed;
  top: clamp(24px, 6vh, 70px);
  left: clamp(20px, 6vw, 120px);
  width: clamp(280px, 40vw, 720px);
  z-index: 2;
}
.title__top {
  font-weight: 500;
  font-size: clamp(14px, 2.15vw, 38px);
  letter-spacing: .55em;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 255, 255, .35);
  margin-bottom: clamp(8px, 2vh, 26px);
}
.title__logo { position: relative; padding-left: 6%; }
.title__vi {
  display: block;
  width: 78%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.9)) drop-shadow(0 0 16px rgba(255,140,210,.7));
}
.title__vi polygon {
  fill: rgba(255, 255, 255, .04);
  stroke: #fff;
  stroke-width: 9;
  stroke-linejoin: miter;
}
.title__script {
  position: absolute;
  left: -2%;
  top: 30%;
  width: 100%;
  transform: rotate(-9deg);
  pointer-events: none;
}
.title__script span {
  display: block;
  font-family: "Yellowtail", cursive;
  font-size: clamp(64px, 10.5vw, 190px);
  line-height: 1;
  padding-left: 14%;
  color: #fff;
  text-shadow: var(--glow);
  animation: flicker 7s infinite;
}
.title__swash {
  display: block;
  width: 92%;
  height: clamp(18px, 3vw, 54px);
  margin-top: -3%;
  margin-left: 4%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.9)) drop-shadow(0 0 14px rgba(255,120,200,.7));
}
.title__swash path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; }

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } 97% { opacity: 1; }
}

/* ---------- Selector ---------- */
.tuner {
  position: fixed;
  left: 50%;
  bottom: clamp(36px, 7vh, 80px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.wheel {
  position: relative;
  display: flex;
  align-items: center;
  height: calc(var(--card) * 1.2 + 16px);
  padding: 0 6px;
  background: linear-gradient(180deg, rgba(10, 6, 20, .55), rgba(10, 6, 20, .7));
  backdrop-filter: blur(6px);
  border-radius: 6px;
}

.cards {
  position: relative;
  width: calc(var(--step) * 5);
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card);
  height: var(--card);
  margin: calc(var(--card) / -2) 0 0 calc(var(--card) / -2);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .3s, box-shadow .3s, filter .3s;
  filter: brightness(.82) saturate(.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
}
.card.no-anim { transition: none; }
.card.is-active {
  filter: none;
  box-shadow: 0 0 0 4px #fff, 0 10px 28px rgba(0, 0, 0, .6);
  z-index: 2;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8%;
  text-align: center;
  line-height: .95;
  overflow-wrap: normal; hyphens: none;
}
.logo__name { font-size: calc(var(--card) * var(--fs) / 118); text-shadow: 0 2px 0 rgba(0,0,0,.18); }

.arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 56px;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s, transform .15s;
}
.arrow:hover { opacity: 1; }
.arrow:active { transform: scale(.88); }
.arrow svg { width: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.bumpers {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.bumper {
  font: 700 11px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .04em;
  padding: 4px 9px 3px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 10px 10px 4px 4px;
  opacity: .9;
  position: relative;
  background: transparent;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background .15s, color .15s, transform .1s, opacity .15s;
}
/* zona táctil más grande que el botón visible */
.bumper::before { content: ""; position: absolute; inset: -12px -10px; }
.bumper:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 120, 200, .7); }
@media (hover: hover) { .bumper:hover { opacity: 1; background: rgba(255, 255, 255, .15); } }
.bumper:active, .bumper.is-pressed { background: #fff; color: #1a1030; transform: scale(.92); opacity: 1; }
.bar {
  position: relative;
  width: clamp(140px, 15vw, 220px);
  height: 3px;
  background: rgba(255, 255, 255, .35);
  border-radius: 2px;
}
.bar__thumb {
  position: absolute;
  top: -1px;
  height: 5px;
  background: #fff;
  border-radius: 2px;
  transition: left .38s cubic-bezier(.2, .8, .2, 1);
}

.station {
  margin-top: 12px;
  font: 700 clamp(22px, 2vw, 30px)/1 "Barlow Condensed", sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.status {
  margin-top: 6px;
  min-height: 1.2em;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  opacity: .75;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}
.status.blink { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.legal {
  position: fixed;
  right: 14px;
  bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .6);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
  z-index: 3;
}
.legal__name { color: #fff; }

@media (max-width: 700px) {
  :root { --card: 64px; }
  .title { width: 86vw; }
  .bg { background-position: 70% center; }
  .legal { left: 0; right: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .bg, .title__script span { animation: none; }
  .card, .bar__thumb { transition: none; }
}

/* ---------- Instalar app ---------- */
.install {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 19px;
  background: rgba(20, 10, 40, .45);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 600 12px "Montserrat", sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  opacity: .8;
  transition: opacity .2s, background .2s, gap .25s;
}
.install[hidden] { display: none; }
/* con el tracklist abierto el botón de instalar se aparta para no taparlo */
body.tl-open .install, body.tl-open .ios-hint { opacity: 0 !important; pointer-events: none; transform: translateY(-8px); }
.install, .ios-hint { transition: opacity .2s, background .2s, gap .25s, transform .2s; }
.install svg { width: 18px; flex: none; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.install span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease; }
.install:hover, .install:focus-visible { opacity: 1; gap: 8px; background: rgba(20, 10, 40, .7); }
.install:hover span, .install:focus-visible span { max-width: 120px; }

.ios-hint {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 46px);
  right: max(14px, env(safe-area-inset-right));
  z-index: 5;
  max-width: 250px;
  padding: 12px 30px 12px 14px;
  border-radius: 10px;
  background: rgba(20, 10, 40, .88);
  backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.5;
}
.ios-hint[hidden] { display: none; }
.ios-hint svg { width: 15px; vertical-align: -3px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ios-hint button { position: absolute; top: 4px; right: 8px; border: 0; background: none; color: #fff; font-size: 18px; cursor: pointer; opacity: .7; }

@media (display-mode: standalone) { .install, .ios-hint { display: none !important; } }

/* ---------- Volumen ---------- */
.volume {
  --level: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 7px 14px 7px 8px;
  border-radius: 22px;
  background: rgba(10, 6, 20, .5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  outline: none;
  transition: border-color .2s, background .2s;
}
.volume:hover, .volume:focus-visible, .volume.is-dragging {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(10, 6, 20, .65);
}
.volume:focus-visible { box-shadow: 0 0 0 2px rgba(255, 120, 200, .6); }

.volume__mute {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: background .2s, transform .12s;
}
.volume__mute:hover { background: rgba(255, 255, 255, .18); }
.volume__mute:active { transform: scale(.9); }
.volume__mute svg { width: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.volume__mute .spk { fill: #fff; }
.volume__mute .w1, .volume__mute .w2 { transition: opacity .2s; }
.volume__mute .x { opacity: 0; transition: opacity .2s; }
.volume.is-muted .w1, .volume.is-muted .w2 { opacity: 0; }
.volume.is-muted .x { opacity: 1; }

.volume__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  padding: 2px 0;
  cursor: pointer;
  touch-action: none;
}
.volume__bars i {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .16);
  transform-origin: bottom;
  transition: background .18s, box-shadow .18s, transform .18s;
}
.volume__bars i.on { background: rgba(255, 255, 255, .78); }
.volume__bars i.hot {
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 140, 210, calc(.35 + var(--level) * .65));
}
.volume__bars i.on:last-of-type, .volume__bars i.on:nth-last-child(-n+4).hot { background: #ffd0ec; }
.volume__bars:hover i.on, .volume.is-dragging i.on { transform: scaleY(1.08); }

.volume__value {
  min-width: 34px;
  font: 700 15px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .05em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: .9;
}
.volume.is-muted .volume__value { color: #ff8fc8; }

@media (max-width: 700px) {
  .volume__bars i { width: 3px; }
  .volume__bars { gap: 2.5px; }
}

/* ---------- Canción actual ---------- */
.track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(90vw, 560px);
  min-height: 20px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .75);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .35s, transform .35s;
}
.track.is-visible { opacity: 1; transform: none; }
.track__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track__eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.track__eq i { width: 3px; height: 100%; background: #ff8fc8; border-radius: 1px; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.track__eq i:nth-child(2) { animation-delay: -.35s; }
.track__eq i:nth-child(3) { animation-delay: -.7s; }
.track.is-paused .track__eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .track__eq i { animation: none; transform: scaleY(.6); } }

/* ---------- Fila de controles: volumen + tracklist ---------- */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.controls .volume { margin-top: 0; }

.tl-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 14px 0 12px;
  border-radius: 23px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 6, 20, .5);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 700 14px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .12s;
}
.tl-btn[hidden] { display: none; }
.tl-btn:hover, .tl-btn:focus-visible, .tl-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(10, 6, 20, .65);
  outline: none;
}
.tl-btn:focus-visible { box-shadow: 0 0 0 2px rgba(255, 120, 200, .6); }
.tl-btn:active { transform: scale(.96); }
.tl-btn svg { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tl-btn__icon { width: 18px; }
.tl-btn__chev { width: 14px; opacity: .8; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.tl-btn[aria-expanded="true"] .tl-btn__chev { transform: rotate(180deg); }

/* ---------- Panel del tracklist (se abre hacia arriba) ---------- */
.tl-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  width: min(92vw, 440px);
  max-height: min(52vh, 460px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(14, 8, 28, .82);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  transform: translateX(-50%);
  transform-origin: bottom center;
  animation: tl-in .22s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
  z-index: 4;
}
.tl-panel[hidden] { display: none; }
@keyframes tl-in { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.98); } }

.tl-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.tl-panel__title {
  font: 700 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tl-panel__count { font-size: 11px; font-weight: 600; letter-spacing: .08em; opacity: .55; text-transform: uppercase; }

.tl-panel__list {
  list-style: none;
  overflow-y: auto;
  padding: 6px 6px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  overscroll-behavior: contain;
}
.tl-panel__list li {
  display: grid;
  grid-template-columns: 1fr 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.3;
  transition: background .2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tl-panel__list li:active { background: rgba(255, 120, 200, .2); }
.tl-panel__list li:hover { background: rgba(255, 255, 255, .05); }
.tl-panel__list .song { min-width: 0; }
.tl-panel__list .tl-artist { display: block; font-size: 11px; font-weight: 500; opacity: .6; margin-top: 2px; }
.tl-panel__list .tl-song { display: block; font-weight: 600; }
.tl-panel__list li.is-past { opacity: .55; }
.tl-panel__list li.is-now { background: rgba(255, 120, 200, .14); opacity: 1; }
.tl-panel__list li.is-now .tl-song { color: #ff8fc8; }
.tl-panel__list .now { display: none; align-items: flex-end; gap: 2px; height: 11px; }
.tl-panel__list li.is-now .now { display: flex; }
.tl-panel__list .now i { width: 2px; height: 100%; background: #ff8fc8; border-radius: 1px; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.tl-panel__list .now i:nth-child(2) { animation-delay: -.35s; }
.tl-panel__list .now i:nth-child(3) { animation-delay: -.7s; }

@media (max-width: 700px) {
  .controls { flex-wrap: wrap; justify-content: center; }
  .tl-btn span { display: none; }
  .tl-btn { padding: 0 12px; }
  .tl-panel { max-height: 48vh; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-panel { animation: none; }
  .tl-panel__list .now i { animation: none; transform: scaleY(.6); }
}

/* Móvil: el volumen va con los botones del teléfono; solo se muestra el botón de silencio */
.volume.vol-hw { padding: 7px 8px; gap: 0; }
.volume.vol-hw .volume__bars, .volume.vol-hw .volume__value { display: none; }
