/**
 * Sonorium - Tema alineado con el logo
 * Paleta: oscuros cálidos + #f5c960 (dorado del logo). Sin morado.
 */

:root {
  --bg-deep: #0c0b09;
  --bg-main: #141210;
  --bg-card: #1a1815;
  --bg-elevated: #22201c;
  --bg-warm: #252320;
  --border: #2d2a26;
  --text: #e8e6e3;
  --text-muted: #8a8682;
  --accent: #f5c960;
  --accent-dim: #d4a84b;
  --accent-glow: rgba(245, 201, 96, 0.3);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 201, 96, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(245, 201, 96, 0.04) 0%, transparent 50%);
}

/* Fondo bg.png al 50%, cubre toda la página (radio + dashboard + login) */
.page-radio, .page-dashboard, .page-login {
  position: relative;
}
.page-radio::before,
.page-dashboard::before,
.page-login::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); text-decoration: underline; }

/* Logo: sin caja, solo la imagen. Fondo del header/card ya es oscuro cálido para que el logo encaje */
.logo-container {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
}
.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(245, 201, 96, 0.25));
}
.brand-logo-dashboard { height: 52px; }
.brand-logo-login { height: 64px; margin-bottom: 0.5rem; }
.brand-logo-radio { height: 72px; margin: 0 auto 0.75rem; display: block; }
.radio-header .logo-container,
.login-card .logo-container { margin: 0 auto; justify-content: center; }
.brand-icon { display: none; }

