/* ================================================================
   ZARA DROP — pasar archivos en tu red
   Mismo design system que Zara Radio (radio.zarasc.com):
   editorial-noir con pulso rojo preciso. Tema claro/oscuro.
   La base (tokens, atmósfera, nav, masthead, consola, tarjetas, pie)
   está copiada de la radio tal cual; abajo van las piezas de Drop.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:ital,wght@0,300..800;1,300..800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root,
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --bg-card: #161616;
  --bg-elevated: #1c1c1c;

  --border: rgba(255, 255, 255, 0.06);
  --border-soft: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-red: rgba(233, 28, 36, 0.35);

  --text: #fafafa;
  --text-dim: #a3a3a3;
  --text-muted: #737373;
  --text-faint: #525252;

  --red: #e91c24;
  --red-bright: #ff2730;
  --red-dark: #b31318;
  --red-deep: #7a0c10;

  --red-glow: rgba(233, 28, 36, 0.45);
  --red-glow-soft: rgba(233, 28, 36, 0.18);
  --red-glow-faint: rgba(233, 28, 36, 0.08);
  --red-glow-strong: rgba(233, 28, 36, 0.65);

  --grid-line: rgba(255, 255, 255, 0.018);
  --noise-opacity: 0.035;
  --noise-blend: overlay;
  --nav-bg: rgba(10, 10, 10, 0.75);
  --title-fade-end: rgba(250, 250, 250, 0.55);
  --card-shadow: none;

  --radar-ring: rgba(233, 28, 36, 0.55);
  --radar-line: rgba(255, 255, 255, 0.035);
  --scrim: rgba(0, 0, 0, 0.62);
  --modal-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9);
  --color-scheme: dark;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-raised: #eaedf1;
  --bg-card: #ffffff;
  --bg-elevated: #eef1f4;

  --border: rgba(15, 23, 42, 0.08);
  --border-soft: rgba(15, 23, 42, 0.05);
  --border-strong: rgba(15, 23, 42, 0.15);
  --border-red: rgba(233, 28, 36, 0.32);

  --text: #0a0c12;
  --text-dim: #3d4557;
  --text-muted: #64748b;
  --text-faint: #9ca3af;

  --red-glow: rgba(233, 28, 36, 0.28);
  --red-glow-soft: rgba(233, 28, 36, 0.10);
  --red-glow-faint: rgba(233, 28, 36, 0.045);
  --red-glow-strong: rgba(233, 28, 36, 0.42);

  --grid-line: rgba(15, 23, 42, 0.035);
  --noise-opacity: 0.03;
  --noise-blend: multiply;
  --nav-bg: rgba(245, 246, 248, 0.78);
  --title-fade-end: rgba(10, 12, 18, 0.35);
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px -16px rgba(15, 23, 42, 0.12);

  --radar-ring: rgba(233, 28, 36, 0.4);
  --radar-line: rgba(15, 23, 42, 0.05);
  --scrim: rgba(15, 23, 42, 0.28);
  --modal-shadow: 0 40px 100px -30px rgba(15, 23, 42, 0.35);
  --color-scheme: light;
}

html { color-scheme: var(--color-scheme); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--red); color: #fff; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

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

/* logo y badge por tema */
.logo-light, .badge-light { display: none; }
:root[data-theme="light"] .logo-dark,
:root[data-theme="light"] .badge-dark { display: none; }
:root[data-theme="light"] .logo-light,
:root[data-theme="light"] .badge-light { display: block; }

