/* ==========================================================================
   KHAPIA ONE · Reproductor web — hoja de estilo base
   Tokens tomados de radio-premium-listener/lib/theme/app_skin.dart (skin
   "Dorado"). Proporciones replicadas de playback_controls.dart /
   listening_header.dart / on_air_info.dart / home_shell.dart.
   ========================================================================== */

:root {
  --bg: #0A0A0A;
  --surface: #121212;
  --card: #151515;
  /* Acento activo. El "skin" (PREMIUM) sobrescribe estas 4 en :root vía JS;
     todo lo dorado deriva de acá (incluidos los glows con --accent-rgb). */
  --gold: #D4A94A;
  --gold-light: #E8C878;
  --gold-dark: #B8892E;
  --accent-rgb: 212, 169, 74;
  --gold-border: rgba(var(--accent-rgb), 0.20);
  --gold-12: rgba(var(--accent-rgb), 0.12);
  --gold-50: rgba(var(--accent-rgb), 0.50);
  --live-red: #E53935;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-tertiary: #757575;
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-2: rgba(255, 255, 255, 0.10);

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cinzel', 'Times New Roman', serif;

  --gold-gradient: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Icono base reutilizable */
.ico {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
  stroke: none;
}

/* ==========================================================================
   CONTENEDOR DE APP — vista única, columna centrada en escritorio
   ========================================================================== */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}
[hidden] { display: none !important; }

/* ==========================================================================
   ESTRUCTURA DE PANTALLA
   ========================================================================== */
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text-primary);
}
.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px calc(64px + 24px);
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   TOPBAR (reproductor) — logo centrado, hamburguesa izq, PREMIUM der
   PremiumHeader: alto 68, logo 28, "KHAPIA" Cinzel 16 / +4.5, "ONE" 9 / +4
   ========================================================================== */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 14px;
  flex: none;
}
.topbar__menu {
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0 6px;
  z-index: 2;
}
.topbar__menu span {
  height: 1.6px;
  border-radius: 1px;
  background: var(--gold);
}
.topbar__menu span:nth-child(1) { width: 20px; }
.topbar__menu span:nth-child(2) { width: 14px; }
.topbar__menu span:nth-child(3) { width: 10px; }

.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.brand__logo { width: 26px; height: 26px; object-fit: contain; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 4.5px;
  /* degradado dorado sobre el texto (ShaderMask en Flutter) */
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* sangría para compensar el letter-spacing del último glifo */
  text-indent: 4.5px;
}
.brand__sub {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 4px;
  text-indent: 4px;
  color: rgba(var(--accent-rgb), 0.9);
}

/* Chip PREMIUM — borde dorado, degradado tenue, glow */
.chip-premium {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  border: 1.1px solid var(--gold);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.08));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
  color: var(--gold-light);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  z-index: 2;
}
.chip-premium .ico {
  font-size: 12px;
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.7));
}

/* Topbar variante catálogo — logo a la izquierda en fila */
.topbar--catalog { height: 60px; padding: 12px 20px 0; }
.brand--row {
  position: static;
  transform: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}
.brand--row .brand__logo { width: 32px; height: 32px; }
.brand__stack { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.brand--row .brand__name { font-size: 15px; letter-spacing: 3.2px; text-indent: 3.2px; }
.brand--row .brand__sub { font-size: 8.5px; letter-spacing: 3.5px; text-indent: 3.5px; }

/* ==========================================================================
   LISTENING HEADER — "EN VIVO" · "ESTÁS ESCUCHANDO" · nombre · tagline
   ========================================================================== */
.listening { text-align: center; padding: 10px 0 0; }
.listening__live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.6px;
  color: rgba(255, 255, 255, 0.8);
}
.dot-live {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 4px rgba(229, 57, 53, 0.9);
  animation: pulse-live 1.8s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(229, 57, 53, 0.9); }
  50% { opacity: 0.35; box-shadow: 0 0 9px 2px rgba(229, 57, 53, 0.55); }
}
.listening__eyebrow {
  margin: 8px 0 0;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 2.2px;
  color: var(--text-tertiary);
}
.listening__name {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
}
.listening__tag {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* ==========================================================================
   COVER ART — cuadrada, radio 22, glow dorado difuso, fade en cambios
   StationArt: boxShadow gold@.28 blur 28 offset 0/8
   ========================================================================== */
.cover {
  margin: 14px 18px 0;
  border-radius: 22px;
  aspect-ratio: 1 / 1;
  box-shadow:
    0 8px 28px rgba(var(--accent-rgb), 0.28),
    0 0 60px rgba(var(--accent-rgb), 0.16);
}
.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  background: var(--surface);
  /* transición suave cuando el JS cambie el src (mitiga el banner-delay) */
  transition: opacity 320ms ease;
}
.cover__img.is-swapping { opacity: 0; }