/* Login */
.page-login { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; gap: 1.5rem; }
.login-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.brand { text-align: center; margin-bottom: 1.5rem; }
.tagline { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

.login-form label { display: block; margin-top: 1rem; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-form .btn { margin-top: 1.5rem; width: 100%; padding: 0.75rem; font-size: 1rem; }
.form-error { color: var(--danger); font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Registro y auth */
.auth-success {
  text-align: center;
  padding: 0.5rem 0 1rem;
}
.auth-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.auth-success p { margin: 0 0 1.25rem; color: var(--text-muted); }
.auth-success .btn-block { width: 100%; }
.auth-switch {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.auth-switch a { font-weight: 500; }
.register-form .btn { margin-top: 1.25rem; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: rgba(245, 201, 96, 0.12);
  color: var(--accent);
  text-decoration: none;
}
.btn-register { margin-top: 0.5rem; display: inline-block; width: 100%; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #0c0b09;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px var(--accent-glow); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #0c0b09;
  font-weight: 600;
}
.btn-accent:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }
.btn-small { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-activate { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-activate:hover { border-color: var(--accent); color: var(--accent); }
.btn-rename { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.2rem 0.4rem; font-size: 0.9rem; border-radius: 4px; opacity: 0.7; }
.btn-rename:hover { color: var(--accent); opacity: 1; }

/* Dashboard */
.page-dashboard { display: flex; flex-direction: column; min-height: 100vh; }
.page-dashboard main { flex: 1; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.version-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  opacity: 0.5;
  font-family: ui-monospace, 'SF Mono', 'Consolas', monospace;
}
.header-meta { display: flex; align-items: center; gap: 1rem; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #0c0b09;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.user-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}
.listeners-badge {
  background: var(--bg-elevated);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.listeners-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; margin-right: 0.4rem; vertical-align: middle; animation: pulse 2s ease-in-out infinite; }
.listeners-badge.has-listeners { color: var(--accent); }
.listeners-badge.has-listeners::before { background: var(--success); }
@keyframes pulse { 0%,100%{ opacity:1 } 50%{ opacity:0.5 } }

.dashboard-main {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 1200px) { .dashboard-main { grid-template-columns: 280px 1fr; } .panel-listeners { grid-column: 1 / -1; } }
@media (max-width: 950px) { .dashboard-main { grid-template-columns: 1fr; } .panel-listeners { grid-column: 1; } }

.panel-rooms {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
  box-shadow: var(--shadow);
}
.panel-rooms h2 { margin: 0 0 1.25rem; font-size: 1.15rem; font-weight: 600; color: var(--text); }
.room-list { display: flex; flex-direction: column; gap: 0.75rem; }
.room-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-main);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.room-item:hover { background: var(--bg-elevated); border-color: var(--border); }
.room-item.is-active { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.room-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.room-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.room-active {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text-muted);
}
.room-active.is-active { color: var(--success); background: rgba(34, 197, 94, 0.15); }
.room-actions { display: flex; align-items: center; gap: 0.5rem; }
.room-create { display: flex; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.room-create input { flex: 1; min-width: 0; padding: 0.75rem 1rem; background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 1rem; }

.panel-control {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.panel-control h2 { margin: 0 0 1.25rem; font-size: 1.3rem; font-weight: 600; }
.no-room { color: var(--text-muted); padding: 3rem; text-align: center; font-size: 1.1rem; }

/* Ahora suena + Timeline */
.master-now-playing-wrap {
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.master-now-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.master-now-title { font-weight: 600; font-size: 1.05rem; }
.timeline-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.timeline-current, .timeline-duration { font-size: 0.85rem; color: var(--text-muted); min-width: 2.5em; }
.timeline-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
}
.timeline-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

/* Equalizer - datos reales vía JS (AnalyserNode) + peak hold */
.equalizer-wrap { margin-bottom: 1rem; padding: 1.25rem; background: var(--bg-main); border-radius: var(--radius); border: 1px solid var(--border); }
.equalizer { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 88px; padding: 0 1rem; }
.equalizer-bar {
  position: relative;
  width: 10px;
  height: 88px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.eq-bar-fill {
  width: 100%;
  min-height: 12px;
  background: linear-gradient(to top, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: height 0.05s ease-out;
}
.eq-bar-peak {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(245,201,96,0.6);
  transition: bottom 0.03s ease-out;
  pointer-events: none;
}
.panel-control.stopped .eq-bar-fill { height: 12px !important; opacity: 0.35; }
.panel-control.stopped .eq-bar-peak { display: none; }

/* Transport */
.transport { display: flex; gap: 1rem; margin-bottom: 1rem; justify-content: center; align-items: center; }

/* Volumen brutal - debajo de transport */
.volume-brutal-wrap {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(245, 201, 96, 0.08) 0%, var(--bg-main) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(245, 201, 96, 0.1);
}
.volume-brutal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.volume-brutal-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
}
.volume-brutal-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}
.volume-brutal-slider {
  width: 100%;
  height: 14px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-deep);
  border-radius: 7px;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}
.volume-brutal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dim) 100%);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow), 0 0 0 3px var(--bg-deep);
  transition: transform 0.15s, box-shadow 0.15s;
}
.volume-brutal-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px var(--accent-glow), 0 0 0 3px var(--bg-deep);
}

/* Panel oyentes */
.panel-listeners {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 1.5rem;
}
.listeners-link-box {
  background: linear-gradient(135deg, rgba(245, 201, 96, 0.12) 0%, var(--bg-main) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.listeners-link-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.listeners-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.listeners-link-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}
.listeners-link-row .btn-copy {
  flex-shrink: 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}
.listeners-panel-title { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.listeners-count-big {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 24px var(--accent-glow);
}
.listeners-count-label { margin: 0.25rem 0 1rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.listeners-list { margin-top: 1rem; }
.listeners-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: none;
}
.listeners-list:not(.has-listeners) .listeners-empty { display: block; }
.listeners-list.has-listeners .listeners-empty { display: none; }
.listeners-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.listener-item {
  padding: 0.85rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.listener-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.listener-id { font-weight: 600; color: var(--accent); font-family: monospace; font-size: 0.8rem; }
.listener-duration { font-size: 0.75rem; color: var(--success); }
.listener-ip { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.listener-joined { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.btn-transport {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.btn-transport:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.06); }
.btn-transport.btn-play {
  width: 72px; height: 72px; font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border: none; color: #0c0b09;
  box-shadow: 0 8px 28px var(--accent-glow);
}
.btn-transport.btn-play:hover { transform: scale(1.08); filter: brightness(1.08); }
.btn-transport.btn-next { font-size: 1.2rem; width: 48px; height: 48px; }
.btn-transport.btn-repeat,
.btn-transport.btn-repeat-crossfade { font-size: 1.1rem; width: 44px; height: 44px; }
.btn-transport.btn-repeat.is-active,
.btn-transport.btn-repeat-crossfade.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245, 201, 96, 0.15);
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-transport:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-icon { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.35rem; font-size: 1rem; border-radius: 6px; transition: color 0.2s, background 0.2s; }
.btn-icon:hover { color: var(--accent); background: var(--bg-elevated); }
.btn-icon.btn-play-track { opacity: 0.8; }
.btn-icon.btn-play-track:hover { opacity: 1; }
.btn-icon.btn-delete-track { color: var(--text-muted); font-size: 0.9rem; }
.btn-icon.btn-delete-track:hover { color: var(--danger); }
.track-num { font-size: 0.8rem; color: var(--text-muted); min-width: 1.5em; }
.track-item .track-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Volume */
.volume-wrap { margin-bottom: 1.5rem; }
.volume-wrap label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.volume-wrap input[type="range"] { width: 100%; max-width: 280px; height: 8px; -webkit-appearance: none; background: var(--bg-main); border-radius: 4px; outline: none; }
.volume-wrap input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; cursor: pointer; box-shadow: 0 0 10px var(--accent-glow); }
.volume-value { font-size: 0.95rem; color: var(--text-muted); margin-left: 0.5rem; }
.volume-wrap label em { font-size: 0.8rem; color: var(--text-muted); font-weight: normal; }
.transition-wrap { margin-bottom: 1rem; font-size: 0.9rem; }
.transition-wrap label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.transition-wrap input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--accent); }

/* Track list */
.track-list-wrap h3 { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; }
.track-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.track-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 1rem; background: var(--bg-main);
  border-radius: var(--radius-sm); margin-bottom: 0.5rem;
  border: 1px solid transparent; transition: all 0.2s;
}
.track-item:hover { background: var(--bg-elevated); }
.track-item.is-current { border-color: var(--accent); background: linear-gradient(135deg, rgba(245, 201, 96, 0.12) 0%, var(--bg-elevated) 100%); box-shadow: 0 0 20px var(--accent-glow); }
.track-name { flex: 1; min-width: 0; font-weight: 500; }
.track-duration { font-size: 0.85rem; color: var(--text-muted); }
.track-upload { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.track-upload label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.upload-input-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.track-upload input[type="file"] { padding: 0.5rem; background: var(--bg-main); border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); flex: 1; min-width: 0; }
.upload-progress-wrap { margin-top: 0.75rem; }
.upload-progress-bar-wrap { height: 6px; background: var(--bg-main); border-radius: 3px; overflow: hidden; margin-bottom: 0.35rem; }
.upload-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; transition: width 0.2s; }
.upload-progress-text { font-size: 0.85rem; color: var(--text-muted); }
.upload-error-msg { font-size: 0.9rem; }

