:root {
  --accent: #1db954;
  --bg: #0e0f13;
  --surface: #181a20;
  --surface-2: #22252d;
  --border: #2c3039;
  --text: #f2f3f5;
  --muted: #9aa0ab;
  --danger: #ff5c6c;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }

/* Íconos SVG (ver Jukebox.icon en common.js). */
.icon-svg { width: 22px; height: 22px; display: block; flex: none; }
[data-icon] { display: inline-flex; }
.pill .icon-svg, .fab .icon-svg, .votes .icon-svg, .q-actions .icon-svg, a.btn .icon-svg, button.icon .icon-svg,
.mode-title .icon-svg, .mystatus .icon-svg, .cooldown-pill .icon-svg, #fallback-status .icon-svg { width: 16px; height: 16px; }
button.round .icon-svg { width: 20px; height: 20px; }
.login-logo .icon-svg { width: 28px; height: 28px; }
.now-empty-icon .icon-svg { width: 26px; height: 26px; }
.mystatus > span, .cooldown-pill, .mode-title, #fallback-status, #audio-activate { display: inline-flex; align-items: center; gap: 8px; }
.qrow .pos .icon-svg { width: 14px; height: 14px; margin: 0 auto; color: var(--accent); }
.screen-queue .pos .icon-svg { width: 2.2vh; height: 2.2vh; color: var(--accent); }
.votes button { display: inline-grid; place-items: center; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.35; } }

button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #0b0b0b; font-weight: 600; }
button.danger { color: var(--danger); }
button.icon { padding: 6px 10px; line-height: 1; }

input[type='text'], input[type='search'], input[type='password'], input[type='number'], select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

.cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  flex: none;
}

.track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-info { min-width: 0; flex: 1; }
.track-title, .track-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-title { font-weight: 600; }
.track-artist { color: var(--muted); font-size: 0.9rem; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  vertical-align: middle;
  margin-left: 4px;
}
.badge.accent { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }

.progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 12px;
  max-width: calc(100% - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind='error'] { border-color: var(--danger); }
#toast[data-kind='ok'] { border-color: var(--accent); }

/* ---------- bloques compartidos (participantes y admin) ---------- */

