:root {
  color-scheme: light;
  /* calidad de objetos de WoW, ajustada para leerse sobre cada fondo */
  --q0: #66645e; --q1: #1b1a17; --q2: #1a7a00; --q3: #005fb8; --q4: #7b2fc9; --q5: #a85200;
  --bg: #f6f4ef;
  --surface: #fffefb;
  --surface-2: #f0ede5;
  --border: #dcd7cb;
  --text: #1b1a17;
  --text-2: #4f4c45;
  --muted: #6b675e;
  --accent: #7a4fd0;
  --accent-ink: #ffffff;
  --focus: #1f6feb;
  --hp: #2f8f3a;
  --mana: #2a78d6;
  --xp: #8a4fd6;
  --enemy: #c4392f;
  --good: #217a33;
  --warn: #9a6400;
  --bad: #b3261e;
  --map-land: #e3ecd5;
  --map-forest: #c9dbb4;
  --map-water: #b9d5f0;
  --map-road: #c8b48f;
  --map-ink: #3b3a35;
  --map-sea: #c9dcea;
  --map-edge: #5b5a52;
  --map-halo: #fffefb;
  --map-nc: #d9d6cd;
  --con-gray: #b4b2aa;
  --con-green: #7cc576;
  --con-yellow: #f0d35a;
  --con-orange: #f0a25a;
  --con-red: #e2706a;
  /* paleta categórica (actividades) */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7;
  --fs: 17px;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --q0: #a8a8a3; --q1: #f4f3ee; --q2: #4cd93a; --q3: #4da3ff; --q4: #c084f5; --q5: #ff9d3b;
    --bg: #141413;
    --surface: #1d1d1b;
    --surface-2: #262623;
    --border: #3a3935;
    --text: #f4f3ee;
    --text-2: #cfcdc4;
    --muted: #a9a69c;
    --accent: #a98bf0;
    --accent-ink: #141413;
    --focus: #6aa8ff;
    --hp: #4cb35a;
    --mana: #3987e5;
    --xp: #a77ef0;
    --enemy: #e66767;
    --good: #5cc46c;
    --warn: #e0a83a;
    --bad: #ff7a70;
    --map-land: #27301f;
    --map-forest: #2f3d24;
    --map-water: #1f3550;
    --map-road: #6b5d43;
    --map-ink: #e6e4dc;
    --map-sea: #172634;
    --map-edge: #0e0e0d;
    --map-halo: #141413;
    --map-nc: #2b2b28;
    --con-gray: #5c5b56;
    --con-green: #3f8a3c;
    --con-yellow: #a88f22;
    --con-orange: #b0662a;
    --con-red: #a8433d;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --q0: #a8a8a3; --q1: #f4f3ee; --q2: #4cd93a; --q3: #4da3ff; --q4: #c084f5; --q5: #ff9d3b;
  --bg: #141413;
  --surface: #1d1d1b;
  --surface-2: #262623;
  --border: #3a3935;
  --text: #f4f3ee;
  --text-2: #cfcdc4;
  --muted: #a9a69c;
  --accent: #a98bf0;
  --accent-ink: #141413;
  --focus: #6aa8ff;
  --hp: #4cb35a;
  --mana: #3987e5;
  --xp: #a77ef0;
  --enemy: #e66767;
  --good: #5cc46c;
  --warn: #e0a83a;
  --bad: #ff7a70;
  --map-land: #27301f;
  --map-forest: #2f3d24;
  --map-water: #1f3550;
  --map-road: #6b5d43;
  --map-ink: #e6e4dc;
  --map-sea: #172634;
  --map-edge: #0e0e0d;
  --map-halo: #141413;
  --map-nc: #2b2b28;
  --con-gray: #5c5b56;
  --con-green: #3f8a3c;
  --con-yellow: #a88f22;
  --con-orange: #b0662a;
  --con-red: #a8433d;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9;
  --shadow: none;
}

/* Alto contraste: bordes y textos al máximo */
:root.contrast { --border: currentColor; --muted: var(--text); --text-2: var(--text); }
:root.contrast .card { border-width: 2px; }

