/* ==========================================================================
   El Despertar del Mito · estilos PROVISIONALES
   Todo color sale de variables: cuando llegue el sistema de diseño de Figma
   se reemplazan los tokens de :root y [data-scene].
   ========================================================================== */
:root {
  --font-ui: 'DM Sans', system-ui, sans-serif;
  --font-story: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ink: #f3ede2;
  --ink-2: rgba(243, 237, 226, 0.68);
  --ink-3: rgba(243, 237, 226, 0.42);
  --line: rgba(243, 237, 226, 0.12);
  --surface: rgba(18, 14, 10, 0.55);
  --surface-2: rgba(255, 255, 255, 0.05);
  --panel-bg: #0d0c0a;

  --ok: #8fd18a;
  --bad: #e2766a;
  --radius: 14px;

  /* escena por defecto: fogata */
  --bg: #120c08; --g1: #c2601e; --g2: #6b2a10; --accent: #e0a253;
  --t: 1.4s;
}
body[data-scene='bosque']   { --bg: #070d0b; --g1: #1f4632; --g2: #0e2a2a; --accent: #9cc98f; }
body[data-scene='rio']      { --bg: #041013; --g1: #0f5a63; --g2: #0a2c46; --accent: #5ccaca; }
body[data-scene='niebla']   { --bg: #0e1112; --g1: #56625f; --g2: #2a3434; --accent: #c3cec6; }
body[data-scene='catedral'] { --bg: #061108; --g1: #2f7d3a; --g2: #7c9a2e; --accent: #a6e597; }
body[data-scene='cinta']    { --bg: #15110b; --g1: #7a5b2e; --g2: #3d2b15; --accent: #e9c78d; }
body[data-scene='amanecer'] { --bg: #16131b; --g1: #e3a26b; --g2: #5a6fa8; --accent: #ffd39c; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  transition: background var(--t) ease;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- layout ---------------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: 'top top' 'rail panel' 'stage panel';
  height: 100vh;
}
.topbar { grid-area: top; }
.rail { grid-area: rail; }
.stage { grid-area: stage; }
.panel { grid-area: panel; }

/* ---------------- topbar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(8px);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, var(--accent), transparent 62%), radial-gradient(circle at 50% 50%, var(--g1), var(--g2));
  box-shadow: 0 0 18px -2px var(--g1);
  transition: all var(--t);
}
.brand-title { font-family: var(--font-story); font-weight: 600; font-size: 17px; letter-spacing: 0.01em; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.settings { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 5px 10px; color: var(--ink-2); font-size: 12px; }
.seg button.is-active { background: var(--accent); color: #111; font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); }

.btn-primary, .btn-ghost {
  border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: 14px; border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent); color: #15110b; }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }
.sm { padding: 6px 12px; font-size: 12.5px; }
.btn-primary .k { opacity: 0.55; font-family: var(--font-mono); font-size: 11px; margin-left: 4px; }

/* ---------------- rail (acontecimientos) ---------------- */
.rail {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 14px 20px 12px; border-bottom: 1px solid var(--line);
  position: relative; z-index: 2; background: rgba(0, 0, 0, 0.15);
}
.act { opacity: 0.45; transition: opacity 0.4s; min-width: 0; }
.act.is-done { opacity: 0.75; }
.act.is-current { opacity: 1; }
.act-head { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.act-n { font-family: var(--font-mono); color: var(--accent); }
.act-title { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.act.is-current .act-title { color: var(--ink); }
.act-track { display: flex; align-items: center; height: 16px; }
.dash { flex: 1; height: 1px; background: var(--line); min-width: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; transition: all 0.3s; }
.dot.dot-act { border-radius: 2px; transform: rotate(45deg) scale(0.9); }
.dot.is-visited { background: var(--ink-2); }
.dot.is-current { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 1.6s infinite; }
.dot-gate { width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); background: transparent; border: 1.5px solid var(--accent); display: grid; place-items: center; }
.dot-gate i { width: 6px; height: 6px; border-radius: 1px; background: transparent; }
.dot-gate.is-heard { background: var(--accent); }
.dot-gate.is-skipped { border-style: dashed; opacity: 0.6; }
.dot-gate.is-current { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 1.6s infinite; }
.dot-gate.is-listening i { background: var(--accent); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }

/* ---------------- stage ---------------- */
.stage { position: relative; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; transition: background var(--t), opacity var(--t); }
.g1 { width: 70%; height: 70%; left: 15%; bottom: -30%; background: var(--g1); animation: drift 14s ease-in-out infinite alternate; }
.g2 { width: 55%; height: 60%; right: -15%; top: -25%; background: var(--g2); opacity: 0.45; animation: drift 19s ease-in-out infinite alternate-reverse; }
body[data-scene='fogata'] .g1 { animation: flicker 3.2s ease-in-out infinite, drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(6%, -4%) scale(1.08); } }
@keyframes flicker { 0%, 100% { opacity: 0.55; } 30% { opacity: 0.42; } 55% { opacity: 0.62; } 70% { opacity: 0.47; } }
.grain { position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

.now {
  position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 28px clamp(20px, 5vw, 64px) 20px; max-width: 920px; width: 100%; margin: 0 auto;
}
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); letter-spacing: 0.02em; }
.chip-act { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.o-guion { color: #a8d5a2; } .o-ficha { color: #e8c37a; } .o-propuesto { color: #c9a6e8; }
.node-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.node-title { flex-basis: 100%; margin: 6px 0 0; font-family: var(--font-story); font-weight: 400; font-size: 15px; color: var(--ink-2); }
.node-title em { color: var(--ink-3); }

.speaker { display: flex; align-items: center; gap: 14px; }
.portrait {
  --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff 0%), color-mix(in srgb, var(--c) 35%, #000));
  font-family: var(--font-story); font-weight: 600; font-size: 20px; color: #fff; letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 10px 40px -10px var(--c);
}
.portrait::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--c); opacity: 0; }
.speaker.is-speaking .portrait::after { animation: ring 1.8s ease-out infinite; }
.speaker.is-waiting .portrait::after { opacity: 0.5; animation: ring 2.8s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.95); opacity: 0.7; } 100% { transform: scale(1.3); opacity: 0; } }
.speaker.is-sfx .portrait { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.wave { display: flex; gap: 3px; align-items: center; height: 24px; }
.wave i { width: 3px; height: 30%; background: var(--accent); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.15s; } .wave i:nth-child(3) { animation-delay: 0.3s; } .wave i:nth-child(4) { animation-delay: 0.45s; } .wave i:nth-child(5) { animation-delay: 0.6s; }
@keyframes wave { 50% { height: 100%; } }
.who-name { font-weight: 600; font-size: 15px; }
.who-role { font-size: 12.5px; color: var(--ink-3); }

.caption { min-height: 120px; }
.caption:empty, .caption:has(.cue-loop) { min-height: 0; }
.caption.fade > * { animation: rise 0.5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.line { font-family: var(--font-story); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.45; margin: 0 0 10px; text-wrap: pretty; }
.line-duende { font-style: italic; color: color-mix(in srgb, #b7c46a 70%, var(--ink)); }
.cue { font-family: var(--font-story); font-style: italic; color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.cue-tag { font-family: var(--font-mono); font-style: normal; font-size: 10px; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--accent); flex: none; }
.cue-loop .cue-tag { animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.line-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.line-count b { color: #c9a6e8; font-weight: 500; }

/* ---------------- interacción ---------------- */
.interaction:empty { display: none; }
.interaction.is-on { animation: rise 0.45s ease both; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px; backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
.card-gate { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), var(--surface) 60%); }
.card-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.card-q { font-family: var(--font-story); font-weight: 400; font-size: 24px; margin: 0 0 16px; }
.opts { display: grid; gap: 10px; }
.opts-2 { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; position: relative;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.opt:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); transform: translateY(-1px); }
.opt-k { font-family: var(--font-mono); font-size: 12px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--accent); flex: none; }
.opt-body { display: flex; flex-direction: column; gap: 2px; }
.opt-label { font-weight: 600; font-size: 15px; }
.opt-hint { font-size: 12px; color: var(--ink-3); }
.opt-myth { border-color: color-mix(in srgb, var(--c, var(--accent)) 50%, transparent); }
.opt-myth .opt-k { background: var(--c, var(--accent)); color: #111; border-color: transparent; }
.badge { position: absolute; top: -8px; right: 10px; font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--ok); color: #102010; font-weight: 700; }

.voice { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.voice-off { font-size: 12px; color: var(--ink-3); }
.btn-voice { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px dashed var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-2); }
.btn-voice svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn-voice.is-on { border-style: solid; border-color: var(--bad); color: var(--bad); animation: blink 1.2s infinite; }
.voice-heard { font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.design-note { margin-top: 14px; font-size: 12px; color: var(--ink-3); border-left: 2px solid #c9a6e8; padding: 4px 0 4px 10px; }
.design-note b { color: #c9a6e8; font-weight: 600; margin-right: 6px; }

.timer { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); margin-bottom: 16px; overflow: visible; }
.timer-fill { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--bad), var(--accent)); transition: width 0.1s linear; }
.timer span { position: absolute; right: 0; top: -20px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }

.river { position: relative; height: 110px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); margin-bottom: 14px; overflow: hidden; --amp: 0.7; }
.river-bars { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 14px; }
.river-bars i { flex: 1; max-width: 10px; border-radius: 4px; background: var(--accent); height: calc(10% + var(--amp) * 70%); animation: riv calc(1.4s - var(--amp) * 0.9s) ease-in-out infinite; animation-delay: var(--d); opacity: 0.85; transition: height 0.5s; }
.river[data-phase='brava'] .river-bars i { background: var(--bad); }
@keyframes riv { 50% { transform: scaleY(0.35); } }
.river-label { position: absolute; left: 14px; bottom: 8px; font-size: 12px; font-family: var(--font-mono); color: var(--ink-2); background: rgba(0, 0, 0, 0.45); padding: 2px 8px; border-radius: 6px; }
.river.is-blind .river-bars, .river.is-blind .river-label { display: none; }
.blind-msg { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-story); font-style: italic; color: var(--ink-3); }
.card-river .opt { justify-content: center; padding: 18px; }
.card-river .opt-k { display: none; }
.card-river .opt-label { font-size: 18px; }
.tries { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

.echoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.echo { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; transition: border-color 0.3s, box-shadow 0.3s; }
.echo.is-playing { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.echo-pos { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }
.echo-sound { font-family: var(--font-story); font-size: 16px; min-height: 44px; }
.echo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dots-round { display: flex; gap: 6px; margin-top: 14px; }
.dots-round i { width: 22px; height: 4px; border-radius: 4px; background: var(--line); }
.dots-round i.ok { background: var(--ok); } .dots-round i.cur { background: var(--accent); }

/* fin */
.end-sub { color: var(--ink-2); margin: -8px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-family: var(--font-story); font-size: 26px; font-weight: 400; }
.stats span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.tapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.tape { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tape.is-heard { border-style: solid; border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.tape-n { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.tape-t { font-family: var(--font-story); font-size: 15px; }
.tape-s { font-size: 11px; color: var(--ok); }
.path { margin-bottom: 16px; font-size: 13px; color: var(--ink-2); }
.path summary { cursor: pointer; }
.path ol { padding-left: 20px; margin: 10px 0 0; display: grid; gap: 6px; }
.path li span { display: block; }
.p-node { font-size: 11px; color: var(--ink-3); }

/* ---------------- transporte ---------------- */
.transport { position: relative; z-index: 2; padding: 12px clamp(20px, 5vw, 64px) 18px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(10px); }
.progress { display: flex; gap: 3px; height: 4px; margin-bottom: 12px; max-width: 920px; margin-inline: auto; }
.progress span { flex: 1; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.12s linear; }
.controls { display: flex; align-items: center; gap: 10px; max-width: 920px; margin: 0 auto; }
.ctl { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; display: grid; place-items: center; }
.ctl svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.ctl-main { width: 52px; height: 52px; background: var(--accent); color: #15110b; border-color: transparent; }
.ctl-main svg { width: 20px; height: 20px; }
.ctl-main .i-pause, .ctl-main.is-playing .i-play { display: none; }
.ctl-main.is-playing .i-pause { display: block; }
.status { margin-left: auto; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.st-playing { background: var(--ok); animation: blink 1.4s infinite; }
.st-waiting { background: var(--accent); animation: blink 0.9s infinite; }
.st-paused { background: #e8c37a; }

/* ---------------- splash ---------------- */
.splash { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 100%, rgba(194, 96, 30, 0.35), transparent 60%), rgba(10, 7, 5, 0.86); transition: opacity 0.6s, visibility 0.6s; }
.splash.is-hidden { opacity: 0; visibility: hidden; }
.splash-card { max-width: 560px; text-align: center; }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.splash h1 { font-family: var(--font-story); font-weight: 400; font-size: clamp(44px, 7vw, 76px); line-height: 0.98; margin: 14px 0 18px; }
.splash h1 em { color: var(--accent); }
.splash p { color: var(--ink-2); line-height: 1.6; }
.splash-tip { font-size: 13px; color: var(--ink-3) !important; }
.splash-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0 18px; }
.splash .btn-primary { padding: 14px 28px; font-size: 15px; box-shadow: 0 10px 40px -10px var(--g1); }
.kbd-help { font-size: 11.5px; color: var(--ink-3); }
kbd { font-family: var(--font-mono); font-size: 10.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; margin: 0 1px; }

/* ---------------- panel lógico ---------------- */
.panel { background: var(--panel-bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; position: relative; z-index: 3; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; padding: 12px 0; font-size: 12.5px; color: var(--ink-3); border-bottom: 2px solid transparent; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-body { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }
.panel-hint { font-size: 11.5px; color: var(--ink-3); margin: 0 0 10px; line-height: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 10.5px; color: var(--ink-3); margin-bottom: 12px; }
.fgroup { margin-bottom: 14px; }
.fgroup-h { font-size: 11px; color: var(--ink-2); margin-bottom: 4px; letter-spacing: 0.02em; }
.fgroup-h span { font-family: var(--font-mono); color: var(--accent); }
.fnode { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; color: var(--ink-3); }
.fnode:hover { background: var(--surface-2); color: var(--ink); }
.fnode.is-visited { color: var(--ink-2); }
.fnode.is-current { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
.fnode.is-branch { padding-left: 28px; }
.fi { width: 14px; text-align: center; font-size: 11px; flex: none; }
.ft { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx { color: var(--ok); }
.fo { font-family: var(--font-mono); font-size: 9.5px; opacity: 0.8; }
.t-gate .fi, .legend .t-gate { color: var(--accent); }
.t-myth .fi, .legend .t-myth { color: #e9c78d; }
.t-challenge .fi, .legend .t-challenge { color: #5ccaca; }
.t-choice .fi, .legend .t-choice { color: #9cc98f; }
.is-loop .fi, .lg-loop { color: var(--bad); }

.meters { display: grid; gap: 8px; margin-bottom: 14px; }
.meter { display: grid; grid-template-columns: 80px 1fr 34px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.meter div { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; transition: width 0.4s; }
.m-esc i { background: var(--ok); } .m-imp i { background: var(--bad); } .m-tap i { background: #e9c78d; }
.meter b { font-family: var(--font-mono); font-weight: 500; text-align: right; }
.json { font-family: var(--font-mono); font-size: 11px; line-height: 1.55; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); margin: 0 0 10px; }
.jk { color: #9cc9e0; } .js { color: #a8d5a2; } .jn { color: #e8c37a; } .jb { color: #c9a6e8; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.log li { display: grid; grid-template-columns: 58px 66px 1fr; gap: 6px; font-size: 11.5px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.log time { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.lt { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.lt-decision { color: var(--accent); } .lt-myth { color: #e9c78d; } .lt-await { color: #5ccaca; } .lt-dev { color: #c9a6e8; } .lt-error { color: var(--bad); }
.lm { color: var(--ink-2); }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(560px, 1fr) 420px; grid-template-areas: 'top' 'rail' 'stage' 'panel'; height: auto; min-height: 100vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .rail { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px 12px; }
  .act-title { display: none; }
  .opts-2, .echoes, .stats, .tapes { grid-template-columns: 1fr 1fr; }
  .echoes { grid-template-columns: 1fr; }
  .line { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- mezclador ---------------- */
.mixer-wrap { position: relative; }
.mixer { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; z-index: 30; padding: 14px; border-radius: 14px; background: #15120e; border: 1px solid var(--line); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8); display: grid; gap: 10px; }
.mixer-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.mixer label:not(.toggle) { display: grid; grid-template-columns: 64px 1fr 38px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.mixer input[type='range'] { accent-color: var(--accent); width: 100%; }
.mixer b { font-family: var(--font-mono); font-weight: 400; font-size: 11px; text-align: right; color: var(--ink-3); }
.mixer .toggle { font-size: 12px; align-items: flex-start; line-height: 1.35; }

/* ---------------- slot de voz bajo el subtítulo ---------------- */
.slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; margin: 4px 0 8px; color: var(--ink-3); }
.slot code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.slot-k { font-family: var(--font-mono); color: var(--accent); }
.pst { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.st-ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.st-miss { background: transparent; border: 1.5px solid var(--bad); }
.st-part { background: linear-gradient(90deg, var(--ok) 50%, transparent 50%); border: 1.5px solid var(--ok); }
.st-pend { background: var(--ink-3); animation: blink 1s infinite; }
.st-none { background: transparent; }

/* ---------------- sonando ahora ---------------- */
.nowplaying { margin-left: 18px; display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-2); min-width: 0; overflow: hidden; white-space: nowrap; }
.nowplaying span { overflow: hidden; text-overflow: ellipsis; }
.nowplaying i { font-style: normal; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.nowplaying em { font-style: normal; font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.nowplaying em.src-file { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

/* ---------------- pestaña producción ---------------- */
.tab { font-size: 12px; }
.psums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.psum { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; padding: 7px 6px 9px; display: flex; flex-direction: column; }
.psum b { font-family: var(--font-story); font-weight: 400; font-size: 17px; }
.psum small { font-size: 10px; color: var(--ink-3); }
.psum span { font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.psum i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--ok); }
.pfilters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pfilters button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 11px; color: var(--ink-2); }
.pfilters button.is-active { background: var(--accent); color: #15110b; border-color: transparent; }
.pactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.pactions .sm { padding: 5px 10px; font-size: 11px; }
.pcopied { font-size: 11px; color: var(--ok); }
.pgroup { margin-bottom: 10px; border-radius: 10px; }
.pgroup.is-current { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.pgroup-h { width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; font-size: 12px; color: var(--ink); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pgroup-h span { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); }
.pgroup-h code { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.pgroup-h em { font-style: normal; font-size: 10px; color: #c9a6e8; }
.prow { display: flex; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 8px; }
.prow .pst { margin-top: 5px; }
.prow.is-current { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pbody { min-width: 0; flex: 1; }
.ptop { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ptype { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.05em; padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.p-voz .ptype { color: var(--accent); } .p-mus .ptype { color: #c9a6e8; } .p-amb .ptype { color: #5ccaca; } .p-sfx .ptype { color: #9cc98f; } .p-mix .ptype, .p-note .ptype { color: var(--ink-3); }
.ptop code { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); word-break: break-all; }
.ptop code.muted { color: var(--ink-3); }
.ptxt { font-size: 12px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.ptxt b { color: var(--ink); font-weight: 600; }
.p-note .ptxt, .p-mix .ptxt { font-style: italic; color: var(--ink-3); }
.ppos { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.ppos b { color: #c9a6e8; font-weight: 500; }
@media (max-width: 1280px) { .nowplaying { display: none; } }
.mixer[hidden] { display: none; }

/* ---------------- modo público (sin panel de desarrollo) ---------------- */
.btn-dev.is-active { border-color: #c9a6e8; color: #c9a6e8; }
body.public .app { grid-template-columns: 1fr; grid-template-areas: 'top' 'rail' 'stage'; grid-template-rows: auto auto minmax(0, 1fr); }
body.public .panel,
body.public .slot,
body.public .design-note,
body.public .chip-origin,
body.public .chip-type,
body.public .node-id,
body.public .line-count,
body.public .nowplaying,
body.public .tries { display: none !important; }
@media (max-width: 1080px) { body.public .app { grid-template-rows: auto auto minmax(100vh, 1fr); } }