.radio-link-wrap { margin-top: 1.25rem; }
.radio-link-wrap strong { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
.radio-link-row { display: flex; gap: 0.5rem; align-items: center; }
.radio-link-row input { flex: 1; min-width: 0; padding: 0.6rem 0.85rem; background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 0.85rem; }
.btn-copy { flex-shrink: 0; padding: 0.6rem 1rem; font-size: 0.9rem; }

/* Panel Master - Enlace destacado y sala */
.master-link-card {
  background: linear-gradient(135deg, rgba(245, 201, 96, 0.15) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 24px var(--accent-glow);
}
.master-link-title { margin: 0 0 0.35rem; font-size: 1.2rem; color: var(--accent); }
.master-link-desc { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.master-link-row input { font-size: 0.95rem; }
.master-link-row .btn-copy { padding: 0.75rem 1.25rem; font-size: 1rem; }

.master-room-settings { margin-bottom: 1.5rem; }
.master-room-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.editable-room-name { font-weight: 700; }
.btn-edit-title { vertical-align: middle; opacity: 0.7; }
.btn-edit-title:hover { opacity: 1; }

.banner-dropzone {
  margin-top: 0.75rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-main);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}
.banner-dropzone:hover, .banner-dropzone.is-dragover { border-color: var(--accent); background: rgba(245, 201, 96, 0.05); }
.banner-dropzone input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }
.banner-dropzone-inner { padding: 1rem; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.banner-preview-area {
  width: 100%;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}
.banner-preview-area img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.banner-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.banner-placeholder-icon { font-size: 2rem; opacity: 0.6; }
.banner-placeholder-hint { font-size: 0.8rem; opacity: 0.8; }
.banner-actions { margin-top: 0.75rem; }
.btn-remove-banner { font-size: 0.85rem; color: var(--text-muted); }
.btn-remove-banner:hover { color: var(--danger); }
.banner-upload-progress {
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 9, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
}
.banner-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
}
.banner-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s;
}
.banner-progress-text { font-size: 0.9rem; color: var(--text-muted); }

.master-playback-section { margin-bottom: 1.5rem; }

