/* K-Manager v2 — "neon cabaret" theme for join / screen / host */
@import url("https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Monoton&display=swap");

:root {
  --bg: #0d0810;
  --bg-2: #180d1f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #fbf3ff;
  --muted: #b9a7c4;
  --dim: #7d6b89;
  --neon: #ff3d8a;
  --neon-soft: rgba(255, 61, 138, 0.18);
  --amber: #ffb347;
  --amber-soft: rgba(255, 179, 71, 0.16);
  --mint: #4ee6b8;
  --mint-soft: rgba(78, 230, 184, 0.16);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.16);
  --radius: 18px;
  --radius-lg: 26px;
  --display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --body: "Albert Sans", "Helvetica Neue", sans-serif;
  --sign: "Monoton", "Bricolage Grotesque", cursive;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(255, 61, 138, 0.45), 0 0 60px rgba(255, 61, 138, 0.2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at -10% -10%, rgba(255, 61, 138, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255, 179, 71, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
.sign {
  font-family: var(--sign);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--neon);
  text-shadow: var(--glow);
  text-transform: uppercase;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}

/* layout */
.page { max-width: 560px; margin: 0 auto; padding: 18px 16px 120px; display: grid; gap: 16px; }
.page.wide { max-width: 1400px; padding-bottom: 40px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.card.accent { border-color: rgba(255, 61, 138, 0.35); background: linear-gradient(160deg, rgba(255, 61, 138, 0.14), rgba(255, 255, 255, 0.03)); }
.card.amber { border-color: rgba(255, 179, 71, 0.35); background: linear-gradient(160deg, rgba(255, 179, 71, 0.14), rgba(255, 255, 255, 0.03)); }

/* controls */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--ink);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #ff3d8a 0%, #ff7a59 100%); color: #1a0710; box-shadow: 0 10px 30px rgba(255, 61, 138, 0.35); }
.btn.primary:hover { box-shadow: var(--glow); }
.btn.amber { background: linear-gradient(135deg, #ffb347, #ffd27a); color: #2a1600; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.danger { background: var(--danger-soft); color: #ffb3b3; border-color: rgba(255, 92, 92, 0.3); }
.btn.mint { background: var(--mint-soft); color: var(--mint); border-color: rgba(78, 230, 184, 0.3); }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 0.88rem; }
.btn.big { padding: 18px 26px; font-size: 1.1rem; min-height: 60px; border-radius: 22px; }
.btn.block { width: 100%; }
.icon { font-size: 1.1em; line-height: 1; }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 13px 15px;
  min-height: 50px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--neon); box-shadow: 0 0 0 4px var(--neon-soft); }
