/* Paciente Virtual · Modo presentación (ADR 0020)
 * Misma dirección artística "Turno de noche" que la aplicación, pensada para
 * proyector: todo escala con el tamaño de la pantalla (unidad --u), letra
 * grande, un solo foco por paso.
 */

:root {
  --bg: #070b0e;
  --s0: #0d1418;
  --s1: #121b21;
  --s2: #18242c;
  --s3: #1f2e37;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #edf2f5;
  --ink-2: #b8c5cd;
  --muted: #7d8f9a;
  --accent: #2ee6a8;
  --accent-soft: rgba(46, 230, 168, 0.14);
  --warm: #ffcf8a;
  --info: #7cbcff;
  --warn: #f2b53c;
  --danger: #ff6b6b;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --u: min(1vw, 1.7778vh);   /* 1 % del ancho de una pantalla 16:9 que quepa entera */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; font-size: 16px; }
:root:has(body.presenting) { font-size: calc(var(--u) * 1.32); }
body {
  margin: 0; font-family: var(--font); line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.presenting { overflow: hidden; height: 100vh; }
body.presenting.idle { cursor: none; }
h1, h2, h3, p { margin: 0; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
.eyebrow { font-family: var(--display); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--accent); margin-bottom: .5rem; }
.small { font-size: .84rem; }
kbd { font-family: var(--mono); font-size: .85em; background: var(--s2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 .4em; }

/* ---------- elegir caso ---------- */

.picker { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.picker-head { margin-bottom: 2rem; }
.picker .back { color: var(--muted); text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 1.5rem; }
.picker .back:hover { color: var(--ink); }
.picker h1 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.1; }
.lead { max-width: 60ch; color: var(--ink-2); margin-top: .8rem; font-size: 1.04rem; }
.notice { color: var(--warm); border-left: 3px solid rgba(255,207,138,.6); padding: .4rem .7rem; margin-top: 1rem; max-width: 70ch; }
.case-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.case-btn {
  position: relative; width: 100%; min-height: 220px; text-align: left; color: inherit; font: inherit; cursor: pointer;
  background: linear-gradient(160deg, var(--s2), var(--s0)); border: 1px solid var(--line-2); border-radius: 18px; padding: 1.2rem 1.2rem 1.1rem;
  display: flex; flex-direction: column; gap: .35rem; overflow: hidden; transition: transform .25s var(--ease), border-color .25s;
}
.case-btn:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--accent); }
.case-btn:disabled { opacity: .55; cursor: not-allowed; }
.case-num { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; }
.case-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; max-width: 62%; }
.case-meta { color: var(--muted); font-size: .82rem; max-width: 62%; }
.case-art { position: absolute; right: -8%; bottom: -10%; height: 105%; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(0,0,0,.6)); pointer-events: none; }
.case-cta { margin-top: auto; font-weight: 600; color: var(--accent); font-size: .9rem; }
.locked .case-cta { color: var(--muted); }

/* ---------- escenario ---------- */