/* ==========================================================================
   ON-AIR INFO — pill AL AIRE · título programa · "con LOCUTOR" · tema · horario
   ========================================================================== */
.onair { text-align: center; padding: 14px 6px 0; }
.onair__pill {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--gold-50);
  border-radius: 14px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 8px;
}
.onair__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
}
.onair__host {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}
.onair__host b {
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.4px;
}
.onair__song {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.onair__range {
  margin: 4px 0 0;
  font-size: 10.5px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   CONTROLES — [FAVORITOS | play glow | TEMPORIZADOR] · badge EN VIVO · volumen
   ========================================================================== */
.controls { padding: 16px 0 0; }
.controls__row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.controls__sep {
  width: 1px;
  height: 44px;
  background: var(--hairline-2);
  margin: 0 10px;
  flex: none;
}

.sidectl {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px 4px;
  color: var(--text-secondary);
}
.sidectl .ico { font-size: 22px; }
.sidectl span {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.8px;
}
.sidectl.is-active { color: var(--gold); }

/* Botón play — envoltorio 92, glow 78, anillo 74 (borde 2.5), disco 58 blanco */
.playbtn {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
}
.playbtn__glow {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  box-shadow:
    0 0 24px 2px rgba(var(--accent-rgb), 0.5),
    0 0 40px 10px rgba(var(--accent-rgb), 0.2);
}
.playbtn__ring {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
}
.playbtn__disc {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  transition: transform 120ms ease;
}
.playbtn__disc .ico { font-size: 30px; fill: var(--bg); }
.playbtn.is-playing .playbtn__disc .ico { font-size: 26px; }
.playbtn:active .playbtn__disc { transform: scale(0.94); }

/* Badge EN VIVO / CONECTANDO — pill borde dorado + antena */
.livebadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 14px auto 0;
  padding: 5px 12px;
  border: 1px solid var(--gold-50);
  border-radius: 16px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.15px;
  width: max-content;
}
.livebadge .ico { font-size: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.livebadge.is-connecting { color: var(--gold-dark); border-color: rgba(var(--accent-rgb), 0.35); }

.livebadge-wrap { display: flex; justify-content: center; }

/* Volumen — icono + slider dorado + % */
.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  color: var(--gold);
}
.volume > .ico { font-size: 16px; }
.volume__pct {
  font-size: 11px;
  font-weight: 500;
  color: rgba(var(--accent-rgb), 0.9);
  min-width: 34px;
  text-align: right;
}
.volume__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  border-radius: 2px;
  /* --v (0..100) lo setea player.js según el valor actual */
  background: linear-gradient(to right,
    var(--gold) 0 calc(var(--v, 80) * 1%),
    #2C2C2C calc(var(--v, 80) * 1%) 100%);
  outline: none;
}
.volume__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 0;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16);
}
.volume__slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
}

/* ==========================================================================
   TARJETA "ENVÍA TU MENSAJE" (disparador)
   ========================================================================== */
.msgcard {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 20px 0 0;
  padding: 11px 12px;
  background: var(--card);
  border: 0.8px solid var(--gold-border);
  border-radius: 12px;
  text-align: left;
  color: var(--text-secondary);
}
.msgcard__ico {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: var(--gold);
}
.msgcard__ico .ico { font-size: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.msgcard__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.msgcard__body b {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--gold);
}
.msgcard__body small { font-size: 10px; line-height: 1.3; color: var(--text-secondary); }
.msgcard__chev { font-size: 20px; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.9; }