/* ── Atmósfera ─────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 10%, transparent 80%);
}
.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.bg-glow-a {
  position: fixed; top: -320px; left: 50%; transform: translateX(-50%);
  width: min(1200px, 100vw); height: 700px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--red-glow-soft) 0%, transparent 65%);
  filter: blur(30px);
  animation: breathe 12s ease-in-out infinite;
}
.bg-glow-b {
  position: fixed; bottom: -200px; right: -200px; width: 600px; height: 600px;
  z-index: 0; pointer-events: none;
  background: radial-gradient(circle, var(--red-glow-faint) 0%, transparent 60%);
  filter: blur(60px);
  animation: breathe 15s ease-in-out infinite reverse;
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
.bg-glow-b { animation-name: breathe-b; }
@keyframes breathe-b {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

/* ── NAV ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 32px; max-width: 1120px; margin: 0 auto;
}
.nav-logo { display: flex; align-items: center; gap: 14px; transition: opacity 0.3s var(--ease); }
.nav-logo:hover { opacity: 0.82; }
.nav-logo img {
  height: 44px; width: auto;
  filter: drop-shadow(0 0 18px var(--red-glow-soft));
  transition: filter 0.4s var(--ease);
}
.nav-logo:hover img {
  filter: drop-shadow(0 0 30px var(--red-glow)) drop-shadow(0 0 14px var(--red-glow-strong));
}
.nav-logo-badge {
  padding: 4px 8px; font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--red);
  border: 1px solid var(--border-red); border-radius: 4px; background: var(--red-glow-faint);
}
.nav-right { display: flex; align-items: center; gap: 12px; }

.live-clock {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 99px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim); background: var(--bg-card);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
  white-space: nowrap;
}
.live-clock-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint); transition: background 0.3s, box-shadow 0.3s;
}
/* al aire → punto rojo latiendo */
.live-clock.on-air { color: var(--red); border-color: var(--border-red); }
.live-clock.on-air .live-clock-dot {
  background: var(--red); box-shadow: 0 0 10px var(--red);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.25); }
}

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); position: relative; overflow: hidden; flex-shrink: 0;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover {
  color: var(--red); border-color: var(--border-red);
  box-shadow: 0 0 24px -6px var(--red-glow); transform: translateY(-1px);
}
.theme-toggle:active { transform: translateY(0) scale(0.94); }
.theme-toggle svg { width: 17px; height: 17px; position: absolute; transition: transform 0.45s var(--ease-spring), opacity 0.3s var(--ease); }
:root[data-theme="dark"] .theme-icon-sun  { transform: translateY(0) rotate(0); opacity: 1; }
:root[data-theme="dark"] .theme-icon-moon { transform: translateY(150%) rotate(60deg); opacity: 0; }
:root[data-theme="light"] .theme-icon-sun  { transform: translateY(-150%) rotate(-60deg); opacity: 0; }
:root[data-theme="light"] .theme-icon-moon { transform: translateY(0) rotate(0); opacity: 1; }

/* enlaces a los otros sitios de Zara (Calendar y Radio): la misma píldora de
   "Al aire"; en pantallas angostas se vuelven botones redondos como el del tema */
.hermano { cursor: pointer; position: relative; }
.hermano:hover { color: var(--red); border-color: var(--border-red); }
.hermano .live-clock-dot, .hermano-icono, .radio-link-flecha { flex: none; }
.hermano-icono { width: 14px; height: 14px; }
.hermano .solo-movil { display: none; }
.radio-link-flecha { width: 11px; height: 11px; opacity: 0.6; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.hermano:hover .radio-link-flecha { transform: translate(2px, -2px); opacity: 1; }
@media (max-width: 640px) {
  .nav-right { gap: 10px; }
  .hermano { width: 40px; height: 40px; padding: 0; justify-content: center; border-color: var(--border-strong); }
  .hermano-texto, .hermano .radio-link-flecha { display: none; }
  .hermano-icono, .hermano .solo-movil { display: block; width: 17px; height: 17px; }
  .radio-link .live-clock-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; }
}

/* ── MASTHEAD ──────────────────────────────────────── */
.masthead {
  position: relative; z-index: 1; padding: 64px 0 40px;
}
.masthead-inner { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.masthead-meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 18px;
}
.masthead-meta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.masthead-meta-row span { display: flex; align-items: center; gap: 8px; }
.masthead-meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