.app-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.app-header img { height: 40px; width: auto; border-radius: 8px; }
.app-header h1 { margin: 0; font-size: 1.4rem; }
.app-header p { margin: 2px 0 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.banner {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: none; }
.list .row { display: flex; align-items: center; gap: 10px; }
.list .row .track { flex: 1; }

.votes { display: flex; align-items: center; gap: 4px; flex: none; }
.votes button { padding: 6px 9px; border-radius: 10px; font-size: 0.85rem; }
.votes button.on { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
.votes button.on.down { background: var(--danger); border-color: var(--danger); }
.votes .score { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

.empty { text-align: center; padding: 20px 0; color: var(--muted); }

/* ---------- página de participantes (estilo app) ---------- */

body.participant { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
body.participant #toast { bottom: calc(140px + env(safe-area-inset-bottom)); }

.view { max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }
.view a { color: inherit; }
.view a.search-cta { color: #15171c; }
.loading-screen { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }



.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 40px; width: auto; border-radius: 8px; }
.brand h1 { margin: 0; font-size: 1.45rem; line-height: 1.15; }
.brand p { margin: 2px 0 0; }
.name-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 45%; padding: 7px 12px 7px 9px; font-size: 0.85rem; font-weight: 600; }
.name-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-btn .icon-svg { width: 18px; height: 18px; }

.search-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: #f2f3f5;
  color: #15171c;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 18px;
}
.search-cta .icon-svg { color: #15171c; }

.page-title { font-size: 1.7rem; margin: 6px 0 12px; }
.section-title { font-size: 1.2rem; font-weight: 700; margin: 28px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-title a { font-size: 0.82rem; color: var(--muted) !important; font-weight: 600; text-decoration: none; flex: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }

.shelf { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }

.tile { flex: 0 0 140px; width: 140px; scroll-snap-align: start; text-decoration: none; display: block; min-width: 0; }
.grid .tile { width: auto; }
.tile-art { position: relative; }
.tile-art img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.tile.round .tile-art img { border-radius: 50%; }
.tile.round { text-align: center; }
.t-title { font-weight: 600; font-size: 0.92rem; margin-top: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.t-sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fab {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: none;
  background: var(--accent);
  color: #0b0b0b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.fab:not(.add) { background: #f2f3f5; }
.fab:disabled { opacity: 1; }

.list.tracks li, .list .qrow { border-top: none; }
.list.tracks li { padding: 0; }
.trow { display: flex; align-items: center; gap: 12px; padding: 7px 0; min-width: 0; }
.trow .num { width: 22px; flex: none; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.trow .track-artist a { text-decoration: none; }
.trow .track-artist a:hover { text-decoration: underline; }
.trow .dur { flex: none; font-variant-numeric: tabular-nums; }

.pill { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; font-size: 0.82rem; font-weight: 700; border-radius: 999px; }
.pill.add { background: transparent; border-color: #5b616d; }
.pill.add:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pill.queued { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: transparent; color: var(--accent); }
.pill.voted { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
.pill.mine, .pill.playing, .pill.next { background: var(--surface-2); border-color: transparent; color: var(--muted); }
.pill:disabled { opacity: 1; cursor: default; }

.best { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; }
.best img { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.best.round img { border-radius: 50%; }
.best .best-info { flex: 1; min-width: 0; }
.best h3 { margin: 0 0 4px; font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.searchbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.search-field { position: relative; }
.search-field > .icon-svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #15171c; pointer-events: none; }
.search-field input { background: #f2f3f5; color: #15171c; border: none; padding: 14px 44px; font-weight: 600; border-radius: 10px; }
.search-field input::placeholder { color: #6b7180; font-weight: 500; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; color: #15171c; padding: 8px; }
.filters { display: flex; gap: 8px; margin: 4px 0 8px; overflow-x: auto; scrollbar-width: none; }

.explore { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.explore button {
  height: 92px;
  border: none;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  font-weight: 800;
  font-size: 1.02rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
}
.explore button::after { content: ''; position: absolute; right: -14px; bottom: -14px; width: 60px; height: 60px; border-radius: 10px; background: rgba(255, 255, 255, 0.18); transform: rotate(25deg); }

.topnav { position: sticky; top: 0; z-index: 5; padding: 8px 0; margin: -8px 0 0; }
.back { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.55); border-color: transparent; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 -16px; padding: 4px 16px 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 85%); }
.hero img { width: min(220px, 60vw); aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }
.hero img.round { border-radius: 50%; }
.hero h1 { font-size: 1.9rem; margin: 16px 0 4px; line-height: 1.15; }
.hero .meta { color: var(--muted); font-size: 0.9rem; }
.hero .meta a { color: var(--text); font-weight: 700; text-decoration: none; }

.nowcard { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; margin-bottom: 18px; }
.nowcard img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.nowcard .label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.nowcard .progress { margin-top: 8px; }
.nowcard.big { flex-direction: column; text-align: center; padding: 22px 16px; }
.nowcard.big img { width: min(240px, 64vw); height: auto; aspect-ratio: 1; }
.nowcard.big .track-info { width: 100%; }
.nowcard.big .track-title { font-size: 1.25rem; white-space: normal; }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: currentColor; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.2s; }
.eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.cta-card { text-align: center; padding: 28px 18px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border); margin-top: 18px; }
.cta-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.cta-card p { margin: 0 0 14px; }
.cta-card a { text-decoration: none; }

.mystatus { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; font-size: 0.9rem; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.qrow .pos { width: 22px; flex: none; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.qrow .by { color: var(--muted); font-size: 0.78rem; margin-top: 1px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-row { height: 48px; margin: 10px 0; }
.sk-tile { flex: 0 0 140px; height: 186px; }
.sk-hero { width: min(220px, 60vw); aspect-ratio: 1; margin: 8px auto; }

.mini {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(66px + env(safe-area-inset-bottom));
  max-width: 744px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, #23262e);
  text-decoration: none;
  color: var(--text);
  z-index: 20;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.mini img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.mini .track-title { font-size: 0.88rem; }
.mini .track-artist { font-size: 0.78rem; }
.mini .mini-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: rgba(255, 255, 255, 0.15); border-radius: 2px; overflow: hidden; }
.mini .mini-bar span { display: block; height: 100%; width: 0; background: #fff; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(180deg, rgba(14, 15, 19, 0.75), rgba(14, 15, 19, 0.98) 40%);
  backdrop-filter: blur(10px);
  z-index: 19;
}
.tabbar a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600; position: relative; padding: 6px 0; }
.tabbar a.active { color: var(--text); }
.tab-badge { position: absolute; top: 0; left: calc(50% + 8px); background: var(--accent); color: #0b0b0b; font-size: 0.66rem; font-weight: 800; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.tab-badge.bump { animation: bump 0.4s; }
@keyframes bump { 50% { transform: scale(1.35); } }

.cooldown-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(126px + env(safe-area-inset-bottom)); z-index: 18; padding: 6px 12px; border-radius: 999px; background: #2a2d36; border: 1px solid var(--border); font-size: 0.8rem; white-space: nowrap; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; animation: up 0.25s ease-out; }
.sheet h2 { margin: 0; font-size: 1.3rem; }
.sheet p { margin: 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- pantalla del proyector ---------- */

.screen {
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4vw;
  padding: 5vh 5vw;
  z-index: 1;
}
.screen-bg {
  position: fixed;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(1.4) brightness(0.35);
  z-index: 0;
  transition: background-image 1s;
}
.screen-now { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.screen-now .big-cover {
  width: min(42vh, 32vw);
  height: min(42vh, 32vw);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: var(--surface-2);
}
.screen-now .label { text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); font-weight: 700; font-size: 1.6vh; margin: 4vh 0 1vh; }
.screen-now h1 { font-size: 5.5vh; margin: 0; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.screen-now .artist { font-size: 3vh; color: var(--muted); margin-top: 1vh; }
.screen-now .requester { font-size: 2.2vh; margin-top: 1.5vh; }
.screen-now .progress { height: 6px; margin-top: 3vh; max-width: 70vh; }

.screen-side { display: flex; flex-direction: column; min-height: 0; }
.screen-side h2 { font-size: 2vh; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); margin: 0 0 2vh; }
.screen-queue { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: hidden; }
.screen-queue li {
  display: flex;
  align-items: center;
  gap: 1.6vh;
  padding: 1.4vh 1.6vh;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 1.2vh;
}
.screen-queue .pos { font-size: 2.2vh; color: var(--muted); width: 3ch; font-variant-numeric: tabular-nums; }
.screen-queue .cover { width: 6vh; height: 6vh; }
.screen-queue .track-title { font-size: 2.3vh; }
.screen-queue .track-artist { font-size: 1.8vh; }
.screen-queue .score { font-size: 2.2vh; font-weight: 700; font-variant-numeric: tabular-nums; }
.screen-queue .score.neg { color: var(--danger); }
.screen-queue .score.pos { color: var(--accent); }

.screen-join { display: flex; align-items: center; gap: 2vh; margin-top: 2vh; padding: 2vh; border-radius: 16px; background: rgba(0, 0, 0, 0.35); }
.screen-join #qr { background: #fff; padding: 1vh; border-radius: 10px; line-height: 0; }
.screen-join #qr img, .screen-join #qr canvas { width: 14vh !important; height: 14vh !important; }
.screen-join .cta { font-size: 2.6vh; font-weight: 700; }
.screen-join .url { font-size: 2vh; color: var(--accent); word-break: break-all; }

.screen-message {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4vh 5vw;
  background: var(--accent);
  color: #0b0b0b;
  font-weight: 700;
  font-size: 2.4vh;
  text-align: center;
}

/* ---------- admin ---------- */

a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
a.btn:hover { border-color: var(--accent); }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0b0b; font-weight: 600; }
button.ghost { background: transparent; }
button.small, a.btn.small { padding: 6px 12px; font-size: 0.82rem; }
button.danger:hover:not(:disabled) { border-color: var(--danger); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; flex: none; }
.status-dot.on { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.status-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.status-chip.warn { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 24px; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: var(--accent); color: #0b0b0b; }
.login-card h1 { margin: 0 0 4px; font-size: 1.35rem; }
.login-card p { margin: 0 0 20px; }
.login form { display: grid; gap: 12px; }

.adm-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, calc((100vw - 1200px) / 2));
  background: rgba(14, 15, 19, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.adm-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.adm-brand img { height: 36px; width: auto; border-radius: 8px; }
.adm-brand h1 { margin: 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-kicker { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.adm-top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.adm-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px max(16px, calc((100vw - 1200px) / 2)) 0;
  border-bottom: 1px solid var(--border);
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: none; border: none; background: none; border-radius: 0; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.adm-tabs button:hover { color: var(--text); }
.adm-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.adm-main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.adm-grid { display: grid; gap: 16px; align-items: start; }
.adm-grid.two { grid-template-columns: 1fr 1fr; }
.adm-grid.two > .wide { grid-column: 1 / -1; }
.live-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.adm-col { display: grid; gap: 16px; min-width: 0; }

.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.adm-card-head h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.adm-card > p.muted { margin: -4px 0 12px; }
.count { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 0.78rem; }
.count:empty { display: none; }

.adm-alert { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 0.92rem; }
.adm-alert a { color: var(--text); }

.now-card { position: relative; overflow: hidden; padding: 0; }
.now-bg { position: absolute; inset: -20%; background-size: cover; background-position: center; filter: blur(50px) saturate(1.4) brightness(0.4); }
.now-body { position: relative; display: flex; gap: 16px; padding: 18px 18px 8px; align-items: center; }
.now-cover { width: 112px; height: 112px; border-radius: 10px; object-fit: cover; flex: none; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); background: var(--surface-2); }
.now-info { min-width: 0; flex: 1; }
.now-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 800; }
.now-title { font-size: 1.3rem; font-weight: 800; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-artist { color: rgba(255, 255, 255, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-req { font-size: 0.82rem; color: rgba(255, 255, 255, 0.65); margin-top: 6px; }
.now-info .progress { margin-top: 12px; background: rgba(255, 255, 255, 0.18); }
.now-times { display: flex; justify-content: space-between; font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); margin-top: 4px; font-variant-numeric: tabular-nums; }
.now-controls { position: relative; display: flex; justify-content: center; gap: 14px; padding: 6px 0 16px; }
button.round { width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 1rem; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); border-color: transparent; }
button.round.primary { background: var(--accent); color: #0b0b0b; }
.now-empty { display: flex; align-items: center; gap: 14px; padding: 18px; }
.now-empty-icon { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.5rem; color: var(--muted); flex: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stat-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.75rem; }

.quick-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
button.quick { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border-radius: 12px; padding: 12px; text-align: left; }
.quick-label { font-weight: 700; font-size: 0.9rem; }
.quick-state { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); }
button.quick.on .quick-state { color: var(--accent); }

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { width: 40px; height: 24px; border-radius: 999px; background: #3a3e48; position: relative; transition: background 0.15s; flex: none; display: inline-block; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-ui, button.quick.on .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after, button.quick.on .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
button.quick .switch-ui { width: 32px; height: 18px; }
button.quick .switch-ui::after { width: 12px; height: 12px; }
button.quick.on .switch-ui::after { transform: translateX(14px); }

.adm-search input { padding: 11px 14px; }
.adm-list { list-style: none; margin: 8px 0 0; padding: 0; }
.adm-empty { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 0.9rem; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--border); min-width: 0; }
.q-item:first-child { border-top: none; }
.q-item .track-info { flex: 1; min-width: 0; }
.q-item .cover { width: 44px; height: 44px; }
.q-pos { width: 20px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; flex: none; }
.q-time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; flex: none; width: 48px; }
.q-meta { color: var(--muted); font-size: 0.75rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-chip { flex: none; min-width: 34px; text-align: center; font-weight: 700; font-size: 0.82rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.vote-chip.pos { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.vote-chip.neg { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.q-actions { display: flex; gap: 4px; flex: none; }
.q-actions button.icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; display: grid; place-items: center; font-size: 0.85rem; background: transparent; }
.q-actions button.icon.on { color: var(--accent); border-color: var(--accent); }
.q-actions button.icon.danger:hover { border-color: var(--danger); }
.up-next { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.up-next .cover { width: 40px; height: 40px; }

/* En pantallas con mouse, las acciones de la cola aparecen al pasar por encima. */
@media (hover: hover) {
  .q-item .q-actions:not(.always) { opacity: 0.35; transition: opacity 0.15s; }
  .q-item:hover .q-actions, .q-item:focus-within .q-actions { opacity: 1; }
}

.join-card { display: flex; align-items: center; gap: 18px; }
.join-qr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; flex: none; }
.join-qr img, .join-qr canvas { width: 120px !important; height: 120px !important; }
.join-info { min-width: 0; }
.join-info h2 { margin: 0 0 4px; font-size: 1rem; }
.join-url { color: var(--accent); font-weight: 600; word-break: break-all; text-decoration: none; }
.join-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.fields { display: grid; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.field-row:first-child { border-top: none; padding-top: 4px; }
.field-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.field-row label { display: flex; flex-direction: column; gap: 2px; font-weight: 600; font-size: 0.92rem; }
.field-row label .muted { font-weight: 400; }
.field-row input[type='text'], .field-row textarea, .adm-card > input[type='text'] { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: inherit; }
.field-row textarea { resize: vertical; }
.num { display: flex; align-items: center; gap: 8px; flex: none; }
.num input { width: 88px; padding: 8px 10px; background: var(--bg); text-align: right; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--bg) inset; }
.swatches input[type='color'] { width: 34px; height: 34px; border: none; background: none; padding: 0; cursor: pointer; }

.mode-cards { display: grid; gap: 10px; }
.mode-card { display: grid; gap: 4px; padding: 14px 14px 14px 44px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; position: relative; background: var(--bg); }
.mode-card input { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.mode-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.mode-title { font-weight: 700; }
.mode-help { margin-top: 12px; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.mode-help a, .mode-help strong { color: var(--text); }
.device-row { display: flex; gap: 8px; }
.device-row select { flex: 1; padding: 9px 12px; }

@media (max-width: 900px) {
  .live-grid, .adm-grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .adm-top { flex-wrap: wrap; }
  .adm-top-actions { width: 100%; }
  .adm-top-actions .status-chip { margin-right: auto; }
  .adm-top-actions a.btn { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .now-cover { width: 84px; height: 84px; }
  .q-item { flex-wrap: wrap; }
  .q-item .q-actions { width: 100%; justify-content: flex-end; padding-left: 74px; }
  .join-card { flex-direction: column; text-align: center; }
  .join-actions { justify-content: center; }
}

@media (max-width: 860px) {
  .screen { grid-template-columns: 1fr; overflow: auto; height: auto; min-height: 100vh; }
  .screen-now .big-cover { width: 60vw; height: 60vw; }
}

/* reproductor embebido (modo embed) */
.player-mount { margin-top: 3vh; max-width: 70vh; border-radius: 12px; overflow: hidden; }
.player-mount iframe { display: block; border-radius: 12px; }
.fake-embed { padding: 18px; background: rgba(255, 255, 255, 0.06); border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 1.6vh; }
.audio-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  z-index: 10;
  max-width: calc(100% - 32px);
}


