/* scry-ui.css, the legacy-class compat layer over the Deck design system.
 * Loads AFTER deck/deck-tokens.css + deck/deck-ui.css and restyles the
 * fun-layer / watchtower class vocabulary (.tile, .badge, nav.fun, tables,
 * sparklines…) onto the deck's tokens, so every page, old markup or new, * is one visual system. No hex here beyond alpha washes (deck-ui precedent);
 * palette/type live in deck-tokens.css only. No external requests. */

:root {
    /* legacy custom-property names → deck tokens (JS + inline styles still
       reference these; the alias keeps every generated row on-system) */
    --void: var(--omen-0); --void-2: var(--omen-1); --dusk: var(--steel);
    --dusk-line: var(--line);
    --amber: var(--gild); --amber-dim: var(--gild-dim);
    --amber-glow: rgba(242, 181, 60, 0.10);
    --cream: var(--ink); --ink-mute: var(--ink-dim);
    --hood: var(--settle-green); --red: var(--magi-red);
    /* series hues, validated for dark surfaces; color follows the measure */
    --s-coupling: #4f8fd9; --s-switch: #b5811f; --s-ycon: #b8619e;
    --display: var(--face-jrpg);
    --body: var(--face-mono);
    --mono: var(--face-mono);
}

/* ── shell (header.deck + nav.fun live in deck-ui.css) ───────────────── */
.kicker { font-family: var(--face-engraved); font-size: 14px; letter-spacing: 0.26em;
    color: var(--gild); margin: 26px 0 0; font-weight: 600; }
.hero { font-family: var(--face-oracle); font-size: clamp(24px, 3.6vw, 34px);
    font-style: italic; line-height: 1.3; color: var(--ink);
    padding: 10px 0 4px; max-width: 24em; }
.hero em { color: var(--gild); font-style: italic; }

/* ── content primitives ──────────────────────────────────────────────── */
section { padding: 32px 0 0; }
.note { font-family: var(--face-oracle); font-size: 16px; color: var(--ink-dim);
    font-style: italic; margin-top: 10px; max-width: 62em; }
.note .mono, .note code { font-style: normal; }
.mono { font-family: var(--face-mono); font-size: 12px; }
.mono-note { font-family: var(--face-mono); font-size: 11.5px; color: var(--ink-dim); }
.hidden { display: none; }

/* stat tiles, legacy .tile speaks both dialects (.n/.l and .k/.v) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--gap); margin: 16px 0 6px; }
.tile { background: var(--omen-1); border: 1px solid var(--steel);
    border-radius: var(--r); box-shadow: inset 0 1px 0 var(--omen-3);
    padding: 12px 14px; position: relative; overflow: hidden;
    background-image:
        radial-gradient(2px 2px at 7px 7px, var(--rivet) 50%, transparent 55%),
        radial-gradient(2px 2px at calc(100% - 7px) 7px, var(--rivet) 50%, transparent 55%); }
a.tile { text-decoration: none; }
a.tile:hover { border-color: var(--gild-dim); box-shadow: inset 0 1px 0 var(--omen-3), var(--glow-trim); }
.tile .n, .tile .v { font-family: var(--face-jrpg); font-variant-numeric: tabular-nums;
    font-size: 21px; color: var(--filigree); text-shadow: var(--glow-data);
    word-break: break-word; line-height: 1.25; }
.tile .v { margin-top: 3px; }
.tile .l, .tile .k { font-family: var(--face-jrpg); font-size: 10px;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
    margin-top: 5px; }
.tile .k { margin-top: 0; }
.tile svg.spark { display: block; margin-top: 8px; width: 100%; height: 26px; }

/* charts (js/chart.js), shared by the tally and the pools. The ink lives in
   the module; this is only the frame it hangs in. Every chart carries a
   details.tnum table fold beneath it — the numbers for a reader who cannot
   use the picture, which is a site law, not a nicety. */
.chart { background: var(--omen-1); border: 1px solid var(--line);
    border-radius: var(--r); padding: 10px 12px; margin: 8px 0; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; align-items: center; font: 11px var(--face-label);
    letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
    margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
    margin-right: 5px; vertical-align: -1px; }
details.tnum { margin: 4px 0 16px; }
details.tnum summary { font: 11px var(--face-label); letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-dim); cursor: pointer; }
details.tnum table { border-collapse: collapse; font: 12px var(--face-mono);
    margin-top: 6px; width: auto; }
details.tnum th, details.tnum td { border: 1px solid var(--line); padding: 3px 9px;
    text-align: left; white-space: nowrap; }

/* tables, the ledger grammar */
table { width: 100%; border-collapse: collapse; font-family: var(--face-mono);
    font-size: 12.5px; }