.masthead-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 13vw, 168px);
  font-weight: 700; line-height: 0.82; letter-spacing: -0.055em;
  text-transform: lowercase; font-variation-settings: 'wdth' 82;
  background: linear-gradient(180deg, var(--text) 0%, var(--title-fade-end) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeUp 0.8s var(--ease-out) both;
}
.masthead-title em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.03em; font-variation-settings: 'wdth' 100;
  -webkit-text-fill-color: var(--red); color: var(--red);
  text-shadow: 0 0 40px var(--red-glow-soft);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.masthead-tagline {
  margin-top: 22px; max-width: 560px;
  font-size: 16px; color: var(--text-dim); letter-spacing: -0.005em;
  animation: fadeUp 0.8s var(--ease-out) 0.15s both;
}

/* ── LAYOUT ────────────────────────────────────────── */
.layout {
  position: relative; z-index: 1; flex: 1;
  max-width: 1120px; margin: 0 auto; width: 100%;
  padding: 12px 32px 72px;
}

/* ── CONSOLA ───────────────────────────────────────── */
.console {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.console::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 62%; height: 1px; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, transparent, var(--red-glow), transparent);
}

.console-body {
  display: flex; align-items: center; gap: 28px;
  padding: 28px 34px 22px;
}
@media (max-width: 560px) { .console-body { padding: 24px 22px 18px; gap: 20px; } }

/* aro que late (el mismo del botón play de la radio) */
.play-btn-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--red); opacity: 0;
}
@keyframes ring {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* "Este dispositivo" (en la radio: "Sonando ahora") */
.now-playing { min-width: 0; flex: 1; }
.now-playing-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.np-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); transition: background 0.3s, box-shadow 0.3s; flex: none; }
body.en-linea .np-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.now-playing-title {
  font-family: var(--font-display); font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.05;
  font-variation-settings: 'wdth' 90;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-playing-artist {
  margin-top: 5px; font-size: 15px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-playing-artist:empty { display: none; }
.now-playing-album {
  margin-top: 6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* barra de progreso (la de la canción en la radio) */
.progress {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; max-width: 420px;
}
.progress-time {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--text-muted); flex-shrink: 0; min-width: 32px;
}
.progress-time:last-child { text-align: right; }
.progress-track {
  flex: 1; height: 3px; border-radius: 2px; overflow: hidden;
  background: var(--border-strong);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--red-glow);
  transition: width 0.3s linear;
}

/* columna derecha (en la radio: anterior / a continuación) */
.queue-col {
  flex: 0 0 230px; min-width: 0; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding-left: 26px; border-left: 1px solid var(--border);
}
.queue-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px;
}
.queue-next .queue-label { color: var(--red); }
.queue-title {
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-artist {
  margin-top: 2px; font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-artist:empty { display: none; }

@media (max-width: 860px) {
  .console-body { flex-wrap: wrap; }
  .queue-col {
    flex: 1 1 100%; flex-direction: row; gap: 24px;
    padding-left: 0; padding-top: 16px; margin-top: 2px;
    border-left: none; border-top: 1px solid var(--border);
  }
  .queue-item { flex: 1; min-width: 0; }
}

/* Marquesina (igual que la radio): si el nombre no cabe, se desliza. */
.now-playing-title.marquee { text-overflow: clip; }
.mq-track {
  display: inline-flex; flex-wrap: nowrap; white-space: nowrap;
  animation: marquee 14s linear infinite;
  will-change: transform;
}
.mq-item { padding-right: 3rem; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.now-playing:hover .mq-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } }

/* controles */
.console-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 34px; border-top: 1px solid var(--border); background: var(--bg-raised);
}
@media (max-width: 560px) { .console-controls { padding: 16px 22px; } }
.volume { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.control-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-muted); flex-shrink: 0;
}
.listeners {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  white-space: nowrap; flex-shrink: 0;
}