textarea.input { min-height: 80px; resize: vertical; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--muted); text-transform: uppercase;
}
.chip.active, .chip.mint { background: var(--mint-soft); color: var(--mint); }
.chip.paused, .chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.closed, .chip.danger { background: var(--danger-soft); color: #ffb3b3; }
.chip.neon { background: var(--neon-soft); color: #ff8fbd; }
.chip.youtube { background: rgba(255, 0, 0, 0.16); color: #ff9c9c; }
.chip.local { background: var(--amber-soft); color: var(--amber); }
.chip.none { background: var(--surface-2); color: var(--dim); }

.message { padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 0.95rem; }
.message.info { background: var(--neon-soft); color: #ffb7d3; }
.message.success { background: var(--mint-soft); color: var(--mint); }
.message.error { background: var(--danger-soft); color: #ffb3b3; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.connected { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.dot.reconnecting { background: var(--amber); animation: pulse 1s infinite; }

/* big number */
.bignum {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 16vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #fff 0%, #ffb7d3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* search results */
.search-box { position: relative; }
.search-box .input { padding-left: 44px; }
.search-box .icon-lead { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.results { display: grid; gap: 10px; }
.result {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  align-items: center;
  animation: rise 0.35s ease both;
}
.result .thumb {
  width: 96px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; background: var(--surface-2);
  display: grid; place-items: center; font-size: 1.6rem;
}
.result .title { font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.result .sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.result .foot { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.clamp-1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }

/* queue list */
.qlist { display: grid; gap: 8px; }
.qitem {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
}
.qitem.mine { border-color: rgba(255, 61, 138, 0.5); background: var(--neon-soft); }
.qitem .pos { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--amber); text-align: center; }
.qitem .name { font-weight: 700; }
.qitem .song { font-size: 0.85rem; color: var(--muted); }
.qitem .wait { font-size: 0.8rem; color: var(--dim); text-align: right; white-space: nowrap; }

/* reactions */
.reactions { display: flex; gap: 8px; justify-content: space-between; }
.reactions button {
  flex: 1; font-size: 1.7rem; padding: 10px 0; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); cursor: pointer; transition: transform 0.12s ease;
}
.reactions button:active { transform: scale(1.2); }
.float-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.float-emoji { position: absolute; bottom: -40px; font-size: 2.6rem; animation: floatUp 3s ease-out forwards; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }

/* takeover */
.takeover {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, #ff3d8a 0%, #5a1238 35%, #0d0810 72%);
  animation: fadeIn 0.3s ease;
}
.takeover h1 { font-size: clamp(3rem, 14vw, 6rem); text-shadow: var(--glow); }
.takeover .inner { display: grid; gap: 18px; max-width: 420px; }

.banner { position: sticky; top: 8px; z-index: 20; animation: rise 0.3s ease; }

/* animations */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes floatUp { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-60px) scale(1.1); } 100% { transform: translateY(-80vh) scale(1); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--neon); animation: spin 0.8s linear infinite; display: inline-block; }
.stagger > * { animation: rise 0.4s ease both; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }

/* ---------- SCREEN (TV) ---------- */
.tv { min-height: 100vh; padding: 28px 32px; display: grid; grid-template-rows: auto 1fr; gap: 20px; }
.tv-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tv-top h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
.tv-promo { padding: 12px 18px; border-radius: 999px; border: 1px solid rgba(255, 179, 71, 0.4); background: var(--amber-soft); color: #ffd9a1; font-weight: 600; max-width: 520px; }
.tv-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: stretch; min-height: 0; }
.tv-stage { position: relative; border-radius: 28px; overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 60vh; display: grid; }
.tv-stage > * { grid-area: 1 / 1; }
.tv-stage .video-shell { width: 100%; height: 100%; }
.tv-stage iframe, .tv-stage video, #yt-player { width: 100%; height: 100%; display: block; background: #000; }
.tv-overlay { display: grid; place-items: center; text-align: center; padding: 40px; background: radial-gradient(circle at 50% 40%, rgba(255, 61, 138, 0.35), rgba(13, 8, 16, 0.985) 70%); z-index: 2; }
.tv-overlay .inner { display: grid; gap: 18px; justify-items: center; max-width: 720px; }
.tv-overlay h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
.tv-overlay .huge { font-size: clamp(3rem, 8vw, 7rem); font-weight: 800; letter-spacing: -0.04em; text-shadow: var(--glow); }
.countdown-ring { width: 180px; height: 180px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--neon) var(--pct, 0%), rgba(255,255,255,0.08) 0); position: relative; }
.countdown-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #140a19; }
.countdown-ring span { position: relative; z-index: 1; font-family: var(--display); font-size: 4rem; font-weight: 800; }
.tv-side { display: grid; gap: 16px; align-content: start; }
.tv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; backdrop-filter: blur(12px); }
.tv-now .name { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1; }
.tv-now .song { color: var(--muted); margin-top: 6px; }
.tv-up { display: grid; gap: 8px; }
.tv-up .item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,0.25); }
.tv-up .item .pos { font-family: var(--display); font-weight: 800; color: var(--amber); font-size: 1.3rem; text-align: center; }
.tv-up .item .n { font-weight: 700; }
.tv-up .item .s { font-size: 0.8rem; color: var(--muted); }
.qr { background: #fff; border-radius: 18px; padding: 10px; width: 100%; max-width: 260px; aspect-ratio: 1; display: grid; place-items: center; }
.qr img { width: 100%; height: 100%; }
.qr.mini { max-width: 120px; padding: 6px; border-radius: 12px; }
.tv-applause { font-family: var(--display); font-size: 1.4rem; font-weight: 800; color: var(--amber); }
.tv-status { position: absolute; top: 14px; left: 14px; z-index: 3; }
@media (max-width: 1000px) { .tv-body { grid-template-columns: 1fr; } .tv { padding: 16px; } }

/* ---------- HOST ---------- */
.host { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
.host-col { display: grid; gap: 16px; }
.now-card .name { font-family: var(--display); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.now-card .song { color: var(--muted); margin-top: 6px; }
.controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.controls .btn { flex-direction: column; gap: 2px; padding: 12px 6px; min-height: 64px; border-radius: 16px; }
.controls .btn .icon { font-size: 1.4rem; }
.controls .btn small { font-size: 0.7rem; font-weight: 600; opacity: 0.8; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); position: relative; transition: background 0.2s ease; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.switch input:checked { background: var(--neon); }
.switch input:checked::after { transform: translateX(20px); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric { background: rgba(0,0,0,0.25); border-radius: 14px; padding: 10px 12px; }
.metric .v { font-family: var(--display); font-size: 1.4rem; font-weight: 800; }
.metric .l { font-size: 0.72rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(0,0,0,0.3); }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.tabs button.active { background: var(--surface-2); color: var(--ink); }
.hq { display: grid; gap: 10px; }
.hq-item {
  display: grid; grid-template-columns: 36px 84px 1fr; gap: 12px; align-items: start;
  padding: 12px; border-radius: 16px; background: rgba(0,0,0,0.25); border: 1px solid var(--line);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hq-item[draggable="true"] { cursor: grab; }
.hq-item.dragging { opacity: 0.4; }
.hq-item.drop-target { border-color: var(--neon); }
.hq-item.singing { border-color: rgba(78, 230, 184, 0.5); background: var(--mint-soft); }
.hq-item .pos { font-family: var(--display); font-size: 1.5rem; font-weight: 800; color: var(--amber); text-align: center; padding-top: 4px; }
.hq-item .thumb { width: 84px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 1.5rem; }
.hq-item .name { font-weight: 800; font-size: 1.05rem; }
.hq-item .song { color: var(--muted); font-size: 0.9rem; }
.hq-item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drawer { margin-top: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px dashed var(--line-strong); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fadeIn 0.2s ease; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.linkbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; word-break: break-all; color: var(--muted); background: rgba(0,0,0,0.3); padding: 8px 10px; border-radius: 10px; }
details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .host { grid-template-columns: 1fr; } .controls { grid-template-columns: repeat(2, 1fr); } .metrics { grid-template-columns: repeat(2, 1fr); } }

/* toast notifications (non-blocking) */
.toast-layer { position: fixed; top: 16px; right: 16px; z-index: 200; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 16px 40px rgba(0,0,0,0.25); animation: toastIn 0.25s ease; background: #1f1a24; color: #fff; border-left: 4px solid #9aa; }
.toast.success { border-left-color: #2fbf8a; }
.toast.error { border-left-color: #ff5c5c; }
.toast.info { border-left-color: #ffb347; }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.3s ease, transform 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* on-screen controls (appear on mouse move) */
.stage-controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4; display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 999px; background: rgba(13, 8, 16, 0.85); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); animation: rise 0.2s ease; }
.stage-controls button { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--surface-2); color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.stage-controls button:hover { background: var(--neon); color: #1a0710; }
.stage-controls .hint { font-size: 0.72rem; color: var(--dim); padding: 0 8px; white-space: nowrap; }
.tv-tally { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-tally span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,0.3); font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.tv-tally span.bump { animation: bump 0.3s ease; }
@keyframes bump { 50% { transform: scale(1.25); } }

/* tablet portrait / phone: put "Ahora" first, then the queue, then everything else */
@media (max-width: 900px) {
  .host { display: flex; flex-direction: column; gap: 16px; }
  .host-col { display: contents; }
  .host-col > * { order: 2; }
  .host .now-card { order: 0; }
  .host-col:last-child > * { order: 1; }
}

/* host: screen state strip */
.screen-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); font-weight: 700; }
.screen-strip.countdown { border-color: rgba(255, 179, 71, 0.5); background: var(--amber-soft); }
.screen-strip.held { border-color: rgba(255, 61, 138, 0.5); background: var(--neon-soft); }
.screen-strip.playing { border-color: rgba(78, 230, 184, 0.4); }
.screen-strip.offline { color: var(--dim); }
.screen-strip .btn { min-height: 48px; padding: 10px 18px; font-size: 1rem; }

/* transparent layer over the video: captures mouse/touch so our controls show instead of YouTube's UI */
.stage-shield { z-index: 3; cursor: default; background: transparent; }

/* license watermark on the venue screen */
.license-mark { position: fixed; left: 14px; bottom: 10px; z-index: 60; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); background: rgba(0,0,0,0.35); padding: 4px 10px; border-radius: 999px; pointer-events: none; }

/* blocked singer: full-screen, cannot be dismissed */
.takeover.blocked { background: radial-gradient(circle at 50% 30%, #7a1f1f 0%, #2a0d12 45%, #0d0810 75%); }
.takeover.blocked h1 { text-shadow: 0 0 24px rgba(255, 92, 92, 0.5); }

/* while stalled the overlay is informational; clicks go to the shield below */
.tv-overlay.passthrough { pointer-events: none; }

/* ---------- STAGE MODE: video almost full screen while a song plays ---------- */
:root { --stage-top: 44px; --stage-bottom: 48px; }
body.stage-mode .tv { padding: 0; gap: 0; grid-template-rows: 1fr; min-height: 100vh; height: 100vh; overflow: hidden; }
body.stage-mode .tv-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 54; height: var(--stage-top); padding: 0 16px; align-items: center; gap: 12px;
  background: linear-gradient(180deg, rgba(13, 8, 16, 0.9), rgba(13, 8, 16, 0.55) 70%, rgba(13, 8, 16, 0));
}
body.stage-mode .tv-top.faded { opacity: 0; pointer-events: none; }
body.stage-mode .tv-top h1 { font-size: 1rem; line-height: 1; }
body.stage-mode .tv-top .sign { font-size: 0.7rem; }
body.stage-mode .tv-top .row .row { display: none; }
body.stage-mode .tv-top > div:first-child { display: flex; align-items: center; gap: 10px; }
body.stage-mode .tv-top > div:first-child > div { display: flex; align-items: center; gap: 10px; }
body.stage-mode .tv-promo { padding: 5px 12px; font-size: 0.85rem; max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.stage-mode .tv-body { grid-template-columns: 1fr; gap: 0; height: calc(100vh - var(--stage-bottom)); align-items: center; justify-items: center; background: #000; }
body.stage-mode .tv-side { display: none; }
body.stage-mode .tv-stage { border-radius: 0; border: 0; box-shadow: none; min-height: 0; height: 100%; width: min(100vw, calc((100vh - var(--stage-bottom)) * 16 / 9)); }
body.stage-mode .license-mark { display: none; }

.stage-strip {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--stage-bottom); z-index: 55;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 0 130px 0 16px; background: linear-gradient(180deg, rgba(13, 8, 16, 0.92), rgba(13, 8, 16, 0.98));
  border-top: 1px solid var(--line);
}
.stage-strip .stage-label { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-right: 8px; }
.stage-strip .stage-name { font-family: var(--display); font-weight: 800; font-size: 1.2rem; margin-right: 10px; white-space: nowrap; }
.stage-strip .stage-song { color: var(--muted); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-now, .stage-next { display: flex; align-items: baseline; min-width: 0; overflow: hidden; }
.stage-tally { display: flex; gap: 6px; }
.stage-tally span { padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); font-family: var(--display); font-weight: 800; font-size: 0.95rem; }
.stage-tally span.bump { animation: bump 0.3s ease; }
.stage-qr {
  position: fixed; right: 12px; bottom: 6px; z-index: 56; width: 104px; display: grid; gap: 3px; justify-items: center;
  background: #fff; color: #1a0710; border-radius: 10px; padding: 5px 5px 4px; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.stage-qr img { width: 100%; height: auto; }
body.stage-mode .stage-controls { bottom: calc(var(--stage-bottom) + 12px); }
@media (max-width: 1100px) { .stage-strip { grid-template-columns: minmax(0, 1fr) auto; } .stage-next { display: none; } }

/* login */
.auth-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; width: min(1080px, 100%); align-items: center; }
.auth-card { padding: 28px; }
@media (max-width: 900px) { .auth-grid { grid-template-columns: 1fr; } }
/* venue logo */
.logo-preview { height: 44px; max-width: 160px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,0.06); padding: 4px; }
.venue-logo { height: 54px; max-width: 220px; object-fit: contain; border-radius: 8px; }
body.stage-mode .venue-logo { height: 32px; max-width: 160px; }
.join-logo { height: 56px; max-width: 200px; object-fit: contain; border-radius: 10px; margin: 4px 0; display: block; }

/* search result preview (30 s YouTube embed) */
.preview-slot { grid-column: 1 / -1; }
.preview-slot:empty { display: none; }
.preview { margin-top: 10px; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); animation: rise 0.25s ease; }
.preview-frame { aspect-ratio: 16 / 9; width: 100%; }
.preview-frame iframe, .preview-mount { width: 100%; height: 100%; display: block; }
.preview-note { padding: 6px 10px; font-size: 0.75rem; color: var(--muted); background: rgba(255,255,255,0.04); }
.preview-note a { color: var(--neon); font-weight: 700; }
.btn.ghost.active { border-color: var(--neon); color: #ff8fbd; }

/* simple data tables (statements, audit) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.table tfoot td { border-bottom: 0; font-weight: 700; }
.table td:last-child, .table th:last-child { text-align: right; }
.credentials { white-space: pre-wrap; font-size: 0.95rem; line-height: 1.6; color: var(--ink); }
@media (max-width: 480px) { .tabs button { font-size: 0.78rem; padding: 8px 4px; line-height: 1.15; } }
.input[readonly] { opacity: 0.65; cursor: not-allowed; }

/* cantante de la noche */
.crown-card { border-color: rgba(255, 215, 90, 0.45); background: linear-gradient(160deg, rgba(255, 200, 60, 0.16), rgba(255, 255, 255, 0.03)); }
.crown-card .crown-name { font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.crown-card .crown-song { color: var(--muted); font-size: 0.95rem; }
.crown-card .crown-count { font-family: var(--display); font-weight: 800; color: #ffd75a; font-size: 1.1rem; }
.crown-card .crown-prize { color: #ffd75a; font-size: 0.9rem; margin-top: 4px; }
.crown-card.changed { animation: rise 0.4s ease; }
.strip-crown { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 200, 60, 0.18); color: #ffd75a; font-family: var(--display); font-weight: 800; font-size: 1rem; white-space: nowrap; }
.strip-crown:empty { display: none; }
.medals { display: grid; gap: 6px; margin-top: 6px; font-size: 0.9rem; }

/* remaining time of the current song */
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #ff3d8a, #ffb347); transition: width 1s linear; }
.remaining { font-family: var(--display); font-weight: 800; color: var(--amber); }
