/* public/css/occult.css — the occult UI (2026-11-04). Replaces ui_cga_terminal.css when ud_ui=occult.
 *
 * One ink per place: --ink is set on the root by the sky model (occ_sky.js) — the power that rules where the pilot
 * is (the star's kind, the dark between stars, a giant's orbit, the sanctum's hearth, war). Every figure reads its
 * colour through these properties, so a change of ink recolours the whole UI without a rebuild. Fonts: OFL. */

@font-face { font-family: 'Cinzel';  font-weight: 400; font-display: block; src: url('../fonts/Cinzel-400.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel';  font-weight: 600; font-display: block; src: url('../fonts/Cinzel-600.woff2') format('woff2'); }
@font-face { font-family: 'Garamond'; font-weight: 500; font-display: block; src: url('../fonts/EBGaramond-500.woff2') format('woff2'); }
@font-face { font-family: 'Garamond'; font-weight: 600; font-display: block; src: url('../fonts/EBGaramond-600.woff2') format('woff2'); }
@font-face { font-family: 'OccSymbols'; font-display: block; src: url('../fonts/Symbols-sub.woff2') format('woff2'); }

:root {
    /* the seven inks [H rulers, C colours] */
    --ink-sun: #e6b34a; --ink-moon: #c8d0dc; --ink-mars: #d8402e; --ink-mercury: #e88a3c;
    --ink-jupiter: #5e8fe8; --ink-venus: #52b97e; --ink-saturn: #8c7ee0;
    --ink: var(--ink-sun);
    --ink-rgb: 230, 179, 74;               /* set alongside --ink (for alpha mixes) */
    --ink-dim: rgba(var(--ink-rgb), 0.52);
    --ink-faint: rgba(var(--ink-rgb), 0.22);
    --parch: #e9dfc9;                      /* content text */
    --parch-dim: rgba(233, 223, 201, 0.58);
    --alert: #e0202a;
    --plate-bg: rgba(4, 3, 6, 0.9);        /* window ground: the scene shows only faintly through */
    --hud-bg: rgba(0, 0, 0, 0.0);
    --glow: 0 0 6px rgba(var(--ink-rgb), 0.55);
    --f-caps: 'Cinzel', 'OccSymbols', Georgia, serif;
    --f-text: 'Garamond', 'OccSymbols', Georgia, serif;
    --f-sym: 'OccSymbols', 'Noto Sans Symbols', 'Segoe UI Symbol', sans-serif;
    --u: 1px;                              /* the HUD's unit: scaled with the window by occ_core */
}

/* ── SVG classes (occ_kit) ──────────────────────────────────── */
.o-svg { display: block; overflow: visible; }
.o-ink    { stroke: var(--ink); }
.o-dim    { stroke: var(--ink-dim); }
.o-faint  { stroke: var(--ink-faint); }
.o-alert  { stroke: var(--alert); }
.o-text-s { stroke: var(--parch); }
.o-glow   { filter: drop-shadow(0 0 3px rgba(var(--ink-rgb), 0.75)); }
.o-dotfill     { fill: var(--ink-dim); }
.o-dotfill-ink { fill: var(--ink); }
.o-moonlit  { fill: var(--parch); }
.o-sealfill { fill: rgba(224, 32, 42, 0.32); }
.o-platefill { fill: var(--plate-bg); }
.o-glyph    { fill: var(--ink); font-family: var(--f-sym); }
.o-glyph-p  { fill: var(--parch); font-family: var(--f-sym); }
.o-engrave  { fill: var(--ink-dim); font-family: var(--f-caps); font-size: 11px; letter-spacing: 0.24em; }
.o-label    { fill: var(--ink); font-family: var(--f-caps); font-size: 12px; letter-spacing: 0.14em; }
.o-label-d  { fill: var(--ink-dim); font-family: var(--f-caps); font-size: 11px; letter-spacing: 0.16em; }
.o-val      { fill: var(--parch); font-family: var(--f-text); font-size: 17px; font-variant-numeric: lining-nums; }
.o-val-s    { fill: var(--parch); font-family: var(--f-text); font-size: 14px; font-variant-numeric: lining-nums; }
.o-name     { fill: var(--parch); font-family: var(--f-text); font-size: 15px; }
.o-seal.is-hot .o-ink { stroke-width: 2; filter: drop-shadow(0 0 4px rgba(var(--ink-rgb), 0.8)); }
.o-ouro { animation: o-turn 2.4s linear infinite; }
@keyframes o-turn { to { transform: rotate(360deg); } }

/* ── HTML text classes ──────────────────────────────────────── */
.oc-caps  { font-family: var(--f-caps); letter-spacing: 0.14em; color: var(--ink); text-transform: uppercase; }
.oc-text  { font-family: var(--f-text); color: var(--parch); }
.oc-dim   { color: var(--ink-dim); }

/* ── Effects (same triggers and timing as the old CRT ones; gfx_engine owns when, this owns how) ─────────────
 * Power-on: the figure draws itself, then the contents unveil from the centre line out.
 * Power-off / die-off: a flash of the ink, the contents gutter to the centre line, the line to a point, the point
 * goes out; held dark; the slow relight. */
.oc-panel.is-booting .o-ink, .oc-panel.is-booting .o-dim { stroke-dasharray: 1600; animation: oc-trace 310ms ease-out both; }
@keyframes oc-trace  { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }
@keyframes oc-unveil { 0% { clip-path: inset(50% 50% 50% 50%); opacity: .2; } 30% { clip-path: inset(49.5% 20% 49.5% 20%); opacity: 1; }
                       100% { clip-path: inset(0 0 0 0); opacity: 1; } }
.oc-panel.is-dying > * { animation: oc-gutter 510ms ease-in both; }
@keyframes oc-gutter { 0% { clip-path: inset(0 0 0 0); filter: brightness(2.2) drop-shadow(0 0 8px var(--ink)); }
                       18% { clip-path: inset(0 0 0 0); filter: brightness(1.6); }
                       45% { clip-path: inset(49.4% 0 49.4% 0); filter: brightness(2); }
                       75% { clip-path: inset(49.4% 49.4% 49.4% 49.4%); filter: brightness(2.4); }
                       100% { clip-path: inset(50% 50% 50% 50%); filter: brightness(1); opacity: 0; } }
.oc-panel.is-dead > * { opacity: 0; }
.oc-panel.is-relight > * { animation: oc-relight var(--relight, 1200ms) ease-in both; }
@keyframes oc-relight { from { opacity: 0; } to { opacity: 1; } }

/* Low bones: the ink bleeds (the zapping); occ_core writes --zap-x / --zap-skew / --zap-bright per frame. */
#OccultHud.is-wounded { transform: translateX(var(--zap-x, 0)) skewX(var(--zap-skew, 0deg)); filter: brightness(var(--zap-bright, 1)); }
#OccultHud.is-bleeding .o-ink, #OccultHud.is-bleeding .o-glyph {
    filter: drop-shadow(var(--bleed-x, 3px) 0 0 rgba(var(--ink-rgb), 0.55)) drop-shadow(0 0 5px rgba(var(--ink-rgb), 0.9)); }