/* píldora de acción secundaria (el botón de silencio de la radio) */
.mute-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--bg-card);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--text-dim); white-space: nowrap; flex-shrink: 0;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.mute-btn:hover { color: var(--red); border-color: var(--border-red); box-shadow: 0 0 20px -8px var(--red-glow); }
.mute-btn:active { transform: scale(0.97); }
.mute-btn svg { width: 14px; height: 14px; }

/* ── STATS ─────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px;
}
@media (max-width: 720px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 18px 18px; }
  .stat-card-value { font-size: 34px; }
  .stat-unit { font-size: 19px; }
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px 22px; position: relative; overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  min-width: 0;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 40px; height: 2px;
  background: var(--red); box-shadow: 0 0 10px var(--red-glow);
  transition: width 0.4s var(--ease);
}
.stat-card.activa { border-color: var(--border-red); }
.stat-card.activa::before { width: 100%; }
.stat-card-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
}
.stat-card-value {
  font-family: var(--font-display); font-size: 40px; font-weight: 700;
  line-height: 1; letter-spacing: -0.04em; color: var(--text);
  font-variation-settings: 'wdth' 85; margin-bottom: 8px;
  white-space: nowrap;
}
.stat-unit { font-size: 22px; color: var(--text-muted); margin-left: 1px; }
.stat-card-meta { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; min-width: 0; }
.stat-card-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card-meta-arrow { font-size: 8px; color: var(--red); flex: none; }

/* ── FOOTER ────────────────────────────────────────── */
.foot {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto; width: 100%;
  padding: 28px 32px 44px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px 24px; flex-wrap: wrap;
}
.foot-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.foot-sep { color: var(--red); }
.foot-badge {
  flex-shrink: 0;
  display: inline-block;
  /* flota suavecito, como corcholata en el agua */
  animation: flotar-badge 4s ease-in-out infinite;
}
@keyframes flotar-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.foot-badge img {
  height: 62px; width: auto;
  opacity: 0.9;
  transition: opacity 0.3s var(--ease), filter 0.4s var(--ease), transform 0.3s var(--ease);
}
.foot-badge:hover img {
  opacity: 1;
  filter: drop-shadow(0 0 18px var(--red-glow-soft));
  transform: scale(1.04);
}
.foot-badge:active img { transform: scale(0.98); }
@media (max-width: 560px) {
  .foot { justify-content: center; text-align: center; }
  .foot-meta { justify-content: center; }
}

/* ── Accesibilidad ─────────────────────────────────── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05s !important; }
}

@media (max-width: 720px) {
  .nav-inner, .masthead-inner, .layout, .foot { padding-left: 20px; padding-right: 20px; }
  .masthead { padding: 40px 0 28px; }
  .nav-logo img { height: 36px; }
}

/* ================================================================
   PIEZAS DE DROP
   ================================================================ */

/* ── El radar: donde aparecen los dispositivos (en la radio: el espectro) ── */
.radar {
  position: relative; min-height: 300px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 50% 120%, var(--red-glow-faint), transparent 60%),
    var(--bg-raised);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 44px 28px 40px;
  transition: box-shadow 0.3s var(--ease);
}
/* anillos fijos de sonar, centrados abajo: salen de "este dispositivo" */
.radar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-radial-gradient(circle at 50% 100%, transparent 0 91px, var(--radar-line) 91px 92px);
}
.radar-fade {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, transparent 22%, transparent 100%);
}
.radar-ondas { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; pointer-events: none; z-index: 0; }
.radar-ondas span {
  position: absolute; left: -150px; top: -150px; width: 300px; height: 300px;
  border-radius: 50%; border: 1px solid var(--radar-ring); opacity: 0;
  animation: onda 6s var(--ease-out) infinite;
}
.radar-ondas span:nth-child(2) { animation-delay: 1.5s; }
.radar-ondas span:nth-child(3) { animation-delay: 3s; }
.radar-ondas span:nth-child(4) { animation-delay: 4.5s; }
@keyframes onda {
  0% { transform: scale(0.12); opacity: 0.9; }
  65% { opacity: 0.12; }
  100% { transform: scale(3.4); opacity: 0; }
}
body.sin-red .radar-ondas span { animation-play-state: paused; opacity: 0.08; }
body.arrastrando .radar { box-shadow: inset 0 0 0 1px var(--border-red), inset 0 -60px 120px -40px var(--red-glow-soft); }

