/* Rockola — estilos de la app del local (cliente + monitor).
   Dirección: "setlist de escenario". Carbón cálido, tipografía condensada
   para números/títulos, el color de marca (--brand) solo como acento. */

:root {
    --brand: #2563eb;
    --bg: #0e0e11;
    --surface: #16161b;
    --surface-2: #1f1f26;
    --line: rgba(243, 240, 232, .09);
    --ink: #f3f0e8;
    --ink-2: #b9b6ad;
    --muted: #7c7b84;
    --ok: #3ccf7a;
    --err: #ff5d5d;
    --scrim: rgba(14, 14, 17, .75);          /* fondo de sheets/modales */
    --overlay: rgba(14, 14, 17, .87);        /* rótulos/controles sobre el video */
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Barlow", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --r: 14px;
}

/* Tema claro: se activa con data-theme="light" en <html> (config del tenant) */
[data-theme="light"] {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #eceae3;
    --line: rgba(24, 24, 30, .12);
    --ink: #1b1b20;
    --ink-2: #4c4b53;
    --muted: #8a8890;
    --scrim: rgba(246, 244, 239, .75);
    --overlay: rgba(255, 255, 255, .92);
    --shadow: 0 10px 30px rgba(24, 24, 30, .12);
    --shadow-lg: 0 10px 30px rgba(24, 24, 30, .2);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
[v-cloak] { display: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
img { display: block; }
p, h1, h2, h3, h4 { margin: 0; }
ol { list-style: none; margin: 0; padding: 0; }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: .02em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- Piezas compartidas ---------------------------------------------- */
.c-eyebrow {
    display: block; font-family: var(--display); font-weight: 600; font-size: .8rem;
    letter-spacing: .18em; text-transform: uppercase; color: var(--brand);
}
.c-num {
    font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1;
    min-width: 2ch; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums;
}
.c-mesa {
    font-family: var(--mono); font-size: .78rem; font-weight: 500; white-space: nowrap;
    padding: .3rem .5rem; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2);
}
.c-mesa.is-mine { background: var(--brand); border-color: var(--brand); color: #fff; }
.c-empty { color: var(--muted); padding: 1.6rem 0; text-align: center; font-size: .95rem; }
.c-btn {
    background: var(--brand); color: #fff; font-weight: 600; padding: .85rem 1.4rem; border-radius: 10px;
    transition: filter .15s, transform .1s;
}
.c-btn:hover { filter: brightness(1.1); }
.c-btn:active { transform: scale(.98); }
.c-btn-ghost { color: var(--ink-2); padding: .85rem 1rem; border-radius: 10px; }
.c-btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.c-link { color: var(--muted); font-size: .9rem; }
.c-link:hover { color: var(--ink); }

/* ===================================================================== */
/* CLIENTE (celular)                                                       */
/* ===================================================================== */
.client { min-height: 100vh; display: flex; flex-direction: column; }

.c-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem .75rem; max-width: 640px; width: 100%; margin: 0 auto;
}
.c-logo { height: 40px; width: auto; }
.c-venue { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: .01em; text-transform: uppercase; }
.c-table {
    display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem .35rem .8rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.c-table-label { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.c-table-num {
    font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1; min-width: 2.2rem;
    padding: .35rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); text-align: center;
}
.c-table.is-set .c-table-num { background: var(--brand); color: #fff; }

.c-main { flex: 1; padding: .5rem 1.25rem 2rem; max-width: 640px; width: 100%; margin: 0 auto; }

.c-search {
    position: sticky; top: .5rem; z-index: 5;
    display: flex; align-items: center; gap: .5rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: .4rem .4rem .4rem .9rem; margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.c-search:focus-within { border-color: var(--muted); }
.c-search-ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.c-search input {
    flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: .7rem 0; font-size: 1.05rem;
    -webkit-appearance: none;
}
.c-search input::placeholder { color: var(--muted); }
.c-search input::-webkit-search-cancel-button { display: none; }
.c-search button {
    background: var(--brand); color: #fff; font-weight: 600; padding: .7rem 1.1rem; border-radius: 10px;
}
.c-search button:disabled { opacity: .6; }

.c-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: -.75rem 0 1.5rem; }
.c-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px;
    border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; font-weight: 500; white-space: nowrap;
}
.c-chip svg { height: 14px; width: 0; opacity: 0; transition: width .15s, opacity .15s; }
.c-chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.c-chip.is-on svg { opacity: 1; width: 14px; }

.c-block { margin-bottom: 2rem; }
.c-block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .75rem; }
.c-block-head h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; text-transform: uppercase; letter-spacing: .04em; }
.c-count { color: var(--muted); font-size: .9rem; }
.c-count b { color: var(--ink); font-weight: 600; }

