/* 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); }

/* ---------- Dedicatorias ---------- */
.dedication-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 4vh 4vw; animation: ded-in 0.6s ease both; }
.dedication-layer.hidden { display: none; }
.dedication-layer.leaving { animation: ded-out 0.6s ease both; }
.dedication-layer.theme-birthday { background: radial-gradient(circle at 50% 40%, #ff7ab8 0%, #c2185b 45%, #3a0a24 100%); }
.dedication-layer.theme-love { background: radial-gradient(circle at 50% 45%, #ff5c8a 0%, #a3123d 50%, #2a0612 100%); }
.dedication-layer.theme-friends { background: radial-gradient(circle at 50% 40%, #ffcf6b 0%, #d9771a 50%, #2e1503 100%); }
.dedication-layer.theme-heartbreak { background: radial-gradient(circle at 50% 35%, #5b6b9c 0%, #1d2747 55%, #070a14 100%); }
.dedication-layer.theme-party { background: radial-gradient(circle at 50% 40%, #8f7bff 0%, #3f1f9c 50%, #0b0520 100%); }
.ded-bits { position: absolute; inset: 0; pointer-events: none; }
.ded-bit { position: absolute; font-size: var(--size); line-height: 1; will-change: transform, opacity; }
.ded-dot { width: calc(var(--size) * 0.5); height: calc(var(--size) * 0.8); background: var(--color); border-radius: 3px; }
.theme-birthday .ded-bit, .theme-heartbreak .ded-bit { top: -10%; animation: ded-fall linear infinite; }
.theme-birthday .ded-bit:not(.ded-dot) { top: auto; bottom: -10%; animation-name: ded-rise; }
.theme-love .ded-bit, .theme-friends .ded-bit { bottom: -10%; animation: ded-rise ease-in infinite; }
.theme-friends .ded-dot { border-radius: 50%; width: var(--size); height: var(--size); background: rgba(255, 255, 255, 0.35); }
.theme-heartbreak .ded-dot { width: 2px; height: calc(var(--size) * 2.2); background: rgba(180, 205, 255, 0.55); border-radius: 2px; animation-duration: 0.9s !important; }
.theme-party .ded-bit { animation: ded-burst ease-out infinite; }
.theme-party .ded-dot { border-radius: 50%; width: 8px; height: 8px; box-shadow: 0 0 12px var(--color); }
.ded-card { position: relative; display: grid; gap: 1.4vh; max-width: 90vw; }
.ded-theme { font-family: var(--display); font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.8rem); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); animation: ded-up 0.7s 0.2s ease both; }
.ded-for { font-family: var(--display); font-size: clamp(1.4rem, 3.5vw, 3rem); color: rgba(255, 255, 255, 0.9); animation: ded-up 0.7s 0.4s ease both; }
.ded-name { font-family: var(--display); font-weight: 800; font-size: clamp(3.4rem, 13vw, 12rem); line-height: 0.95; color: #fff; text-shadow: 0 0 30px rgba(255, 255, 255, 0.55), 0 0 80px rgba(255, 255, 255, 0.3); word-break: break-word; animation: ded-name 1.1s 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both, ded-glow 2.2s 1.8s ease-in-out infinite; }
.ded-msg { font-size: clamp(1.2rem, 3.2vw, 2.6rem); font-weight: 700; color: #fff; animation: ded-up 0.8s 1.4s ease both; }
.ded-from { font-size: clamp(1rem, 2.2vw, 1.7rem); color: rgba(255, 255, 255, 0.85); animation: ded-up 0.8s 1.9s ease both; }
.theme-heartbreak .ded-name { animation: ded-name 1.1s 0.6s ease both, ded-shake 0.5s 1.8s ease both; }
@keyframes ded-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ded-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes ded-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ded-name { from { opacity: 0; transform: scale(0.4); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ded-glow { 50% { text-shadow: 0 0 50px rgba(255, 255, 255, 0.9), 0 0 120px rgba(255, 255, 255, 0.45); } }
@keyframes ded-shake { 20%, 60% { transform: translateX(-10px) rotate(-1deg); } 40%, 80% { transform: translateX(10px) rotate(1deg); } }
@keyframes ded-fall { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--drift), 115vh) rotate(540deg); opacity: 0.9; } }
@keyframes ded-rise { from { transform: translate(0, 0) scale(0.8); opacity: 0; } 15% { opacity: 1; } to { transform: translate(var(--drift), -120vh) scale(1.15); opacity: 0; } }
@keyframes ded-burst { 0% { transform: scale(0.2); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(calc(var(--drift) * 3), calc(var(--drift) * -2)) scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ded-bit { animation: none !important; display: none; } }

/* phone: dedication form */
.ded-themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ded-themes button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 8px 2px; font: inherit; font-size: 0.72rem; display: grid; gap: 2px; justify-items: center; cursor: pointer; }
.ded-themes button span { font-size: 1.4rem; }
.ded-themes button.active { border-color: var(--neon); background: var(--neon-soft); }
.ded-preview { position: relative; height: 190px; border-radius: 16px; overflow: hidden; }
.ded-preview .dedication-layer { position: absolute; animation: none; padding: 12px; }
.ded-preview .ded-name { font-size: 2.6rem; }
.ded-preview .ded-for, .ded-preview .ded-theme { font-size: 0.85rem; }
.ded-preview .ded-msg { font-size: 0.95rem; }
.ded-preview .ded-from { font-size: 0.8rem; }

/* ---------- Muro de fotos ---------- */
.photo-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-thumb { margin: 0; display: grid; gap: 4px; font-size: 0.75rem; }
.photo-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.photo-wall { position: relative; z-index: 3; pointer-events: none; display: flex; justify-content: space-between; align-items: center; padding: 3% 2%; }
.photo-wall.hidden { display: none; }
.photo-col { display: grid; gap: 4vh; width: min(22%, 300px); }
.polaroid { background: #fff; padding: 8px 8px 10px; border-radius: 4px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); color: #222; text-align: center; animation: polaroid-in 0.8s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.polaroid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #ddd; }
.polaroid .pol-name { font-family: var(--display); font-weight: 800; font-size: clamp(0.8rem, 1.2vw, 1.1rem); margin-top: 6px; }
.polaroid .pol-cap { font-size: clamp(0.7rem, 1vw, 0.95rem); color: #555; }
.photo-col .polaroid:nth-child(1) { transform: rotate(-5deg); }
.photo-col .polaroid:nth-child(2) { transform: rotate(4deg); }
.photo-col.right .polaroid:nth-child(1) { transform: rotate(5deg); }
.photo-col.right .polaroid:nth-child(2) { transform: rotate(-3deg); }
.photo-wall.single .photo-col.left { width: min(32%, 420px); }
.photo-pop { position: fixed; top: calc(var(--stage-top, 44px) + 16px); right: 18px; z-index: 70; width: min(260px, 26vw); pointer-events: none; }
.photo-pop.hidden { display: none; }
.photo-pop .polaroid { transform: rotate(3deg); }
.photo-pop .pop-label { font-weight: 800; font-size: 0.8rem; color: #ff3d8a; }
@keyframes polaroid-in { from { opacity: 0; transform: scale(0.6) rotate(-14deg); } }

/* ---------- Cierre de la noche ---------- */
.finale-layer { position: fixed; inset: 0; z-index: 75; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; gap: 2.4vh; padding: 4vh 4vw; text-align: center; color: #fff;
  background: radial-gradient(circle at 20% 15%, rgba(255, 61, 138, 0.45), transparent 45%), radial-gradient(circle at 85% 80%, rgba(143, 123, 255, 0.4), transparent 50%), #0d0810; animation: ded-in 1s ease both; }
.finale-layer.hidden { display: none; }
.fin-brand img { max-height: 9vh; max-width: 40vw; object-fit: contain; }
.fin-brand .fin-bar { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.6rem); }
.fin-msg { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 5.4rem); line-height: 1; margin: 0; text-shadow: var(--glow); animation: ded-name 1.2s 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.fin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3vw; align-items: center; min-height: 0; }
.fin-grid.no-photos { grid-template-columns: minmax(0, 700px); justify-content: center; }
.fin-photo { position: relative; height: 100%; max-height: 62vh; display: grid; place-items: center; }
/* entrance only: with a single photo it must stay on screen; with several, each swap re-renders and re-enters */
.fin-photo .polaroid { width: min(100%, 70vh); animation: fin-photo 0.9s ease both; }
.fin-photo .polaroid img { aspect-ratio: 4 / 3; }
.fin-side { display: grid; gap: 3vh; align-content: center; }
.fin-top-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.1rem, 2.2vw, 2rem); color: var(--amber); }
.fin-row { display: grid; grid-template-columns: auto 1fr auto; gap: 1vw; align-items: center; text-align: left; padding: 1.2vh 1.4vw; border-radius: 16px; background: rgba(255, 255, 255, 0.08); margin-top: 1vh; animation: ded-up 0.8s ease both; }
.fin-row .medal { font-size: clamp(1.6rem, 3.2vw, 3rem); }
.fin-row .who { font-family: var(--display); font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 2.2rem); line-height: 1.05; }
.fin-row .what { font-size: clamp(0.8rem, 1.2vw, 1.1rem); color: rgba(255, 255, 255, 0.75); }
.fin-row .count { font-weight: 800; color: var(--amber); font-size: clamp(0.9rem, 1.5vw, 1.4rem); }
.fin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1vw; }
.fin-stats div { padding: 1.4vh 0.5vw; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.fin-stats b { display: block; font-family: var(--display); font-size: clamp(1.6rem, 3.6vw, 3.4rem); line-height: 1; }
.fin-stats span { font-size: clamp(0.75rem, 1.1vw, 1rem); color: rgba(255, 255, 255, 0.75); }
.fin-song { font-size: clamp(0.85rem, 1.3vw, 1.2rem); color: rgba(255, 255, 255, 0.75); }
@keyframes fin-photo { from { opacity: 0; transform: scale(0.92) rotate(-3deg); } to { opacity: 1; transform: scale(1) rotate(-1deg); } }