/* estado vacío */
.radar-vacio {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 40px;
  max-width: 700px; animation: fadeUp 0.6s var(--ease-out) both;
}
.radar-vacio-titulo {
  font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.05;
  font-variation-settings: 'wdth' 90;
}
.radar-vacio-titulo em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.02em; color: var(--red);
}
.radar-vacio-texto { margin-top: 12px; max-width: 420px; font-size: 15px; color: var(--text-dim); }
.radar-vacio-texto strong { color: var(--text); font-weight: 600; }
.puntos::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: puntos 1.6s steps(4, end) infinite; }
@keyframes puntos { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.qr { flex: none; text-align: center; }
.qr-caja {
  width: 132px; padding: 12px; border-radius: 16px; background: #fff;
  box-shadow: 0 16px 50px -18px var(--red-glow-strong), 0 0 0 1px var(--border);
}
.qr-caja svg { width: 100%; height: auto; }
.qr-pie {
  margin-top: 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted);
}
@media (max-width: 720px), (hover: none) { .qr { display: none; } }

/* ── Dispositivos ─────────────────────────────────── */
.pares {
  position: relative; z-index: 1; list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  width: 100%;
}
.par { position: relative; width: 214px; animation: fadeUp 0.5s var(--ease-out) both; }
.par-btn {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 16px 18px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s var(--ease);
}
/* el acento rojo de las tarjetas de la radio */
.par-btn::before {
  content: ''; position: absolute; top: 0; left: 0; width: 40px; height: 2px;
  background: var(--red); box-shadow: 0 0 10px var(--red-glow);
  transition: width 0.4s var(--ease);
}
.par-btn:hover, .par.sobre .par-btn {
  border-color: var(--border-red); transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px var(--red-glow-strong);
}
.par-btn:active { transform: translateY(-1px) scale(0.985); }
.par.sobre .par-btn::before, .par.ocupado .par-btn::before { width: 100%; }
.par.sobre .par-btn { background: linear-gradient(180deg, var(--red-glow-faint), transparent 70%), var(--bg-card); }