.stage { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 0%, #10191f 0%, var(--bg) 60%); }
.progress { position: absolute; top: 0; left: 0; right: 0; height: .28rem; background: rgba(255,255,255,.06); z-index: 5; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #8affd8); transition: width .5s var(--ease); box-shadow: 0 0 12px rgba(46,230,168,.6); }

.slide-host { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0; padding: 3.4rem 5rem 4.6rem; display: flex; flex-direction: column; gap: 1.3rem; overflow: hidden;
  opacity: 0; transform: translateX(3rem); transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.slide.entered { opacity: 1; transform: none; }
.slide.leaving { opacity: 0; transform: translateX(-3rem); pointer-events: none; }

.slide-head { flex: 0 0 auto; max-width: 78%; }
.kicker { font-family: var(--display); font-size: .95rem; font-weight: 600; text-transform: uppercase; letter-spacing: .22em; color: var(--accent); margin-bottom: .6rem; }
.slide-title { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1.05; letter-spacing: -0.025em; }
.slide-sub { color: var(--ink-2); font-size: 1.2rem; margin-top: .6rem; max-width: 60ch; }

/* Unidades destapables */
.unit { opacity: 0; transform: translateY(.8rem); transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .6s; }
.unit.on { opacity: 1; transform: none; }
.unit.instant { transition: none !important; }
.unit.latest { box-shadow: 0 0 0 2px rgba(46,230,168,.55), 0 0 30px rgba(46,230,168,.25); }
.unit.reveal-title { transform: scale(.94); transform-origin: left center; }
.unit.reveal-title.on { transform: none; }
.card-head.unit.latest, .card-detail.unit.latest, .para.unit.latest, .dd-rationale.unit.latest { box-shadow: none; }

/* Grados de densidad (ver fitSlide): el cuerpo usa em, así baja todo a la vez */
.slide.dense-1 .blocks { font-size: .92em; }
.slide.dense-2 .blocks { font-size: .84em; }
.slide.dense-3 .blocks { font-size: .76em; }
.slide.dense-4 .blocks { font-size: .68em; }
.slide.dense-5 .blocks { font-size: .6em; }
.slide.dense-6 .blocks { font-size: .52em; }

/* Bloques */
.blocks { flex: 1 1 auto; min-height: 0; display: grid; gap: 1.2rem; align-content: start; }
/* Anamnesis y exploración fluyen en dos columnas, como una hoja de evolución. */
.blocks-history, .blocks-exam { display: block; columns: 2; column-gap: 2.2rem; }
.blocks-history .block, .blocks-exam .block { break-inside: avoid; margin-bottom: 1.1rem; }
.blocks-exam:has(.block-vitals) { display: grid; columns: auto; align-content: center; }
.blocks-tests .items, .blocks-plan .items, .blocks-safety .items { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
.block-title { font-family: var(--display); font-size: .82em; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: .45rem; display: flex; align-items: center; gap: .7rem; }
.block-title::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.items { display: grid; gap: .45rem; }

.para { font-size: 1.3em; line-height: 1.42; color: var(--ink); max-width: 48ch; }
.para.tone-info { border-left: .3rem solid var(--info); padding: .6rem 1.1rem; background: rgba(124,188,255,.08); border-radius: 0 12px 12px 0; font-family: var(--mono); font-size: 1.15em; }
.para.tone-good { border-left: .3rem solid var(--accent); padding: .6rem 1.1rem; background: var(--accent-soft); border-radius: 0 12px 12px 0; }
.kind-arrival .slide-title { font-size: 2.3rem; }
.kind-arrival .blocks { grid-template-columns: minmax(0, 60%); }

/* Hechos (anamnesis, exploración, evidencia) */
.fact { display: flex; align-items: flex-start; gap: .8rem; font-size: 1.15em; line-height: 1.32; padding: .42rem .85rem; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid transparent; }
.fact .dot { flex: 0 0 auto; width: .8rem; height: .8rem; border-radius: 50%; margin-top: .55rem; background: var(--accent); box-shadow: 0 0 10px rgba(46,230,168,.6); }
.fact.tone-absent { color: var(--ink-2); }
.fact.tone-absent .dot { background: transparent; border: 2px solid var(--muted); box-shadow: none; }
.fact.tone-key { background: var(--accent-soft); border-color: rgba(46,230,168,.4); }
.fact.tone-bad { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.45); font-size: 1.5em; padding: .8rem 1.1rem; }
.fact.tone-bad .dot { background: var(--danger); box-shadow: 0 0 12px rgba(255,107,107,.7); animation: pulse 1.6s infinite; }
.fact-text { flex: 1 1 auto; }
.tag { flex: 0 0 auto; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: var(--s3); color: var(--ink-2); border: 1px solid var(--line-2); align-self: center; white-space: nowrap; }
.tone-key > .tag { background: var(--accent); color: #05231a; border-color: transparent; }
.tone-bad > .tag { background: var(--danger); color: #2a0808; border-color: transparent; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* Constantes como en un monitor */
.block-vitals .items { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.vital { display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem 1.3rem; border-radius: 14px; background: #08110f; border: 1px solid rgba(46,230,168,.25); box-shadow: inset 0 0 40px rgba(46,230,168,.06); }
.vital-value { font-family: var(--mono); font-weight: 600; font-size: 2.4em; line-height: 1; color: var(--accent); text-shadow: 0 0 14px rgba(46,230,168,.5); }
.vital-value small { font-size: .9rem; margin-left: .3rem; color: var(--ink-2); text-shadow: none; }
.vital-text { font-size: 1em; color: var(--ink-2); line-height: 1.3; }

/* Hipótesis y objetivos como fichas */
.kind-hypotheses .items, .kind-closing .block-list .items { display: flex; flex-wrap: wrap; gap: .9rem; }
.chip { font-family: var(--display); font-weight: 600; font-size: 1.5em; padding: .8rem 1.4rem; border-radius: 999px; background: var(--s2); border: 1px solid var(--line-2); }
.kind-closing .chip { border-radius: 16px; font-size: 1.25em; background: var(--accent-soft); border-color: rgba(46,230,168,.35); flex: 1 1 100%; font-weight: 500; font-family: var(--font); }

/* Tarjetas (pruebas, plan, seguridad, otras posibilidades) */
.card { border-radius: 16px; background: var(--s1); border: 1px solid var(--line-2); overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; }
.card-label { font-family: var(--display); font-weight: 700; font-size: 1.35em; line-height: 1.2; }
.card-side { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.pill { font-family: var(--display); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; padding: .3rem .7rem; border-radius: 999px; background: var(--s3); color: var(--ink-2); }
.pill:empty { display: none; }
.card-detail { padding: .9rem 1.2rem 1.1rem; border-top: 1px solid var(--line); font-size: 1.1em; line-height: 1.45; color: var(--ink-2); background: rgba(0,0,0,.18); }
.card-detail.unit:not(.on) { display: none; }
.slide.measuring .card-detail.unit { display: block !important; }
.card.tone-good { border-color: rgba(46,230,168,.5); }
.card.tone-good .pill { background: var(--accent); color: #05231a; }
.card.tone-info .pill { background: rgba(124,188,255,.2); color: var(--info); }
.card.tone-warn { border-color: rgba(242,181,60,.45); }
.card.tone-warn .pill { background: rgba(242,181,60,.2); color: var(--warn); }
.card.tone-bad { border-color: rgba(255,107,107,.55); }
.card.tone-bad .pill { background: var(--danger); color: #2a0808; }
.card.tone-neutral .pill { background: var(--s3); color: var(--muted); }
.card .tag { background: transparent; border-color: var(--line-2); }

/* Diagnóstico diferencial */
.dd { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.6rem; align-items: start; }
.dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.dd-col h3 { font-family: var(--display); font-size: .85rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin-bottom: .6rem; }
.dd-col.pros h3 { color: var(--accent); }
.dd-col.cons h3 { color: var(--danger); }
.dd-col .fact { font-size: 1.15em; margin-bottom: .45rem; }
.dd-col.cons .fact .dot { background: transparent; border: 2px solid var(--danger); box-shadow: none; }
.dd-col .none { color: var(--muted); font-style: italic; }
.dd-rationale { font-size: 1.12em; line-height: 1.45; color: var(--ink); border-left: .3rem solid var(--warn); padding: .8rem 1.1rem; background: rgba(242,181,60,.08); border-radius: 0 12px 12px 0; }
.kind-differential .slide-title { font-size: 2.6rem; }
.kind-differential .slide-sub { color: var(--warn); font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; }

/* Diagnóstico final */
.kind-diagnosis .slide-title { color: var(--accent); text-shadow: 0 0 30px rgba(46,230,168,.35); font-size: 2.7rem; }
.kind-diagnosis .slide-head { max-width: 90%; }
.kind-diagnosis .blocks { grid-template-columns: 1.6fr 1fr; }
.kind-diagnosis .para.tone-good { font-size: 1.05em; }
.kind-diagnosis .block-facts .items { grid-template-columns: 1fr 1fr; }
.kind-diagnosis .fact { font-size: 1em; padding: .4rem .8rem; }

/* Camino de razonamiento */
.block-timeline .items { gap: 0; }
.tl { position: relative; padding: .5rem 0 .9rem 2.6rem; }
.tl::before { content: ""; position: absolute; left: .7rem; top: 0; bottom: 0; width: 2px; background: var(--line-2); }
.tl::after { content: ""; position: absolute; left: .2rem; top: 1rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .3rem var(--bg), 0 0 14px rgba(46,230,168,.6); }
.tl-stage { font-family: var(--display); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); display: block; margin-bottom: .2rem; }
.tl-text { font-size: 1.12em; line-height: 1.4; max-width: 70ch; }

/* Evolución */
.block-evolution .items { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: stretch; }
.evo { padding: 1.3rem 1.4rem; border-radius: 18px; background: var(--s1); border: 1px solid var(--line-2); border-top-width: .4rem; }
.evo h3 { font-family: var(--display); font-size: 1.15em; margin-bottom: .6rem; }
.evo p { font-size: 1.08em; line-height: 1.45; color: var(--ink-2); }
.evo.tone-good { border-top-color: var(--accent); }
.evo.tone-warn { border-top-color: var(--warn); }
.evo.tone-bad { border-top-color: var(--danger); }

/* Bibliografía */
.ref { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1rem; font-size: 1.05em; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.ref-title { font-weight: 500; }
.ref-url { flex-basis: 100%; font-family: var(--mono); font-size: .8rem; color: var(--muted); word-break: break-all; }
.kind-closing .blocks { grid-template-columns: 1.1fr .9fr; }

/* Portada y pausas */
.kind-cover { justify-content: center; }
.kind-cover .kicker { font-size: 1.1rem; }
.kind-cover .slide-title { font-size: 4.4rem; max-width: 60%; }
.kind-cover .slide-sub { font-size: 1.4rem; }
.cover-body { display: flex; flex-direction: column; gap: 1.4rem; max-width: 60%; }
.cover-who { font-size: 1.8rem; color: var(--ink-2); font-family: var(--display); }
.ecg { width: 100%; height: 5rem; }
.ecg path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 4s linear infinite; filter: drop-shadow(0 0 6px rgba(46,230,168,.7)); }
@keyframes trace { to { stroke-dashoffset: 0; } }
.cover-hint { color: var(--muted); font-size: 1rem; }
.kind-question { justify-content: center; align-items: center; text-align: center; }
.kind-question .slide-head { max-width: 80%; }
.kind-question .slide-title { font-size: 3.6rem; }
.question-body { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; max-width: 70%; }
.question-mark { font-family: var(--display); font-weight: 800; font-size: 9rem; line-height: 1; color: var(--accent); text-shadow: 0 0 60px rgba(46,230,168,.45); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }
.question-prompt { font-size: 1.7rem; line-height: 1.4; color: var(--ink-2); }

/* Paciente en portada y llegada */
.patient-figure { position: absolute; right: 4rem; bottom: 0; top: 4rem; margin: 0; width: 34%; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; z-index: 0; }
.patient-figure::before { content: ""; position: absolute; inset: auto 0 -20% 0; height: 70%; background: radial-gradient(50% 60% at 50% 60%, rgba(46,230,168,.18), transparent 70%); }
.patient-figure img { position: relative; max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,.7)); }
.kind-arrival .patient-figure { width: 30%; opacity: .95; }
.slide-head, .blocks, .cover-body { position: relative; z-index: 1; }

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem 1.4rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: linear-gradient(to top, rgba(7,11,14,.92), transparent); opacity: 0; transition: opacity .35s; z-index: 6; font-size: 16px;
}
.hud.visible { opacity: 1; }
.hud-left, .hud-center, .hud-right { display: flex; align-items: center; gap: .6rem; }
.hud-btn { font: inherit; font-size: 1.1rem; line-height: 1; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line-2); background: var(--s2); color: var(--ink); cursor: pointer; }
.hud-btn:hover { border-color: var(--accent); color: var(--accent); }
.hud-btn:disabled { opacity: .35; cursor: default; }
.hud-case { color: var(--muted); font-size: .85rem; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-counter { font-family: var(--mono); font-size: .9rem; min-width: 7rem; text-align: center; color: var(--ink-2); }

/* Índice */
.index { position: absolute; inset: 0; background: rgba(7,11,14,.7); backdrop-filter: blur(6px); z-index: 7; display: flex; justify-content: flex-end; font-size: 16px; }
.index-panel { width: min(420px, 90vw); height: 100%; overflow: auto; background: var(--s0); border-left: 1px solid var(--line-2); padding: 1.5rem 1.2rem 3rem; }
.index ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.index li button { width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .6rem .5rem; display: grid; gap: .1rem; cursor: pointer; border-radius: 8px; }
.index li button:hover { background: var(--s2); }
.index li.current button { background: var(--accent-soft); }
.index li button::before { counter-increment: s; content: counter(s); font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.ix-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.ix-title { font-size: .95rem; }

/* Mensajes */
.error { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--danger); color: #2a0808; padding: .6rem 1rem; border-radius: 10px; font-weight: 600; z-index: 9; font-size: 16px; }
.loading { position: fixed; top: 1rem; right: 1rem; display: flex; gap: .5rem; align-items: center; background: var(--s2); border: 1px solid var(--line-2); padding: .4rem .8rem; border-radius: 999px; font-size: 14px; z-index: 9; }
.spinner { width: 1rem; height: 1rem; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pantallas estrechas (un móvil de apoyo): se reduce el margen */
@media (max-aspect-ratio: 4/3) {
  .slide { padding: 4rem 2.5rem 5rem; }
  .patient-figure { display: none; }
  .kind-cover .slide-title, .cover-body, .slide-head { max-width: 100%; }
  .blocks-history, .blocks-exam, .kind-diagnosis .blocks, .kind-diagnosis .block-facts .items, .kind-closing .blocks, .dd, .dd-cols, .block-evolution .items { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .unit, .slide { transition: none; }
  .ecg path, .question-mark, .fact.tone-bad .dot { animation: none; }
}

/* ---------- Aula en directo (ADR 0021) ---------- */
.hud-btn.wide { width: auto; border-radius: 999px; padding: 0 .9rem; font-size: .85rem; font-weight: 600; }
.live-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--danger); margin-right: .35em; vertical-align: middle; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-badge { position: absolute; top: 1rem; right: 1.2rem; z-index: 6; display: flex; align-items: center; gap: .6rem; font: inherit; font-size: 16px; color: var(--ink); background: rgba(8,14,24,.85); border: 1px solid var(--line-2); border-radius: 999px; padding: .4rem .9rem; cursor: pointer; backdrop-filter: blur(8px); }
.live-badge b { font-family: var(--mono); letter-spacing: .15em; color: var(--accent); }
.live-count { color: var(--muted); font-size: .85rem; }
.with-panel .slide-host { right: 36%; }
.with-panel .live-badge { right: calc(36% + 1.2rem); }
.live-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 36%; z-index: 5; background: rgba(10,16,21,.96); border-left: 1px solid var(--line-2); padding: 1.6rem 1.4rem 5rem; overflow: auto; font-size: 16px; display: flex; flex-direction: column; gap: .9rem; }
.live-panel-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.live-panel-head .kicker { margin: 0; font-size: .8rem; }
.live-q { font-family: var(--display); font-size: 1.35rem; line-height: 1.2; }
.live-note { color: var(--muted); font-size: .9rem; }
.live-tpl { display: grid; gap: .15rem; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--s2); border: 1px solid var(--line-2); border-radius: 12px; padding: .8rem .9rem; cursor: pointer; }
.live-tpl:hover { border-color: var(--accent); }
.live-tpl-kind { font-family: var(--mono); font-size: .7rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.live-tpl-q { font-weight: 600; }
.live-custom { display: grid; gap: .4rem; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.live-custom label { font-family: var(--display); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.live-custom input { font: inherit; color: var(--ink); background: var(--s2); border: 1px solid var(--line-2); border-radius: 10px; padding: .6rem .8rem; }
.btn-solid, .btn-ghost { font: inherit; font-weight: 600; border-radius: 10px; padding: .6rem 1rem; cursor: pointer; }
.btn-solid { background: var(--accent); color: #05231a; border: 0; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }
.live-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.live-bars { display: grid; gap: .7rem; }
.live-bar-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.live-bar-letter { font-family: var(--display); font-weight: 800; font-size: .8rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--s3); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.live-bar-label { flex: 1; font-weight: 500; line-height: 1.2; }
.live-bar-count { font-family: var(--mono); font-weight: 600; font-size: 1.1rem; }
.live-bar-track { height: .9rem; border-radius: 999px; background: var(--s2); overflow: hidden; }
.live-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width .6s var(--ease); }
.live-bar-fill.c0 { background: #ff6b6b; } .live-bar-fill.c1 { background: #4d9fff; } .live-bar-fill.c2 { background: #f2b53c; } .live-bar-fill.c3 { background: var(--accent); }
.live-bar.correct .live-bar-label { color: var(--accent); font-weight: 700; }
.live-bar.correct .live-bar-letter { background: var(--accent); color: #05231a; }
.live-bar.correct .live-bar-fill { background: var(--accent); box-shadow: 0 0 14px rgba(46,230,168,.6); }
.live-bar.wrong { opacity: .45; }
.live-texts { display: grid; gap: .45rem; }
.live-text { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: start; background: var(--s2); border: 1px solid var(--line-2); border-radius: 12px; padding: .55rem .7rem; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: translateY(.4rem); opacity: 0; } to { transform: none; opacity: 1; } }
.live-text-nick { font-family: var(--mono); font-size: .72rem; color: var(--accent); padding-top: .2rem; }
.live-text-body { font-size: 1rem; line-height: 1.35; }
.live-hide { font: inherit; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: .9rem; }
.live-hide:hover { color: var(--danger); }
.live-overlay { position: absolute; inset: 0; z-index: 8; background: rgba(7,11,14,.92); display: flex; align-items: center; justify-content: center; cursor: pointer; text-align: center; }
.live-code-box, .live-board-box { display: flex; flex-direction: column; align-items: center; gap: .6rem; max-width: 80%; }
.live-code-url { font-size: 1.6rem; color: var(--ink-2); }
.live-code-url b { color: var(--ink); }
.live-code-code { font-family: var(--mono); font-weight: 600; font-size: 9rem; line-height: 1; letter-spacing: .18em; color: var(--accent); text-shadow: 0 0 40px rgba(46,230,168,.45); margin: .4rem 0; }
.live-code-count { font-size: 1.4rem; color: var(--warm); }
.live-names { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; max-width: 60rem; }
.live-names span { font-size: 1rem; background: var(--s2); border: 1px solid var(--line-2); border-radius: 999px; padding: .2rem .8rem; animation: pop .3s var(--ease); }
.live-board-box h2 { font-size: 3rem; }
.live-board-list { list-style: none; margin: .8rem 0 0; padding: 0; width: min(60rem, 80vw); display: grid; gap: .5rem; text-align: left; }
.live-board-list li { display: grid; grid-template-columns: 3rem 14rem 1fr 6rem; align-items: center; gap: 1rem; font-size: 1.5rem; }
.live-rank { font-family: var(--display); font-weight: 800; color: var(--warm); }
.live-nick { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-track { height: 1.1rem; border-radius: 999px; background: var(--s2); overflow: hidden; }
.live-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #8affd8); border-radius: 999px; transition: width .6s var(--ease); }
.live-pts { font-family: var(--mono); text-align: right; }
.live-board-list li:first-child .live-rank { font-size: 2rem; }
@media (max-aspect-ratio: 4/3) { .with-panel .slide-host { right: 0; bottom: 45%; } .live-panel { width: 100%; top: auto; height: 45%; border-left: 0; border-top: 1px solid var(--line-2); } .live-code-code { font-size: 5rem; } }