th { text-align: left; font-weight: 500; font-family: var(--face-jrpg);
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-dim); padding: 8px 10px; border-bottom: 1px solid var(--line);
    white-space: nowrap; }
th.numeric, td.numeric { text-align: right; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.answer, td.prose { font-family: var(--face-oracle); font-style: italic;
    font-size: 15.5px; line-height: 1.45; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--amber-glow); }
.scroll-x { overflow-x: auto; border: 1px solid var(--steel);
    border-radius: var(--r); background: var(--omen-1); }
.scroll-x table td, .scroll-x table th { padding-left: 14px; padding-right: 14px; }

.up { color: var(--settle-green); } .down { color: var(--magi-red); }
.badge { font-family: var(--face-mono); font-size: 10px; letter-spacing: 0.1em;
    padding: 2px 9px; border-radius: 999px; border: 1px solid var(--steel);
    color: var(--ink-dim); white-space: nowrap; }
.badge.ok   { border-color: var(--filigree-dim); color: var(--filigree); }
.badge.warn { border-color: var(--gild-dim);     color: var(--gild); }
.badge.bad  { border-color: var(--magi-red);     color: var(--magi-red); }

/* controls, same voice as button.tog in deck-ui.css */
button, .btn { font-family: var(--face-jrpg); font-size: 12px; letter-spacing: 0.08em;
    background: var(--omen-1); color: var(--ink-dim); border: 1px solid var(--steel);
    border-radius: var(--r); padding: 7px 14px; cursor: pointer;
    text-decoration: none; }
button:hover, .btn:hover { border-color: var(--gild-dim); color: var(--gild); }
button.primary { border-color: var(--gild-dim); color: var(--gild); }
button:disabled { opacity: 0.4; cursor: default; }
input, textarea, select { font-family: var(--face-mono); font-size: 13px; width: 100%;
    background: var(--omen-2); color: var(--ink); border: 1px solid var(--steel);
    border-radius: var(--r); padding: 8px 11px; }
input:focus, textarea:focus, select:focus { outline: none;
    border-color: var(--gild-dim); box-shadow: var(--glow-trim); }
textarea { min-height: 74px; resize: vertical; }
/* (the reputation lookup + bubble-map blocks retired in v3.1 U3 — the
   page they served folded into the Registry, which speaks pure deck) */
label { font-family: var(--face-jrpg); font-size: 10.5px; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--ink-dim); display: block;
    margin: 12px 0 5px; }

pre { font-family: var(--face-mono); font-size: 11.5px;
    background: var(--omen-1); border: 1px solid var(--steel);
    border-radius: var(--r); padding: 14px; overflow-x: auto;
    color: var(--ink-dim); line-height: 1.6; }

/* legacy block seal (augury question meta), the pill .seal in deck-ui.css
   stays for spans; a div.seal is a meta line, not a pill */
div.seal { display: block; font-size: 11px; font-family: var(--face-mono);
    color: var(--ink-dim); letter-spacing: 0.08em; word-break: break-all;
    border: none; border-radius: 0; padding: 0; margin: 6px 0 0;
    text-transform: none; }

/* cards (chamber pages) */
.card { background: var(--omen-1); border: 1px solid var(--steel);
    border-radius: var(--r); box-shadow: inset 0 1px 0 var(--omen-3);
    padding: 18px 20px; margin-top: 14px; }
.spark { background: var(--omen-1); border: 1px solid var(--steel);
    border-radius: var(--r); padding: 12px 14px; }
.spark .t { font-family: var(--face-jrpg); font-size: 11px; letter-spacing: 0.1em;
    color: var(--ink-dim); margin-bottom: 6px; display: flex; gap: 8px;
    align-items: center; }
.spark .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.spark svg { display: block; width: 100%; height: 74px; }
.msg { font-family: var(--face-mono); font-size: 12px; margin-top: 10px;
    word-break: break-all; }
.msg.ok { color: var(--settle-green); } .msg.err { color: var(--magi-red); }

/* pool split bar (duels): two fills, 2px surface gap */
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden;
    background: var(--omen-3); min-width: 120px; }
.split .a { background: var(--settle-green); }
.split .b { background: var(--magi-red); margin-left: 2px; }

/* warning box → the deck's hazard grammar */
.warnbox { border: 1px solid var(--magi-red); border-radius: var(--r);
    padding: 14px 16px; font-family: var(--face-mono); font-size: 12px;
    color: var(--ink); margin-top: 16px;
    background: repeating-linear-gradient(-45deg, transparent 0 12px,
        rgba(255, 59, 48, 0.07) 12px 24px); }

footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line);
    font-family: var(--face-mono); font-size: 11.5px; color: var(--ink-dim); }
footer a { margin-right: 18px; }

@media (max-width: 640px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
}