.oc-cracks path { stroke: var(--parch); stroke-width: 0.8; fill: none; opacity: 0.55; filter: drop-shadow(0 0 2px rgba(var(--ink-rgb), 0.9)); }

/* ── state classes ──────────────────────────────────────────── */
.o-alerttext { fill: var(--alert) !important; }
.o-alertfill { fill: var(--alert); }
.o-muted     { fill: var(--parch-dim) !important; }
.o-flame     { fill: rgba(var(--ink-rgb), 0.85); stroke: var(--ink); }
.o-pulse     { animation: o-pulse 1.6s ease-in-out infinite; }
@keyframes o-pulse { 50% { filter: drop-shadow(0 0 7px var(--alert)); } }

/* ── the HUD layer ──────────────────────────────────────────── */
#OccultHud { position: absolute; inset: 0; z-index: 2; pointer-events: none; transform-origin: 0 0; }
#OccultHud .oc-panel { pointer-events: auto; }
#OccultHud .oc-panel svg text { user-select: none; }

/* ── the ledger (terminal) ──────────────────────────────────── */
.oc-ledger { font-family: var(--f-text); font-size: 17px; color: var(--parch); line-height: 1.32; }
.oc-ln { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.12); padding: 1px 0 1px 4px; }
.oc-lg { width: 18px; flex: none; }
.oc-lt { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.oc-cmd { font-family: var(--f-caps); font-size: 11.5px; letter-spacing: .16em; color: var(--ink); background: transparent; cursor: inherit;
          border: 1px solid var(--ink-dim); border-radius: 9px 2px 9px 2px; padding: 1px 10px 0; margin-left: 4px; }
.oc-cmd:hover { color: var(--parch); border-color: var(--ink); box-shadow: var(--glow); }
.oc-job { border-bottom: 0; padding-top: 6px; }
.oc-wick { position: relative; width: 300px; height: 12px; flex: none;
           background: linear-gradient(var(--ink), var(--ink)) 0 50% / calc(var(--p) * 100%) 1.5px no-repeat,
                       repeating-linear-gradient(90deg, var(--ink-faint) 0 2px, transparent 2px 6px) 0 50% / 100% 1px no-repeat; }
.oc-wick::after { content: ''; position: absolute; left: calc(var(--p) * 100% - 3px); top: -4px; width: 6px; height: 10px;
                  background: var(--ink); border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; box-shadow: 0 0 6px var(--ink); }
.oc-eta { margin-left: auto; font-variant-numeric: lining-nums tabular-nums; }
.o-nofill { fill: none; }
.o-dimglyph { fill: var(--ink-dim); }

/* ── layers (occ_core) ──────────────────────────────────────── */
#OccultHud { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#OccultHud .oc-panel { position: absolute; pointer-events: none; }
#OccultHud .oc-panel .oc-in > svg, #OccultHud .oc-panel .oc-in > div { pointer-events: none; }
#OccultHud [data-z], #OccultWin [data-z] { pointer-events: auto; cursor: var(--ud-cursor, default); }
#OccultHud.is-modal [data-z] { pointer-events: none; }
#OccultWin { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.oc-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); pointer-events: auto; }
.oc-win { position: absolute; left: 50%; top: 50%; pointer-events: auto; transform-origin: 50% 50%; }
.oc-win .oc-in { position: relative; width: 100%; height: 100%; }
.oc-win .oc-frame { position: absolute; left: 0; top: 0; }
.oc-win.is-booting .oc-in { animation: oc-unveil 330ms cubic-bezier(.3,0,.2,1) both; }
.oc-win.is-booting .o-ink, .oc-win.is-booting .o-dim { stroke-dasharray: 1600; animation: oc-trace 330ms ease-out both; }
.oc-win.is-closing .oc-in { animation: oc-gutter 510ms ease-in both; }
.oc-hit { cursor: var(--ud-cursor, default); }
.oc-hit:hover .o-ink, .oc-hit:hover .o-dim { stroke: var(--ink); filter: drop-shadow(0 0 3px rgba(var(--ink-rgb), 0.85)); }
.oc-hit:hover .o-label-d { fill: var(--ink); }
.oc-hit:hover .o-name { fill: #fff; }
.oc-row.is-on .o-name, .o-tgt { fill: var(--ink) !important; }
.oc-off { opacity: 0.45; }
.is-locked { opacity: 0.25 !important; pointer-events: none !important; }
.oc-hitband { pointer-events: stroke; }
.o-flame-alert { fill: rgba(224, 32, 42, 0.85); stroke: var(--alert); }
.oc-listen { position: absolute; left: 30px; right: 30px; top: 140px; text-align: center; font-family: var(--f-text); font-size: 15px;
             color: var(--parch-dim); line-height: 1.2; max-height: 38px; overflow: hidden; }
.oc-listen.is-fresh { color: var(--parch); text-shadow: 0 0 6px rgba(var(--ink-rgb), 0.6); }
.oc-ledger .oc-lt { flex: 1 1 auto; min-width: 0; }
.oc-ln.k-combat .oc-lt, .oc-ln.k-restart .oc-lt { color: #f0d8cf; }
.oc-panel.is-booting > .oc-in { animation: oc-unveil 310ms cubic-bezier(.3,.0,.2,1) both; }
.oc-panel > .oc-cracks { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.oc-prose { font-family: var(--f-text); font-size: 19px; line-height: 1.35; color: var(--parch); }
.oc-prose .oc-dim, .oc-prose-dim { color: var(--parch-dim); }

/* ── the login (index.php occLogin) ─────────────────────────── */
html.ud-occult #UntoldDarkLoginBg { position: fixed; inset: 0; transform: none; width: 100vw; height: 100vh; aspect-ratio: auto; image-rendering: auto; }
#OccultLogin { position: fixed; left: 50%; top: 50%; width: 520px; height: 900px; transform: translate(-50%, -50%) scale(var(--ol-s, 1)); z-index: 3;
               display: flex; flex-direction: column; align-items: center; pointer-events: none; }
@media (max-height: 940px) { #OccultLogin { --ol-s: calc(100vh / 940px); } }
#OccultLogin .ol-fig { width: 520px; height: 450px; }
#OccultLogin .ol-fields { width: 400px; margin-top: 18px; pointer-events: auto; }
#OccultLogin .ol-f { display: block; position: relative; margin: 0 0 16px; padding-left: 26px; cursor: var(--ud-cursor); }
#OccultLogin .ol-f > span { display: block; font-family: var(--f-caps); font-size: 12px; letter-spacing: .2em; color: var(--ink-dim); margin-bottom: 2px; }
#OccultLogin .ol-f > i { display: block; height: 34px; border-bottom: 1px solid var(--ink-dim); }
#OccultLogin .ol-f::before { content: ''; position: absolute; left: 4px; bottom: 11px; width: 9px; height: 9px; border: 1px solid var(--ink); border-radius: 50%; }
#OccultLogin .ol-f.is-focus > i { border-bottom-color: var(--ink); box-shadow: 0 7px 8px -8px var(--ink); }
#OccultLogin .ol-f.is-focus::before { background: var(--ink); box-shadow: 0 0 6px var(--ink); }
#OccultLogin .ol-sent { font-family: var(--f-text); font-size: 18px; color: var(--parch); text-align: center; line-height: 1.4; margin-bottom: 16px; }
#OccultLogin .ol-sent b { font-weight: 600; color: #fff; }
#OccultLogin .ol-seals { display: flex; gap: 34px; align-items: flex-start; margin-top: 10px; pointer-events: auto; }
#OccultLogin .ol-seal { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: var(--ud-cursor);
                         font-family: var(--f-caps); font-size: 11px; letter-spacing: .18em; color: var(--ink-dim); }
#OccultLogin .ol-seal.is-main { margin-top: 10px; color: var(--ink); font-size: 12.5px; }
#OccultLogin .ol-seal:hover { color: var(--parch); }
#OccultLogin .ol-seal:hover .o-ink { filter: drop-shadow(0 0 4px rgba(var(--ink-rgb), .9)); }
#OccultLogin .ol-seal[disabled] { opacity: .45; }
#OccultLogin .ol-msg { margin-top: 18px; width: 460px; text-align: center; font-family: var(--f-text); font-size: 17px; color: var(--parch); min-height: 24px; }
#OccultLogin .ol-msg.is-error { color: #f08a7e; }
html.ud-occult #UntoldDarkAuthForm input { color: var(--parch); -webkit-text-fill-color: var(--parch); caret-color: var(--ink); font: 500 21px var(--f-text); padding: 0 4px 4px; z-index: 4; }
html.ud-occult #UntoldDarkAuthForm input:-webkit-autofill { -webkit-text-fill-color: var(--parch) !important; }
html.ud-occult #UntoldDarkAuthForm input::selection { color: #000; background: var(--ink); }
/* a window under another one recedes (the top window is the last child of #OccultWin) */
#OccultWin .oc-win.is-under { filter: brightness(0.32) blur(0.6px); pointer-events: none; }   /* set by occ_core: every window but the top one */
/* a window's layered full-size figure SVGs never swallow clicks meant for the frame or the controls under them;
   only their controls (data-z) take the pointer */
.oc-win .oc-in > svg { pointer-events: none; }
.oc-win .oc-in > svg [data-z] { pointer-events: auto; }
/* the ledger's text catches clicks (a click on a line must not pick the world behind it) */
#OccultHud .oc-ledger .oc-ln { pointer-events: auto; }
#OccultHud.is-modal .oc-ledger .oc-ln { pointer-events: none; }
/* shared scrolling list inside windows (native scroll, thin ink bar) */
.oc-win .oc-scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--ink-dim) transparent; pointer-events: auto; }
.oc-win .oc-scroll::-webkit-scrollbar { width: 5px; }
.oc-win .oc-scroll::-webkit-scrollbar-thumb { background: var(--ink-dim); border-radius: 3px; }
/* CAST is never lost: without a course it stays readable (not the usual off-dim); with one it beats */
#OccultHud .oc-cast-off { opacity: 0.72; }
#OccultHud .oc-cast .o-ink { stroke-width: 1.6; }
/* SCROLLING (2026-11-04): Chrome will not wheel-scroll a list that has an ancestor with pointer-events:none, even
   when the list itself takes the pointer. So in the occult UI the game container takes pointer events (its full-screen
   3D canvas still receives every click it did), and the window layer takes them only while a window is open (its scrim
   catches those clicks anyway). */
html.ud-occult #UntoldDarkGameUI { pointer-events: auto; }
#OccultWin.has-win { pointer-events: auto; }
/* the loader's line of the old arts, under the circle */
.oc-lore { position: absolute; left: 40px; right: 40px; top: 548px; text-align: center; font-family: var(--f-text); font-size: 16.5px; line-height: 1.4; color: var(--parch-dim); }
.oc-lore span { display: block; margin-bottom: 4px; font-family: var(--f-caps); font-size: 11px; letter-spacing: .26em; color: var(--ink-dim); }