:root[data-size="s"] { --fs: 15px; }
:root[data-size="m"] { --fs: 17px; }
:root[data-size="l"] { --fs: 20px; }
:root[data-size="xl"] { --fs: 23px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--fs); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", "Noto Sans", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; color: var(--text-2); font-weight: 600; }
p { margin: 0 0 .5rem; }
small { font-weight: normal; color: var(--muted); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Cabecera */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(16px, 4vw, 40px);
  max-width: none; margin: 0;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand h1 { font-size: 1.4rem; margin: 0; }
.brand .sub { margin: 0; color: var(--muted); font-size: .9rem; }
.logo { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 1.3rem; }
.top-right { display: flex; align-items: center; gap: .6rem; }
.pill { display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--muted); }
.pill.live .dot { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite; }
.pill.off .dot { background: var(--bad); }
.pill.wait .dot { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 .6rem transparent; } }
.icon-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); min-height: 44px; }

/* Ajustes */
.settings {
  max-width: none; margin: 0 0 1rem; padding: 1rem clamp(16px, 2.5vw, 40px);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
  background: var(--surface); border-block: 1px solid var(--border);
}
.settings fieldset { border: 0; padding: 0; margin: 0; }
.settings legend { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .45rem .8rem; min-height: 44px; min-width: 44px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.switch { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; }
.switch input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }

.banner { max-width: none; margin: 0 0 1rem; padding: .7rem clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border-block: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }

/* Pestañas */
.tabs {
  display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none;
  max-width: none; margin: 0; padding: 0 clamp(16px, 4vw, 40px) .2rem;
  position: sticky; top: 0; background: var(--bg); z-index: 5; border-bottom: 1px solid var(--border);
}
.tabs button {
  border: 0; background: transparent; padding: .7rem 1rem; min-height: 48px; white-space: nowrap;
  border-bottom: 3px solid transparent; color: var(--text-2); font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }
:root:not(.expert) .expert-only { display: none; }

main { max-width: none; margin: 0; padding: 1.2rem clamp(16px, 4vw, 40px) 4rem; }
.view { display: grid; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* Héroe */
.hero { padding: 1.4rem; }
.who { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.who h2 { margin: 0; font-size: 1.35rem; }
.who p { margin: 0; }
.avatar { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); border: 2px solid var(--accent); flex: none; }
.level { margin-left: auto; text-align: right; line-height: 1.1; }
.level strong { display: block; font-size: 2rem; }
.doing { font-size: 1.5rem; font-weight: 700; margin-bottom: .6rem; }
.why, .goal { color: var(--text-2); }
.why-label, .goal-label { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 6.2em; }

/* Barras */
.meter { margin-bottom: .9rem; }
.m-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .95rem; margin-bottom: .3rem; }
.m-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: .8rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s ease; }
.bar.hp span { background: var(--hp); }
.bar.mana span { background: var(--mana); }
.bar.xp span { background: var(--xp); }
.bar.enemy span { background: var(--enemy); }
.meter.low .m-val { color: var(--bad); }

.target.empty { color: var(--muted); }
.target .t-name { font-size: 1.15rem; font-weight: 700; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; border: 1px solid currentColor; }
.badge.danger { color: var(--bad); }
.badge.easy { color: var(--good); }
.badge.fair { color: var(--warn); }

.quests { list-style: none; padding: 0; margin: 0; }
.quests li { margin-bottom: .6rem; }
.quests .q-name { font-weight: 600; }