.c-results { display: flex; flex-direction: column; gap: .4rem; }
.c-result {
    display: flex; align-items: center; gap: .8rem; padding: .5rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.c-result img { width: 88px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.c-result-body { flex: 1; min-width: 0; }
.c-result-body h3 { font-size: .95rem; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-result-body p { font-size: .8rem; color: var(--muted); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-add {
    flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff;
    display: grid; place-items: center; transition: transform .1s, background .2s;
}
.c-add svg { width: 22px; height: 22px; }
.c-add:active { transform: scale(.92); }
.c-add:disabled { opacity: .6; }
.c-add.is-done { background: var(--ok); opacity: 1; }
.c-add.is-bad { background: var(--surface-2); color: var(--muted); opacity: 1; }

/* El botón gira mientras se comprueba si el video se puede reproducir */
.c-add.is-loading { background: var(--surface-2); }
.c-add-spin {
    width: 20px; height: 20px; border-radius: 50%; display: block;
    border: 2px solid var(--line); border-top-color: var(--brand);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* El reproductor de prueba existe pero no se ve (1px, sin interacción). Debe estar en el DOM para que YouTube lo cargue. */
.c-probe-player { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: .01; pointer-events: none; }

.c-now {
    display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; margin-bottom: .6rem;
    background: var(--surface-2); border-radius: var(--r); border-left: 3px solid var(--brand);
}
.c-now-body { flex: 1; min-width: 0; }
.c-now-body p { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15rem; }
.c-now-eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; flex: none; }
.c-now-eq i { width: 3px; background: var(--brand); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.c-now-eq i:nth-child(2) { animation-delay: .2s; }
.c-now-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

.c-setlist { display: flex; flex-direction: column; }
.c-song {
    display: flex; align-items: center; gap: .9rem; padding: .8rem .25rem;
    border-bottom: 1px solid var(--line);
}
.c-song-body { flex: 1; min-width: 0; }
.c-song-body p { font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-song-body small { color: var(--brand); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.c-song.is-mine .c-num { color: var(--brand); }

.c-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 1.25rem max(1.5rem, env(safe-area-inset-bottom)); }

.c-toast {
    position: fixed; left: 50%; bottom: max(1.5rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
    padding: .8rem 1.2rem; border-radius: 999px; font-weight: 500; font-size: .95rem; z-index: 50;
    background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); white-space: nowrap;
    animation: rise .25s ease-out;
}
.c-toast.is-err { background: var(--err); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.c-sheet {
    position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(6px);
    display: flex; align-items: flex-end; justify-content: center;
}
.c-sheet-panel {
    width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px 20px 0 0;
    padding: 1.5rem 1.25rem max(1.5rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    animation: up .25s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.c-sheet-title { font-family: var(--display); font-weight: 600; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .03em; }
.c-sheet-help { color: var(--muted); margin: .25rem 0 1.2rem; }
.c-sheet-input {
    width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem;
    font-family: var(--display); font-size: 2rem; font-weight: 700; text-align: center; letter-spacing: .1em;
}
.c-sheet-input:focus { outline: 0; border-color: var(--brand); }
.c-sheet-actions { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.c-sheet-actions .c-btn { flex: 1; }

@media (min-width: 640px) {
    .c-sheet { align-items: center; }
    .c-sheet-panel { border-radius: 20px; border: 1px solid var(--line); }
}

/* ===================================================================== */
/* MONITOR (TV)                                                            */
/* ===================================================================== */
.monitor { overflow: hidden; }
.monitor, .monitor #app { height: 100vh; }

/* Bloqueo por PIN */
.m-lock { height: 100vh; display: grid; place-items: center; padding: 2rem; }
.m-lock-card { text-align: center; width: min(100%, 380px); }
.m-lock-logo { height: 56px; width: auto; margin: 0 auto 2rem; }
.m-lock-venue { font-family: var(--display); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 2rem; }
.m-lock h1 { font-family: var(--display); font-weight: 600; font-size: 2.4rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.m-lock-help { color: var(--muted); margin: .6rem 0 2rem; }
.m-pin {
    display: block; width: 100%; margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 1rem; text-align: center; font-family: var(--display); font-size: 2.6rem; font-weight: 700; letter-spacing: .5em; text-indent: .5em;
}
.m-pin:focus { outline: 0; border-color: var(--brand); }
.m-lock .c-btn { width: 100%; padding: 1rem; font-size: 1.05rem; }
.m-lock-error { color: var(--err); font-size: .9rem; margin-top: 1rem; opacity: 0; transition: opacity .2s; }
.m-lock-error.show { opacity: 1; }

/* Escenario: reproductor + riel */
.m-stage { display: grid; grid-template-columns: 1fr 0; height: 100vh; transition: grid-template-columns .35s ease; }
.m-stage.rail-open { grid-template-columns: 1fr clamp(300px, 24vw, 420px); }

.m-player { position: relative; background: #000; overflow: hidden; }
#player { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Pantalla de espera */
.m-idle {
    position: absolute; inset: 0; z-index: 5; background: var(--bg);
    display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 4vw; padding: 6vw;
}
.m-idle::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%);
}
.m-idle-copy { position: relative; }
.m-idle-logo { height: clamp(48px, 7vw, 110px); width: auto; margin-bottom: 2.5vw; }
.m-idle-venue { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); font-size: clamp(1rem, 1.8vw, 1.6rem); margin-bottom: 2vw; }
.m-idle h2 {
    font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: .92; letter-spacing: -.01em;
    font-size: min(8.5vw, 13vh, 11rem);
}
.m-idle-welcome { color: var(--ink-2); font-size: clamp(1rem, 1.8vw, 1.8rem); margin-top: 2vw; max-width: 28ch; }
.m-idle-url { color: var(--muted); margin-top: 1.2vw; font-size: clamp(.8rem, 1.2vw, 1.2rem); }
.m-qr { position: relative; justify-self: end; background: var(--ink); padding: 1.6vw; border-radius: 1.4vw; }
.m-qr img { width: clamp(180px, 26vw, 520px); height: auto; aspect-ratio: 1; }

/* Rótulo "sonando ahora" sobre el video */
.m-now {
    position: absolute; left: 2.5vw; bottom: 8vh; z-index: 6; max-width: min(60%, 900px);
    padding: 1.2vw 1.6vw 1.2vw 1.4vw; background: var(--overlay); backdrop-filter: blur(10px);
    border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0;
}
.m-now .c-eyebrow { font-size: clamp(.7rem, 1vw, 1rem); }
.m-now h3 { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 3rem); line-height: 1.05; margin: .3vw 0 .6vw; }
.m-now .c-mesa { font-size: clamp(.75rem, 1vw, 1rem); }

/* Aviso sobre el video */
.m-alert {
    position: absolute; left: 50%; top: 1.5rem; transform: translateX(-50%); z-index: 7; max-width: 80%;
    padding: .8rem 1.2rem; border-radius: 10px; background: var(--err); color: #fff; font-weight: 500;
    font-size: clamp(.9rem, 1.3vw, 1.3rem); box-shadow: var(--shadow-lg); text-align: center;
}

/* Aviso de sonido bloqueado por el navegador */
.m-muted {
    position: absolute; left: 50%; top: 1.5rem; transform: translateX(-50%); z-index: 9;
    display: flex; align-items: center; gap: .7rem; max-width: 90%;
    padding: .9rem 1.4rem; border-radius: 999px; text-align: left;
    background: var(--brand); color: #fff; font-weight: 600;
    font-size: clamp(.9rem, 1.3vw, 1.2rem); box-shadow: var(--shadow-lg);
    animation: btnGlow 1.8s ease-in-out infinite;
}
.m-muted-ico { font-size: 1.3em; line-height: 1; }

/* Saludo de una mesa sobre el video */
.m-greet {
    position: absolute; right: 2.5vw; bottom: 8vh; z-index: 7; max-width: min(46%, 700px);
    display: flex; align-items: flex-start; gap: 1vw;
    padding: 1.2vw 1.6vw; border-radius: 14px;
    background: var(--overlay); backdrop-filter: blur(10px);
    border-right: 4px solid var(--brand);
    box-shadow: var(--shadow-lg);
}
.m-greet-ico { font-size: clamp(1.4rem, 2.2vw, 2.4rem); line-height: 1; flex: none; }
.m-greet-body { min-width: 0; }
.m-greet-text {
    font-family: var(--display); font-weight: 600; line-height: 1.1;
    font-size: clamp(1.3rem, 2.4vw, 2.8rem); overflow-wrap: anywhere;
}
.m-greet-from {
    display: block; margin-top: .4vw; color: var(--brand);
    font-size: clamp(.75rem, 1.1vw, 1.1rem); font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
}
.greet-enter-active, .greet-leave-active { transition: opacity .5s, transform .5s; }
.greet-enter-from, .greet-leave-to { opacity: 0; transform: translateX(20px); }

/* Esquina superior derecha: clave de saludos (fija) + controles (auto-ocultables) */
.m-topright {
    position: absolute; top: 1.2rem; right: 1.2rem; z-index: 8;
    display: flex; flex-direction: column; align-items: flex-end; gap: .6rem;
}

/* Clave del día para los saludos: discreta, y al pasar el mouse ofrece renovarla */
.m-code {
    display: flex; align-items: center; gap: .8rem; padding: .55rem .55rem .55rem 1rem;
    border-radius: 12px; background: var(--overlay); border: 1px solid var(--line);
    backdrop-filter: blur(8px); opacity: .55; transition: opacity .2s;
}
.m-code:hover { opacity: 1; }
.m-code-main { display: flex; flex-direction: column; line-height: 1; }
.m-code-label {
    font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.m-code-num {
    font-family: var(--display); font-weight: 700; font-size: 1.7rem; letter-spacing: .16em;
    font-variant-numeric: tabular-nums; margin-top: .15rem;
}
.m-code-renew {
    width: 0; padding: 0; overflow: hidden; white-space: nowrap; opacity: 0;
    border-radius: 8px; background: var(--brand); color: #fff; font-size: .85rem; font-weight: 600;
    transition: width .2s, opacity .2s, padding .2s;
}
.m-code:hover .m-code-renew { width: auto; opacity: 1; padding: .55rem .9rem; }
.m-code-renew:disabled { opacity: .6; }

/* Controles auto-ocultables */
.m-controls {
    display: flex; gap: .5rem;
    opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.is-active .m-controls { opacity: 1; transform: none; pointer-events: auto; }
.m-ctl {
    display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: 10px;
    background: var(--overlay); border: 1px solid var(--line); backdrop-filter: blur(8px); font-weight: 500; font-size: .9rem;
}
.m-ctl svg { width: 18px; height: 18px; }
.m-ctl:hover { background: var(--surface-2); }
.m-ctl.is-armed { background: var(--err); border-color: var(--err); color: #fff; }
.m-ctl-quiet { color: var(--muted); }

/* Lista del local (modo automático) */
.m-pl {
    position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 3vh 2vw;
    background: var(--scrim); backdrop-filter: blur(8px);
}
.m-pl-panel {
    width: min(100%, 760px); max-height: 94vh; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    padding: 1.4rem 1.4rem 1rem; box-shadow: var(--shadow-lg);
}
.m-pl-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.m-pl-head h3 { font-family: var(--display); font-weight: 700; font-size: 2rem; text-transform: uppercase; line-height: 1; }
.m-pl-x { width: 40px; height: 40px; border-radius: 10px; color: var(--ink-2); font-size: 1.1rem; }
.m-pl-x:hover { background: var(--surface-2); color: var(--ink); }

.m-pl-opts { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1rem; }
.m-sw { display: flex; align-items: center; gap: .55rem; color: var(--ink-2); font-size: .95rem; cursor: pointer; }
.m-sw input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }

.m-pl-search {
    display: flex; gap: .5rem; align-items: center; background: var(--bg);
    border: 1px solid var(--line); border-radius: var(--r); padding: .35rem .35rem .35rem .9rem;
}
.m-pl-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: .65rem 0; font-size: 1rem; }
.m-pl-search input::placeholder { color: var(--muted); }
.m-pl-search button { background: var(--brand); color: #fff; font-weight: 600; padding: .65rem 1.1rem; border-radius: 10px; }
.m-pl-search button:disabled { opacity: .6; }
.m-pl-err { color: var(--err); font-size: .9rem; margin-top: .6rem; }

.m-pl-results { margin-top: .8rem; padding: .5rem; border-radius: var(--r); background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); }
.m-pl-list { margin-top: .8rem; overflow-y: auto; scrollbar-width: none; }
.m-pl-list::-webkit-scrollbar { display: none; }
.m-pl-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .3rem; border-bottom: 1px solid var(--line); }
.m-pl-item:last-child { border-bottom: 0; }
.m-pl-item img { width: 72px; height: 45px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.m-pl-body { flex: 1; min-width: 0; }
.m-pl-body p { font-size: .95rem; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-pl-body small { color: var(--muted); font-size: .78rem; }
.m-pl-mini { width: 36px; height: 36px; border-radius: 8px; flex: none; color: var(--ink-2); font-size: 1.05rem; }
.m-pl-mini:hover { background: var(--surface-2); color: var(--ink); }
.m-ctl.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Riel lateral (setlist) */
.m-rail {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: var(--surface); border-left: 1px solid var(--line);
}
.m-rail-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.4rem 1.4rem 1rem; }
.m-rail-head h4 { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1; text-transform: uppercase; letter-spacing: .02em; margin-top: .3rem; color: var(--ink-2); }
.m-rail-head h4 b { color: var(--ink); font-weight: 700; }
.m-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .4rem; }
.m-dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(60, 207, 122, .15); }
.m-dot.off { background: var(--err); }

.m-setlist { flex: 1; overflow-y: auto; padding: 0 .8rem; scrollbar-width: none; }
.m-setlist::-webkit-scrollbar { display: none; }
.m-song {
    position: relative; display: flex; align-items: center; gap: .8rem; padding: .7rem .6rem; border-radius: 10px;
    border-bottom: 1px solid var(--line);
}
.m-song img { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.m-song-body { flex: 1; min-width: 0; }
.m-song-body p { font-weight: 500; font-size: .95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-song-body small { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.m-song.is-next { background: var(--surface-2); border-bottom-color: transparent; }
.m-song.is-next .c-num { color: var(--brand); }
.m-song.is-next small { color: var(--brand); }
.m-song-tools {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); display: flex; gap: .25rem;
    opacity: 0; transition: opacity .15s; background: var(--surface-2); padding: .2rem; border-radius: 8px;
}
.m-song:hover .m-song-tools, .m-song:focus-within .m-song-tools { opacity: 1; }
.m-song-tools button { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-2); }
.m-song-tools button:hover { background: var(--surface); color: var(--ink); }
.m-song-tools button.danger:hover { background: var(--err); color: #fff; }
.m-song-tools svg { width: 16px; height: 16px; }
.m-rail .c-empty { flex: 1; display: grid; place-items: center; padding: 1.4rem; }
.m-rail-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Transiciones Vue */
.fade-enter-active, .fade-leave-active { transition: opacity .5s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.slide-enter-active, .slide-leave-active { transition: opacity .4s, transform .4s; }
.slide-enter-from, .slide-leave-to { opacity: 0; transform: translateX(-16px); }
.list-move, .list-enter-active, .list-leave-active { transition: all .3s ease; }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateX(12px); }
.list-leave-active { position: absolute; width: calc(100% - 1.6rem); }

@media (max-width: 900px) {
    .m-stage.rail-open { grid-template-columns: 1fr; grid-template-rows: 1fr 40vh; }
    .m-rail { border-left: 0; border-top: 1px solid var(--line); }
    .m-idle { grid-template-columns: 1fr; text-align: center; }
    .m-qr { justify-self: center; }
    .m-idle-welcome { margin-inline: auto; }
    .m-greet { left: 2.5vw; right: 2.5vw; bottom: 2vh; max-width: none; }
}
/* ===================================================================== */
/* ¡TE TOCA! — takeover a pantalla completa cuando suena tu canción        */
/* ===================================================================== */
.c-turn {
    position: fixed; inset: 0; z-index: 100; overflow: hidden;
    display: grid; place-items: center; text-align: center; padding: 2rem;
    background:
        radial-gradient(120% 90% at 50% 110%, color-mix(in srgb, var(--brand) 55%, var(--bg)), transparent 65%),
        radial-gradient(90% 60% at 50% -10%, color-mix(in srgb, var(--brand) 25%, transparent), transparent 70%),
        var(--bg);
    animation: turnIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes turnIn { from { opacity: 0; transform: scale(1.06); } }
.c-turn-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.c-turn-rings i {
    grid-area: 1/1; width: 42vmin; height: 42vmin; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--brand) 60%, transparent);
    animation: ringPulse 2.4s ease-out infinite;
}
.c-turn-rings i:nth-child(2) { animation-delay: .8s; }
.c-turn-rings i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ringPulse { from { transform: scale(.55); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.c-turn-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: .6rem; max-width: 560px; }
.c-turn-copy { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.c-turn-cta { display: flex; justify-content: center; }
.c-turn-mic { font-size: clamp(3rem, 16vw, 5.5rem); animation: micBounce 1s ease-in-out infinite; }
@keyframes micBounce { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-12px) rotate(8deg); } }
.c-turn-eyebrow {
    font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .3em;
    text-transform: uppercase; color: var(--ink-2);
}
.c-turn-title {
    font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: .95;
    font-size: clamp(3rem, 17vw, 6.5rem); letter-spacing: -.01em;
}
.c-turn-song { color: var(--ink-2); font-size: 1.1rem; max-width: 34ch; }
.c-turn-eq { display: flex; align-items: flex-end; gap: 5px; height: 34px; margin-top: .4rem; }
.c-turn-eq i { width: 6px; border-radius: 3px; background: var(--brand); animation: eq 0.9s ease-in-out infinite; }
.c-turn-eq i:nth-child(2) { animation-delay: .15s; }
.c-turn-eq i:nth-child(3) { animation-delay: .3s; }
.c-turn-eq i:nth-child(4) { animation-delay: .45s; }
.c-turn-eq i:nth-child(5) { animation-delay: .6s; }
.c-turn-btn {
    margin-top: 1.2rem; background: var(--brand); color: #fff; font-weight: 700; font-size: 1.15rem;
    padding: 1rem 2.6rem; border-radius: 999px; white-space: nowrap;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 25%, transparent);
    animation: btnGlow 1.6s ease-in-out infinite;
}
@keyframes btnGlow {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
    50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--brand) 10%, transparent); }
}

/* Horizontal (celular acostado o pantalla baja): el texto va a la izquierda y
   el botón "Ya voy" a la derecha, siempre visible sin desplazar. */
@media (orientation: landscape) and (max-height: 560px) {
    .c-turn { padding: 1rem 1.5rem; place-items: center; }
    .c-turn-inner {
        flex-direction: row; align-items: center; justify-content: space-between;
        gap: 1.5rem; max-width: 100%; width: 100%; text-align: left;
    }
    .c-turn-copy { align-items: flex-start; gap: .25rem; min-width: 0; flex: 1; }
    .c-turn-mic { font-size: 2.2rem; }
    .c-turn-eyebrow { font-size: .75rem; letter-spacing: .22em; }
    .c-turn-title { font-size: clamp(2rem, 8vw, 3.4rem); }
    .c-turn-song {
        font-size: .95rem; max-width: 100%;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .c-turn-eq { height: 22px; margin-top: .2rem; }
    .c-turn-cta { flex: none; }
    .c-turn-btn { margin-top: 0; padding: 1rem 2rem; }
    .c-turn-rings i { width: 30vmin; height: 30vmin; }
}

/* "Eres el siguiente" — aviso persistente arriba */
.c-next {
    position: fixed; top: max(.75rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 55;
    display: flex; align-items: center; gap: .55rem; white-space: nowrap;
    background: var(--brand); color: #fff; font-weight: 500; font-size: .95rem;
    padding: .65rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow-lg);
    animation: rise .25s ease-out;
}
.c-next-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: nextBlink 1s ease-in-out infinite; }
@keyframes nextBlink { 50% { opacity: .25; } }

/* Pedidos en pausa (cliente) */
.c-paused {
    position: sticky; top: 0; z-index: 6; text-align: center;
    background: var(--surface-2); color: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: .6rem 1rem; font-size: .9rem;
}

/* Tu canción sonando (aviso discreto cuando NO es karaoke) */
.c-now.is-mine { background: color-mix(in srgb, var(--brand) 14%, var(--surface-2)); }
.c-now.is-mine .c-eyebrow { color: var(--brand); }

/* Chip para mandar un saludo a la pantalla */
.c-chip-greet { border-style: dashed; }
.c-chip-greet:hover { color: var(--ink); border-color: var(--brand); }

/* Sheet del saludo */
.c-greet-input {
    width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
    padding: .9rem 1rem; font-family: var(--body); font-size: 1.05rem; line-height: 1.35;
    resize: none; outline: 0;
}
.c-greet-input:focus { border-color: var(--brand); }
.c-greet-count { color: var(--muted); font-size: .78rem; text-align: right; margin-top: .35rem; }
.c-greet-code { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.c-greet-code > span {
    font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); flex: none;
}
.c-greet-code input {
    flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
    padding: .7rem 1rem; font-family: var(--display); font-size: 1.7rem; font-weight: 700;
    text-align: center; letter-spacing: .35em; text-indent: .35em; outline: 0;
}
.c-greet-code input:focus { border-color: var(--brand); }
.c-greet-hint { color: var(--muted); font-size: .78rem; margin-top: .4rem; }

/* Pedido propio esperando aprobación */
.c-song.is-pending { opacity: .75; }
.c-song.is-pending .c-num { font-size: 1.1rem; }
.c-song.is-pending small { color: var(--muted); }

/* ===================================================================== */
/* MONITOR: moderación (pedidos por aprobar)                              */
/* ===================================================================== */
.m-approve { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.m-approve-head {
    padding: .9rem 1.4rem .4rem; font-family: var(--display); font-weight: 600; font-size: 1.05rem;
    text-transform: uppercase; letter-spacing: .06em; color: var(--brand);
}
.m-approve-item { display: flex; align-items: center; gap: .6rem; padding: .5rem 1.4rem .7rem; }
.m-approve-item .m-song-body p { font-size: .9rem; }
.m-ok, .m-no {
    flex: none; width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem; font-weight: 700;
    display: grid; place-items: center;
}
.m-ok { background: var(--ok); color: #08130c; }
.m-no { background: var(--surface-2); color: var(--ink-2); }
.m-no:hover { background: var(--err); color: #fff; }

/* ===================================================================== */
/* PANEL DEL DUEÑO (/panel)                                               */
/* ===================================================================== */
.p-badge {
    font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
}
.p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.p-action {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: .9rem .6rem; font-weight: 600; font-size: .95rem;
}
.p-action.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.p-action.is-danger:active { background: var(--err); border-color: var(--err); color: #fff; }
.p-action-ico { font-size: 1.1rem; }
.p-note { color: var(--muted); font-size: .82rem; text-align: center; margin-bottom: 1rem; }
.p-mini {
    flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    background: var(--surface-2); color: var(--ink-2); font-size: 1rem; font-weight: 700;
}
.p-mini.is-ok { background: var(--ok); color: #08130c; }
.p-mini.is-no:hover, .p-mini.is-no:active { background: var(--err); color: #fff; }
.p-tools { display: flex; gap: .3rem; }
.client .m-lock { min-height: 100vh; height: auto; }

/* ===================================================================== */
/* OPCIÓN BLOQUEADA — modal del plan demo                                 */
/* ===================================================================== */
.c-lock {
    position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1.5rem;
    background: var(--scrim); backdrop-filter: blur(8px);
    animation: rise .2s ease-out;
}
.c-lock-card {
    width: min(100%, 380px); text-align: center; background: var(--surface);
    border: 1px solid var(--line); border-radius: 20px; padding: 2rem 1.6rem 1.6rem;
    box-shadow: var(--shadow-lg);
}
.c-lock-ico { font-size: 2.6rem; line-height: 1; }
.c-lock-title {
    font-family: var(--display); font-weight: 700; font-size: 1.9rem; text-transform: uppercase;
    letter-spacing: .02em; line-height: 1; margin: .8rem 0 .5rem;
}
.c-lock-text { color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.c-lock-text b { color: var(--ink); }
.c-lock-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.4rem; }
.c-lock-cta {
    background: var(--brand); color: #fff; font-weight: 700; font-size: 1.05rem;
    padding: .95rem 1.4rem; border-radius: 12px;
}
.c-lock-cta:hover { filter: brightness(1.1); }
.c-lock-close { color: var(--muted); font-size: .9rem; padding: .6rem; border-radius: 10px; }
.c-lock-close:hover { color: var(--ink); background: var(--surface-2); }

/* Controles que en demo están bloqueados: se ven apagados pero siguen siendo clicables */
.is-locked { opacity: .55; }
.is-locked::after { content: " 🔒"; font-size: .85em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