/* ==========================================================================
   REDES SOCIALES
   ========================================================================== */
.social { margin: 22px 0 0; }
.social__head {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--gold);
}
.social__head .ico { font-size: 12px; }
.social__row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.social__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}
.social__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.social__dot .ico { font-size: 15px; }
.social__item span:last-child {
  font-size: 8px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.social__dot--fb  { background: #1877F2; }
.social__dot--ig  { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.social__dot--tt  { background: #010101; border: 0.8px solid rgba(255,255,255,0.24); }
.social__dot--yt  { background: #FF0000; }
.social__dot--wa  { background: #25D366; }
.social__dot--web { background: #6B7280; }
.social__dot--tg  { background: #229ED9; }
.social__dot--x   { background: #111111; border: 0.8px solid rgba(255,255,255,0.24); }

/* ==========================================================================
   PROGRAMACIÓN — preview + página completa + estado vacío
   ========================================================================== */
.sched-preview { margin: 20px 0 0; }
.sched-preview__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sched-preview__head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--gold);
}
.sched-preview__head a {
  font-size: 9.5px;
  color: var(--text-tertiary);
}
.empty-line {
  text-align: center;
  padding: 16px 0;
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin: 14px 0 8px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 24px;
  text-align: center;
}
.empty-state .ico { font-size: 40px; color: var(--text-tertiary); fill: none; stroke: currentColor; stroke-width: 1.4; }
.empty-state p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* ==========================================================================
   VISTA CATÁLOGO
   ========================================================================== */
.catalog-head { padding: 20px 0 0; }
.catalog-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
}
.catalog-head p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0 14px;
  height: 46px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.searchbar .ico { font-size: 20px; color: var(--text-tertiary); fill: none; stroke: currentColor; stroke-width: 1.8; }
.searchbar input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}
.searchbar input::placeholder { color: var(--text-tertiary); }
.searchbar:focus-within { border-color: var(--gold-50); }

.chips {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.is-active {
  border-color: var(--gold);
  background: var(--gold-12);
  color: var(--gold);
  font-weight: 600;
}

.stations {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.station {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 12px;
  background: var(--card);
  border-radius: 14px;
}
.station__cover {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
}
.station__info { flex: 1; min-width: 0; }
.station__live {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--gold);
}
.station__live .ico { font-size: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.station__name {
  margin: 4px 0 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station__desc {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station__genre {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--text-tertiary);
}
.station__genre .ico { font-size: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.station__play {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1.4px solid var(--gold);
  display: grid;
  place-items: center;
  color: var(--gold);
}
.station__play .ico { font-size: 24px; }

/* ==========================================================================
   VISTA "MÁS" + FORMULARIO MENSAJE
   ========================================================================== */
.more-head { padding: 18px 0 0; }
.more-head h1 { margin: 0; font-size: 24px; font-weight: 800; color: var(--text-primary); }
.more-head__genre { margin: 4px 0 0; font-size: 14px; color: var(--gold); }
.more-head__desc { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

.msgform {
  margin: 26px 0 0;
  padding: 16px;
  background: var(--card);
  border: 0.8px solid var(--gold-border);
  border-radius: 14px;
}
.msgform__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--gold);
}
.msgform__hint {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.field {
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.8px solid var(--gold-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
}
.field::placeholder { color: var(--text-tertiary); }
.field:focus { border-color: var(--gold); }
.msgform__counter {
  margin: 6px 0 0;
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
}

.btn-primary {
  width: 100%;
  margin: 10px 0 0;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #000;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.btn-primary:disabled { background: rgba(var(--accent-rgb), 0.3); }

.btn-ghost {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 18px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   PÁGINAS DE ESTADO (402 / error)
   ========================================================================== */
.state-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 32px;
  text-align: center;
}
.state-page__ico {
  font-size: 64px;
  color: var(--text-secondary);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  margin-bottom: 8px;
}
.state-page h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}
.state-page p {
  margin: 0;
  max-width: 30ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.state-page .btn-primary { width: auto; padding: 12px 28px; margin-top: 12px; }

/* ==========================================================================
   TABBAR — RADIOS / EN VIVO / PROGRAMACIÓN / MÁS
   home_shell _PremiumBottomNav: alto 54, negro, borde superior gold@.09,
   seleccionado = dorado + barra 28px
   ========================================================================== */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  display: flex;
  background: #000;
  border-top: 0.6px solid rgba(var(--accent-rgb), 0.09);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-tertiary);
}
.tab .ico { font-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tab span {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.6px;
}
.tab::after {
  content: "";
  height: 2px;
  width: 0;
  border-radius: 1px;
  background: var(--gold);
  transition: width 180ms ease;
}
.tab.is-active {
  color: var(--gold);
}
.tab.is-active span { font-weight: 600; }
.tab.is-active::after { width: 28px; }

/* ==========================================================================
   V1 · WIRING JS — overlays y estados (aditivo)
   ========================================================================== */

/* Spinner de carga */
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--gold-border);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast — aviso breve no bloqueante (ej. "Radio no encontrada") */
.toast {
  position: absolute;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%) translateY(8px);
  z-index: 50;
  max-width: 86%;
  padding: 10px 16px;
  border-radius: 10px;
  background: #2A2A2A;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Sheet del temporizador — se ancla al fondo del contenedor .app */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
}
.sheet {
  width: 100%;
  background: #141414;
  border-radius: 18px 18px 0 0;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sheet-up 200ms ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet__grip {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  align-self: center;
  margin-bottom: 6px;
}
.sheet__opt {
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.sheet__opt--muted { color: var(--text-secondary); }
.sheet__opt:active { background: #1c1c1c; }

/* Estados del formulario de mensaje */
.msgform__error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--live-red);
}
.msgform__ok {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
}
.msgform__ok .ico { font-size: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Badge en error de stream */
.livebadge.is-error { color: var(--live-red); border-color: rgba(229, 57, 53, 0.5); }

/* Autoplay bloqueado por el navegador: pulsamos el play para invitar al toque */
#app.is-autoplay-pending .playbtn { animation: ap-pulse 1.5s ease-in-out infinite; }
#app.is-autoplay-pending .playbtn__glow {
  animation: ap-glow 1.5s ease-in-out infinite;
}
#app.is-autoplay-pending .livebadge {
  border-color: var(--gold);
  color: var(--gold);
}
#app.is-autoplay-pending .npbanner__toggle { animation: ap-pulse 1.5s ease-in-out infinite; }
@keyframes ap-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes ap-glow {
  0%, 100% { box-shadow: 0 0 24px 2px rgba(var(--accent-rgb), 0.5), 0 0 40px 10px rgba(var(--accent-rgb), 0.2); }
  50% { box-shadow: 0 0 34px 6px rgba(var(--accent-rgb), 0.75), 0 0 60px 18px rgba(var(--accent-rgb), 0.32); }
}
@media (prefers-reduced-motion: reduce) {
  #app.is-autoplay-pending .playbtn,
  #app.is-autoplay-pending .playbtn__glow,
  #app.is-autoplay-pending .npbanner__toggle { animation: none; }
}

/* Mini-banner "en reproducción" sobre el bottom nav del catálogo */
.npbanner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 54px;               /* alto de .tabbar */
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 8px 8px 8px 12px;
  background: #141414;
  border-top: 0.6px solid rgba(var(--accent-rgb), 0.22);
  cursor: pointer;
}
.npbanner__cover {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}
.npbanner__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.npbanner__meta b {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npbanner__sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npbanner__sub.is-connecting { color: var(--gold); }
.npbanner__sub.is-error { color: var(--live-red); }
.npbanner__toggle {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--gold);
}
.npbanner__toggle .ico { font-size: 28px; }

/* deja aire bajo la última tarjeta cuando el banner está visible */
.scroll.has-npbanner { padding-bottom: calc(54px + 64px + 24px); }

/* ==========================================================================
   PREMIUM — hub de skins de color (réplica de premium_page.dart)
   ========================================================================== */
.premium-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 0;
  flex: none;
}
.premium-top__back {
  background: none;
  border: 0;
  color: var(--gold);
  display: grid;
  place-items: center;
  padding: 8px;
}
.premium-top__back .ico { font-size: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.premium-top__label {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--gold-light);
}
.premium-top__label .ico { font-size: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.premium-hero {
  text-align: center;
  padding: 8px 24px 0;
  flex: none;
}
.premium-hero img { width: 48px; height: 48px; object-fit: contain; margin: 0 auto; }
.premium-hero h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 4px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-indent: 4px;
}
.premium-hero p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.premium-section {
  margin: 18px 0 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: rgba(var(--accent-rgb), 0.85);
}

.skin {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 0.9px solid rgba(var(--skin-rgb), 0.35);
  background:
    linear-gradient(to right,
      rgba(var(--skin-rgb), 0.10) 0%,
      #141414 35%, #101010 100%);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.skin.is-active {
  border-width: 1.4px;
  border-color: rgb(var(--skin-rgb));
  background:
    linear-gradient(to right,
      rgba(var(--skin-rgb), 0.22) 0%,
      #141414 35%, #101010 100%);
  box-shadow: 0 4px 16px rgba(var(--skin-rgb), 0.28);
}
.skin__bar {
  width: 4px;
  height: 42px;
  flex: none;
  border-radius: 2px;
  background: linear-gradient(to bottom,
    var(--skin-light), rgb(var(--skin-rgb)), var(--skin-dark));
}
.skin__meta { flex: 1; min-width: 0; }
.skin__meta b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.skin__meta small {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.skin.is-active .skin__meta small { color: var(--skin-light); }
.skin__swatch {
  width: 56px;
  height: 28px;
  flex: none;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg,
    var(--skin-light), rgb(var(--skin-rgb)), var(--skin-dark));
  box-shadow: 0 0 8px rgba(var(--skin-rgb), 0.4);
}
.skin__check { flex: none; font-size: 22px; color: var(--text-tertiary); }
.skin__check .ico { fill: none; stroke: currentColor; stroke-width: 1.7; }
.skin.is-active .skin__check { color: var(--skin-light); }
.skin.is-active .skin__check .ico { fill: currentColor; stroke: none; }

/* Filas de programación (schedule + preview) */
.sched-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0;
  border-top: 0.6px solid var(--hairline);
}
.sched-row:first-child { border-top: 0; }
.sched-row__time {
  flex: none;
  width: 60px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--gold);
}
.sched-row__thumb {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
}
.sched-row__meta { flex: 1; min-width: 0; }
.sched-row__meta b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.sched-row__meta small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.sched-row__onair { font-size: 18px; color: var(--gold); flex: none; }
.sched-row.is-on-air .sched-row__meta b { color: var(--gold); }

/* Cursores / affordances de click */
.station, .chip, .tab, .social__item, .sheet__opt,
.sidectl, .playbtn, .msgcard, .chip-premium, .topbar__menu { cursor: pointer; }
.station__play { pointer-events: none; }

/* Tarjeta de estado dentro del catálogo (cargando / error / vacío) */
.catalog-state {
  padding: 60px 24px;
  text-align: center;
}
.catalog-state p { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.catalog-state .spinner { margin: 0 auto; }
.catalog-state button {
  background: none;
  border: 0;
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   FONDO AMBIENTAL (portada difuminada)
   ========================================================================== */
.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(70px) saturate(1.3) brightness(0.5);
  opacity: 0;
  transition: opacity 600ms ease;
}
.ambient.is-on { opacity: 0.12; }

/* ==========================================================================
   RESPONSIVE — ESCRITORIO
   El reproductor deja de ser "una franja de celular": ocupa la pantalla,
   contenido centrado y aireado, chrome flotante, catálogo en grilla y un
   fondo ambiental con la portada del tema.
   ========================================================================== */
@media (min-width: 700px) {
  body { background: #060606; }

  .app { max-width: none; }
  .screen { background: rgba(10, 10, 10, 0.82); }
  .ambient.is-on { opacity: 0.55; }

  /* barras superiores alineadas al ancho de contenido */
  .topbar,
  .topbar--catalog { max-width: 1180px; margin-inline: auto; width: 100%; }
  .topbar { height: 76px; }

  /* --- área scroll: contenido centrado --- */
  .scroll { padding: 12px 40px calc(72px + 40px); }

  /* --- REPRODUCTOR: columna central ancha y aireada --- */
  [data-panel] { max-width: 620px; margin-inline: auto; }
  [data-panel="live"] { padding-top: 8px; }
  .listening { padding-top: 20px; }
  .listening__name { font-size: 26px; }
  .listening__tag { font-size: 12.5px; margin-top: 8px; }
  .cover {
    margin: 22px auto 0;
    max-width: 360px;
    box-shadow:
      0 20px 60px rgba(var(--accent-rgb), 0.30),
      0 0 100px rgba(var(--accent-rgb), 0.18);
  }
  .onair { padding-top: 22px; }
  .onair__title { font-size: 19px; }
  .controls { padding-top: 22px; max-width: 460px; margin-inline: auto; }
  .msgcard, .social, .sched-preview { max-width: 460px; margin-inline: auto; }
  .social { margin-top: 26px; }

  /* schedule / más: mismo ancho central */
  [data-panel="schedule"], [data-panel="more"] { max-width: 620px; }

  /* --- CATÁLOGO: grilla --- */
  .screen[data-screen="catalog"] .scroll > * { max-width: 1180px; margin-inline: auto; }
  .catalog-head { padding-top: 28px; }
  .catalog-head h1 { font-size: 32px; }
  .catalog-head p { font-size: 15px; }
  .searchbar { max-width: 520px; }
  .stations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
    align-content: start;
  }
  .station { padding: 14px; }

  /* --- PREMIUM --- */
  .premium-top { max-width: 640px; margin-inline: auto; width: 100%; }
  .premium-hero { padding-top: 18px; }
  .premium-hero img { width: 56px; height: 56px; }
  .premium-hero h2 { font-size: 24px; }
  .premium .scroll > *, [data-screen="premium"] .scroll > * { max-width: 560px; margin-inline: auto; }
  #skin-list { max-width: 560px; margin-inline: auto; }

  /* --- chrome flotante: bottom nav + mini-banner como "pill" centrada --- */
  .tabbar {
    left: 50%;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 48px));
    bottom: 22px;
    height: 58px;
    border: 1px solid var(--gold-border);
    border-radius: 18px;
    background: rgba(16, 16, 16, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
    overflow: hidden;
  }
  .scroll.has-npbanner { padding-bottom: calc(58px + 22px + 64px + 24px); }
  .npbanner {
    left: 50%;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 48px));
    bottom: calc(58px + 22px + 12px);
    border: 1px solid var(--gold-border);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(20, 20, 20, 0.92);
  }

  /* páginas de estado: no estirar el texto a lo ancho */
  .state-page { max-width: 460px; margin-inline: auto; }
}

/* --- MUY ANCHO: reproductor a dos columnas (portada | info) --- */
@media (min-width: 1080px) {
  [data-panel="live"] {
    display: grid;
    grid-template-columns: 340px minmax(0, 420px);
    grid-template-areas:
      "listening onair"
      "cover     controls"
      "cover     msgcard"
      "social    social"
      "sched     sched";
    gap: 8px 48px;
    align-items: start;
    max-width: 860px;
  }
  [data-panel="live"] > .listening { grid-area: listening; padding-top: 0; }
  [data-panel="live"] > .cover { grid-area: cover; margin: 12px 0 0; max-width: 340px; align-self: start; }
  [data-panel="live"] > .onair { grid-area: onair; padding-top: 0; text-align: left; }
  [data-panel="live"] > .onair .onair__title,
  [data-panel="live"] > .onair .onair__song { text-align: left; }
  [data-panel="live"] > .controls { grid-area: controls; margin: 0; max-width: none; }
  [data-panel="live"] > .msgcard { grid-area: msgcard; margin: 12px 0 0; max-width: none; }
  [data-panel="live"] > #social-live { grid-area: social; max-width: none; margin-top: 22px; }
  [data-panel="live"] > .sched-preview { grid-area: sched; max-width: none; }
  [data-panel="live"] > .listening { text-align: left; }
  [data-panel="live"] > .listening .listening__live,
  [data-panel="live"] > .listening .listening__eyebrow { justify-content: flex-start; }
}