.facts { display: grid; gap: .6rem; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: .4rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }
.coin { font-variant-numeric: tabular-nums; }
.coin .g { color: #b8860b; } .coin .s { color: #8a8a8a; } .coin .c { color: #a0522d; }
:root[data-theme="dark"] .coin .g { color: #e6c35c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .coin .g { color: #e6c35c; } }

.result { font-size: .8rem; font-weight: 700; margin-left: .3rem; }
.result.verified { color: var(--good); }
.result.failed { color: var(--bad); }
.result.unverified { color: var(--muted); }

/* Etiquetas de origen (modo experto) */
.src { display: none; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .4rem; border-radius: 5px; margin-left: .35rem; vertical-align: middle; border: 1px solid; }
:root.expert .src, .sources .src { display: inline-block; }
.src-observed { color: var(--good); }
.src-intent { color: var(--accent); }
.src-derived { color: var(--mana); }
.src-estimated { color: var(--warn); }

/* Diario */
.diary { list-style: none; padding: 0; margin: 0; }
.diary li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .2rem .7rem; padding: .7rem 0; border-bottom: 1px solid var(--border); align-items: start; }
.diary li:last-child { border-bottom: 0; }
.diary .ico { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 1.05rem; }
.diary .txt { font-weight: 600; }
.diary .det { grid-column: 2 / 4; color: var(--text-2); font-size: .92rem; }
.diary .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.diary .chat { grid-column: 2 / 4; display: grid; gap: .35rem; }
.bubble { padding: .45rem .7rem; border-radius: 12px; background: var(--surface-2); max-width: 36rem; font-size: .95rem; }
.bubble.her { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); justify-self: end; }
.bubble b { display: block; font-size: .78rem; color: var(--muted); }
.diary.compact li { padding: .5rem 0; }
.diary li.new { animation: flash 1.2s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 14%, transparent); } to { background: transparent; } }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: .5rem 0; min-height: 44px; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: .35rem .85rem; border-radius: 999px; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Mapa */
.map-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.map-head h2 { margin: 0; }
.map-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; margin: .5rem 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
#world-map { width: 100%; height: 100%; display: block; }
#world-map .sea { fill: var(--map-sea); }
#world-map .zone { stroke: var(--map-edge); stroke-width: 1; stroke-linejoin: round; transition: fill .4s; }
#world-map .zone.con-none { fill: var(--map-land); }
#world-map .zone.con-gray { fill: var(--con-gray); }
#world-map .zone.con-green { fill: var(--con-green); }
#world-map .zone.con-yellow { fill: var(--con-yellow); }
#world-map .zone.con-orange { fill: var(--con-orange); }
#world-map .zone.con-red { fill: var(--con-red); }
#world-map .zone.nc { fill: url(#nc-hatch); }
#world-map .nc-bg { fill: var(--map-nc); }
#world-map .nc-line { stroke: var(--map-edge); stroke-width: 1.2; opacity: .35; }
#world-map .zone.here { stroke: var(--text); stroke-width: 2.5; }
#world-map .zone:hover { filter: brightness(1.08); }
#world-map .labels text { text-anchor: middle; dominant-baseline: middle; fill: var(--map-ink); font-weight: 700; paint-order: stroke; stroke: var(--map-halo); stroke-width: .25em; stroke-linejoin: round; pointer-events: none; }
#world-map .labels text.lv { font-weight: 600; opacity: .85; }
#world-map .labels text.here { font-weight: 800; }
#world-map .labels text.cont { opacity: .45; letter-spacing: .1em; stroke: none; }
#world-map .trail { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 6 4; }
#world-map .goal-area { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
#world-map .me circle, #map .me path { fill: var(--accent); stroke: #fff; stroke-width: .25; }
.map-tip { transform: translate(-50%, -120%); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: 0; margin: .6rem 0 0; font-size: .92rem; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: .4rem; }
.sw { display: inline-block; width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid var(--map-edge); }
.sw.me { background: var(--accent); border-radius: 50%; border-color: transparent; }
.sw.trail { height: 0; border: 0; border-top: 3px dashed var(--accent); border-radius: 0; }
.sw.nc { background: repeating-linear-gradient(45deg, var(--map-nc) 0 4px, color-mix(in srgb, var(--map-edge) 35%, var(--map-nc)) 4px 5px); }
.con-gray { background: var(--con-gray); } .con-green { background: var(--con-green); } .con-yellow { background: var(--con-yellow); }
.con-orange { background: var(--con-orange); } .con-red { background: var(--con-red); }
.con-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .45rem; vertical-align: -1px; border: 1px solid var(--map-edge); }
#zone-table tr.here td { font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent); }
#zone-table td:nth-child(n+2), #zone-table th:nth-child(n+2) { text-align: left; }
.fine { font-size: .82rem; color: var(--muted); margin-top: .6rem; }
.fine a { color: inherit; }