.par-avatar {
  position: relative; width: 70px; height: 70px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  margin-bottom: 16px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.par-btn:hover .par-avatar, .par.sobre .par-avatar, .par.ocupado .par-avatar {
  border-color: var(--border-red); box-shadow: 0 0 26px -8px var(--red-glow);
}
.par-emoji {
  font-family: var(--font-emoji); font-size: 31px; line-height: 1;
  color: var(--red); /* los emoji "de texto" (✔︎) toman el rojo */
  position: relative; z-index: 1; white-space: nowrap;
}
.par-emoji.doble { font-size: 23px; letter-spacing: -0.12em; }
.par-anillo {
  position: absolute; left: -6px; top: -6px; width: 82px; height: 82px;
  transform: rotate(-90deg); pointer-events: none; overflow: visible;
}
.par-anillo circle { fill: none; stroke-width: 2.5; }
.par-anillo .pista { stroke: transparent; transition: stroke 0.3s; }
.par.ocupado .par-anillo .pista { stroke: var(--border-strong); }
.par-anillo .avance {
  stroke: var(--red); stroke-linecap: round;
  stroke-dasharray: 245; stroke-dashoffset: 245;
  transition: stroke-dashoffset 0.35s linear;
  filter: drop-shadow(0 0 4px var(--red-glow));
}
.par.esperando .par-anillo { animation: girar 1.4s linear infinite; }
.par.esperando .par-anillo .avance { transition: none; }
@keyframes girar { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }

.par-nombre {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.15; font-variation-settings: 'wdth' 90;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.par-disp {
  margin-top: 8px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted);
}
.par-estado {
  margin-top: auto; padding-top: 12px; min-height: 30px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
  max-width: 100%;
}
.par-estado > span:last-child {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  text-align: center; line-height: 1.3;
}
.par.ocupado .par-estado, .par.bien .par-estado { color: var(--red); }
.par.mal .par-estado { color: var(--text); }
.par.relevo .par-disp { color: var(--red); }
.par.ausente .par-btn { opacity: 0.45; filter: grayscale(1); pointer-events: none; }
.par-cancelar {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.par-cancelar:hover { color: var(--red); border-color: var(--border-red); }
.par-cancelar svg { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .radar { min-height: 260px; padding: 36px 16px 32px; }
  .pares { gap: 12px; }
  .par { width: calc(50% - 6px); max-width: 214px; }
  .par-btn { padding: 20px 10px 14px; }
  .par-nombre { font-size: 15px; -webkit-line-clamp: 4; }
  .par-disp { font-size: 9px; letter-spacing: 0.12em; }
}

/* ── Este dispositivo (en la radio: el botón play) ── */
.yo-avatar {
  flex: none; width: 84px; height: 84px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 10px 40px -8px var(--red-glow-strong);
}
.yo-emoji {
  font-family: var(--font-emoji); font-size: 38px; line-height: 1;
  position: relative; z-index: 1; white-space: nowrap;
}
.yo-emoji.doble { font-size: 28px; letter-spacing: -0.12em; }
body.en-linea .yo-avatar .play-btn-ring { animation: ring 2.4s ease-out infinite; }
@media (max-width: 560px) {
  .yo-avatar { width: 68px; height: 68px; }
  .yo-emoji { font-size: 31px; }
}

.controls-hint {
  font-size: 13px; color: var(--text-dim);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) {
  .console-controls { flex-wrap: wrap; gap: 12px 16px; }
  .console-controls .volume { flex: 1 1 100%; }
  .controls-hint { white-space: normal; line-height: 1.35; }
}

/* ── Botones de los diálogos ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  transition: transform 0.2s var(--ease-spring), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn-pri { background: var(--red); color: #fff; box-shadow: 0 10px 32px -10px var(--red-glow-strong); }
.btn-pri:hover { background: var(--red-bright); transform: translateY(-1px); box-shadow: 0 14px 40px -8px var(--red-glow-strong); }
.btn-sec { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border-strong); }
.btn-sec:hover { color: var(--red); border-color: var(--border-red); }
.btn:active { transform: scale(0.97); }
.btn-mini { min-height: 32px; padding: 6px 12px; font-size: 10px; letter-spacing: 0.08em; }

/* ── Diálogo de recepción ──────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.modal-fondo {
  position: absolute; inset: 0; background: var(--scrim);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: aparecer 0.25s var(--ease) both;
}
.modal-caja {
  position: relative; width: min(540px, 100%);
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 28px; overflow: hidden;
  box-shadow: var(--modal-shadow);
  animation: subir 0.4s var(--ease-out) both;
}
.modal-caja::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 62%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--red-glow), transparent);
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-cabeza {
  display: flex; align-items: center; gap: 20px;
  padding: 28px 28px 20px;
  background: radial-gradient(120% 160% at 50% 140%, var(--red-glow-faint), transparent 60%), var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.modal-avatar {
  flex: none; width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--red); color: #fff;
  box-shadow: 0 10px 34px -8px var(--red-glow-strong);
}
.modal-avatar .yo-emoji { font-size: 30px; }
.modal-avatar .yo-emoji.doble { font-size: 22px; }
.modal-avatar .play-btn-ring { animation: ring 2.4s ease-out infinite; }
.modal-quien { min-width: 0; flex: 1; }
.modal-quien .now-playing-label { margin-bottom: 8px; }
.modal-quien .np-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.modal-titulo {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.08; font-variation-settings: 'wdth' 90;
  overflow-wrap: anywhere;
}
.modal-disp {
  margin-top: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted);
}

.modal-cuerpo { padding: 18px 28px 6px; overflow: auto; min-height: 0; }
.modal-resumen {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
}
.modal-resumen strong { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.03em; color: var(--text); text-transform: none; font-weight: 700; }
.modal-progreso { max-width: none; margin-top: 12px; }
.modal-progreso .progress-time { min-width: 38px; }
.modal-progreso .progress-time:last-child { min-width: 64px; }
.modal-nota {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; color: var(--text-dim);
  background: var(--bg-raised); border: 1px solid var(--border);
}
.modal-nota.roja { color: var(--text); border-color: var(--border-red); background: var(--red-glow-faint); }

.modal-lista { list-style: none; margin-top: 14px; display: flex; flex-direction: column; }
.archivo {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.archivo:first-child { border-top: none; }
.archivo-icono {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted);
}
.archivo-icono svg { width: 16px; height: 16px; }
.archivo.listo .archivo-icono { color: var(--red); border-color: var(--border-red); background: var(--red-glow-faint); }
.archivo-info { min-width: 0; flex: 1; }
.archivo-nombre {
  display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.archivo-meta {
  display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.04em; color: var(--text-muted);
}
.archivo-accion { flex: none; display: flex; align-items: center; gap: 6px; }
.archivo-ok { width: 18px; height: 18px; color: var(--red); }
.archivo-mas { padding: 10px 0 2px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); }

.modal-acciones {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 18px 28px 24px;
}
@media (max-width: 560px) {
  .modal { align-items: end; padding: 12px 10px calc(10px + env(safe-area-inset-bottom)); }
  .modal-caja { border-radius: 24px; }
  .modal-cabeza { padding: 22px 20px 16px; gap: 16px; }
  .modal-cuerpo { padding: 14px 20px 4px; }
  .modal-acciones { padding: 16px 20px 20px; }
  .modal-acciones .btn { flex: 1; }
  .modal-titulo { font-size: 21px; }
}

/* ── Arrastrar sobre la página ─────────────────────── */
.soltar {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  display: grid; place-items: end center; padding-bottom: calc(34px + env(safe-area-inset-bottom));
}
.soltar-caja {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-radius: 99px;
  background: var(--bg-card); border: 1px solid var(--border-red);
  box-shadow: 0 20px 60px -20px var(--red-glow-strong);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); animation: subir 0.3s var(--ease-out) both;
  max-width: calc(100vw - 32px);
}
.soltar-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soltar-nombre {
  font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.02em;
  text-transform: none; font-variation-settings: 'wdth' 90; margin-left: 6px;
}
.soltar-caja .live-clock-dot { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse-dot 2s ease-in-out infinite; flex: none; }

/* selector de archivos: oculto a la vista pero no con display:none (iOS viejo
   no abre el selector de un input que no se pinta) */
.archivo-oculto { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Avisos flotantes ──────────────────────────────── */
.avisos {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(92vw, 480px); pointer-events: none;
}
.aviso {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  max-width: 100%; padding: 11px 18px; border-radius: 99px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  box-shadow: var(--modal-shadow);
  font-size: 13px; color: var(--text);
  animation: subir 0.35s var(--ease-out) both;
}
.aviso.rojo { border-color: var(--border-red); }
.aviso.saliendo { animation: bajar 0.3s var(--ease) forwards; }
@keyframes bajar { to { opacity: 0; transform: translateY(12px); } }
.aviso .stat-card-meta-arrow { font-size: 9px; }