/* Cola: siguiente pista + fundido - diseño mejorado */
.master-queue-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .master-queue-options { grid-template-columns: 1fr; }
}
.queue-option-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.queue-option-card:hover { border-color: rgba(245, 201, 96, 0.4); }
.queue-option-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 201, 96, 0.15);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.queue-option-body { flex: 1; min-width: 0; }
.queue-option-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.queue-option-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.queue-option-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}
.queue-option-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.queue-option-toggle input { display: none; }
.toggle-switch {
  width: 48px;
  height: 26px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.queue-option-toggle input:checked + .toggle-switch {
  background: rgba(245, 201, 96, 0.25);
  border-color: var(--accent);
}
.queue-option-toggle input:checked + .toggle-switch::before {
  transform: translateX(22px);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.queue-option-toggle input:checked ~ .toggle-label { color: var(--accent); }

/* Radio - sala de escucha */
.page-radio { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.radio-wrap { width: 100%; max-width: 520px; padding: 1.5rem; }
.radio-header { text-align: center; margin-bottom: 2rem; }
.radio-header .tagline { margin: 0.25rem 0 0; color: var(--text-muted); }

.radio-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.radio-room-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.radio-room-banner-wrap {
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 180px;
  background: var(--bg-main);
  border: 1px solid var(--border);
}
.radio-room-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
}
.radio-room-name { font-weight: 600; color: var(--text); }
.radio-listeners { color: var(--text-muted); }

.radio-status { text-align: center; font-size: 0.9rem; margin-bottom: 1.25rem; }
.radio-status.connected { color: var(--success); }
.radio-status.error { color: var(--danger); }

.radio-error-card {
  margin-bottom: 1.5rem;
  padding: 2.5rem 2rem;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
}
.radio-error-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.9; }
.radio-error-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
.radio-error-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 0.75rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.radio-error-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.radio-activate-card {
  margin-bottom: 1.75rem;
  padding: 2rem;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-main) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: opacity 0.4s, transform 0.4s;
}
.radio-activate-card.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  position: absolute;
  visibility: hidden;
}
.radio-activate-inner { max-width: 280px; margin: 0 auto; }
.radio-activate-icon {
  font-size: 2.5rem;
  opacity: 0.9;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.radio-activate-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.radio-activate-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.radio-activate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--bg-deep);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.radio-activate-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 28px var(--accent-glow);
}
.radio-listeners.has-listeners { color: var(--accent); }
.radio-room-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
@media (min-width: 480px) { .radio-room-name { max-width: 260px; } }

.radio-now { text-align: center; margin-bottom: 1.75rem; }
.now-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.35rem; }
.now-title { font-size: 1.35rem; font-weight: 600; display: block; margin-bottom: 0.35rem; }
.now-time { font-size: 1rem; color: var(--text-muted); }

.radio-visual { height: 100px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-bottom: 1.75rem; padding: 0 0.5rem; }
.radio-visual .vis-bar {
  position: relative;
  width: 10px;
  height: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.radio-visual .vis-bar-fill {
  width: 100%;
  min-height: 12px;
  background: linear-gradient(to top, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 4px;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: height 0.06s ease-out;
}
.radio-visual .vis-bar-peak {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(245,201,96,0.6);
  transition: bottom 0.03s ease-out;
  pointer-events: none;
}

.radio-volume-wrap label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.radio-volume-wrap input[type="range"] { width: 100%; height: 8px; -webkit-appearance: none; background: var(--bg-main); border-radius: 4px; }
.radio-volume-wrap input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; cursor: pointer; }

/* Selección de salas - ÉPICO */
.radio-choose { padding: 3rem; text-align: center; }
.radio-choose h2 { margin: 0 0 2rem; font-size: 1.5rem; font-weight: 600; color: var(--text); }
.radio-choose p { color: var(--text-muted); }
.room-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.room-links li { margin: 0; }
.room-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-main) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
}
.room-links a .room-link-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.room-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px var(--accent-glow);
  text-decoration: none;
}
.room-links a::after { content: '▶'; font-size: 1rem; opacity: 0.7; }

/* Footer */
.sonorium-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-link:hover { color: var(--accent-dim); text-decoration: none; }
.footer-heart {
  display: inline-block;
  color: #e74c3c;
  font-size: 1.5em;
  animation: heart-beat 1.1s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.25); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  56% { transform: scale(1); }
}
.page-radio .radio-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.page-radio .sonorium-footer { margin-top: auto; padding: 2rem 1rem; }
.page-login .sonorium-footer { margin-top: 1rem; }
.dashboard-main { flex: 1; }
.page-dashboard .sonorium-footer { padding: 1.5rem; }