/* Directo */
.now-top { display: grid; gap: 1rem; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .now-top { grid-template-columns: 1fr; } }
.live { padding: .7rem; }
.live-frame { position: relative; aspect-ratio: 16 / 9; background: #0e0e0d; border-radius: 10px; overflow: hidden; }
.live-frame video { width: 100%; height: 100%; display: block; object-fit: contain; background: #0e0e0d; }
.live-frame:fullscreen { border-radius: 0; }
.live-chip { position: absolute; top: .6rem; left: .6rem; font-size: .75rem; font-weight: 800; letter-spacing: .06em; padding: .2rem .55rem; border-radius: 6px; background: rgb(0 0 0 / .65); color: #fff; }
.live[data-state="live"] .live-chip { background: #c62828; }
.live-cover { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1rem; color: #f4f3ee; background: #0e0e0d; }
.live[data-state="live"] .live-cover { display: none; }
.live-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 .3rem; }
.live-reason { margin: 0; color: #cfcdc4; max-width: 34rem; }
.live[data-state="connecting"] .live-title::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .5em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -.1em; }
@keyframes spin { to { transform: rotate(360deg); } }
.live-unmute { position: absolute; bottom: .8rem; right: .8rem; border: 0; border-radius: 999px; padding: .6rem 1.1rem; min-height: 48px; font-weight: 700; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgb(0 0 0 / .35); }
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; padding: .6rem .2rem 0; }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: .4rem .8rem; min-height: 44px; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.vol { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.vol input { width: 6.5rem; accent-color: var(--accent); }
.live-tech { font-size: .85rem; margin-left: auto; }

/* Hoy */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.tile .k { color: var(--muted); font-size: .9rem; }
.tile .v { font-size: 1.9rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 260px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 12px; }
.chart .line { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: color-mix(in srgb, var(--c1) 12%, transparent); }
.chart .lvl-mark { stroke: var(--xp); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .lvl-text { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .cross { stroke: var(--text-2); stroke-width: 1; }
.chart .hover-dot { fill: var(--c1); stroke: var(--surface); stroke-width: 2; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .6rem; font-size: .85rem; box-shadow: 0 4px 14px rgb(0 0 0 / .15); white-space: nowrap; transform: translate(-50%, -110%); }
.empty-chart { padding: 2rem 0; text-align: center; color: var(--muted); }

.stack { display: flex; gap: 2px; height: 2.2rem; border-radius: 8px; overflow: hidden; margin: .4rem 0 1rem; background: var(--surface); }
.stack span { display: block; height: 100%; min-width: 3px; }
.stack span:first-child { border-radius: 4px 0 0 4px; } .stack span:last-child { border-radius: 0 4px 4px 0; }
.stack .stuck { background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgb(255 255 255 / .35) 4px 6px); }
.time-table { width: 100%; border-collapse: collapse; }
.time-table td, .time-table th, #models td, #models th { text-align: left; padding: .45rem .3rem; border-bottom: 1px solid var(--border); }
.time-table th, #models th { color: var(--muted); font-weight: 600; font-size: .88rem; }
.time-table td:nth-child(n+2), .time-table th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; margin-right: .5rem; vertical-align: -2px; }

/* Cerebro */
.systems { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.systems li { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.status { font-weight: 700; font-size: .88rem; }
.status.ok { color: var(--good); } .status.idle { color: var(--muted); } .status.warn { color: var(--warn); } .status.error { color: var(--bad); }
.table-scroll { overflow-x: auto; }
#models { width: 100%; border-collapse: collapse; min-width: 520px; }
.decisions { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.decisions li { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; }
.decisions .opts { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.opt { font-size: .85rem; padding: .1rem .55rem; border-radius: 6px; border: 1px solid var(--border); }
.opt.chosen { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 700; }

/* Ayuda */
.prose { max-width: 48rem; }
.prose h2 { margin-top: 1.4rem; } .prose h2:first-child { margin-top: 0; }
details { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .5rem; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details p { margin: .5rem 0 0; color: var(--text-2); }
.sources, .glossary { display: grid; gap: .5rem; margin: 0; }
.sources div, .glossary div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; }
.sources dd, .glossary dd { margin: 0; color: var(--text-2); }
.glossary dt { font-weight: 700; }

@media (max-width: 560px) {
  .doing { font-size: 1.25rem; }
  .why-label, .goal-label { display: block; }
  .icon-btn .label { display: none; }
  .diary li { grid-template-columns: 2.2rem 1fr; }
  .diary .when { grid-column: 2; }
  .diary .det, .diary .chat { grid-column: 1 / -1; }
  .sources div, .glossary div { grid-template-columns: 1fr; gap: .1rem; }
}

:root.reduce-motion *, :root.reduce-motion *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .bar span, .stack span { forced-color-adjust: none; } }

/* ---------- Personaje ---------- */
.char-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .5rem 1.2rem; margin: 0; }
.stats div { display: flex; justify-content: space-between; gap: .8rem; border-bottom: 1px dashed var(--border); padding-bottom: .35rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sub-h { margin-top: 1.2rem; }
.trees, .talent-list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .7rem; }
.talent-list li { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.talent-list .rank { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.q { font-weight: 700; }
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); }
.q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); }
:root.contrast .q { color: var(--text); text-decoration: underline; }
.gear-table td:first-child { color: var(--muted); white-space: nowrap; }
.gear-table th, .gear-table td { text-align: left; }

/* ---------- Chat dentro del vídeo ---------- */
.live-chat { position: absolute; top: .6rem; right: .6rem; bottom: .6rem; width: min(440px, 42%); z-index: 3;
  display: flex; color: #f4f3ee; }
.lc-toggle { align-self: flex-start; margin-right: .3rem; min-width: 44px; height: 44px; padding: 0 .6rem;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 8px; background: rgba(14, 14, 13, .7); color: #fff;
  cursor: pointer; font-size: .95rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.lc-toggle:hover { background: rgba(122, 79, 208, .85); }
.lc-toggle:focus-visible, .live-chat input:focus-visible, .lc-send:focus-visible { outline: 3px solid #8ab4ff; outline-offset: 1px; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: .6rem; border-radius: 10px;
  background: rgba(14, 14, 13, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.live-chat[data-open="false"] { width: auto; bottom: auto; }
.live-chat[data-open="false"] .lc-body { display: none; }
.live-chat[data-open="false"] .lc-arrow { display: inline-block; transform: rotate(180deg); }
.lc-title { margin: 0 0 .4rem; font-size: .95rem; color: #f4f3ee; }
.mc-list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .3rem;
  flex: 1; overflow-y: auto; font-size: .9rem; }
.mc-list li { padding: .3rem .5rem; border-radius: 8px; background: rgba(255, 255, 255, .10); overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.mc-list li.her { background: rgba(122, 79, 208, .45); }
.mc-list li.muted { color: #d6d3ca; background: none; }
.mc-list b { margin-right: .35rem; }
.mc-form { display: grid; grid-template-columns: 1fr auto; gap: .35rem; }
.mc-form #mc-name { grid-column: 1 / -1; }
.live-chat input { font: inherit; font-size: .9rem; min-height: 40px; padding: .4rem .55rem; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .45); color: #f4f3ee; min-width: 0; }
.live-chat input::placeholder { color: #c9c6bc; }
.lc-send { min-height: 40px; padding: 0 .8rem; border: 0; border-radius: 8px; background: #7a4fd0; color: #fff; font-weight: 600; cursor: pointer; }
.mc-status { min-height: 1.2em; margin: .3rem 0 0; font-size: .8rem; color: #e4e1d8; }
/* en el móvil no cabe encima del vídeo: va debajo */
@media (max-width: 700px) {
  .live-chat { position: static; width: auto; margin-top: .6rem; color: var(--text); }
  .lc-body { background: var(--surface-2); backdrop-filter: none; }
  .lc-title { color: var(--text); }
  .mc-list { max-height: 14rem; }
  .mc-list li { text-shadow: none; background: var(--surface); }
  .mc-list li.her { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
  .live-chat input { background: var(--surface); color: var(--text); border-color: var(--border); }
  .live-chat input::placeholder { color: var(--muted); }
  .mc-status { color: var(--muted); }
  .lc-toggle { background: var(--surface-2); color: var(--text); }
  .live-frame { overflow: visible; aspect-ratio: auto; }
  .live-frame video { aspect-ratio: 16 / 9; height: auto; }
}
