
    :root {
      --void: #060409; --gold: #c9a227; --gold-lt: #e8c35a; --gold-dim: #a8873a;
      --mist: #7a6f90; --parch: #cbbd97; --fire: #b83a0d; --amber: #FFBF00; --amber-lt: #ffd454;
      --shadow-purple: #bf40bf; --blood: #8b1a1a; --ash: #9aa0a8; --tallow: #e8c86a; --spirits: #e8c86a;
      --ff-title: 'Cinzel Decorative', serif; --ff-head: 'Cinzel', serif; --ff-body: 'IM Fell English', serif;
      --ease-fast: 0.22s ease; --ease-mid: 0.42s cubic-bezier(0.4,0,0.2,1); --ease-slow: 0.65s cubic-bezier(0.4,0,0.2,1);
      --r: 8px;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body { background: var(--void); color: var(--parch); font-family: var(--ff-body); font-size: 1.13rem; line-height: 1.72; overflow-x: hidden; min-height: 100vh; }
    ::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-track { background: #08060d; }
    ::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 6px; } ::-webkit-scrollbar-thumb:hover { background: var(--gold); }

    /* NAV */
    nav#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; background: rgba(3,2,6,0.82); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(201,162,39,0.18); }
    .nav-brand { font-family: var(--ff-title); font-size: 1rem; color: var(--gold); text-decoration: none; letter-spacing: 0.04em; text-shadow: 0 0 14px rgba(201,162,39,0.55); transition: color var(--ease-fast); }
    .nav-brand:hover { color: var(--gold-lt); }
    .nav-toggle { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 6px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
    .nav-toggle span { display: block; width: 26px; height: 2.5px; background: var(--amber); border-radius: 2px; box-shadow: 0 0 8px rgba(255,191,0,0.55); transition: background-color var(--ease-mid); }
    .nav-toggle:hover span { background: var(--amber-lt); }
    .oc-backdrop { position: fixed; inset: 0; z-index: 1001; background: rgba(3,2,6,0.55); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity var(--ease-mid), visibility var(--ease-mid); }
    .oc-backdrop.open { opacity: 1; visibility: visible; }
    .oc-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1002; width: min(320px, 84vw); padding: 4rem 1.4rem 2rem; background: linear-gradient(160deg, #0a0810, #06040c); border-left: 1px solid rgba(255,191,0,0.18); overflow-y: auto; transform: translateX(100%); transition: transform var(--ease-slow); }
    .oc-drawer.open { transform: translateX(0); }
    .oc-close { position: absolute; top: 1.1rem; right: 1.2rem; width: 44px; height: 44px; border: 1px solid rgba(255,191,0,0.3); border-radius: 50%; background: rgba(255,191,0,0.06); color: var(--amber); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color var(--ease-fast); }
    .oc-close:hover { background: rgba(255,191,0,0.16); }
    .oc-eyebrow { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--amber); text-shadow: 0 0 12px rgba(255,191,0,0.5); }
    .oc-rule { display: block; height: 1px; margin: 0.9rem 0 1.4rem; background: linear-gradient(90deg, var(--amber), transparent); }
    .nav-links { display: flex; flex-direction: column; gap: 0.25rem; list-style: none; }
    .nav-links a { display: block; font-family: var(--ff-head); font-size: 1rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); text-decoration: none; padding: 0.72rem 0.9rem; border-radius: var(--r); border: 1px solid transparent; border-left: 2px solid transparent; transition: color var(--ease-fast), background-color var(--ease-fast), border-color var(--ease-fast), border-left-color var(--ease-fast), box-shadow var(--ease-fast), padding-left var(--ease-fast); }
    .nav-links a:hover, .nav-links a.active { color: var(--amber); border-color: rgba(255,191,0,0.3); border-left-color: var(--amber); background: rgba(255,191,0,0.06); box-shadow: inset 0 0 18px rgba(255,191,0,0.08); padding-left: 1.2rem; }
    .nav-item.dropdown .dropdown-toggle { position: relative; }
    .nav-item.dropdown .dropdown-toggle::after { content: '▾'; position: absolute; right: 0.95rem; top: 50%; transform: translateY(-50%); font-size: .7rem; color: var(--gold); opacity: 0.8; }
    .nav-item.dropdown .dropdown-menu { list-style: none; margin: 0.25rem 0 0.4rem; padding: 0 0 0 0.5rem; border-left: 1px solid rgba(255,191,0,0.18); }
    .nav-item.dropdown .dropdown-menu a { font-family: var(--ff-head); font-size: .92rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); text-decoration: none; display: block; padding: 0.55rem 0.9rem; border-radius: var(--r); border-left: 2px solid transparent; transition: color var(--ease-fast), background-color var(--ease-fast), border-left-color var(--ease-fast), padding-left var(--ease-fast); }
    .nav-item.dropdown .dropdown-menu a:hover { color: var(--gold-lt); border-left-color: var(--gold); background: rgba(255,191,0,0.05); padding-left: 1.1rem; }

    .page-wrap { padding: 7rem 1.2rem 2rem; scroll-margin-top: 7rem; }
    .back-link { display: inline-flex; align-items: center; gap: 8px; max-width: 1600px; margin: 0 auto 0.85rem; font-family: var(--ff-head); font-size: 1rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-lt); text-decoration: none; padding: 11px 20px; border: 1.5px solid rgba(201,162,39,0.65); border-radius: 10px; background: linear-gradient(180deg, rgba(46,32,12,0.92), rgba(22,15,7,0.92)); box-shadow: 0 4px 18px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,220,150,0.25); transition: all var(--ease-fast); }
    .back-link:hover { color: #ffe9b0; border-color: var(--gold); box-shadow: 0 4px 22px rgba(0,0,0,0.6), 0 0 18px rgba(255,180,80,0.35), inset 0 1px 0 rgba(255,220,150,0.4); transform: translateY(-1px); }

    /* ═══════════ KARMA'S GAMBIT ═══════════ */
    .kg-container { position: relative; max-width: 1600px; margin: 24px auto; background: linear-gradient(165deg, #0d0a12 0%, #070509 60%, #0b0705 100%); border: 1px solid rgba(201,162,39,0.35); border-radius: 14px; padding: 26px; color: var(--parch); overflow: hidden; box-shadow: 0 0 60px rgba(0,0,0,0.85), inset 0 0 90px rgba(184,58,13,0.05); scroll-margin-top: 8rem; }
    /* ═══════════ TRUE FULLSCREEN (Oct 10, 2026, fix 2) ═══════════
       Root cause of the ?v=20261010f failure (Brody: "no fucking scrolling"):
       the f fix turned every game view into an INTERNAL PAGE SCROLLER
       (.kg-container:fullscreen > section { overflow-y: auto }) and merely hid
       the scrollbar chrome — the bout is ~2x taller than any viewport, so the
       "fullscreen game" still slid around like a webpage, now with no visible
       scrollbar. On top of that, the f "Safari webkit patch" covered events/UI
       sync but NEVER gave :-webkit-full-screen the layout rules (Safari still
       uses the prefixed Fullscreen API), so webkit-path browsers got NO
       fullscreen layout at all — and 100vh (no dvh) mismatched mobile.
       New model: the fullscreen element is a viewport-fitted STAGE. The page
       never scrolls, views never page-scroll — each view FITS (bout: flex
       column, chrome compacts, the mat flexes, creatures fill their lanes).
       Designed internal scrollers (.hand x-carousel, .bill-items, .battle-log,
       modal bodies, inspect box) keep working; the section itself never does.
       FS = .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs)
       (.kg-fakefs = simulated fullscreen when the API is absent, e.g. iPhone). */
    .kg-container:fullscreen,
    .kg-container:-webkit-full-screen,
    .kg-container.kg-fakefs {
      max-width: none; width: 100vw;
      height: 100vh; height: 100dvh;
      max-height: 100vh; max-height: 100dvh;
      margin: 0; border-radius: 0; border: none;
      overflow: hidden; overscroll-behavior: none;
      padding: 20px 28px;
      display: flex; flex-direction: column;
    }
    .kg-container.kg-fakefs { position: fixed; inset: 0; z-index: 5000; }
    .kg-container:fullscreen > section,
    .kg-container:-webkit-full-screen > section,
    .kg-container.kg-fakefs > section {
      flex: 1 1 auto; min-height: 0; min-width: 0;
      overflow: hidden; /* views fit; they NEVER page-scroll */
      display: flex; flex-direction: column;
    }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header { flex: 0 0 auto; }
    html.kg-fs, html.kg-fs body { overflow: hidden !important; height: 100%; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #emberCanvas { position: fixed; }
    /* ── scrollbar chrome stays suppressed in true fullscreen (belt + braces:
       with the fit layout there is nothing to scroll, but designed internal
       scrollers keep working without visible bars). Firefox via
       scrollbar-width; Chrome/Safari via ::-webkit-scrollbar. ── */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs),
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) ::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
    /* ── fullscreen header compaction: every pixel goes to the game ── */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header { padding-bottom: 8px; gap: 8px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-sub { display: none; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header h1 { font-size: 1.15rem; letter-spacing: 2px; }
    /* ── THE BOUT fits one screen: flex column, chrome compacts, mat flexes ── */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout { display: flex; flex-direction: column; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout > * { flex: 0 0 auto; min-width: 0; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone { padding: 8px 12px; margin: 8px 0 4px; gap: 10px; align-items: center; flex-direction: row; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-figure { width: 44px; height: 52px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-figure .stranger-portrait { width: 44px; height: 44px; top: 4px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-name { display: none; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .speech { min-height: 0; padding: 6px 10px; font-size: 0.85rem; } /* intentional: compact bout chrome so the viewport-fitted stage fits one screen (base .speech is 0.98rem) */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .tab-wrap { margin: 6px auto 2px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-slip { padding: 6px 10px; font-size: 0.92rem; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-items { max-height: 34px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-head { font-size: 0.8rem; padding-bottom: 2px; margin-bottom: 2px; } /* intentional: compact tab header for the fullscreen stage fit (base .bill-head is 0.92rem) */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud { margin: 8px 0 4px; gap: 6px; grid-template-columns: repeat(4, 1fr); }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud-box { padding: 5px 4px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud-box .lbl { font-size: 0.7rem; letter-spacing: 0.1em; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud-box .val { font-size: 1rem; }
    /* the mat takes ALL remaining space; the two boards split it; lanes yield
       (min-height 0); creatures are height-driven and fill their lane — the
       fit holds by construction at ANY viewport, no scrollbars involved.
       (#kg-bout > .mat-row outranks the #kg-bout > * flex:none above.) */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-row { flex: 1 1 auto; min-height: 0; margin: 4px 0; overflow: hidden; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout > .mat-row { flex: 1 1 auto; min-height: 0; }
    /* LIVE-BUG (Oct 12 2026): the "giant dark disc" intruding from the right
       edge in fullscreen was the playmat art itself. playmat.jpg (1920x1200)
       carries heavy side motifs — a candle ring at the left edge and a big
       stone ring at the right. background-size:cover on the widened
       fullscreen stage scales the art to the stage width and blows the
       right-hand ring up to a screen-eating disc. In fullscreen the mat is
       height-fit and centered (contain) instead: the whole mat reads as a
       mat on the dark stage, motifs stay at their designed scale, and the
       gradient overlay still covers the full section (100% 100%). */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout { background-size: 100% 100%, contain; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main { display: flex; flex-direction: column; min-height: 0; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label { margin: 4px 0 2px; font-size: 0.85rem; } /* intentional: compact board labels for the fullscreen stage fit (base is 1.00rem) */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .trap-row { min-height: 34px; margin: 2px 0; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .trap-back { width: 32px; height: 45px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board { flex: 1 1 0; min-height: 0; margin: 2px 0; gap: 6px; grid-template-rows: 1fr; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .lane { min-height: 0; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bcreature { width: auto; height: 100%; max-width: 100%; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bcreature canvas { width: auto; height: 100%; max-width: 100%; }
    /* fixtures share the lane: the strip dissolves (display:contents) so the
       fixture card is a direct lane flex item at a fixed compact size. */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-strip { display: contents; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card { width: 64px; flex: 0 0 auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card canvas { width: 100%; height: auto; }
    /* TINYCARD FIX (Oct 16 2026): solo fixture in fullscreen is height-driven
       like a creature, not the 64px shared-lane chip. */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card.fx-solo { width: auto; height: 100%; flex: 0 0 auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card.fx-solo canvas { width: auto; height: 100%; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.annex { min-height: 0; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnexHolder.annex-holder { width: 96px; height: 134px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-label { margin: 6px 0 4px; font-size: 0.9rem; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand { min-height: 0; padding: 6px 4px 10px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card { width: 150px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card .cost-tag { font-size: 0.95rem; min-width: 38px; padding: 1px 8px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .action-bar { margin-top: 6px; gap: 8px; flex-direction: row; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .action-bar .btn { min-height: 44px; padding: 9px 14px; font-size: 0.9rem; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mode-note { margin: 4px 0 0; font-size: 0.85rem; } /* intentional: compact mode note for the fullscreen stage fit (base is 0.95rem) */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #combatBanner.active { margin: 6px 0; padding: 8px 10px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #combatBanner .cb-sub { display: none; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .battle-log { max-height: 84px; margin-top: 8px; padding: 8px 12px; font-size: 0.85rem; } /* intentional: compact log inside the 84px fullscreen scroller (base is 0.9rem; designed internal scroller per block header) */
    /* ── menus: the VIEW never pages; long lists get their own internal scroll ── */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-lobby,
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-campaign { height: 100%; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .card-split { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .card-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .deck-list { max-height: 120px; overflow-y: auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .campaign-levels { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-map { height: 100%; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .pmap { height: auto; flex: 1 1 auto; min-height: 160px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .map-lore { margin: 6px 0; }
    /* ── narrow screens: tighter stage padding + smaller hand cards ── */
    @media (max-width: 720px) {
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) { padding: 12px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card { width: 112px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header h1 { font-size: 1rem; }
    }
    /* ── large screens: bigger cards in fullscreen (Oct 10 2026) — desktop
       fullscreen was shrinking cards to phone sizes; scale up while keeping
       the single-screen fit. */
    @media (min-width: 1200px) {
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card { width: 210px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card .cost-tag { font-size: 1.05rem; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bcreature { min-width: 170px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bcreature .badge { font-size: 1.25rem; min-width: 32px; height: 32px; }
    }

    /* ── BOUT PRESENTATION (Oct 13 2026): on TALL fullscreen stages the field
       gets its share back. Diagnosis: board creatures are height-driven
       (height:100% of the lane) and the lane only gets the post-chrome
       remainder, while the hand was content-sized at full card height and
       never yielded — on a 1080p stage the two-row HUD, full hand and 84px
       log starved the boards to ~125px lanes of thumbnail cards. Here the
       HUD collapses to one row and the bill/log take the short-height
       program's own proven trim values; at real height (>=900px) the mat
       and the hand split the free space 5:2 with BOTH height-driven, so
       board creatures scale UP with the stage. The short-height landscape
       context (max-height 500px / landscape max-height 700px) can never
       match min-height:701px — the phone ledger (fs-fold pins) is untouched. */
    @media (min-width: 1100px) and (min-height: 701px) {
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud { grid-template-columns: repeat(7, 1fr); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-items { max-height: 22px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .battle-log { max-height: 64px; }
      /* fixtures ride the lane like creatures do — full lane height, not a 64px chip */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card { width: auto; height: 100%; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fixture-card canvas { width: auto; height: 100%; }
      /* the creature wrapper hugs its canvas — the >=1200px min-width:170px
         left a wide empty frame around a ~120px card on tall stages */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bcreature { min-width: 0; }
    }
    @media (min-width: 1100px) and (min-height: 900px) {
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout > .mat-row { flex: 5 1 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout > .hand { flex: 2 1 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card { width: auto; height: 100%; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card canvas { width: auto; height: 100%; }
    }
    #emberCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.5; z-index: 0; }
    /* content sits above the ember canvas — scoped to content ONLY (.game-header,
       sections). The old "> *:not(#emberCanvas)" version won by ID specificity
       (1,1,0) and silently demoted every fixed/absolute overlay that is a
       direct child of #kg-app — .modal, .kg-toast, .kg-share-pop,
       .cutscene-overlay, .god-bark, .end-overlay, .rw-overlay, #inspectOverlay,
       #tutOverlay/#tutRing/#tutArrow/#tutNudge, #combatArrows, #kgBuildMarker —
       into in-flow relative boxes (toast as a layout-shifting bar, modals as
       bands instead of centered overlays). Overlays keep their designed
       positioning now. */
    .kg-container > .game-header, .kg-container > section { position: relative; z-index: 1; }
    .hidden { display: none !important; }

    .game-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid rgba(201,162,39,0.22); padding-bottom: 14px; flex-wrap: wrap; }
    /* official title treatment (Oct 9, 2026): hand-inked tankard mark + letterpress gold */
    .game-brand { display: flex; align-items: center; gap: 12px; }
    .kg-mark { flex: 0 0 auto; width: 44px; height: 44px; }
    .kg-mark svg { width: 100%; height: 100%; display: block; }
    .game-header h1 { font-family: var(--ff-title); color: var(--gold-lt); letter-spacing: 3px; font-size: 1.5rem; margin: 0;
      text-shadow: 0 2px 0 #000, 0 0 26px rgba(201,162,39,0.45), 0 0 4px rgba(0,0,0,0.9); }
    .game-sub { font-style: italic; color: var(--mist); font-size: .92rem; margin-top: 2px; }
    .header-btns { display: flex; gap: 8px; flex-wrap: wrap; }
    .help-toggle-btn, .sound-btn, .acct-btn {
      background: transparent; border: 1px solid var(--gold-dim); color: var(--gold);
      padding: 8px 14px; border-radius: 6px; cursor: pointer; font-family: var(--ff-head);
      font-size: 1rem; letter-spacing: 0.08em; transition: background-color var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast); min-height: 40px;
    }
    .help-toggle-btn:hover, .sound-btn:hover, .acct-btn:hover { background: rgba(201,162,39,0.14); border-color: var(--gold); color: var(--gold-lt); }
    .acct-btn .who { color: var(--amber-lt); }

    /* ── LEGITIMACY POLISH (Oct 9, 2026): transitions, loading states, board
       material, press juice. Pure CSS; no game logic. The page already ships
       a global prefers-reduced-motion rule that zeroes animation/transition
       durations, so every effect below degrades to instant. ── */
    /* smoother phase changes: sections fade-rise when unhidden */
    #kg-app > section { animation: kgPhaseIn 0.38s cubic-bezier(0.2,0.7,0.3,1) both; }
    @keyframes kgPhaseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    /* loading states that don't look broken: quiet tavern notes while grids fill */
    .card-grid:empty::after { content: 'Shuffling the archive…'; grid-column: 1 / -1; justify-self: center;
      font-style: italic; color: var(--mist); font-size: 1rem; padding: 28px 12px; }
    .deck-list:empty::after { content: 'No cards dealt yet — tap the collection below.'; display: block;
      font-style: italic; color: var(--mist); font-size: 1rem; padding: 10px 4px; }
    .campaign-levels:empty::after { content: 'Dealing the five tables…'; display: block; text-align: center;
      font-style: italic; color: var(--mist); font-size: 1rem; padding: 24px 12px; }
    .custom-rows:empty::after { content: 'Polishing the table…'; display: block;
      font-style: italic; color: var(--mist); font-size: 1rem; padding: 10px 4px; }
    /* board material depth: vignette + wood rail over the flat playmat,
       felt weave inside lanes (kg-3d.js enhances cards, not this shell) */
    #kg-bout { border: 1px solid rgba(201,162,39,0.4);
      box-shadow: inset 0 0 120px rgba(0,0,0,0.7), 0 12px 44px rgba(0,0,0,0.55); }
    #kg-bout::after { content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
      background: radial-gradient(ellipse at 50% 42%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.52) 100%);
      box-shadow: inset 0 0 0 5px rgba(18,10,4,0.92), inset 0 0 0 6px rgba(201,162,39,0.28); }
    .lane { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.016) 0 2px, rgba(0,0,0,0) 2px 4px); }
    /* subtle press juice */
    .btn:active, .gbtn:active { transform: translateY(1px) scale(0.99); }
    /* TRACK 4 FEEL: press-in snaps fast, release eases */
    .hand-card:active { transform: translateY(-4px) scale(0.98); transition-duration: .05s; }

    /* ── OATH / GATE ── */
    .oath-wrap { max-width: 520px; margin: 24px auto; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.4); border-radius: 12px; padding: 28px; box-shadow: 0 0 40px rgba(0,0,0,0.7); }
    /* GUEST ON-RAMP (Oct 13 2026, DECISION-QUEUE ##31a): signed-out visitors
       may sit at Learn, Story and Practice on house decks; the Oath is asked
       for at the moment of value. Guest-only chrome is keyed off classes the
       guest entry sets — signed-in markup and flow are untouched. */
    #guestBackBtn { display: none; }
    #kg-gate.guest-session #guestBackBtn { display: inline-block; }
    #guestWallNote, #campaignGuestNote { display: none; }
    #kg-app.guest-mode #guestWallNote, #kg-app.guest-mode #campaignGuestNote { display: block; }
    #kg-app.guest-mode #deckRoom, #kg-app.guest-mode #customRoom, #kg-app.guest-mode #deckHintNote { display: none; }
    .oath-wrap h2 { font-family: var(--ff-title); color: var(--gold); letter-spacing: 2px; font-size: 1.4rem; text-align: center; margin-bottom: 4px; }
    .oath-blurb { font-style: italic; color: var(--mist); text-align: center; font-size: 1rem; margin-bottom: 18px; }
    .oath-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
    .oath-tab { flex: 1; min-height: 44px; background: transparent; border: 1px solid rgba(201,162,39,0.3); color: var(--mist); border-radius: 8px; font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: background-color var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast); }
    .oath-tab.active { background: rgba(201,162,39,0.18); border-color: var(--gold); color: var(--gold-lt); }
    .oath-field { margin-bottom: 12px; }
    .oath-field label { display: block; font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); margin-bottom: 5px; }
    .oath-field input { width: 100%; min-height: 46px; background: rgba(0,0,0,0.55); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; color: var(--parch); font-family: var(--ff-body); font-size: 1rem; padding: 10px 14px; transition: border-color var(--ease-fast); }
    .oath-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 12px rgba(201,162,39,0.25); }
    .oath-err { color: #ff7b6b; font-size: .9rem; font-style: italic; min-height: 24px; margin: 6px 0; }
    .oath-note { color: var(--mist); font-size: 1rem; font-style: italic; margin-top: 10px; line-height: 1.6; }
    .code-input { text-align: center; letter-spacing: 0.5em !important; font-size: 1.4rem !important; font-family: var(--ff-head) !important; }
    .resend-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
    .link-btn { background: none; border: none; color: var(--gold); font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; text-decoration: underline; min-height: 40px; }
    .link-btn:hover { color: var(--gold-lt); }
    .link-btn:disabled { opacity: 0.4; cursor: not-allowed; }

    /* ── BUTTONS ── */
    .btn { min-height: 50px; padding: 12px 18px; border-radius: 10px; cursor: pointer; font-family: var(--ff-head); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 1rem; border: 1px solid transparent; }
    /* TRACK 4 FEEL: press-in snaps fast, release eases — buttons feel alive */
    .btn:active { transform: scale(0.97); transition-duration: .05s; }
    .btn:disabled { opacity: 0.35; cursor: not-allowed; }
    .btn-gold { background: linear-gradient(160deg, #d9a83c, #9a6f1c); color: #140e02; box-shadow: 0 4px 18px rgba(201,162,39,0.35); }
    .btn-gold:hover:not(:disabled) { box-shadow: 0 4px 26px rgba(255,191,0,0.5); filter: brightness(1.1); }
    .btn-blood { background: linear-gradient(160deg, #a02323, #5f1010); color: #ffe9e9; box-shadow: 0 4px 18px rgba(139,26,26,0.4); }
    .btn-blood:hover:not(:disabled) { filter: brightness(1.15); }
    .btn-ghost { background: transparent; border: 1px solid rgba(122,111,144,0.5); color: var(--mist); }
    .btn-ghost:hover:not(:disabled) { border-color: var(--mist); color: var(--parch); }
    .btn-block { display: block; width: 100%; margin-top: 8px; }

    /* ── LOBBY / COLLECTION ── */
    /* ── SCREEN SHAKE (Oct 10 2026): impact feel for big hits ── */
    .kg-container.shake { animation: kgShake .32s ease-out; }
    @keyframes kgShake {
      0%, 100% { transform: translate(0, 0); }
      20% { transform: translate(-5px, 3px); }
      40% { transform: translate(4px, -4px); }
      60% { transform: translate(-3px, -2px); }
      80% { transform: translate(2px, 2px); }
    }
    @media (prefers-reduced-motion: reduce) {
      .kg-container.shake { animation: none; }
    }
    /* ── WELCOME BANNER (Oct 10 2026): new-player 3-step guide ── */
    .welcome-banner { background: linear-gradient(135deg, rgba(201,162,39,.14), rgba(201,162,39,.05)); border: 1px solid rgba(201,162,39,.45); border-radius: 10px; padding: 14px 18px; margin: 0 0 14px; position: relative; }
    .welcome-banner h3 { margin: 0 0 8px; color: var(--gold-lt); font-family: var(--ff-head); font-size: 1rem; }
    .welcome-banner ol { margin: 0; padding-left: 20px; }
    .welcome-banner li { margin: 4px 0; font-size: .92rem; }
    .welcome-banner .wb-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--gold); font-size: 1.13rem; cursor: pointer; opacity: .7; }
    .welcome-banner .wb-close:hover { opacity: 1; }
    /* MOBILE (Oct 12 2026, B8): the ✕ stays small-by-design but gets a 44px
       hit box via ::after — same trick as .inspect-btn, zero layout shift so
       it can't cover the banner text on 360px. */
    .welcome-banner .wb-close::after { content: ''; position: absolute; inset: -12px; }
    /* ── MAIN MENU (Oct 10 2026): game modes as hero cards ── */
    .play-menu { margin: 18px 0 8px; }
    .play-menu-title { font-family: var(--ff-head); color: var(--gold); letter-spacing: .08em; margin: 0 0 10px; font-size: 1.13rem; text-align: center; }
    .play-menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
    .play-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px !important; min-height: 96px !important; text-transform: none !important; letter-spacing: normal !important; }
    /* Batch #257: .play-card's display:flex would beat the hidden
       attribute — the seasonal door stays gone out of season. */
    #seasonCampaignBtn[hidden] { display: none !important; }
    .play-card .pc-icon { font-size: 1.9rem; line-height: 1; }
    /* ── KG ICON SET (Track 1, batch 4): hand-inked SVG icons, currentColor ── */
    .kg-ic { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }
    [data-kg-icon] { display: inline-flex; align-items: center; justify-content: center; }
    [data-kg-icon] .kg-ic { width: 1.15em; height: 1.15em; }
    .play-card .pc-icon [data-kg-icon] .kg-ic, .play-card .pc-icon .kg-ic { width: 1em; height: 1em; }
    .kg-ic-label { margin-left: .35em; }
    .hud-ico { display: inline-flex; align-items: center; margin-right: .3em; color: var(--gold-lt); }
    .hud-ico .kg-ic { width: 1.05em; height: 1.05em; }
    .g-label .kg-ic, .sound-btn .kg-ic, .help-toggle-btn .kg-ic, .btn .kg-ic,
    .play-menu-title .kg-ic, h3 .kg-ic { width: 1.1em; height: 1.1em; vertical-align: -0.15em; margin-right: .25em; }
    .pn-badge .kg-ic, .lg-pill .kg-ic { width: 1em; height: 1em; vertical-align: -0.12em; }
    .cost-lock .kg-ic, .inspect-btn .kg-ic { width: 1.1em; height: 1.1em; }
    .badge .pip-ico .kg-ic { width: .95em; height: .95em; vertical-align: -0.1em; }
    .play-card .pc-label { font-family: var(--ff-head); font-weight: 700; font-size: 1rem; letter-spacing: .06em; }
    .play-card .pc-sub { font-size: .78rem; opacity: .7; font-weight: 400; }
    .play-card.btn-gold .pc-sub { color: #2a1e05; opacity: .8; }
    /* ── POLISH (Oct 10 2026): hover lift, transitions, focus rings ── */
    .play-card { transition: transform .15s ease, box-shadow .15s ease; }
    .play-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(201,162,39,.25); }
    .play-card:active { transform: translateY(0); transition-duration: .05s; }
    .play-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
    .btn { transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
    .btn:hover:not(:disabled) { transform: translateY(-1px); }
    .card-grid .kg-card { transition: transform .15s ease, box-shadow .15s ease; }
    .card-grid .kg-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 2; }
    /* ── collapsible Table Style (Oct 10 2026): customizations no longer dominate ── */
    .custom-room > details > summary { cursor: pointer; list-style: none; position: relative; }
    /* MOBILE (Oct 12 2026, B8): the summary row is only ~32px tall — extend
       the hit box to 44px with ::after (same trick as .inspect-btn). The
       extension overlaps only non-interactive padding/text, so no tap
       target is stolen. */
    .custom-room > details > summary::after { content: ''; position: absolute; inset: -6px 0; }
    .custom-room > details > summary::-webkit-details-marker { display: none; }
    .custom-room > details > summary h3 { display: inline; }
    .custom-room > details > summary::after { content: ' ▸'; color: var(--gold); }
    .custom-room > details[open] > summary::after { content: ' ▾'; }
    .lobby-head h2 { font-family: var(--ff-title); color: var(--gold-lt); font-size: 1.25rem; letter-spacing: 2px;
      text-shadow: 0 2px 0 #000, 0 0 18px rgba(201,162,39,0.35);
      border-bottom: 3px double rgba(201,162,39,0.5); padding-bottom: 6px; }
    .lobby-meta { font-family: var(--ff-head); font-size: .92rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); }
    .lobby-meta b { color: var(--gold-lt); }
    /* ranked ladder tier badge — shared by the lobby and the result overlay */
    .rank-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem;
      letter-spacing: 0.18em; border: 1px solid currentColor; background: rgba(0,0,0,0.35); white-space: nowrap; }
    .rank-badge.tier-0 { color: #d99a5b; } /* bronze */
    .rank-badge.tier-1 { color: #cfd6dd; } /* silver */
    .rank-badge.tier-2 { color: #f0c44c; } /* gold */
    .rank-badge.tier-3 { color: #8fd8ef; } /* platinum */
    .rank-badge.tier-4 { color: #c9a2ff; } /* diamond */
    .rank-icon { width: 22px; height: 22px; vertical-align: -5px; margin-right: 5px; border-radius: 50%; background: rgba(0,0,0,0.45); }
    /* ── RANKED REWARDS PANEL ── */
    .rw-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(4,2,1,0.85); padding: 16px; }
    .rw-card { max-width: 880px; width: 100%; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #1a130b, #0d0906);
      border: 1px solid rgba(201,162,39,0.45); border-radius: 14px; padding: 20px 22px; box-shadow: 0 0 60px rgba(0,0,0,0.85); }
    .rw-card h2 { font-family: var(--ff-title); color: var(--gold); letter-spacing: 2px; margin: 0 0 4px; font-size: 1.3rem; }
    .rw-sub { color: var(--mist); font-style: italic; margin: 0 0 14px; font-size: .92rem; }
    .rw-sub b { color: var(--gold-lt); font-style: normal; }
    /* ranked PvP lobby */
    .pvp-sec { border: 1px solid rgba(201,162,39,0.25); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: rgba(0,0,0,0.32); }
    .pvp-sec h3 { font-family: var(--ff-head); color: var(--gold-lt); letter-spacing: 1px; margin: 0 0 8px; font-size: 1rem; }
    .pvp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
    .pvp-note { color: var(--mist); font-size: .9rem; font-style: italic; margin: 6px 0; }
    .pvp-note b { color: var(--gold-lt); font-style: normal; }
    .pvp-input { background: #0d0906; border: 1px solid rgba(201,162,39,0.4); color: var(--ink, #e8dcc0); border-radius: 8px; padding: 10px 12px; min-height: 44px; font-size: 1rem; } /* 1rem: iOS Safari auto-zooms on focus below 16px */
    .pvp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
    .pvp-dot.on { background: #7dd87d; box-shadow: 0 0 6px #7dd87d; }
    .pvp-dot.off { background: #6b6259; }
    .pvp-ch { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed rgba(201,162,39,0.2); }
    .rw-tier { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start;
      border: 1px solid rgba(201,162,39,0.25); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: rgba(0,0,0,0.32); }
    .rw-tier-img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: rgba(0,0,0,0.5); border: 1px solid rgba(201,162,39,0.3); }
    .rw-tier h3 { margin: 0 0 2px; font-family: var(--ff-head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 1rem; color: var(--gold-lt); }
    .rw-tier.rw-cur-tier { border-color: rgba(240,196,76,0.65); }
    .rw-cur { font-size: .72rem; color: var(--gold); letter-spacing: 0.1em; text-transform: none; font-style: italic; }
    .rw-tier .rw-quality { font-size: .78rem; color: var(--mist); letter-spacing: 0.08em; }
    .rw-list { margin: 6px 0 0; padding: 0; list-style: none; }
    .rw-list li { font-size: .9rem; color: var(--parch); padding: 2px 0; }
    .rw-list li.owned { color: var(--gold-lt); }
    .rw-list li .rw-check { color: #7fd97f; font-weight: 700; margin-right: 6px; }
    .rw-list li .rw-lock { color: rgba(160,150,140,0.55); margin-right: 6px; }
    .rw-sec { font-size: .78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); margin: 8px 0 2px; }
    .rw-close { margin-top: 6px; }
    .deck-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: rgba(0,0,0,0.4); border: 1px solid rgba(201,162,39,0.25); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
    .deck-bar .lbl { font-family: var(--ff-head); font-size: .88rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); }
    .deck-bar .val { font-family: var(--ff-head); font-size: 1.2rem; color: var(--gold-lt); font-weight: 700; }
    /* collection grid density (S/M/L): persisted view preference, applied as
       data-density on #kg-lobby; tile sizes live in game-readability.css */
    .grid-density { display: inline-flex; gap: 4px; }
    .grid-den-btn { min-width: 44px; min-height: 44px; padding: 4px 0; font-family: var(--ff-head); font-weight: 700; }
    .grid-den-btn[aria-pressed="true"] { background: rgba(201,162,39,0.28); border-color: var(--gold); color: var(--gold-lt); box-shadow: 0 0 10px rgba(201,162,39,0.35); }
    .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 12px 0 20px; }
    /* #964 (DQ #13): 360–390px phones fell off a cliff to ONE column
       (a 328px container fits only one 170px track + gap). At ≤720px
       the minimum drops to 150px, so small phones get 2 columns;
       desktop is untouched. */
    @media (max-width: 720px) {
      .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    }
    .card-tile { position: relative; cursor: pointer; border-radius: 8px; border: 2px solid transparent; transition: transform var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast), opacity var(--ease-fast), outline-color var(--ease-fast); background: rgba(0,0,0,0.35); }
    .card-tile canvas { display: block; width: 100%; height: auto; border-radius: 6px; }
    .card-tile:hover { transform: translateY(-3px); border-color: rgba(201,162,39,0.5); }
    .card-tile.in-deck { border-color: var(--amber); box-shadow: 0 0 14px rgba(255,191,0,0.35); }
    .card-tile .deck-check { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.75); border: 1px solid var(--amber); color: var(--amber); display: none; align-items: center; justify-content: center; font-size: .9rem; }
    .card-tile.in-deck .deck-check { display: flex; }
    .card-tile .bonus-tag { position: absolute; bottom: 4px; left: 4px; font-family: var(--ff-head); font-size: 1rem; background: rgba(0,0,0,0.8); border: 1px solid var(--gold); color: var(--gold-lt); border-radius: 4px; padding: 1px 6px; }

    /* ── MAP: the endless pathway (visual upgrade Oct 9, 2026) ──
       Hand-inked tavern art direction: heavy blacks, flat ink tones, hatch
       texture drawn as static SVG — no gradients on new imagery, no glossy
       AI look, zero per-frame cost (everything is static DOM/SVG; the only
       animation is the reachable-node pulse, already reduced-motion gated). */
    .map-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
    .map-head h2 { font-family: var(--ff-title); color: var(--gold); font-size: 1.25rem; letter-spacing: 2px; }
    .purse-strip { display: flex; gap: 14px; font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
    .purse-strip b { color: var(--spirits); } .purse-strip .ash b { color: var(--ash); }
    .map-path { font-style: italic; color: var(--mist); font-size: .9rem; margin-bottom: 8px; min-height: 24px; }
    .map-lore { font-style: italic; color: var(--mist); text-align: center; font-size: .92rem; margin: 6px 0 0; }
    .pmap { position: relative; width: 100%; height: 560px; border: 1px solid rgba(201,162,39,0.35); border-radius: 14px; overflow: hidden;
      background: #0d0805;
      box-shadow: inset 0 0 90px rgba(0,0,0,0.85), inset 0 0 26px rgba(255,180,90,0.06), 0 12px 44px rgba(0,0,0,0.5); margin: 10px 0 18px; }
    .pmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
    /* paths: dark ink underlay + gold overlay, round caps; walked paths burn brighter with ember dots */
    .pmap-path-under { fill: none; stroke: rgba(8,5,2,0.9); stroke-width: 7; stroke-linecap: round; }
    .pmap-path { fill: none; stroke: rgba(222,168,64,0.78); stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(255,180,80,0.35)); }
    .pmap-path.walked { stroke: rgba(255,190,80,0.95); }
    .pmap-ember { fill: #ffcf7a; opacity: 0.9; }
    /* floorboards: flat plank tones + ink grain + gaps + nails (fills set inline per plank) */
    .pmap-grain { stroke: rgba(0,0,0,0.55); stroke-width: 1.2; fill: none; }
    .pmap-gap { stroke: rgba(0,0,0,0.8); stroke-width: 2.5; }
    .pmap-nail { fill: rgba(0,0,0,0.65); }
    .pmap-glow { pointer-events: none; }
    .pmap-sconce { fill: #ffcf7a; }
    .pmap-nodes { position: absolute; inset: 0; }
    /* node medallions: the per-type art lives in the inline SVG (ink ring +
       hatch ticks + hand-drawn icon); the button is just the hit area */
    .pnode { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
      background: radial-gradient(circle at 50% 35%, #241a0e, #100a05);
      border: none; padding: 0; cursor: default; color: #fff;
      display: flex; align-items: center; justify-content: center;
      transition: transform 0.18s ease, filter 0.18s ease; }
    .pnode .pn-medal { width: 88%; height: 88%; display: block; pointer-events: none; }
    .pnode .pn-label { position: absolute; top: 100%; margin-top: 5px; left: 50%; transform: translateX(-50%); white-space: nowrap;
      font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: #f2e6c8;
      background: rgba(6,4,3,0.85); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; padding: 2px 8px;
      text-shadow: 0 1px 3px #000; }
    .pnode.done { opacity: 0.45; }
    .pnode.skipped { opacity: 0.22; filter: grayscale(0.7); }
    .pnode.future { opacity: 0.42; }
    .pnode.current { filter: drop-shadow(0 0 12px rgba(255,205,110,0.75)); }
    .pnode.reachable { cursor: pointer; animation: nodePulse 2.2s ease-in-out infinite; }
    .pnode.reachable:hover, .pnode.reachable:focus-visible { transform: scale(1.14); outline: 2px solid var(--gold-lt); outline-offset: 3px; }
    /* state badges: ✓ cleared · 🔒 locked — node state at a glance */
    .pnode .pn-badge { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center; font-size: .9rem; line-height: 1;
      background: #0d0906; border: 1px solid rgba(201,162,39,0.5); }
    .pnode .pn-badge.done { color: #ffd977; border-color: rgba(255,191,0,0.7); box-shadow: 0 0 8px rgba(255,191,0,0.35); }
    .pnode .pn-badge.lock { color: #8d8a96; border-color: rgba(141,138,150,0.45); }
    /* boss chip: elite rooms are unmistakable */
    .pnode .pn-boss { position: absolute; top: calc(100% + 34px); left: 50%; transform: translateX(-50%); white-space: nowrap;
      font-family: var(--ff-head); font-size: .9rem; letter-spacing: 0.28em; color: #f0a6f0;
      background: rgba(40,8,40,0.85); border: 1px solid rgba(203,80,203,0.6); border-radius: 6px; padding: 2px 8px 2px 10px; }
    .pmap-legend { display: flex; gap: 8px 10px; justify-content: center; flex-wrap: wrap; font-size: 1rem; color: #e8dcc2; margin: 0 0 8px; }
    .pmap-legend .lg-room { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
      background: rgba(0,0,0,0.5); border: 1px solid rgba(201,162,39,0.3); border-radius: 20px; padding: 3px 11px 3px 6px; }
    .pmap-legend .lg-room svg { width: 24px; height: 24px; flex: 0 0 auto; }
    .pmap-legend-states { margin-top: 6px; font-size: .9rem; }
    .pmap-legend-states .lg-pill { display: inline-block; padding: 2px 10px; border-radius: 10px; border: 1px solid rgba(201,162,39,0.35); background: rgba(0,0,0,0.5); color: #e8dcc2; }
    .pnode:disabled { cursor: default; }
    @keyframes nodePulse { 0%, 100% { filter: drop-shadow(0 0 4px rgba(232,195,90,0.25)); } 50% { filter: drop-shadow(0 0 14px rgba(232,195,90,0.7)); } }
    .pmap-piece { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 5;
      display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
      background: radial-gradient(circle at 50% 35%, #3a2c14, #191006);
      border: 2px solid var(--gold-lt); border-radius: 50%; box-shadow: 0 0 18px rgba(232,195,90,0.85);
      transition: left 0.55s ease, top 0.55s ease; }
    .pmap-fog { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none;
      background: linear-gradient(to bottom, rgba(10,7,5,0) 0%, rgba(10,7,5,0.55) 55%, rgba(10,7,5,0.96) 100%); }
    .pmap-depth { position: absolute; top: 10px; right: 12px; font-family: var(--ff-head); font-size: .9rem; letter-spacing: 0.2em;
      color: var(--gold-lt); background: rgba(0,0,0,0.6); border: 1px solid rgba(201,162,39,0.45); border-radius: 20px; padding: 4px 14px;
      text-shadow: 0 1px 2px #000; }
    @media (prefers-reduced-motion: reduce) {
      .pnode.reachable { animation: none; }
      .pmap-piece { transition: none; }
    }
    /* MANUAL reduced-motion override (header Motion toggle, a11y Oct 10 2026):
       mirrors every OS-level prefers-reduced-motion block in this sheet so
       the stored setting covers the same surface on any OS. */
    :root[data-motion="reduced"] .pnode.reachable { animation: none; }
    :root[data-motion="reduced"] .pmap-piece { transition: none; }
    @media (max-width: 720px) {
      /* rows sit ~46px apart at 390px: shrink nodes so medallions never collide;
         labels + boss chips hide — the legend below carries names and types */
      .pnode { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
      .pnode .pn-boss { display: none; }
    }
    /* ── back-shelf shop ── */
    .shop-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: rgba(20,14,8,0.6);
      border: 1px solid rgba(201,162,39,0.3); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
    .shop-info { text-align: left; }
    .shop-info b { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.06em; color: var(--gold-lt); }
    .shop-info .skind { font-size: .88rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--mist); margin-left: 8px; }
    .shop-info span.sdesc { display: block; font-size: .78rem; color: var(--mist); font-style: italic; }
    .shop-buy { display: flex; gap: 8px; flex-shrink: 0; }
    .shop-buy .btn { min-height: 44px; padding: 6px 12px; font-size: .78rem; }

    /* ── BOUT ── */
    .stranger-zone { display: flex; gap: 16px; align-items: flex-start; background: rgba(10,6,16,0.55); border: 1px solid rgba(191,64,191,0.18); border-radius: 10px; padding: 14px 16px; margin: 14px 0 6px; }
    .stranger-fig-wrap { flex: 0 0 auto; text-align: center; }
    .stranger-figure { width: 76px; height: 90px; position: relative; margin: 0 auto; transition: transform 0.6s cubic-bezier(0.34,1.3,0.44,1), filter 0.6s ease; }
    .stranger-figure .hood { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 32%, #2c2540 0%, #16121f 52%, #070509 100%); border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%; box-shadow: inset 0 -14px 30px rgba(0,0,0,0.9), 0 0 26px rgba(191,64,191,0.10); border: 1px solid rgba(122,111,144,0.25); }
    .stranger-figure .face-void { position: absolute; left: 22%; right: 22%; top: 34%; height: 38%; background: radial-gradient(ellipse at 50% 40%, #000 55%, transparent 100%); border-radius: 50%; }
    .stranger-figure.rattled { animation: tremble 0.45s ease-in-out infinite; }
    /* campaign duels: the hooded figure is replaced by the opponent's animated
       talking-head portrait (kg-talkheads.js). Square portrait so the face
       anchors map 1:1; the CSS hood/void hide underneath. */
    .stranger-figure .stranger-portrait { position: absolute; left: 0; top: 7px; width: 76px; height: 76px;
      object-fit: cover; border-radius: 50%; border: 1px solid rgba(201,162,39,0.35);
      box-shadow: 0 0 18px rgba(0,0,0,0.6); background: #1a120c; }
    .stranger-figure.dealer-face .hood, .stranger-figure.dealer-face .face-void { display: none; }
    @keyframes tremble { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-1.5px,1px); } 50% { transform: translate(1.5px,-1px); } 75% { transform: translate(-1px,-1px); } }
    .stranger-name { font-family: var(--ff-head); font-size: .88rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); margin-top: 6px; }
    /* PvP opponent identity line (DECISION-QUEUE #37): icon + rank under the name; PvE leaves it empty/hidden. */
    .stranger-sub { font-size: .9rem; letter-spacing: 0.03em; color: var(--gold); margin-top: 2px; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-sub { display: none; }
    .speech { background: rgba(0,0,0,0.5); border: 1px solid rgba(201,162,39,0.25); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 10px; padding: 10px 14px; font-style: italic; font-size: 0.98rem; color: #e3d5b8; min-height: 58px; line-height: 1.55; flex: 1; }
    .speech .cursor { display: inline-block; width: 8px; animation: blink 0.8s steps(2) infinite; color: var(--gold); }
    @keyframes blink { 50% { opacity: 0; } }

    .hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
    .hud-box { background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.22); border-radius: 8px; padding: 8px 6px; text-align: center; }
    .hud-box .lbl { font-family: var(--ff-head); font-size: .78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); display: block; }
    .hud-box .val { font-family: var(--ff-head); font-size: 1.13rem; font-weight: 700; color: var(--tallow); text-shadow: 0 0 12px rgba(232,200,106,0.35); }
    .hud-box.ash .val { color: var(--ash); } .hud-box.tab .val { color: #ff9d6b; }
    .hud-box.clay .val { color: #d08a4e; }
    .hud-box.round .val { color: var(--gold-lt); }
    /* ── GRAVE PILES ── */
    .grave-pile { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.5); border: 1px solid rgba(154,160,168,0.4); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--ff-head); color: var(--ash); min-height: 44px; transition: background-color var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast); }
    .grave-pile:hover { border-color: var(--ash); color: var(--parch); background: rgba(154,160,168,0.08); }
    .grave-pile .g-count { font-size: 1.25rem; font-weight: 700; color: var(--gold-lt); min-width: 2ch; text-align: center; }
    .grave-pile .g-label { font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }
    .grave-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
    .grave-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: rgba(0,0,0,0.4); border: 1px solid rgba(154,160,168,0.25); border-radius: 6px; font-size: 1rem; }
    .grave-item .g-name { color: var(--parch); font-weight: 600; }
    .grave-item .g-meta { color: var(--mist); font-size: .92rem; }
    .grave-item .g-act { flex: none; font-size: .95rem; padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(201,162,39,0.55); background: rgba(201,162,39,0.14); color: var(--parch); cursor: pointer; }
    .grave-item .g-act:hover { background: rgba(201,162,39,0.28); }
    /* ── DECK ROOM ── */
    .deck-room { background: rgba(0,0,0,0.4); border: 1px solid rgba(201,162,39,0.3); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
    .deck-room h3 { font-family: var(--ff-head); color: var(--gold); font-size: 1.13rem; letter-spacing: 0.1em; margin-bottom: 10px; }
    .deck-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
    .deck-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.5); border: 1px solid rgba(201,162,39,0.3); color: var(--parch); border-radius: 20px; padding: 8px 8px 8px 16px; font-size: 1rem; cursor: pointer; min-height: 44px; }
    .deck-chip.active { border-color: var(--gold); background: rgba(201,162,39,0.15); color: var(--gold-lt); }
    .deck-chip .dc-del { background: none; border: none; color: var(--mist); font-size: 1.13rem; cursor: pointer; padding: 4px 8px; border-radius: 50%; }
    .deck-chip .dc-load { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: left; }
    .deck-chip .dc-del:hover { color: #ff7b6b; }
    .deck-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .deck-actions input { background: rgba(0,0,0,0.55); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; color: var(--parch); font-size: 1rem; padding: 10px 14px; min-height: 44px; }
    .filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
    .filter-bar .flt-missing { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; color: var(--parch); cursor: pointer; font-size: 1rem; }
    .filter-bar .flt-missing input { width: 20px; height: 20px; accent-color: #c9a227; cursor: pointer; }
    .filter-bar input, .filter-bar select { background: rgba(0,0,0,0.55); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; color: var(--parch); font-size: 1rem; padding: 8px 12px; min-height: 44px; }
    .filter-bar select option { background: #141019; }
    .curve-strip { display: flex; gap: 4px; align-items: flex-end; margin: 8px 0 40px; height: 44px; }
    /* MOBILE (Oct 12 2026, B8): the cost-digit labels hang 18px below the bars
       (bottom:-18px on .curve-bar span) — the old 8px bottom margin let them
       print directly on top of the .deck-stats line. 40px clears the ~35px the
       labels occupy. Same fix on desktop (the collision was all-widths). */
    .curve-bar { flex: 1; background: rgba(201,162,39,0.35); border-radius: 3px 3px 0 0; min-width: 14px; position: relative; }
    .curve-bar span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: .9rem; color: var(--mist); }
    .deck-actions select { background: rgba(0,0,0,0.55); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; color: var(--parch); font-size: 1rem; padding: 8px 12px; min-height: 44px; }
    .deck-actions select option { background: #141019; }
    .deck-stats { color: var(--mist); font-size: 1rem; line-height: 1.55; margin: 8px 0 2px; }
    .deck-stats b { color: var(--gold-lt); font-weight: 700; }
    /* ── DECK ROOM: archive tiles — owned counts, dimmed unowned, remove-all ── */
    .card-tile .own-count { position: absolute; bottom: 4px; left: 4px; font-family: var(--ff-head); font-size: .9rem; background: rgba(0,0,0,0.82); border: 1px solid var(--gold); color: var(--gold-lt); border-radius: 4px; padding: 2px 8px; z-index: 2; pointer-events: none; }
    .card-tile .own-count.not-owned { border-color: rgba(201,162,39,0.35); color: var(--mist); }
    .card-tile.unowned { opacity: 0.55; }
    .card-tile.unowned .deck-check { display: none; }
    .deck-remove-all { position: absolute; top: 4px; left: 4px; min-width: 44px; min-height: 44px; border-radius: 22px; background: rgba(0,0,0,0.82); border: 1px solid #ff7b6b; color: #ff9d8f; font-size: .9rem; font-weight: 700; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 0 10px; font-family: var(--ff-head); }
    .deck-remove-all:hover { background: rgba(120,20,10,0.85); color: #ffd9d2; }
    .deck-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 10px 0 4px; flex-wrap: wrap; }
    .deck-pager .pg-info { color: var(--mist); font-size: 1rem; min-width: 190px; text-align: center; }
    /* ── DECK ROOM: in-deck / collection split ── */
    .card-split { margin: 14px 0 4px; }
    .split-head { display: flex; align-items: baseline; gap: 10px; font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.12em; color: var(--gold); margin: 6px 0 8px; flex-wrap: wrap; }
    .split-count { color: var(--mist); font-size: 1rem; letter-spacing: 0.02em; }
    .in-deck-grid { border: 1px dashed rgba(255,191,0,0.35); border-radius: 10px; padding: 10px; background: rgba(255,191,0,0.045); }
    .split-hint { grid-column: 1 / -1; color: var(--mist); font-style: italic; text-align: center; padding: 14px 10px; font-size: 1rem; }
    .card-tile.out-deck .deck-check { display: flex; border-color: rgba(201,162,39,0.55); color: var(--gold-lt); }
    /* ── TABLE STYLE: deck-room customization panel ── */
    .custom-room { background: rgba(0,0,0,0.4); border: 1px solid rgba(201,162,39,0.3); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
    .custom-room h3 { font-family: var(--ff-head); color: var(--gold); font-size: 1.13rem; letter-spacing: 0.1em; margin-bottom: 10px; }
    .custom-preview { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.25); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
    .cu-who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
    .cu-avatar { width: 56px; height: 56px; border-radius: 50%; border: 3px solid rgba(201,162,39,0.4); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: rgba(0,0,0,0.5); flex: none; }
    .cu-name { color: var(--parch); font-weight: 700; font-size: 1rem; }
    .cu-title { color: var(--gold-lt); font-size: 1rem; font-style: italic; }
    .cu-prev-item { display: flex; flex-direction: column; gap: 6px; align-items: center; }
    .cu-cap { font-size: .88rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
    .cu-backcv { width: 96px; height: auto; border-radius: 8px; border: 1px solid rgba(201,162,39,0.4); }
    .cu-mat { width: 96px; height: 60px; border-radius: 8px; border: 1px solid rgba(201,162,39,0.4); }
    .custom-rows { display: flex; flex-direction: column; gap: 12px; }
    .custom-row { display: flex; flex-direction: column; gap: 6px; }
    .custom-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
    .custom-label b { color: var(--parch); font-size: 1rem; letter-spacing: 0.06em; }
    .custom-label span { color: var(--mist); font-size: .9rem; font-style: italic; }
    .custom-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
    .custom-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; min-height: 64px; background: rgba(0,0,0,0.5); border: 2px solid rgba(201,162,39,0.25); border-radius: 10px; color: var(--parch); cursor: pointer; font-size: .88rem; }
    .custom-opt:hover { border-color: rgba(201,162,39,0.6); }
    .custom-opt.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(201,162,39,0.45); background: rgba(201,162,39,0.12); }
    .custom-opt .opt-label { line-height: 1.15; text-align: center; }
    .opt-icon { font-size: 1.6rem; }
    .opt-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); }
    .opt-back { width: 46px; height: auto; border-radius: 6px; }
    .opt-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #888; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: rgba(0,0,0,0.5); }
    .opt-framechip { width: 52px; height: 70px; border-radius: 6px; border: 3px solid #c9a227; background: rgba(0,0,0,0.6); }
    .custom-err { color: var(--mist); font-size: .9rem; font-style: italic; min-height: 1.2em; margin-top: 8px; }
    .cu-avatar-chip { font-size: 1.13rem; margin-right: 6px; }
    .cu-title-chip { color: var(--gold-lt); font-style: italic; }
    /* ── FIELD ANNEX: one shared contested zone, off the left of the play mat ── */
    .mat-row { display: flex; gap: 14px; align-items: stretch; margin: 8px 0; }
    .mat-main { flex: 1 1 auto; min-width: 0; }
    #fieldAnnex.annex {
      flex: 0 0 148px; align-self: center;
      min-height: 240px; border: 2px solid rgba(201,162,39,0.55); border-radius: 12px;
      padding: 10px; background: linear-gradient(170deg, rgba(46,32,18,0.92), rgba(12,8,6,0.94));
      box-shadow: 0 0 22px rgba(201,162,39,0.18), inset 0 0 26px rgba(0,0,0,0.6);
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      text-align: center; position: relative;
    }
    #fieldAnnex.annex::before { content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(201,162,39,0.3); border-radius: 8px; pointer-events: none; }
    #fieldAnnex .annex-title { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-lt); }
    #fieldAnnexHolder.annex-holder {
      width: 120px; height: 168px; border-radius: 8px; position: relative;
      background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.35);
      display: flex; align-items: center; justify-content: center; overflow: hidden;
    }
    #fieldAnnex .annex-sub { font-size: .88rem; color: var(--mist); font-style: italic; }
    #fieldAnnex .annex-hp { font-size: 1.13rem; font-weight: 700; color: var(--blood); }
    #fieldAnnex.annex.npc { border-color: rgba(154,160,168,0.55); }
    /* Nov 5 2026: while the Squatter holds, his painted portrait fills
       the holder frame behind the clay figure (holder children are a
       pinned contract — a background touches none of them). */
    #fieldAnnex.annex.npc #fieldAnnexHolder.annex-holder {
      background: linear-gradient(rgba(8,6,4,0.15), rgba(8,6,4,0.32)), url('squatter-portrait.webp') top center / cover no-repeat, rgba(0,0,0,0.45);
    }
    #fieldAnnex.annex.wild { border-color: rgba(168,85,247,0.75); box-shadow: 0 0 18px rgba(168,85,247,0.4); }
    #fieldAnnex.annex.mine { border-color: var(--gold); box-shadow: 0 0 18px rgba(201,162,39,0.35); }
    #fieldAnnex.annex.theirs { border-color: var(--blood); box-shadow: 0 0 18px rgba(154,20,20,0.35); }
    #fieldAnnex.annex.open { opacity: 0.75; border-style: dashed; }
    /* CREW B (Oct 10 2026) — raise moment: a gold flash + scale pulse on the
       annex when a field spell is raised into it, so the raise FEELS like an
       event, not a quiet card swap. The owner's color rides the pulse (gold
       for yours, blood for his), keeping the dark-tavern aesthetic. */
    #fieldAnnex.annex.raise-flash { animation: annexRaiseFlash 1.15s ease-out; }
    #fieldAnnex.annex.raise-flash.mine { border-color: var(--gold); }
    #fieldAnnex.annex.raise-flash.theirs { border-color: var(--blood); animation: annexRaiseFlashBlood 1.15s ease-out; }
    @keyframes annexRaiseFlash {
      0%   { box-shadow: 0 0 0 rgba(255,215,130,0), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1); }
      18%  { box-shadow: 0 0 52px rgba(255,215,130,0.95), inset 0 0 34px rgba(255,215,130,0.4); transform: scale(1.045); }
      45%  { box-shadow: 0 0 30px rgba(255,215,130,0.55), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1.015); }
      100% { box-shadow: 0 0 18px rgba(201,162,39,0.35), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1); }
    }
    @keyframes annexRaiseFlashBlood {
      0%   { box-shadow: 0 0 0 rgba(220,60,60,0), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1); }
      18%  { box-shadow: 0 0 52px rgba(220,60,60,0.95), inset 0 0 34px rgba(220,60,60,0.4); transform: scale(1.045); }
      45%  { box-shadow: 0 0 30px rgba(220,60,60,0.55), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1.015); }
      100% { box-shadow: 0 0 18px rgba(154,20,20,0.35), inset 0 0 26px rgba(0,0,0,0.6); transform: scale(1); }
    }
    /* WILD FELLED (Oct 13 2026, annex visual pass): when the wild field-spell
       NPC falls, the annex answers with a one-shot violet burst — the duel
       resuming should FEEL like the spell breaking. Reduced motion (either
       signal) trades the burst for a steady violet glow. */
    #fieldAnnex.annex.wild-felled { animation: annexWildFelled 0.9s ease-out; }
    @keyframes annexWildFelled {
      0%   { box-shadow: 0 0 0 rgba(168,85,247,0), inset 0 0 26px rgba(0,0,0,0.6); }
      22%  { box-shadow: 0 0 54px rgba(168,85,247,0.95), inset 0 0 40px rgba(168,85,247,0.45); }
      100% { box-shadow: 0 0 22px rgba(201,162,39,0.18), inset 0 0 26px rgba(0,0,0,0.6); }
    }
    @media (prefers-reduced-motion: reduce) {
      #fieldAnnex.annex.wild-felled { animation: none; box-shadow: 0 0 22px rgba(168,85,247,0.65); }
    }
    :root[data-motion="reduced"] #fieldAnnex.annex.wild-felled { animation: none; box-shadow: 0 0 22px rgba(168,85,247,0.65); }
    @media (max-width: 700px) {
      /* narrow screens: the annex stacks above the mat as a compact strip —
         still on-screen, never overlapping the boards */
      .mat-row { flex-direction: column; }
      #fieldAnnex.annex { flex: none; width: 100%; min-height: 0; flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; align-self: auto; }
      #fieldAnnexHolder.annex-holder { width: 84px; height: 118px; flex: 0 0 auto; }
      #fieldAnnex .annex-title { display: none; }
    }


    /* karma scale */
    .scale-wrap { margin: 10px auto 4px; max-width: 560px; text-align: center; }
    .scale-label { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--mist); margin-bottom: 6px; }
    .scale-track { position: relative; height: 34px; background: rgba(0,0,0,0.55); border: 1px solid rgba(201,162,39,0.35); border-radius: 16px; overflow: hidden; }
    .scale-pips { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; }
    .scale-pips span { width: 8px; height: 8px; border-radius: 50%; background: rgba(122,111,144,0.35); }
    .scale-pips span.ptip { background: var(--amber); box-shadow: 0 0 8px rgba(255,191,0,0.8); }
    .scale-pips span.dtip { background: var(--shadow-purple); box-shadow: 0 0 8px rgba(191,64,191,0.8); }
    .scale-marker { position: absolute; top: 3px; bottom: 3px; width: 28px; border-radius: 14px; background: linear-gradient(160deg, var(--gold-lt), var(--gold-dim)); box-shadow: 0 0 16px rgba(201,162,39,0.7); transition: left var(--ease-mid); left: calc(50% - 14px); }
    .scale-ends { display: flex; justify-content: space-between; font-family: var(--ff-head); font-size: .78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; }
    .scale-ends .you { color: var(--amber-lt); } .scale-ends .him { color: #c9a2ff; }

    .board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0; }
    .lane { position: relative; min-height: 190px; border: 1px dashed rgba(201,162,39,0.25); border-radius: 10px; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; transition: background-color var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast), outline-color var(--ease-fast); }
    .lane.playable { border-style: solid; border-color: rgba(255,191,0,0.55); background: rgba(255,191,0,0.05); cursor: pointer; }
    .lane.playable:hover { background: rgba(255,191,0,0.12); box-shadow: inset 0 0 18px rgba(255,191,0,0.15); }
    .lane.sac-target { border-color: rgba(184,58,13,0.8); cursor: pointer; }
    .lane.sac-target:hover { background: rgba(184,58,13,0.15); }
    .lane .empty-hint { font-size: 1.4rem; color: rgba(122,111,144,0.35); }
    .lane-label { position: absolute; top: 2px; left: 6px; font-family: var(--ff-head); font-size: .78rem; letter-spacing: 0.14em; color: rgba(122,111,144,0.6); text-transform: uppercase; }
    .board-side-label { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); margin: 10px 0 4px; display: flex; justify-content: space-between; }
    .board-side-label .trap-count { color: var(--gold); }

    /* ═══ v3: tab bill-slips, fixtures, spirit icon ═══ */
    .tab-wrap { display: flex; gap: 12px; margin: 10px auto 4px; max-width: 720px; }
    .bill-slip { flex: 1; background: linear-gradient(170deg, #141007, #0b0803); border: 1px solid rgba(201,162,39,0.4); border-radius: 8px; padding: 8px 12px; font-size: 1rem; }
    .bill-slip.foe { border-color: rgba(191,64,191,0.35); }
    .bill-head { display: flex; justify-content: space-between; font-family: var(--ff-head); font-size: .92rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); border-bottom: 1px dashed rgba(201,162,39,0.35); padding-bottom: 4px; margin-bottom: 4px; }
    .bill-slip.foe .bill-head { color: var(--shadow-purple); border-bottom-color: rgba(191,64,191,0.3); }
    .bill-head b.cutoff { color: #ff7b6b; }
    .bill-items { max-height: 74px; overflow-y: auto; line-height: 1.5; color: var(--parch); }
    .bill-items .bi { display: flex; justify-content: space-between; gap: 8px; }
    .bill-items .bi .amt { color: var(--amber-lt); font-family: var(--ff-head); }
    /* MOBILE (Oct 12 2026, B8): tab-log names ("the Bone-Choir Cantor",
       "<Card>’s Wrath") can exceed the half-width bill-slip on 360px — let
       the flex row shrink and the name wrap instead of forcing a horizontal
       scrollbar inside the 74px log. Zero visual change when content fits. */
    .tab-wrap .bill-slip { min-width: 0; }
    .bill-items .bi > * { min-width: 0; }
    .bill-items .bi .amt { flex: none; }
    .bill-items .bi > span:first-child { overflow-wrap: anywhere; }
    .bill-empty { color: var(--mist); font-style: italic; }
    .fixture-strip { min-height: 26px; display: flex; justify-content: center; margin-top: 3px; }
    .fixture-mini { font-size: .88rem; font-family: var(--ff-head); letter-spacing: 0.06em; color: var(--gold-lt); background: rgba(0,0,0,0.55); border: 1px dashed rgba(201,162,39,0.55); border-radius: 6px; padding: 2px 8px; cursor: pointer; max-width: 96%; text-align: center; line-height: 1.35; overflow-wrap: break-word; }
    .fixture-mini .fhp { color: #8fd18f; }
    /* fixture card face: fixtures render as real cards (frame + art + HP),
     * never a bare text box. The strip shows a compact face; click zooms. */
    .fixture-card { position: relative; width: 104px; cursor: pointer; border-radius: 6px; }
    .fixture-card canvas { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid rgba(201,162,39,0.55); }
    .fixture-card .fx-hp { position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,0.82); border: 1px solid #8fd18f; color: #8fd18f; font-size: .9rem; font-weight: 800; border-radius: 4px; padding: 0 4px; }
    /* TINYCARD FIX (Oct 16 2026): a fixture wears its identity on its face —
     * the ⚒ FIXTURE tag (sibling of .fx-hp) announces the kind at any size,
     * and a fixture ALONE in a lane (.fx-solo, set by renderBout when the
     * creature slot is empty) renders at full creature width instead of
     * sitting at 104px in a 190px lane reading as a broken miniature. */
    .fixture-card .fx-tag { position: absolute; top: 2px; left: 2px; background: rgba(0,0,0,0.82); border: 1px solid rgba(201,162,39,0.85); color: var(--gold-lt); font-size: .9rem; font-weight: 800; letter-spacing: 0.08em; border-radius: 4px; padding: 0 4px; pointer-events: none; }
    .fixture-card .fx-act { position: absolute; bottom: 2px; right: 2px; background: rgba(201,162,39,0.2); border: 1px solid rgba(201,162,39,0.85); color: var(--gold-lt); font-size: .9rem; font-weight: 800; letter-spacing: 0.06em; border-radius: 4px; padding: 3px 8px; min-height: 28px; cursor: pointer; }
    .fixture-card .fx-act:hover { background: rgba(201,162,39,0.38); }
    .hand-card .hand-ability-btn { position: absolute; bottom: 2px; left: 2px; z-index: 3; background: rgba(90,140,90,0.28); border: 1px solid rgba(140,220,140,0.8); color: #dff5df; font-size: .9rem; font-weight: 800; letter-spacing: 0.05em; border-radius: 4px; padding: 3px 8px; min-height: 28px; cursor: pointer; }
    .hand-card .hand-ability-btn.armed { background: rgba(140,220,140,0.45); color: #10240f; }
    .fixture-card.fx-solo { width: 140px; }
    .lane.fixture-playable { outline: 2px dashed var(--gold); outline-offset: -4px; cursor: pointer; }
    .spirit-ico { display: inline-flex; width: 1em; height: 1em; vertical-align: -0.12em; color: var(--tallow); }
    .spirit-ico svg { width: 100%; height: 100%; }
    .hand-card.bluff-pick { outline: 2px solid var(--shadow-purple); }
    /* ═══ playmat — default game field ═══ */
    #kg-bout {
      position: relative;
      border-radius: 12px;
      padding: 14px 12px;
      background:
        linear-gradient(rgba(6,4,10,0.62), rgba(6,4,10,0.62)),
        url('playmat.jpg') center / cover no-repeat,
        #070509;
    }

    .bcreature { position: relative; width: 140px; cursor: default; }
    /* EYE5 TIER 3 (Nov 22, 2026): the canvas MUST be positioned. KG3D inserts
     * an absolutely-positioned "edge slab" gradient div before the canvas and
     * keeps it behind the face only via preserve-3d (translateZ(-6px)). Any
     * grouping property on .bcreature — .attacker-spent's opacity:0.55, the
     * kgm-wither filter — forces transform-style:flat, and in flat paint order
     * the positioned edge paints OVER a static canvas: the spent attacker
     * showed its own card edge (a smooth gradient) instead of its face for
     * the rest of the combat phase. position:relative puts the canvas in the
     * positioned layer, after the edge in DOM order, so the face wins in both
     * flat and preserve-3d modes; badges and the z-5 foil still paint above. */
    .bcreature canvas { display: block; width: 100%; height: auto; border-radius: 6px; position: relative; }
    .bcreature.sacrificeable { cursor: pointer; }
    .bcreature.sacrificeable:hover canvas { filter: brightness(1.25) sepia(0.4); }
    .bcreature.just-played canvas { animation: cardLand 0.4s cubic-bezier(0.2,1.6,0.4,1); }
    @keyframes cardLand { 0% { transform: scale(1.35) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
    .bcreature.dying canvas { animation: cardDie 0.45s ease forwards; }
    @keyframes cardDie { to { transform: scale(0.6) rotate(8deg); opacity: 0; filter: grayscale(1); } }
    .bcreature .stat-badges { position: absolute; bottom: -8px; left: 0; right: 0; display: flex; justify-content: space-between; pointer-events: none; }
    .bcreature .badge { font-family: var(--ff-head); font-weight: 700; font-size: 1rem; min-width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid #000; }
    /* A11Y (Oct 10 2026): ATK/HP were red-vs-green CIRCLES — color-only. ATK is
       now a rounded SQUARE with a crossed-knives glyph; HP stays circular
       with a heart glyph. Shape + symbol + position (ATK left, HP right) all
       survive red/green colorblindness, and the card art's knife/mug glyphs
       + ATK/HP text labels already carried the same redundancy. */
    .bcreature .badge.atk { background: radial-gradient(circle at 35% 35%, #d96b4a, #8b1a1a); color: #ffe9e9; border-radius: 7px; }
    .bcreature .badge.hp { background: radial-gradient(circle at 35% 35%, #6fae6f, #1f5c1f); color: #eaffea; }
    .bcreature .badge .pip-ico { font-size: 0.78em; margin-right: 2px; line-height: 1; }
    .bcreature .sigil-dots { position: absolute; top: -6px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; pointer-events: none; }
    .bcreature .sigil-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--shadow-purple); border: 1px solid #000; box-shadow: 0 0 6px rgba(191,64,191,0.8); }
    .bcreature .pin-marker { position: absolute; top: -9px; right: -5px; font-size: .88rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.85)); z-index: 3; }
    .bcreature .grudge-marker { position: absolute; top: -9px; left: -5px; font-size: .88rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.85)); z-index: 3; }
    .bcreature .debt-tag { position: absolute; top: -8px; right: -6px; font-family: var(--ff-head); font-size: .78rem; background: #3a1408; border: 1px solid #ff9d6b; color: #ffb98a; border-radius: 4px; padding: 0 4px; }
    /* Starfall cocoons: face-down creatures */
    .bcreature.face-down canvas { filter: saturate(0.7) brightness(0.9); }
    .bcreature .flip-btn { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); font-family: var(--ff-head); font-weight: 700; font-size: .92rem; letter-spacing: 0.14em; background: linear-gradient(165deg, #2a1a3a, #120a1e); border: 1px solid #b983f0; color: #d9c2f5; border-radius: 6px; padding: 6px 14px; cursor: pointer; box-shadow: 0 0 12px rgba(185,131,240,0.4); min-height: 44px; z-index: 3; touch-action: manipulation; }
    .bcreature .flip-btn:active { transform: translateX(-50%) scale(0.95); }
    .bcreature .flip-btn:hover { background: linear-gradient(165deg, #3a2450, #1a0e28); box-shadow: 0 0 18px rgba(185,131,240,0.7); }
    /* Sun Gods tribute: picked sacrifices */
    .bcreature.tribute-picked canvas { filter: brightness(0.55) sepia(0.6) hue-rotate(-15deg); outline: 2px solid #ff9d6b; outline-offset: -2px; }

    .trap-row { display: flex; gap: 8px; min-height: 44px; align-items: center; margin: 4px 0; }
    .trap-row .tlabel { font-family: var(--ff-head); font-size: .78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mist); }
    .trap-back { width: 40px; height: 56px; border-radius: 6px; background: linear-gradient(150deg, #241a10, #0e0a06); border: 1px solid var(--gold-dim); position: relative; cursor: default; overflow: hidden; }
    .trap-back canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
    .trap-back.reveal { animation: trapFlip 0.5s ease; border-color: var(--amber); }
    @keyframes trapFlip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
    .trap-back.known { cursor: pointer; }
    .trap-back.known::after { content: '◈'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1rem; text-shadow: 0 0 6px #000, 0 2px 2px #000; pointer-events: none; }

    /* hand */
    .hand-label { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); margin: 12px 0 6px; display: flex; justify-content: space-between; align-items: center; }
    .hand { display: flex; gap: 10px; overflow-x: auto; padding: 10px 4px 16px; min-height: 190px; }
    .hand-card { position: relative; flex: 0 0 auto; width: 210px; cursor: pointer; border-radius: 8px; border: 2px solid transparent; transition: transform var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast); transform-style: preserve-3d; }
    .hand-card canvas { display: block; width: 100%; height: auto; border-radius: 6px; backface-visibility: hidden; }
    .hand-card:hover { transform: translateY(-8px); }
    .hand-card.selected { border-color: var(--amber); box-shadow: 0 0 18px rgba(255,191,0,0.5); transform: translateY(-10px); }
    .hand-card.unplayable canvas { filter: grayscale(0.7) brightness(0.6); }
    /* NOTE: the unplayable dim lives on the CANVAS only. A CSS filter on the
     * .hand-card container forces used transform-style:flat, which collapses
     * the KG3D 3D context — the opaque .kg3d-edge slab (meant to sit BEHIND
     * the face) then paints OVER it, blanking the card while the cost tag
     * and buttons still show. Keep filters off 3D-tilted containers. */
    .hand-card.drawing { animation: drawFlip 0.45s ease; }
    @keyframes drawFlip { 0% { transform: rotateY(90deg) translateY(-14px); opacity: 0; } 100% { transform: rotateY(0) translateY(0); opacity: 1; } }
    .hand-card .cost-tag { position: absolute; top: 20%; left: 4px; font-family: var(--ff-head); font-size: 1.13rem; font-weight: 700; background: rgba(0,0,0,0.88); border: 2px solid var(--tallow); color: var(--tallow); border-radius: 999px; padding: 2px 8px; min-width: 46px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.75); z-index: 2; }
    /* COST LEGIBILITY (Oct 10 2026, Brody: summoning costs must be easier to
       understand): unaffordable cards keep the dim AND get a lock badge —
       the dim alone read as "not your turn". */
    .hand-card.unplayable .cost-tag { border-color: #6b5a3a; color: #8a7a55; }
    .hand-card .cost-lock { position: absolute; bottom: 8px; right: 8px; font-size: 1.35rem; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.85)); z-index: 2; pointer-events: none; }
    .hand-spirits { color: var(--tallow); font-weight: 600; }
    .hand-spirits b { color: #ffd24a; font-size: 1.1em; }

    .action-bar { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
    .action-bar .btn { flex: 1 1 0; }
    .mode-note { text-align: center; font-style: italic; color: var(--gold-lt); min-height: 26px; margin-top: 6px; font-size: 1rem; }

    .battle-log { max-height: 150px; overflow-y: auto; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.2); border-radius: 8px; padding: 10px 14px; margin-top: 12px; font-size: .9rem; line-height: 1.6; }
    .battle-log .lg-bad { color: #ff9d8a; } .battle-log .lg-good { color: #a8e6a1; }
    .battle-log .lg-gold { color: var(--gold-lt); } .battle-log .lg-dim { color: var(--mist); font-style: italic; }
    /* DECISION-QUEUE #27 fold: inert scaffolding — the wrapper takes no
       layout space and both fold controls stay hidden until the JS fold
       module activates them (.fold-live) inside the fullscreen short-height
       context; the live rules live in the short-viewport media block. */
    .fold-wrap { display: contents; }
    #logStrip, #speechFoldBtn { display: none; }

    .dmg-num { position: absolute; font-family: var(--ff-head); font-weight: 900; font-size: 1.5rem; color: #ff6b5b; text-shadow: 0 0 10px rgba(0,0,0,0.9), 0 2px 2px #000; pointer-events: none; z-index: 5; animation: dmgFloat 0.9s ease-out forwards; }
    .dmg-num.heal { color: #a8e6a1; } .dmg-num.scale-tip { color: var(--amber); font-size: 1.2rem; }
    @keyframes dmgFloat { 0% { transform: translateY(0) scale(1.3); opacity: 1; } 100% { transform: translateY(-46px) scale(0.9); opacity: 0; } }

    /* ── turn pill: unmissable active-player / next-step indicator ── */
    .turn-pill { margin: 10px auto 0; padding: 8px 18px; border-radius: 999px; text-align: center; font-size: 0.95rem; letter-spacing: 0.04em; max-width: 640px; }
    .turn-pill.your { background: linear-gradient(135deg, rgba(120,84,10,0.55), rgba(60,40,5,0.6)); border: 1px solid rgba(255,191,0,0.65); color: #ffd98a; box-shadow: 0 0 18px rgba(255,191,0,0.18); animation: kgPhaseIn 0.3s ease both; }
    .turn-pill.foe { background: rgba(0,0,0,0.4); border: 1px solid rgba(140,140,160,0.3); color: var(--mist); font-style: italic; }

    /* ── overlays ── */
    .end-overlay { position: absolute; inset: 0; z-index: 20; background: rgba(3,2,6,0.94); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 14px; }
    .end-card { max-width: min(640px, calc(100vw - 32px)); width: 100%; background: linear-gradient(165deg, #120d18, #080509); border: 1px solid rgba(201,162,39,0.5); border-radius: 12px; padding: 28px; text-align: center; box-shadow: 0 0 50px rgba(0,0,0,0.9), 0 0 30px rgba(201,162,39,0.12); max-height: min(92%, calc(100dvh - 32px)); overflow-y: auto; }
    .end-card h2, .end-card h3 { font-family: var(--ff-title); color: var(--gold); letter-spacing: 2px; font-size: 1.4rem; margin-bottom: 6px; text-shadow: 0 0 20px rgba(201,162,39,0.5); }
    .end-card .end-sub { font-style: italic; color: var(--mist); margin-bottom: 14px; }
    .end-card .story { text-align: left; font-style: italic; color: #dccfae; background: rgba(0,0,0,0.4); border-left: 3px solid var(--gold); padding: 14px 16px; border-radius: 0 8px 8px 0; margin: 14px 0; line-height: 1.7; }
    /* BOUT PRESENTATION (Oct 13 2026): the result card carries a one-line
       ledger recap (final tabs · rounds · mode) and reads its outcome at a
       glance — defeat is blood, victory keeps the house gold, a draw goes grey. */
    .end-card .end-recap { font-family: var(--ff-head); letter-spacing: 0.14em; font-size: 0.9rem; color: var(--gold-lt); text-transform: uppercase; margin: 0 0 4px; }
    .end-card .end-recap:empty { display: none; }
    #resultOverlay.kg-lose .end-card { border-color: rgba(178,44,32,0.8); box-shadow: 0 0 50px rgba(0,0,0,0.9), 0 0 30px rgba(178,44,32,0.25); }
    #resultOverlay.kg-lose .end-card h2 { color: #e5534b; text-shadow: 0 0 20px rgba(178,44,32,0.55); }
    #resultOverlay.kg-lose .end-card .story { border-left-color: #b22c20; }
    #resultOverlay.kg-draw .end-card { border-color: rgba(150,150,160,0.55); }
    #resultOverlay.kg-draw .end-card h2 { color: #b9b3a4; text-shadow: none; }
    .draft-row { display: flex; gap: 12px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
    .draft-pick { width: 190px; cursor: pointer; border: 2px solid transparent; border-radius: 8px; transition: transform var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast); }
    .draft-pick canvas { width: 100%; display: block; border-radius: 6px; }
    .draft-pick:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
    .choice-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
    .choice-btn { text-align: left; background: rgba(0,0,0,0.4); border: 1px solid rgba(201,162,39,0.3); border-radius: 8px; padding: 12px 16px; color: var(--parch); cursor: pointer; font-family: var(--ff-body); font-size: 1rem; transition: background-color var(--ease-fast), border-color var(--ease-fast); min-height: 48px; }
    .choice-btn:hover { border-color: var(--gold); background: rgba(201,162,39,0.08); }
    .choice-btn b { color: var(--gold-lt); font-family: var(--ff-head); font-size: 1.02rem; letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
    .shrine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; max-height: 300px; overflow-y: auto; }
    .shrine-pick { cursor: pointer; border: 2px solid transparent; border-radius: 8px; transition: border-color var(--ease-fast), box-shadow var(--ease-fast); }
    .shrine-pick canvas { width: 100%; display: block; border-radius: 6px; }
    .shrine-pick:hover { border-color: var(--blood); }
    .shrine-pick.chosen { border-color: var(--amber); box-shadow: 0 0 14px rgba(255,191,0,0.4); }

    /* toast */
    .kg-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 3000; max-width: min(560px, 92vw); background: linear-gradient(165deg, #171208, #0b0805); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 18px; box-shadow: 0 8px 40px rgba(0,0,0,0.8), 0 0 24px rgba(201,162,39,0.25); font-size: 0.98rem; opacity: 0; pointer-events: none; transition: opacity var(--ease-mid), transform var(--ease-mid); }
    .kg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    .kg-toast .tt { font-family: var(--ff-head); font-size: 1.00rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }

    /* help modal */
    .modal { position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.86); display: flex; justify-content: center; align-items: center; padding: 16px; }
    .modal-content { background: #141019; border: 1px solid rgba(201,162,39,0.5); padding: 28px; border-radius: 10px; max-width: min(600px, calc(100vw - 32px)); width: 100%; position: relative; max-height: min(88vh, calc(100dvh - 32px)); overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,0.9); }
    .modal-content h3 { font-family: var(--ff-head); color: var(--gold); margin-bottom: 12px; letter-spacing: 0.06em; }
    .modal-content p { margin-bottom: 10px; font-size: 0.98rem; }
    .modal-content ul { margin: 10px 0 10px 1.1rem; } .modal-content li { margin-bottom: 8px; font-size: 0.95rem; }
    .close-modal { position: absolute; right: 14px; top: 8px; font-size: 1.8rem; cursor: pointer; color: var(--gold); background: none; border: none; min-width: 44px; min-height: 44px; }
    /* ENHANCEMENT WAVE 2: styled confirm modal (retires native confirm()).
       Buttons ride .btn (min-height 50px, 1rem) — tap + text floors hold. */
    .kg-confirm-box { max-width: min(440px, calc(100vw - 32px)); }
    .kg-confirm-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
    .kg-confirm-btns .btn { min-width: 120px; }

    /* FOOTER */
    footer { padding: 3rem 1.4rem 2.4rem; text-align: center; border-top: 1px solid rgba(201,162,39,0.18); background: #06040c; }
    .footer-brand { font-family: var(--ff-title); font-size: 1.1rem; color: var(--gold); }
    .footer-tagline { font-family: var(--ff-body); font-style: italic; color: var(--mist); margin: 0.4rem 0 1.2rem; }
    .footer-copy { font-size: 0.97rem; color: var(--mist); }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    }
    /* manual override twin (Motion toggle): zero every animation/transition
       duration so each effect degrades to instant. Gameplay state changes
       (toasts, banners, target outlines) still land — instantly. */
    :root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
      animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
    }
    @media (max-width: 720px) {
      .kg-container { padding: 16px; margin: 20px auto; }
      .board { gap: 5px; } .lane { min-height: 108px; }
      .bcreature { width: 100%; max-width: 120px; }
      .fixture-card.fx-solo { width: 100%; max-width: 120px; }
      .pmap { height: 480px; }
      .pnode .pn-label { display: none; }
      .hud { grid-template-columns: repeat(2, 1fr); }
      .stranger-zone { flex-direction: column; align-items: center; text-align: center; }
      .speech { border-radius: 10px; text-align: left; width: 100%; }
      .action-bar { flex-direction: column; }
      .hand-card { width: 150px; }
      .game-header h1 { font-size: 1.2rem; letter-spacing: 2px; }
    }

    /* ═══ UX (Oct 11 2026, B8): short-viewport bout compaction ═══
       Landscape phones (e.g. 844x390) are wider than the 720px breakpoint, so
       without this they render the full desktop bout at ~390px of height.
       CSS-only first pass — needs verification on a real landscape device. */
    @media (max-height: 500px), (orientation: landscape) and (max-height: 700px) {
      .hud { gap: 4px; margin: 6px 0; }
      .hud-box { padding: 4px 3px; }
      .hud-box .lbl { font-size: 0.9rem; letter-spacing: 0.08em; } /* WAVE 2 (Oct 13): was 0.7rem (~11px) — below the 0.9rem readability floor wave 1 enforced; the +3px is bought back by the lane/stranger savings below */
      .hud-box .val { font-size: 0.95rem; }
      .bcreature { width: 100px; }
      .fixture-card.fx-solo { width: 100px; }
      .hand-card { width: 112px; }
      .hand-card .cost-tag { font-size: 0.9rem; min-width: 34px; padding: 1px 7px; }
      .action-bar { gap: 6px; margin-top: 6px; }
      .action-bar .btn { min-height: 40px; padding: 6px 10px; font-size: 0.9rem; }
      .turn-pill { margin-top: 6px; padding: 5px 12px; font-size: 0.9rem; }
      .game-header h1 { font-size: 1rem; letter-spacing: 1px; }
      /* WAVE 2 (Oct 13) — the elements this block forgot (the fullscreen
         stage compacts every one of them; the numbers are in
         hidden_files/enhancement-w2-NOTES.md). Page mode scrolls, so each
         saved pixel is scroll the player never makes mid-bout:
         lanes 190->148 (a 100px-wide creature canvas is ~140 tall; the
         base min-height was pure air, x2 boards = -84px), stranger zone
         and speech padding/min-height (-~36px; text stays 0.98rem — the
         fitted stage's 0.85rem speech shrink does NOT apply here),
         trap rows/backs mirror the FS sizes (-~30px), board-side-label
         margins (-~12px). */
      .lane { min-height: 148px; }
      .stranger-zone { padding: 8px 12px; margin: 8px 0 4px; }
      .speech { min-height: 0; padding: 6px 10px; }
      .trap-row { min-height: 34px; margin: 2px 0; }
      .trap-back { width: 32px; height: 45px; }
      .board-side-label { margin: 6px 0 2px; }
      /* WAVE 2 — fullscreen/fakefs at short heights: sections NEVER scroll
         there (overflow:hidden by design), and the fixed bout chrome sums
         past a 360-390px-tall landscape phone, crushing the mat and
         clipping the tail. The 150px hand card is the dominant term and
         its shrink media (<=720px wide) misses landscape phones entirely
         (740-960px wide), so: shrink the hand and cap the log here too.
         This narrows the deficit; it does not fully cure it — the rest
         needs a design call (see DECISION-QUEUE, wave-2 landscape item). */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-card { width: 120px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .battle-log { max-height: 64px; }
      /* DECISION-QUEUE #27 (Oct 13) — THE FOLD, as ruled: in fullscreen at
         short heights the battle log and the Stranger's speech fold into
         one-line strips so they stop being the clipped/growing tail of the
         bout. Every rule here is fullscreen-prefixed: page mode (even in
         this media) is untouched, and the strips only render when the JS
         fold module marks them .fold-live (no JS = today's behavior).
         Expanded panels OVERLAY the mat (position:absolute) and scroll
         INTERNALLY — the board never moves and nothing clips. Full audit
         and budget: hidden_files/fs-fold-NOTES.md. */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap { display: block; position: relative; margin-top: 8px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap.fold-live #logStrip { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 76px 0 92px; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.35); border-radius: 8px; color: var(--parch); font-family: var(--ff-body); font-size: 0.9rem; text-align: left; cursor: pointer; position: relative; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap.fold-live #logStrip::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; } /* 36px visual, 44px hit (inspect-btn trick) */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logStrip .fold-name { font-family: var(--ff-head); letter-spacing: 0.08em; color: var(--gold-lt); white-space: nowrap; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logStrip .fold-teaser { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mist); font-style: italic; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logStrip .fold-new { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-lt); font-weight: 700; white-space: nowrap; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fold-chev { color: var(--gold); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .fold-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(255,191,0,0.8); animation: fsFoldPulse 1.1s ease-in-out infinite; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logNew[hidden], .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #speechNewDot[hidden] { display: none; }
      @keyframes fsFoldPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.7; } }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap.fold-live #battleLog { display: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap.fold-live #battleLog.fs-open { display: block; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 55dvh; overflow-y: auto; margin-top: 0; padding: 10px 14px; font-size: 0.9rem; background: rgba(8,5,14,0.97); border: 1px solid rgba(201,162,39,0.5); border-radius: 8px; box-shadow: 0 16px 44px rgba(0,0,0,0.85); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone { position: relative; padding: 6px 10px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live .speech { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 27px; font-size: 0.9rem; cursor: pointer; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live .speech.fs-open { position: absolute; top: calc(100% - 4px); left: 0; right: 0; z-index: 60; white-space: normal; overflow-y: auto; max-height: 45dvh; height: auto; padding: 10px 14px; font-size: 0.9rem; background: rgba(8,5,14,0.97); border: 1px solid rgba(201,162,39,0.5); box-shadow: 0 16px 44px rgba(0,0,0,0.85); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live #speechFoldBtn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; align-self: center; min-width: 44px; min-height: 44px; padding: 6px 10px; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.35); border-radius: 999px; color: var(--gold-lt); font-family: var(--ff-head); font-size: 0.9rem; letter-spacing: 0.04em; cursor: pointer; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #speechFoldBtn #speechWho { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      /* Zero-loss compactions in the same context (the internal scrollers
         absorb the difference; nothing becomes unreachable): the HUD's
         seven boxes take one row instead of two, the tab item lists cap
         at one line (they already scroll internally), the mode note drops
         its forced empty min-height, the hand label's margins slim. */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud { grid-template-columns: repeat(7, 1fr); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-items { max-height: 22px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mode-note { min-height: 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hand-label { margin: 2px 0; }
      /* DECISION-QUEUE #28 (Oct 13) — THE FIT, as ruled: the fold (#27)
         left ~221px of chrome over a 297px section on round 1's count;
         a corrected recount (fs-fit-NOTES.md: text lines inherit body's
         1.72 line-height factor, container padding is 26px not 20, and
         #kg-bout's own 30px box was never counted) puts the true overage
         higher. Three structural moves, same context, all reachable:
         (e) stage-overhead trims, (a) the hand fans over the mat's lower
         edge, (b) the trap rows fold onto the lane ends. The fan and the
         trap clusters engage only under .fold-live (set by the fold
         module on .mat-main) — no JS, no overlays, today's layout. */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) { padding-top: 12px; padding-bottom: 12px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header { padding-bottom: 2px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .kg-mark { width: 40px; height: 40px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live { position: relative; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .hand-label { position: absolute; left: 6px; right: 6px; bottom: 186px; z-index: 41; margin: 0; pointer-events: none; text-shadow: 0 1px 4px #000, 0 0 8px rgba(0,0,0,0.9); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; min-height: 0; padding: 6px 4px 8px; overflow: visible; pointer-events: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand:not(:empty) { background: linear-gradient(to bottom, rgba(5,3,8,0), rgba(5,3,8,0.88) 26%); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand .hand-card { pointer-events: auto; margin-left: calc(var(--fan-cover, 68px) * -1); box-shadow: -8px 0 16px rgba(0,0,0,0.5); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand .hand-card:first-child { margin-left: 0; box-shadow: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand .hand-card:hover { transform: translateY(-46px); z-index: 60; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerHand .hand-card.fan-up { transform: translateY(-46px); z-index: 60; box-shadow: 0 16px 36px rgba(0,0,0,0.85); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row { position: absolute; z-index: 50; margin: 0; min-height: 0; gap: 6px; padding: 3px 6px; background: rgba(5,3,8,0.85); border: 1px solid rgba(201,162,39,0.35); border-radius: 8px; cursor: pointer; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #dealerTraps { top: 0; right: 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live #playerTraps { bottom: 0; right: 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row .tlabel { font-size: 0.9rem; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row::after { content: attr(data-tcount); font-family: var(--ff-head); font-size: 0.9rem; font-weight: 700; color: var(--gold-lt); background: rgba(0,0,0,0.6); border: 1px solid rgba(201,162,39,0.5); border-radius: 999px; padding: 0 7px; line-height: 1.5; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row.trap-ping { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,191,0,0.6); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row.trap-open { z-index: 55; flex-wrap: wrap; max-width: 92%; max-height: 40dvh; overflow-y: auto; padding: 8px 10px; background: rgba(8,5,14,0.97); box-shadow: 0 16px 44px rgba(0,0,0,0.85); cursor: default; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live .trap-row.trap-open .trap-back { width: 40px; height: 56px; }
      /* DECISION-QUEUE #29 (Oct 13) — THE FINAL FOLD PACKAGE, as ruled
         (all six): the stranger compacts to a speaking strip, the tabs
         go totals-only, the HUD goes values-only, the board labels
         (deck-back mini + ash-pile button) compact, the mode note folds
         into the log strip, and the annex sheds chrome. Same context as
         #27/#28; pure compactions are CSS-only, and anything hidden
         behind a tap is .fold-live-gated (module-driven), so a dead
         script degrades to today's layout, never to hidden content.
         The corrected budget — including this round's two recount
         fixes (the labels are grave-pile-driven, and the HUD boxes
         carry an icon line no ledger had counted) — is in
         hidden_files/fs-fit3-NOTES.md. */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone { margin: 4px 0 2px; padding: 2px 8px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone .stranger-figure { width: 20px; height: 24px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone .stranger-figure .stranger-portrait { width: 18px; height: 18px; top: 3px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live .speech:not(.fs-open) { padding: 2px 8px; line-height: 1.35; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live #speechFoldBtn { min-height: 26px; padding: 2px 8px; position: relative; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .stranger-zone.fold-live #speechFoldBtn::after { content: ''; position: absolute; left: 0; right: 0; top: -9px; bottom: -9px; } /* 26px visual, 44px hit (inspect-btn trick) */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #tabWrap { margin: 2px auto; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-slip { padding: 3px 10px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .bill-head { line-height: 1.3; padding-bottom: 0; margin-bottom: 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #tabWrap.fold-live .bill-slip { position: relative; cursor: pointer; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #tabWrap.fold-live .bill-items { display: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #tabWrap.fold-live .bill-slip.tabs-open .bill-items { display: block; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 40dvh; overflow-y: auto; padding: 8px 12px; background: rgba(8,5,14,0.97); border: 1px solid rgba(201,162,39,0.5); border-radius: 8px; box-shadow: 0 16px 44px rgba(0,0,0,0.85); }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud { margin: 2px 0; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud-box { line-height: 1.15; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud.fold-live .hud-ico, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud.fold-live .lbl { display: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud.fold-live.hud-open .hud-ico { display: inline-flex; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .hud.fold-live.hud-open .lbl { display: block; font-size: 0.9rem; line-height: 1.2; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label { margin: 2px 0; line-height: 1.3; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label .deck-back-mini { width: 15px; height: 20px; }
    /* OPPONENT HAND (Oct 17 2026): his cards, face-down in HIS back —
       a fanned row above his board, count always honest. */
    .opp-hand { display: flex; justify-content: center; align-items: flex-end; min-height: 52px; padding: 2px 0 0; }
    .opp-hand:empty { min-height: 0; }
    .opp-hand-card { margin-left: -16px; border-radius: 5px; box-shadow: -4px 2px 10px rgba(0,0,0,0.55); }
    /* FAN SIZE (Oct 17 2026 late, root-fixed Oct 29 2026 batch #218):
       the fan backs once rendered at full canvas size on the owner's
       screen and were pinned three ways (class size, the !important
       scoped size that used to sit here, inline styles in renderOppHand).
       Root cause: the render path set only the canvas BACKING store
       (600x840) and owned no presentation size, so a canvas whose CSS
       sizing failed to apply displayed at backing-store size. The fix
       lives in cards-art.js setupCanvas: renderOppHand passes pw/ph and
       the renderer sets the inline 36x51 itself. Both CSS size pins are
       therefore removed; what remains here is layout only — flex: 0 0
       auto keeps the fan from shrinking in a crowded row. */
    #oppHand .opp-hand-card { flex: 0 0 auto; }
    .opp-hand-card:first-child { margin-left: 0; }
    .opp-hand-more { margin-left: 6px; font-family: var(--ff-head); font-size: 0.95rem; color: var(--gold-lt); align-self: center; }
    /* SPLIT MAT (Oct 17 2026): the bout cloth is two halves — the far
       half wears the OPPONENT's playmat + theme tint, the near half
       wears YOURS. In ranked, both come from the accounts themselves. */
    #kg-bout { position: relative; }
    .mat-half { position: absolute; left: 0; right: 0; height: 50.5%; z-index: 0; pointer-events: none; background-color: #0d0805; }
    .mat-half.opp { top: 0; border-radius: 14px 14px 0 0; }
    .mat-half.you { bottom: 0; border-radius: 0 0 14px 14px; }
    .mat-half.premium::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
      background-image: radial-gradient(2px 2px at 18% 70%, rgba(255,190,90,0.75) 50%, transparent 51%),
        radial-gradient(1.6px 1.6px at 64% 30%, rgba(255,214,130,0.65) 50%, transparent 51%),
        radial-gradient(2.2px 2.2px at 82% 78%, rgba(255,170,70,0.6) 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 38% 18%, rgba(255,230,170,0.7) 50%, transparent 51%);
      animation: kgEmberDrift 7s ease-in-out infinite alternate; }
    @keyframes kgEmberDrift { from { opacity: 0.45; transform: translateY(3px); } to { opacity: 1; transform: translateY(-3px); } }
    :root[data-motion="reduced"] .mat-half.premium::after { animation: none; }
    #kg-bout > *:not(.mat-half) { position: relative; z-index: 1; }

      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label .grave-pile { position: relative; min-height: 0; padding: 2px 10px; line-height: 1.1; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label .grave-pile::after { content: ''; position: absolute; left: 0; right: 0; top: -10px; bottom: -11px; } /* ~24px visual, ~45px hit (inspect-btn trick) */
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label .grave-pile .g-label { font-size: 0.9rem; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .board-side-label .grave-pile .g-count { font-size: 1rem; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout.fold-live .mode-note { display: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #logFoldWrap.fold-live #battleLog .mode-note-line { font-style: italic; color: var(--mist); font-size: 0.9rem; border-bottom: 1px dashed rgba(201,162,39,0.35); padding-bottom: 6px; margin-bottom: 6px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.annex { padding: 4px; gap: 4px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex .annex-title { display: none; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex .annex-sub { line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 136px; }
      .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex .annex-hp { line-height: 1.25; }
      /* DECISION-QUEUE #30 (Oct 13) — THE ANNEX DOCK, as ruled
         (option A): in this context the annex leaves the mat row's
         flow and docks as a compact chip at the mat's top-left — a
         holder thumbnail, the state line, and the HP line riding the
         thumbnail's foot. The mat reserves the vacated column
         (padding-left on .mat-main) so nothing is covered and the
         height ledger does not move (the annex was a parallel
         column, never a demand item). Tapping the chip expands the
         full annex as an overlay panel at the fullscreen in-row
         size — the approved holder presentation, untouched. The
         slot never leaves the DOM: combat keeps targeting it
         through its own click assignment exactly as in-row, and
         the fold module only opens/yields around that. Full
         arithmetic: hidden_files/annex-dock-NOTES.md. */
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout.fold-live .mat-row { position: relative; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .mat-main.fold-live { padding-left: 158px; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live { position: absolute; left: 0; top: 0; z-index: 45; width: 150px; min-height: 0; flex-direction: row; align-items: center; gap: 6px; padding: 4px; text-align: left; cursor: pointer; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live #fieldAnnexHolder { width: 36px; height: 50px; flex: 0 0 auto; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live .annex-sub { max-width: none; flex: 1 1 auto; min-width: 0; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live .annex-hp { position: absolute; left: 6px; bottom: 5px; z-index: 7; font-size: 0.9rem; line-height: 1.2; padding: 0 5px; background: rgba(0,0,0,0.6); border-radius: 999px; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live .annex-hp:empty { display: none; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .kgw-hp, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .kgw-wildtag, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .kgw-name, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .kgsq-hp, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .kgsq-name, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .inspect-btn, .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open) .strike-badge { display: none; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live::after { content: '\25B8'; position: absolute; right: 5px; top: 3px; color: var(--gold); font-size: 0.9rem; pointer-events: none; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-open::after { content: '\25BE'; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live:not(.annex-open):has(> #fieldAnnexHolder.valid-target) { border-color: rgba(120,200,255,0.95); box-shadow: 0 0 18px rgba(120,200,255,0.6); cursor: crosshair; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-ping { box-shadow: 0 0 18px rgba(255,191,0,0.7); }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-open { flex-direction: column; align-items: center; width: 150px; padding: 4px; gap: 4px; text-align: center; cursor: default; z-index: 65; max-height: 94dvh; overflow-y: auto; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-open #fieldAnnexHolder { width: 96px; height: 134px; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-open .annex-sub { white-space: normal; flex: none; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fieldAnnex.fold-live.annex-open .annex-hp { position: static; font-size: 1.15rem; line-height: 1.25; padding: 0; background: none; border-radius: 0; }
    }
    @media (prefers-reduced-motion: reduce) {
      .fold-dot { animation: none; }
    }

    /* ═══ profile themes (data-theme from Tavern profile; default = tavern) ═══ */
    :root[data-theme="ember"] { --gold: #ff7a3c; --gold-lt: #ffc89c; --gold-dim: #8a4a1c; --amber: #ff9a4c; --amber-lt: #ffc89c; }
    :root[data-theme="gold"] { --gold: #e8c35a; --gold-lt: #fff3c4; --gold-dim: #8a6d1c; --amber: #ffd454; --amber-lt: #fff3c4; }
    :root[data-theme="crimson"] { --gold: #d94a4a; --gold-lt: #ff9a8a; --gold-dim: #7a2424; --amber: #ff6b5e; --amber-lt: #ffb3a6; }
    :root[data-theme="violet"] { --gold: #9a6ae0; --gold-lt: #c4b0ff; --gold-dim: #4a358a; --amber: #b48cff; --amber-lt: #d6c2ff; }
    :root[data-theme="bone"] { --gold: #cfc39a; --gold-lt: #efe8d0; --gold-dim: #6a6248; --amber: #ded2ac; --amber-lt: #f4eedd; }
    :root[data-theme="verdant"] { --gold: #5aa86a; --gold-lt: #a8e0b4; --gold-dim: #2a5a34; --amber: #7ccc8c; --amber-lt: #c2ecc9; }
    :root[data-theme="drowned"] { --gold: #35b5ac; --gold-lt: #9fe8e0; --gold-dim: #14524e; --amber: #57c8bc; --amber-lt: #b8f2ec; }
    :root[data-theme="gloaming"] { --gold: #9a8fb0; --gold-lt: #d8d2e8; --gold-dim: #4a4360; --amber: #b0a4c8; --amber-lt: #e2dcf0; }
    :root[data-theme="eclipse"] { --gold: #e6c25c; --gold-lt: #fff0b8; --gold-dim: #7a5c14; --amber: #f0b23e; --amber-lt: #ffe9a8; }
    :root[data-theme="emberdeep"] { --gold: #e0643c; --gold-lt: #ffb59a; --gold-dim: #5e2413; --amber: #f08a4e; --amber-lt: #ffd2ae; }
    :root[data-theme="frostmere"] { --gold: #7fc4e8; --gold-lt: #d6f0ff; --gold-dim: #274b63; --amber: #a8d8f0; --amber-lt: #eaf7ff; }
    :root[data-theme="mosslight"] { --gold: #7fae4c; --gold-lt: #d2edb0; --gold-dim: #33501c; --amber: #a4cc62; --amber-lt: #e6f5c8; }
    :root[data-theme="ashfall"] { --gold: #9aa3ad; --gold-lt: #dde3e9; --gold-dim: #454c54; --amber: #b6bec7; --amber-lt: #eef1f4; }
    :root[data-theme="cellarnoir"] { --gold: #b04a6e; --gold-lt: #f0a8c0; --gold-dim: #571f36; --amber: #cc6a8a; --amber-lt: #fad2e0; }
    /* ECLIPSE (premium theme): the gold itself moves — a slow shimmer
       across the game's great headings. */
    :root[data-theme="eclipse"] .game-header h1, :root[data-theme="eclipse"] .kg-panel h2 {
      background: linear-gradient(100deg, #8a6d1c 0%, #ffe9a8 22%, #e6c25c 45%, #fff6cc 60%, #8a6d1c 82%);
      background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
      animation: kgEclipseShimmer 6s linear infinite; }
    @keyframes kgEclipseShimmer { from { background-position: 0% 0; } to { background-position: 220% 0; } }
    :root[data-motion="reduced"][data-theme="eclipse"] .game-header h1,
    :root[data-motion="reduced"][data-theme="eclipse"] .kg-panel h2 { animation: none; }


    /* ═══ ONBOARDING WALKTHROUGH (Oct 13 2026): the post-sign-up tour —
       the lesson's idiom (amber ring + dim), its own elements/state. */
    #tourCard { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1485; width: min(620px, 94vw); max-height: calc(100dvh - 36px); overflow-y: auto; background: linear-gradient(165deg, #171208, #0b0805); border: 1px solid var(--gold); border-radius: 12px; padding: 16px 18px; box-shadow: 0 12px 50px rgba(0,0,0,0.85), 0 0 30px rgba(201,162,39,0.25); }
    #tourCard .tour-count { font-family: var(--ff-head); font-size: .9rem; letter-spacing: 0.14em; color: var(--mist); text-transform: uppercase; display: block; margin-bottom: 6px; }
    #tourCard .tour-title { font-family: var(--ff-head); font-size: 1.13rem; letter-spacing: 0.06em; color: var(--amber); margin-bottom: 6px; }
    #tourCard .tour-body { color: #e8dcc0; line-height: 1.6; margin-bottom: 12px; font-size: 1rem; }
    #tourCard .tour-body b { color: var(--amber-lt); }
    #tourCard .tour-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    #tourCard .tour-skip { margin-left: auto; }
    #tourRing { position: fixed; z-index: 1480; pointer-events: none; border: 3px solid var(--amber); border-radius: 10px; box-shadow: 0 0 18px rgba(255,191,0,0.75), inset 0 0 12px rgba(255,191,0,0.35); animation: tutPulse 1.1s ease-in-out infinite; }
    #tourRing.spot-dim { box-shadow: 0 0 0 9999px rgba(2,1,3,0.78), 0 0 22px rgba(255,191,0,0.9), inset 0 0 14px rgba(255,191,0,0.4); }
    #tourRing.flash { animation: tutPulse 0.45s ease-in-out 3; }
    #tourArrow { position: fixed; z-index: 1481; pointer-events: none; color: var(--amber, #ffb400); font-size: 2.1rem; line-height: 1; text-shadow: 0 0 14px rgba(255,191,0,0.9), 0 2px 4px rgba(0,0,0,0.9); animation: tutBounce 0.9s ease-in-out infinite; }
    /* the fork: a real choice moment, two big doors */
    #tourFork { position: fixed; inset: 0; z-index: 1486; background: rgba(2,1,3,0.82); display: flex; align-items: center; justify-content: center; padding: 18px; }
    #tourFork.hidden { display: none; }
    .tour-fork-card { width: min(680px, 94vw); background: linear-gradient(165deg, #171208, #0b0805); border: 1px solid var(--gold); border-radius: 14px; padding: 22px; box-shadow: 0 12px 50px rgba(0,0,0,0.85), 0 0 30px rgba(201,162,39,0.25); text-align: center; }
    .tour-fork-card h2 { font-family: var(--ff-head); color: var(--amber); letter-spacing: 0.08em; margin: 0 0 6px; font-size: 1.35rem; }
    .tour-fork-card p { color: #e8dcc0; line-height: 1.55; margin: 0 0 16px; }
    .tour-fork-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    @media (max-width: 560px) { .tour-fork-grid { grid-template-columns: 1fr; } }
    .tour-fork-btn { min-height: 96px; text-align: left; padding: 14px 16px; }
    .tour-fork-btn .tf-label { display: block; font-family: var(--ff-head); font-size: 1.13rem; margin-bottom: 4px; }
    .tour-fork-btn .tf-pitch { display: block; font-size: .92rem; line-height: 1.45; opacity: 0.88; text-transform: none; letter-spacing: 0; font-weight: 400; }
    .tour-fork-skip { margin-top: 14px; }
    @media (prefers-reduced-motion: reduce) { #tourRing, #tourArrow { animation: none; } }
    :root[data-motion="reduced"] #tourRing, :root[data-motion="reduced"] #tourArrow { animation: none; }
    /* HAND-HOLDINESS (onboarding P3): one-shot pulse for numbers that just
       changed. Outline + glow, never color alone. */
    .tut-pulse-once { animation: tutPulseOnce 1.3s ease-in-out 1; border-radius: 8px; }
    @keyframes tutPulseOnce { 0% { box-shadow: 0 0 0 0 rgba(255,191,0,0); } 25% { box-shadow: 0 0 0 3px var(--amber), 0 0 26px rgba(255,191,0,0.95); } 60% { box-shadow: 0 0 0 3px var(--amber), 0 0 26px rgba(255,191,0,0.95); } 100% { box-shadow: 0 0 0 0 rgba(255,191,0,0); } }
    @media (prefers-reduced-motion: reduce) { .tut-pulse-once { animation: none; outline: 3px solid var(--amber); } }
    /* lesson recap (onboarding P3): what was learned + where to go next */
    .tut-recap { text-align: left; margin: 10px auto 4px; max-width: 520px; }
    .tut-recap h4 { font-family: var(--ff-head); color: var(--amber); letter-spacing: 0.1em; margin: 0 0 6px; font-size: 1rem; text-transform: uppercase; }
    .tut-recap ul { margin: 0 0 10px; padding-left: 20px; color: #e8dcc0; line-height: 1.6; }
    .tut-recap .recap-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

    #tutRing.flash { animation: tutPulse 0.45s ease-in-out 3; }
    /* ═══ deck-back minis in the bout HUD ═══ */
    .deck-back-mini { width: 26px; height: 36px; border-radius: 4px; vertical-align: middle; margin-right: 6px; border: 1px solid var(--gold-dim); }

    /* ═══ tutorial: dealer lesson overlay + highlight ring ═══ */
    #learnHub { position: fixed; inset: 0; z-index: 1600; background: rgba(0,0,0,0.86); display: flex; align-items: center; justify-content: center; padding: 18px; }
#learnHub.hidden { display: none; }
.learn-card { width: min(620px, 94vw); max-height: calc(100dvh - 40px); overflow-y: auto; background: linear-gradient(170deg, #171029, #07040f); border: 1px solid rgba(201,162,39,0.55); border-radius: 14px; padding: 1.4rem 1.4rem 1.1rem; box-shadow: 0 24px 60px rgba(0,0,0,0.7); }
.learn-card h3 { font-family: var(--ff-head); color: var(--gold-lt); font-size: 1.25rem; margin: 0 0 0.4rem; }
.learn-sub { color: var(--mist, #b8abd2); font-size: 1rem; line-height: 1.5; margin: 0 0 1rem; }
.learn-row { display: flex; gap: 0.9rem; align-items: flex-start; width: 100%; text-align: left; background: rgba(0,0,0,0.3); border: 1px solid rgba(201,162,39,0.3); border-radius: 10px; padding: 0.85rem 0.95rem; margin-bottom: 0.6rem; cursor: pointer; color: inherit; font: inherit; }
.learn-row:hover { border-color: rgba(232,195,90,0.8); }
.learn-row .lr-icon { font-size: 1.5rem; line-height: 1.2; }
.learn-row .lr-title { font-family: var(--ff-head); font-weight: 700; color: #f2e8d5; font-size: 1rem; }
.learn-row .lr-desc { color: #cfc4ab; font-size: 1rem; line-height: 1.45; margin-top: 0.15rem; }
.learn-row .lr-meta { margin-left: auto; flex: none; text-align: right; font-family: var(--ff-head); font-size: .9rem; color: var(--gold-lt); white-space: nowrap; }
.learn-row.done .lr-meta { color: #9fd48f; }
#tutOverlay { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1500; width: min(620px, 94vw); max-height: calc(100dvh - 36px); overflow-y: auto; background: linear-gradient(165deg, #171208, #0b0805); border: 1px solid var(--gold); border-radius: 12px; padding: 16px 18px; box-shadow: 0 12px 50px rgba(0,0,0,0.85), 0 0 30px rgba(201,162,39,0.25); }
    #tutOverlay .tut-who { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
    #tutOverlay .tut-say { font-style: italic; color: #e8dcc0; line-height: 1.65; margin-bottom: 8px; font-size: 1rem; }
    #tutOverlay .tut-do { color: var(--gold-lt); font-size: 1rem; line-height: 1.6; margin-bottom: 10px; }
    #tutOverlay .tut-do b { color: var(--amber-lt); }
    #tutOverlay .tut-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    #tutOverlay .tut-steps { font-family: var(--ff-head); font-size: .88rem; letter-spacing: 0.14em; color: var(--mist); text-transform: uppercase; }
    /* Tutorial rewrite (Oct 10 2026): the fixed bottom box was covering the
     * player's hand + action bar on small screens, making the lesson
     * unplayable. Two fixes: (1) the box collapses to a slim instruction bar
     * via the — button; (2) while the lesson is active the bout gets bottom
     * padding so hand + buttons scroll fully into view above the box. */
    #tutOverlay.min .tut-say, #tutOverlay.min .tut-who { display: none; }
    #tutOverlay.min { padding: 10px 14px; }
    #tutOverlay.min .tut-do { margin-bottom: 6px; font-size: .9rem; }
    #tutMinBtn { min-height: 44px; padding: 6px 12px; } /* B8 mobile audit: 44px touch target */
    body.tut-active #kg-bout { padding-bottom: 260px; }
    body.tut-active.tut-min #kg-bout { padding-bottom: 120px; }
    /* TUTORIAL TELEMETRY REVIEW (Oct 10 2026): the card-zoom 🔍 buttons are
     * hidden for the whole lesson. They sit INSIDE the spotlighted cards, so
     * the wrong-tap guard lets taps through to them — but the zoom overlay
     * (z-1600) covers the lesson box and its ✕/backdrop close taps are
     * swallowed by the guard, stranding the player (mobile has no Escape).
     * Scoped to #kg-bout so the reward draft's zoom (in #resultOverlay,
     * after the lesson) keeps its 🔍 buttons. */
    body.tut-active #kg-bout .inspect-btn { display: none; }
    #tutRing { position: fixed; z-index: 1490; pointer-events: none; border: 3px solid var(--amber); border-radius: 10px; box-shadow: 0 0 18px rgba(255,191,0,0.75), inset 0 0 12px rgba(255,191,0,0.35); animation: tutPulse 1.1s ease-in-out infinite; }
    @keyframes tutPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.75; } }
    /* HAND-HOLDINESS (Oct 10 2026): the ring doubles as a spotlight — a huge
       spread shadow dims everything outside the target. The lesson box
       (z 1500) and arrow (z 1491) stay bright above it. */
    #tutRing.spot-dim { box-shadow: 0 0 0 9999px rgba(2,1,3,0.78), 0 0 22px rgba(255,191,0,0.9), inset 0 0 14px rgba(255,191,0,0.4); }
    #tutArrow { position: fixed; z-index: 1491; pointer-events: none; color: var(--amber, #ffb400); font-size: 2.1rem; line-height: 1; text-shadow: 0 0 14px rgba(255,191,0,0.9), 0 2px 4px rgba(0,0,0,0.9); animation: tutBounce 0.9s ease-in-out infinite; }
    @keyframes tutBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-13px); } }
    #tutArrow.hidden { display: none; }
    /* outcome preview line under the instruction */
    #tutOverlay .tut-preview { color: #9fd8a8; font-size: .92rem; line-height: 1.5; margin: -4px 0 10px; font-style: italic; }
    #tutOverlay .tut-preview:empty { display: none; }
    /* gentle wrong-tap nudge */
    #tutNudge { position: fixed; z-index: 1492; pointer-events: none; left: 50%; top: 84px; transform: translateX(-50%); background: rgba(20,12,4,0.95); border: 1px solid var(--amber); color: var(--gold-lt); border-radius: 10px; padding: 10px 16px; font-size: 1rem; box-shadow: 0 8px 30px rgba(0,0,0,0.8); transition: opacity 0.25s; }
    #tutNudge.hidden { display: none; }

    @media (prefers-reduced-motion: reduce) {
      #tutRing { animation: none; }
      #tutArrow { animation: none; }
      .bcreature.just-played canvas, .hand-card.drawing, .trap-back.reveal { animation: none; }
    }
    /* manual override twin (Motion toggle) */
    :root[data-motion="reduced"] #tutRing, :root[data-motion="reduced"] #tutArrow { animation: none; }
    :root[data-motion="reduced"] .bcreature.just-played canvas,
    :root[data-motion="reduced"] .hand-card.drawing,
    :root[data-motion="reduced"] .trap-back.reveal { animation: none; }

    /* ═══ card inspect zoom ═══ */
    #inspectOverlay { position: fixed; inset: 0; z-index: 1600; background: rgba(2,1,4,0.88); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
    #inspectOverlay.hidden { display: none; }
    #inspectCard { width: min(320px, 86vw); position: relative; } /* UX (Oct 11 2026, B4): positioning context for the absolute ✕ */
    #inspectOverlay > div { max-width: calc(100vw - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; position: relative; }
    #inspectCard canvas { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 20px 70px rgba(0,0,0,0.9), 0 0 40px rgba(201,162,39,0.3); }
    /* BATCH #212 (Brody, live): the magnify felt choppy — the overlay used
       to hard-cut in while CardArt's two-stage paint (empty frame first,
       the 1280x1792 portrait swapped in whenever it decoded) landed
       mid-reveal as a visible pop. The card now enters on a composited
       transform/opacity glide (GPU layer, no layout animation) while
       openInspect pre-decodes the portrait and paints ONCE (see
       paintInspectCard). End state is identical: transform none,
       opacity 1, same size/position/art. The global reduced-motion rules
       zero this animation like every other on the page. */
    #inspectOverlay:not(.hidden) #inspectCard { animation: kgInspectIn .18s ease-out; will-change: transform, opacity; }
    @keyframes kgInspectIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
    #inspectHint { text-align: center; color: var(--mist); font-style: italic; margin-top: 10px; font-size: 0.9rem; }
    /* BATCH #224: the ✕ is a STATIC child of the overlay, fixed to the
       viewport's top-right on its own layer (z 1701, above the stage and
       the art view). It used to be JS-appended INSIDE the scrolling,
       max-height-clipped card at top:-8px — it scrolled away and clipped
       (Brody: "the X bugs out sometimes"). It can no longer move, clip,
       or be rebuilt away; kg-inspect.js never touches it. */
    #inspectClose { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; width: 48px; height: 48px; min-width: 48px; border-radius: 50%; background: rgba(10,5,8,0.92); border: 2px solid var(--gold); color: var(--gold-lt); font-size: 1.15rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1701; }
    #inspectClose:hover { background: rgba(60,20,20,0.95); color: #fff; }
    /* BATCH #224 zoom stage: while a pan/zoom gesture is live the wrapper
       un-clips (overflow visible) so the card can never be cut by the
       frame mid-drag; kg-inspect.js drives ONE composited transform on
       the wrapper. The card canvas takes the gestures directly. */
    #inspectOverlay.kg-zooming > div { overflow: visible; max-height: none; }
    #inspectCard canvas { touch-action: none; }
    /* BATCH #224 full-art mode: the raw 1280x1792 art, edge-to-edge,
       no frame, no text. Everything else in the overlay hides. */
    #inspectArtImg { display: none; }
    #inspectOverlay.kg-artmode > div, #inspectOverlay.kg-artmode #inspectHint { display: none; }
    #inspectOverlay.kg-artmode #inspectArtImg { display: block; position: fixed; inset: 0; width: 100vw; height: 100dvh; object-fit: contain; background: #000; z-index: 1700; cursor: zoom-out; }
    @media (prefers-reduced-motion: reduce) { #inspectOverlay.kg-artmode #inspectArtImg { transition: none; } }
    #inspectActionBar { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
    .inspect-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.75); border: 1px solid var(--gold); color: var(--gold-lt); font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
    .hand-card .inspect-btn { top: 20%; }
    /* ── inspect readable rules box (Oct 10, 2026): card text is baked into the
       canvas too small to read — this HTML box under the card shows the full
       rules in readable type. Tap toggles expand/collapse. ── */
    /* INSPECT READABLE BOX (rebuilt Oct 10 2026, Brody: "ugly cut off and hard
       to read"): the old "tap to expand" hint was the LAST child of the
       overflow-hidden collapsed box, so on long-text cards it was clipped
       away — the box looked truncated with no affordance. Now the text
       region and the toggle are separate elements; the toggle is always
       visible. Tavern styling: dark wood + parchment, Cinzel name,
       readable serif body. */
    #inspectText { margin-top: 12px; background: linear-gradient(165deg, #1e1510, #0f0a07); border: 1px solid var(--gold); border-radius: 10px; padding: 14px 16px; color: #f2e4c2; font-family: Georgia, 'Times New Roman', serif; font-size: 1.06rem; line-height: 1.65; max-height: 5.4em; overflow: hidden; position: relative; text-align: left; }
    #inspectText:not(.expanded)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(to bottom, rgba(15,10,7,0), #0f0a07); pointer-events: none; }
    #inspectText.expanded { max-height: min(58dvh, 520px); overflow-y: auto; font-size: 1.12rem; }
    #inspectText .inspectTextName { font-family: var(--ff-head); font-size: 1.28rem; font-weight: 700; letter-spacing: 0.05em; color: #ffd9a0; margin-bottom: 8px; }
    #inspectText .inspectTextRules { white-space: pre-wrap; }
    #inspectText .inspectTextFlavor { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(201,162,39,0.28); font-style: italic; color: #d9c69c; font-size: 0.94em; }
    #inspectMoreBtn { display: block; margin: 10px auto 2px; background: rgba(201,162,39,0.10); border: 1px solid rgba(201,162,39,0.55); color: #ffd9a0; border-radius: 999px; padding: 9px 20px; font-family: var(--ff-head); font-size: 0.92rem; letter-spacing: 0.1em; cursor: pointer; min-height: 44px; }
    #inspectMoreBtn:hover { background: rgba(201,162,39,0.22); }
    .draft-pick { position: relative; }

    /* ═══ sigil legend (help modal) ═══ */
    #sigilLegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
    .sigil-legend-item { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,0.35); border: 1px solid rgba(201,162,39,0.25); border-radius: 8px; padding: 6px 8px; }
    .sigil-legend-item canvas { width: 34px; height: 34px; flex: 0 0 auto; }
    .sigil-legend-item .sl-name { font-family: var(--ff-head); font-size: 1rem; letter-spacing: 0.1em; color: var(--gold-lt); text-transform: uppercase; }
    .sigil-legend-item .sl-desc { font-size: 1rem; color: var(--mist); line-height: 1.35; }
    /* ═══ Batch-5 Combat UI ═══ */
    #combatBanner { display: none; margin: 10px 0; padding: 10px 14px; background: linear-gradient(135deg, rgba(38,26,12,0.92), rgba(20,14,7,0.95)); border: 1px solid rgba(201,162,39,0.45); border-radius: 10px; text-align: center; }
    #combatBanner.active { display: block; animation: kgPhaseIn 0.3s ease both; }
    #combatBanner .cb-title { font-family: var(--ff-head); font-size: 1.13rem; letter-spacing: 0.12em; text-transform: uppercase; color: #ffd9a0; margin-bottom: 6px; }
    #combatBanner .cb-sub { font-size: .9rem; color: var(--mist); margin-bottom: 10px; }
    #combatBanner .cb-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
    /* Combat auto-end (Oct 10 2026, Brody: no dead Done waits): during the
       player's strikeNow combat the banner collapses to one minimal inline
       pill row — just the Done/Back buttons, no title, no subtitle. */
    #combatBanner.mini { padding: 6px 8px; border-radius: 999px; }
    #combatBanner.mini .cb-title, #combatBanner.mini .cb-sub { display: none; }
    #combatBanner.mini .cb-actions { flex-wrap: nowrap; gap: 8px; }
    #combatBanner.mini .btn { padding: 6px 14px; font-size: .9rem; }
    /* BUILD MARKER (Task 5a, Oct 10 2026): tiny HUD corner readout of the
       build string — bottom-right of #kg-app, never interactive. */
    #kgBuildMarker { position: absolute; right: 8px; bottom: 6px; font-size: .9rem; color: rgba(201,162,39,0.55); font-family: var(--ff-head); letter-spacing: 0.08em; pointer-events: none; z-index: 5; }
    .bcreature.attacker-selected { outline: 3px solid #ffd24a; outline-offset: 2px; box-shadow: 0 0 18px rgba(255,210,74,0.55); cursor: pointer; }
    /* held attacker (tap-tap flow): picked up, awaiting a target tap */
    .bcreature.attacker-pending { outline: 3px solid #ffb14a; outline-offset: 2px; cursor: crosshair;
      box-shadow: 0 0 22px rgba(255,177,74,0.75); animation: pendingPulse 0.9s ease-in-out infinite; }
    @keyframes pendingPulse { 0%, 100% { box-shadow: 0 0 10px rgba(255,177,74,0.4); } 50% { box-shadow: 0 0 26px rgba(255,177,74,0.9); } }
    @media (prefers-reduced-motion: reduce) { .bcreature.attacker-pending { animation: none; } }
    :root[data-motion="reduced"] .bcreature.attacker-pending { animation: none; } /* manual override twin */
    .bcreature.can-attack { cursor: pointer; }
    .bcreature.can-attack:hover { outline: 2px dashed rgba(255,210,74,0.7); outline-offset: 2px; }
    .lane.valid-target { outline: 2px solid rgba(120,200,255,0.8); outline-offset: -2px; cursor: crosshair; background: rgba(120,200,255,0.08); }
    .lane.valid-target:hover { background: rgba(120,200,255,0.18); }
    #enemyTabTarget.valid-target, #fieldAnnexHolder.valid-target { outline: 2px solid rgba(120,200,255,0.8); cursor: crosshair; }
    #billFoe.valid-target { outline: 2px solid rgba(120,200,255,0.8); outline-offset: 2px; cursor: crosshair; }
    /* field annex as an OBVIOUS attack target: pulsing outline + STRIKE badge
     * (reduced-motion safe). The old 2px static outline was too subtle —
     * Brody couldn't tell the Bar Squatter was targetable. */
    #fieldAnnexHolder.valid-target {
      outline: 3px solid #ffd24a; outline-offset: 2px; cursor: crosshair;
      box-shadow: 0 0 22px rgba(255,210,74,0.65);
      animation: annexTargetPulse 1.1s ease-in-out infinite;
    }
    @keyframes annexTargetPulse {
      0%, 100% { box-shadow: 0 0 10px rgba(255,210,74,0.35); }
      50% { box-shadow: 0 0 26px rgba(255,210,74,0.85); }
    }
    @media (prefers-reduced-motion: reduce) {
      #fieldAnnexHolder.valid-target { animation: none; box-shadow: 0 0 22px rgba(255,210,74,0.65); }
    }
    /* manual override twin (Motion toggle): static glow replaces the pulse */
    :root[data-motion="reduced"] #fieldAnnexHolder.valid-target { animation: none; box-shadow: 0 0 22px rgba(255,210,74,0.65); }
    .strike-badge {
      position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
      background: #c41e1e; color: #fff; font-size: .9rem; font-weight: 800;
      letter-spacing: 0.08em; padding: 3px 10px; border-radius: 10px; z-index: 6;
      box-shadow: 0 2px 8px rgba(0,0,0,0.6); pointer-events: none; white-space: nowrap;
    }
    /* KG overhaul #2 (Graphics, Nov 4 2026): inside the annex the badge's
       host is #fieldAnnexHolder, which clips at its top edge (overflow:
       hidden) — the -12px hang guillotined the badge in the live bout.
       In the holder the badge sits INSIDE the top edge instead. */
    #fieldAnnexHolder .strike-badge { top: 6px; }
    /* The bill's STRIKE HIS TAB badge gets the same inside placement: at the
       default top:-12px it hangs ABOVE #billFoe's box, and with the badge's
       pointer-events:none a click on the red pill landed on whatever sits
       above the bill - dead - while the panel body worked. Inside the box,
       the click passes through the badge onto the bill and its handler. */
    #billFoe { position: relative; }
    #billFoe .strike-badge { top: 6px; }
    /* per-card target marker (bug 6): unambiguous which card is targeted */
    .targeted-badge {
      position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
      background: #1e6ec4; color: #fff; font-size: .9rem; font-weight: 800;
      letter-spacing: 0.06em; padding: 2px 8px; border-radius: 10px; z-index: 6;
      box-shadow: 0 2px 8px rgba(0,0,0,0.6); pointer-events: none; white-space: nowrap;
    }
    .bcreature.valid-target { outline: 3px solid rgba(120,200,255,0.9); outline-offset: 2px; cursor: crosshair; position: relative; }
    /* Yu-Gi-Oh-style strike flow: spent attackers are dimmed; the taunted
     * Tab is shown dimmed and tapping it explains WHY (taunt rule). */
    .bcreature.attacker-spent { opacity: 0.55; }
    #billFoe.taunted { outline: 2px dashed rgba(255,90,90,0.75); outline-offset: 2px; cursor: not-allowed; opacity: 0.8; }
    /* deck tile remove flash (bug 1): visible feedback that the card moved */
    @keyframes tileFlash { 0% { box-shadow: 0 0 0 rgba(255,210,74,0); } 40% { box-shadow: 0 0 18px rgba(255,210,74,0.9); } 100% { box-shadow: 0 0 0 rgba(255,210,74,0); } }
    .card-tile.tile-flash { animation: tileFlash 0.9s ease; }
    .attacker-badge { position: absolute; top: -10px; left: -10px; background: #c41e1e; color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; z-index: 5; letter-spacing: 0.06em; }
    .blocker-badge { position: absolute; top: -10px; right: -10px; background: #1e6ec4; color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; z-index: 5; letter-spacing: 0.06em; }
    .bcreature { position: relative; }
    #combatArrows { position: fixed; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1500; }
    /* ── tavern-styled attack arrows (Oct 9 2026 rebuild): curved, inked,
       gold→ember gradient; each arrow draws itself once on creation, then
       holds until cleared. No stuck arrows: the layer is wiped on cancel,
       phase change, and bout end. ── */
    #combatArrows .atk-arrow { fill: none; stroke: url(#emberGrad); stroke-width: 4.5;
      stroke-linecap: round; opacity: 0.92; pathLength: 1;
      stroke-dasharray: 1; stroke-dashoffset: 1;
      animation: atkDraw 0.45s ease-out forwards; }
    #combatArrows .atk-arrow-glow { fill: none; stroke: rgba(224,106,30,0.28); stroke-width: 10;
      stroke-linecap: round; pathLength: 1;
      stroke-dasharray: 1; stroke-dashoffset: 1;
      animation: atkDraw 0.45s ease-out forwards; }
    #combatArrows .atk-head { fill: none; stroke: #ffb14a; stroke-width: 4.5;
      stroke-linecap: round; opacity: 0; animation: atkHeadIn 0.22s ease-out 0.34s forwards; }
    @keyframes atkDraw { to { stroke-dashoffset: 0; } }
    @keyframes atkHeadIn { to { opacity: 0.95; } }
    @media (prefers-reduced-motion: reduce) {
      #combatArrows .atk-arrow, #combatArrows .atk-arrow-glow { animation-duration: 0.01s; }
      #combatArrows .atk-head { animation-delay: 0s; animation-duration: 0.01s; }
    }
    /* manual override twin (Motion toggle): strike-arrows draw instantly */
    :root[data-motion="reduced"] #combatArrows .atk-arrow,
    :root[data-motion="reduced"] #combatArrows .atk-arrow-glow { animation-duration: 0.01s; }
    :root[data-motion="reduced"] #combatArrows .atk-head { animation-delay: 0s; animation-duration: 0.01s; }
    #priorityModal .modal-content { border-color: rgba(120,200,255,0.6); }
    #priorityCards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
    #priorityCards .hand-card { cursor: pointer; border: 2px solid rgba(120,200,255,0.5); }
    #priorityCards .hand-card:hover { border-color: #78c8ff; transform: translateY(-4px); }
    #priorityLog { max-height: 120px; overflow-y: auto; font-size: .88rem; color: var(--mist); margin-bottom: 10px; text-align: left; }
    .pw-indicator { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .78rem; font-weight: 700; letter-spacing: 0.08em; margin-left: 8px; }
    /* DEAD-CODE CLEANUP (Oct 10 2026): .pw-w1/.pw-w2/.pw-w3 removed — the
       badge color wiring that applied them died with the Flash/fast removal;
       no JS or markup references these classes. */
    /* ═══ CAMPAIGN: The Five Tables ═══ */
    .campaign-levels { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:12px; }
    .campaign-level { background:rgba(20,12,8,.72); border:1px solid var(--gold-dk); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:8px; }
    .campaign-level.locked { opacity:.45; filter:grayscale(.6); }
    .campaign-level.done { border-color:var(--gold); }
    /* status pills: locked / open / done read instantly */
    .campaign-level .cl-status { display:inline-block; align-self:flex-start; padding:3px 10px; border-radius:12px; font-size: .78rem; }
    .campaign-level.locked .cl-status { background:rgba(120,120,130,.14); color:#9a97a3; border:1px solid rgba(150,150,160,.3); }
    .campaign-level.open .cl-status { background:rgba(255,191,0,.12); color:var(--gold-lt); border:1px solid rgba(255,191,0,.5); }
    .campaign-level.done .cl-status { background:rgba(120,220,140,.1); color:#9fe0a8; border:1px solid rgba(120,220,140,.4); }
    /* ── "Claim your god" banner (Oct 10 2026): dismissing the reward modal
       with "Not now" used to strand the reward with no way back short of
       replaying L5. Five Tables only — God's Road renders separately. */
    .god-claim-banner { margin:12px 0 4px; padding:14px 16px; border:1px solid var(--gold); border-radius:10px;
      background:rgba(255,191,0,.08); box-shadow:0 0 18px rgba(255,191,0,.18); text-align:center; }
    .god-claim-banner .gcb-title { font-family:var(--ff-head); color:var(--gold-lt); font-size:1rem; letter-spacing:.05em; }
    .god-claim-banner .gcb-sub { color:var(--mist); font-size:.9rem; margin:6px 0 12px; }
    .god-claim-banner .btn { min-height:44px; }
    /* ═══ CAMPAIGN EXPANSION: The God's Road (additive; Five Tables CSS untouched) ═══ */
    .xcp-head { margin-top:26px; }
    .xcp-head h2 { font-family:var(--ff-head); color:var(--gold); letter-spacing:.06em; margin:0 0 4px; }
    /* ═══ STORY DLC: The Ninefold Reckoning (additive; Oct 18 2026) ═══ */
    .kk-chapter { border:1px solid rgba(201,162,39,.35); border-radius:10px; padding:12px 14px; margin:10px 0; background:rgba(20,14,8,.45); }
    .kk-chapter h3 { font-family:var(--ff-head); color:var(--gold-lt); margin:0 0 4px; letter-spacing:.04em; }
    .kk-chapter.kk-done { border-color:rgba(120,220,140,.5); }
    .kk-chapter.kk-locked { opacity:.72; }
    .kk-pips { margin:4px 0; }
    .kk-pip { color:rgba(200,200,210,.4); }
    .kk-pip.on { color:var(--gold); }
    .kk-weighed { color:#8fe3a0; font-family:var(--ff-head); }
    .kk-tables { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
    .kk-lock-note { font-style:italic; }
    .xcp .cl-foe { min-height:1.2em; }
    .xcp-pips { display:flex; gap:5px; margin:2px 0; }
    .xcp-pip { width:22px; height:8px; border-radius:4px; background:rgba(150,150,160,.18); border:1px solid rgba(150,150,160,.3); }
    .xcp-pip.won { background:rgba(120,220,140,.5); border-color:rgba(120,220,140,.6); }
    .xcp-pip.next { background:rgba(255,191,0,.35); border-color:rgba(255,191,0,.6); }
    .xcp-complete { margin-top:14px; padding:12px 16px; border:1px solid var(--gold); border-radius:10px;
      background:rgba(255,191,0,.08); color:var(--gold-lt); text-align:center; font-size: 1rem; }
    /* progression roadmap (Oct 11 2026): the full road at a glance */
    .xcp-roadmap { display:flex; align-items:center; justify-content:center; gap:8px; margin:0 0 16px; flex-wrap:wrap; }
    .xcp-roadmap-step { text-align:center; padding:8px 14px; border-radius:8px; border:1px solid rgba(150,150,160,.3);
      background:rgba(20,16,12,.6); min-width:110px; }
    .xcp-roadmap-step.done { border-color:rgba(120,220,140,.6); background:rgba(120,220,140,.08); }
    .xcp-roadmap-step.locked { opacity:.45; }
    .xcp-roadmap-label { font-weight:700; font-size: .88rem; color:var(--gold-lt); }
    .xcp-roadmap-step.done .xcp-roadmap-label { color:#8fd694; }
    .xcp-roadmap-hint { font-size: .78rem; color:var(--dim); margin-top:2px; }
    .xcp-roadmap-arrow { color:var(--gold); font-size:1.2rem; opacity:.6; }
    /* bulletproof dialogue player (Oct 11 2026): self-contained cutscene UI */
    .xcp-dialogue-ov { position:fixed; inset:0; z-index:300; background:rgba(5,3,2,.92);
      display:flex; align-items:flex-end; justify-content:center; padding:24px; }
    .xcp-dialogue-box { max-width:720px; width:100%; background:linear-gradient(165deg,#1a1210,#0d0906);
      border:1px solid var(--gold); border-radius:12px; padding:24px; box-shadow:0 0 60px rgba(0,0,0,.9);
      display:flex; gap:20px; align-items:flex-start; }
    .xcp-dialogue-video { width:200px; height:200px; border-radius:50%; object-fit:cover; flex-shrink:0;
      border:3px solid var(--gold); background:#000; box-shadow:0 0 30px rgba(201,162,39,0.3); }
    .xcp-dialogue-content { flex:1; min-width:0; }
    .xcp-dialogue-speaker { font-family:var(--ff-head); color:var(--gold); font-size:1.2rem;
      letter-spacing:.08em; margin-bottom:10px; text-transform:uppercase; }
    .xcp-dialogue-text { font-size: 1.13rem; line-height:1.7; color:var(--parch); min-height:80px; margin-bottom:16px; }
    .xcp-dialogue-controls { display:flex; gap:12px; justify-content:flex-end; }
    /* batch #222 BUG FIX: the dialogue box had NO small-screen rule —
       at 360px wide (Galaxy A16) the 200px portrait + 2x24px overlay
       padding + 2x24px box padding + gap left the dialogue text a
       ~44px-wide ribbon. Stack the portrait over the text instead.
       Shared by every campaign that uses the dialogue player. */
    @media (max-width: 560px) {
      .xcp-dialogue-ov { padding:12px; }
      .xcp-dialogue-box { flex-direction:column; align-items:center; padding:16px; gap:12px; }
      .xcp-dialogue-video { width:120px; height:120px; }
      .xcp-dialogue-content { width:100%; }
      .xcp-dialogue-text { font-size:1rem; }
    }
    /* robust-tap press feedback (Oct 10 2026): immediate visual on touchstart */
    .xcp-press { transform:scale(.96) !important; filter:brightness(1.25) !important; }
    /* RGB/animated avatar border reward (border-prism); static under reduced motion */
    .opt-ring.prism, .cu-avatar.prism { border:3px solid transparent !important;
      background:linear-gradient(#241a12,#241a12) padding-box,
        conic-gradient(from 0deg,#f55,#fb3,#5f5,#5cf,#a5f,#f55) border-box;
      animation:xcpPrism 3s linear infinite; }
    @keyframes xcpPrism { to { filter:hue-rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) { .opt-ring.prism, .cu-avatar.prism { animation:none; border-color:#e8c35a !important; background:none; } }
    /* manual override twin (Motion toggle) */
    :root[data-motion="reduced"] .opt-ring.prism, :root[data-motion="reduced"] .cu-avatar.prism { animation:none; border-color:#e8c35a !important; background:none; }
    /* Expansion cult-set avatar borders: two-tone static rings */
    .opt-ring.choir-tide, .cu-avatar.choir-tide { border:3px solid #2e8f8f !important; box-shadow:0 0 12px rgba(185,194,204,.55), inset 0 0 6px rgba(46,143,143,.5); }
    .opt-ring.veil-moth, .cu-avatar.veil-moth { border:3px solid #8d7b9e !important; box-shadow:0 0 12px rgba(168,160,176,.5), inset 0 0 6px rgba(141,123,158,.5); }
    .opt-ring.cinder-oath, .cu-avatar.cinder-oath { border:3px solid #e07020 !important; box-shadow:0 0 12px rgba(224,112,32,.55), inset 0 0 6px rgba(120,60,20,.55); }
    .campaign-level.final { border-color:rgba(220,70,70,.8); box-shadow:0 0 26px rgba(200,40,40,.22); }
    .campaign-level.final .cl-portrait { border-color:rgba(220,70,70,.85); box-shadow:0 0 18px rgba(220,60,60,.4); }
    .campaign-level .cl-final-tag { font-family:var(--ff-head); font-size: .78rem; letter-spacing:.3em; color:#ff9d9d; text-transform:uppercase; }
    .campaign-level .cl-head { display:flex; gap:10px; align-items:center; }
    .campaign-level .cl-portrait { width:64px; height:64px; border-radius:50%; object-fit:cover; border:2px solid var(--gold-dk); background:#241a12; flex:none; }
    /* ═══ PRACTICE: no-stakes sparring table ═══ */
    .practice-panel { background:rgba(20,12,8,.72); border:1px solid var(--gold-dk); border-radius:10px; padding:16px; margin-top:12px; }
    .practice-panel h3 { font-family:var(--ff-title); color:var(--gold-lt); font-size: 1rem; letter-spacing:1.5px; margin:14px 0 8px; }
    .practice-panel h3:first-child { margin-top:0; }
    .practice-diff-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
    .practice-diff small, .practice-decksrc small { display:block; font-weight:400; font-size:.72rem; opacity:.75; margin-top:4px; }
    .practice-diff.selected, .practice-decksrc.selected { border-color:var(--gold); box-shadow:0 0 0 1px var(--gold), 0 0 12px rgba(255,210,74,.25); }
    .practice-note { color:var(--mist); font-size: .78rem; margin:10px 0 0; min-height:1.2em; }
    .campaign-level .cl-title { font-family:var(--ff-head); color:var(--gold); font-size: 1rem; letter-spacing:.04em; }
    .campaign-level .cl-foe { color:var(--mist); font-size: .88rem; font-style:italic; }
    .campaign-level .cl-blurb { color:var(--parchment); font-size:.88rem; flex:1; }
    .campaign-level .cl-status { font-size: .78rem; color:var(--gold-lt); letter-spacing:.06em; text-transform:uppercase; }
    /* cutscene overlay */
    .cutscene-overlay { position:fixed; inset:0; z-index:200; background:radial-gradient(ellipse at 50% 30%, #241a10 0%, #0b0705 70%); display:flex; align-items:center; justify-content:center; cursor:pointer; }
    .cutscene-overlay.hidden { display:none; }
    /* Batch 3 comms dress: node-entry beats dock over the live campaign
       map — transparent overlay, clicks pass through everywhere except
       the card itself (tap-to-continue) and the Skip button. */
    .cutscene-overlay.cs-comms { background: transparent; align-items: flex-end; justify-content: flex-start; cursor: default; pointer-events: none; }
    .cutscene-overlay.cs-comms .cs-stage { pointer-events: auto; cursor: pointer; margin: 0 0 18px 18px; width: min(430px, calc(100vw - 36px)); max-width: 430px; max-height: 52vh; text-align: left; background: rgba(8,5,3,.9); border: 1px solid rgba(201,162,39,.45); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.65); padding: 14px 16px; }
    .cutscene-overlay.cs-comms .cs-portrait-wrap { width: 84px; height: 84px; margin: 0 0 8px; }
    .cutscene-overlay.cs-comms .cs-subtitles { min-height: 0; font-size: 1rem; padding: 10px 12px; }
    .cutscene-overlay.cs-comms .cs-topbar { pointer-events: none; }
    .cutscene-overlay.cs-comms .cs-topbar .btn { pointer-events: auto; }
    .cs-stage { max-width: min(640px, calc(100vw - 32px)); width:92%; max-height: calc(100dvh - 32px); overflow-y: auto; text-align:center; padding:20px; }
    .cs-portrait-wrap { width:220px; height:220px; margin:0 auto 12px; position:relative; }
    .cs-portrait { width:100%; height:100%; border-radius:50%; object-fit:cover; border:3px solid var(--gold); box-shadow:0 0 42px rgba(201,162,39,.28); background:#1a120c; }
    .cs-portrait-fallback { width:100%; height:100%; border-radius:50%; border:3px solid var(--gold); background:#2a1e12; display:flex; align-items:center; justify-content:center; font-size:5rem; color:var(--gold); font-family:var(--ff-head); }
    .cs-name { font-family:var(--ff-head); color:var(--gold); letter-spacing:.14em; text-transform:uppercase; margin-bottom:10px; }
    .cs-subtitles { min-height:96px; font-size: 1.13rem; line-height:1.55; color:var(--parchment); background:rgba(0,0,0,.55); border:1px solid rgba(201,162,39,.25); border-radius:10px; padding:14px 18px; }
    .cs-subtitles .cs-spk { color:var(--gold-lt); font-weight:700; }
    .cs-hint { margin-top:10px; color:var(--mist); font-size: .88rem; animation:csPulse 1.6s infinite; }
    @keyframes csPulse { 0%,100% { opacity:.45; } 50% { opacity:1; } }
    .cs-topbar { position:absolute; top:0; left:0; right:0; display:flex; justify-content:space-between; align-items:center; padding:14px 18px; }
    .cs-beat { color:var(--mist); font-size: .78rem; letter-spacing:.2em; text-transform:uppercase; }
    /* god-arrival bark toast */
    .god-bark { position:fixed; left:50%; transform:translateX(-50%); bottom:18px; z-index:190; display:flex; gap:12px; align-items:center; max-width:min(640px, 92vw); background:rgba(10,6,4,.94); border:2px solid var(--gold); border-radius:12px; padding:10px 16px 10px 10px; box-shadow:0 0 34px rgba(201,162,39,.35); }
    .god-bark.hidden { display:none; }
    .god-bark-art { width:72px; height:100px; object-fit:cover; border-radius:8px; border:1px solid var(--gold-dk); background:#1a120c; flex:none; }
    .god-bark-name { font-family:var(--ff-head); color:var(--gold); letter-spacing:.08em; margin-bottom:4px; }
    .god-bark-text { color:var(--parchment); font-style:italic; font-size: 1rem; line-height:1.4; }
    /* reward modal */
    .reward-modal { max-width: min(720px, calc(100vw - 32px)); }
    .reward-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:10px; }
    .reward-card { background:rgba(20,12,8,.8); border:1px solid var(--gold-dk); border-radius:10px; padding:10px; cursor:pointer; text-align:center; transition:border-color .15s, transform .15s; }
    .reward-card:hover { border-color:var(--gold); transform:translateY(-2px); }
    .reward-card.picked { border-color:var(--gold); box-shadow:0 0 18px rgba(201,162,39,.4); }
    .reward-card img { width:100%; aspect-ratio:5/7; object-fit:cover; border-radius:6px; background:#1a120c; }
    .reward-card .rw-name { font-family:var(--ff-head); color:var(--gold); font-size:.92rem; margin:6px 0 2px; }
    .reward-card .rw-cost { color:var(--mist); font-size:.78rem; }
    .reward-card .rw-text { color:var(--parchment); font-size:.78rem; line-height:1.35; margin-top:4px; }
    /* ── god-reward celebration (Oct 10, 2026) — the campaign's biggest
       moment gets the house lights. Animations die under both reduced-
       motion gates, matching the rest of this sheet. */
    .reward-modal.celebrating { border-color:var(--gold); box-shadow:0 0 60px rgba(201,162,39,.45), 0 0 40px rgba(0,0,0,.9); }
    .reward-modal.celebrating h3 { animation:rewardTitleGlow 2.6s ease-in-out infinite; }
    @keyframes rewardTitleGlow {
      0%, 100% { text-shadow:0 0 8px rgba(201,162,39,.35); }
      50% { text-shadow:0 0 22px rgba(201,162,39,.85), 0 0 46px rgba(201,162,39,.4); }
    }
    .reward-card { position:relative; }
    .reward-card.picked { border-color:var(--gold); box-shadow:0 0 26px rgba(201,162,39,.65); transform:translateY(-2px) scale(1.03); }
    .reward-card.picked::after {
      content:'✓ CHOSEN'; position:absolute; top:8px; left:8px;
      font-family:var(--ff-head); font-size:.7rem; letter-spacing:.12em;
      color:#0b0705; background:linear-gradient(165deg,#e8c86a,#b8933e);
      border-radius:6px; padding:3px 8px; box-shadow:0 2px 10px rgba(0,0,0,.6);
    }
    .card-tile.just-claimed { outline:2px solid var(--gold); box-shadow:0 0 24px rgba(201,162,39,.7); animation:justClaimedPulse 2s ease-in-out infinite; }
    @keyframes justClaimedPulse {
      0%, 100% { box-shadow:0 0 14px rgba(201,162,39,.45); }
      50% { box-shadow:0 0 32px rgba(201,162,39,.9); }
    }
    .card-tile.just-claimed .new-god-badge {
      position:absolute; top:6px; left:6px; z-index:2;
      font-family:var(--ff-head); font-size:.7rem; letter-spacing:.1em;
      color:#0b0705; background:linear-gradient(165deg,#e8c86a,#b8933e);
      border-radius:6px; padding:3px 8px; box-shadow:0 2px 10px rgba(0,0,0,.6);
    }
    /* BATCH #224 NEW badge (kg-newbadges.js): fresh acquisitions + newly
       added pool cards wear NEW until the player hovers the tile; the
       hover clears it permanently for that player. Top-right, mirroring
       the shop reveal's .r-new pill. */
    .card-tile .kg-new-badge {
      position:absolute; top:6px; right:6px; z-index:2;
      font-family:var(--ff-head); font-size:.7rem; font-weight:700; letter-spacing:.12em;
      color:#0a0810; background:var(--amber, #ffbf00);
      border-radius:999px; padding: 3px 8px; box-shadow:0 0 12px rgba(255,191,0,.7);
      pointer-events:none;
    }
    @media (prefers-reduced-motion: no-preference) { .card-tile .kg-new-badge { animation: kgNewPulse 1.4s ease-in-out infinite; } }
    @keyframes kgNewPulse { 0%, 100% { box-shadow: 0 0 6px rgba(255,191,0,.45); } 50% { box-shadow: 0 0 16px rgba(255,191,0,.9); } }
    @media (prefers-reduced-motion: reduce) {
      .reward-modal.celebrating h3 { animation:none; }
      .card-tile.just-claimed { animation:none; box-shadow:0 0 14px rgba(201,162,39,.45); }
      .reward-card.picked { transform:translateY(-2px); }
    }
    :root[data-motion="reduced"] .reward-modal.celebrating h3 { animation:none; }
    :root[data-motion="reduced"] .card-tile.just-claimed { animation:none; box-shadow:0 0 14px rgba(201,162,39,.45); }
    :root[data-motion="reduced"] .reward-card.picked { transform:translateY(-2px); }
    /* ═══ MOBILE UX PASS (Oct 10 2026) — tap targets, tutorial + lobby in
       fullscreen. Layout/CSS only; no gameplay, card-data, or store changes.
       ── A. Tap targets: every player-tappable control gets a ≥44px hit box.
       Small-by-design controls keep their visuals and extend the hit area
       with ::after; text buttons just grow 40px → 44px. ── */
    .help-toggle-btn, .sound-btn, .acct-btn { min-height: 44px; }
    .link-btn { min-height: 44px; }
    #tutMinBtn { min-height: 44px; }
    .inspect-btn::after { content: ''; position: absolute; inset: -7px; } /* 30px visual, 44px hit */
    /* HIT-MAPPING (Nov 24 2026): on bout board creatures the 44px hit box
     * covers much of a shrunken fullscreen token, so strike clicks land on
     * Read instead of the creature (both climbers, in production). Board
     * creatures keep the plain 30px button; hand cards keep the 44px hit. */
    #kg-bout .bcreature .inspect-btn::after { inset: 0; }
    #inspectClose { width: 44px; height: 44px; }
    .deck-chip .dc-del { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
    /* known trap-backs are tappable (tap = read the trap): the art stays
       40x56, centered in a 44px+ hit box. */
    .trap-back.known { min-width: 44px; min-height: 60px; display: flex; align-items: center; justify-content: center; }
    .trap-back.known canvas { width: 40px; height: 56px; flex: 0 0 auto; }
    /* ── B. Tutorial in fullscreen: the lesson box is a fixed overlay (like a
       modal) and the bout beneath it must stay reachable — exactly as in page
       mode, where body.tut-active already pads + scrolls. So while the lesson
       is active the bout becomes the ONE scrollable view: the mat keeps real
       lane height (no flex crush), lanes stay tappable, and the fixed lesson
       box never covers the hand/action bar — they scroll into view above it
       (see tutEnsureVisible + the ring re-glue listener). Narrowly scoped:
       body.tut-active only, all three fullscreen forms. ── */
    body.tut-active .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout { overflow-y: auto; }
    body.tut-active .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout > .mat-row { flex: 0 0 auto; }
    body.tut-active .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .lane { min-height: 64px; }
    /* ── C. Card Wall lobby in fullscreen: the deck chrome (vault + 7-row
       Table Style + filters + deck bar) is far taller than any phone
       viewport; with the section unscrollable the IN DECK / COLLECTION grids
       collapsed to zero height. The lobby is a management page, not the game
       board — it scrolls like page mode, and each card grid keeps its
       designed internal scroll with a viewport-capped height. ── */
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-lobby { overflow-y: auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-lobby .card-split { flex: 0 0 auto; }
    .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-lobby .card-grid { max-height: 62vh; max-height: 62dvh; }
  
    /* ═══ MENU REDESIGN (Oct 17 2026, Brody: "i hate how the entire
       menu looks") ════════════════════════════════════════════════
       The Card Wall was a stack of identical flat boxes in dim small
       type. New language: candlelit slabs with real depth, a hero
       play-menu, stat chips instead of dotted sentences, and reading
       sizes throughout. Scoped to the header + #kg-lobby so the bout,
       map and campaign screens keep their own skin. */
    .kg-container {
      background:
        radial-gradient(1100px 480px at 50% -80px, rgba(255,166,0,0.14), rgba(255,166,0,0) 62%),
        radial-gradient(800px 500px at 88% 110%, rgba(108,30,140,0.12), rgba(108,30,140,0) 60%),
        linear-gradient(168deg, #120c1e 0%, #08060f 55%, #0d0705 100%);
      border: 1px solid rgba(232,195,90,0.4);
      border-radius: 18px;
      box-shadow: 0 30px 80px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,220,150,0.1);
    }
    .game-header { padding: 22px 26px 18px; border-bottom: 1px solid rgba(232,195,90,0.22); margin-bottom: 6px; }
    .game-header h1 {
      font-size: clamp(1.9rem, 4.5vw, 2.7rem); letter-spacing: 0.06em; color: #ffe9a8;
      text-shadow: 0 2px 0 #000, 0 0 26px rgba(255,166,0,0.45), 0 0 60px rgba(255,120,0,0.18);
    }
    .game-header .game-sub { font-size: 1rem; color: #cfc4ab; font-style: italic; margin-top: 4px; line-height: 1.45; }
    .game-header .kg-mark svg { filter: drop-shadow(0 0 10px rgba(255,166,0,0.5)); }
    .game-header .header-btns { gap: 8px; }
    .game-header .sound-btn, .game-header .help-toggle-btn, .game-header select.sound-btn {
      background: linear-gradient(180deg, rgba(44,32,72,0.9), rgba(20,14,36,0.9));
      border: 1px solid rgba(232,195,90,0.35); border-radius: 999px; color: #efe3c2;
      padding: 8px 14px; font-size: .92rem; min-height: 40px;
    }
    .game-header .sound-btn:hover, .game-header .help-toggle-btn:hover { border-color: rgba(255,212,84,0.85); color: #ffe9a8; }
    #kg-lobby { padding: 10px 26px 30px; }
    #kg-lobby .lobby-head { text-align: left; margin: 14px 0 16px; }
    #kg-lobby .lobby-head h2 {
      font-size: clamp(1.6rem, 3.6vw, 2.2rem); letter-spacing: 0.14em; color: #ffe9a8;
      text-shadow: 0 2px 0 #000, 0 0 20px rgba(255,166,0,0.35); margin: 0;
    }
    #kg-lobby .lobby-head h2::after {
      content: ''; display: block; height: 2px; margin-top: 10px;
      background: linear-gradient(90deg, rgba(255,212,84,0.9), rgba(255,212,84,0.25) 55%, rgba(255,212,84,0));
      border-radius: 2px;
    }
    #kg-lobby .lobby-meta {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px;
      font-size: 1rem; color: #e6dcc4; letter-spacing: 0.04em;
    }
    #kg-lobby .lobby-meta > span, #kg-lobby .lobby-meta > b {
      background: rgba(0,0,0,0.35); border: 1px solid rgba(232,195,90,0.3);
      border-radius: 999px; padding: 4px 12px;
    }
    #kg-lobby .lobby-meta b { color: #ffd454; }
    #kg-lobby .oath-note { color: #bdb0d8; font-size: 1rem; line-height: 1.55; }
    #kg-lobby .deck-room, #kg-lobby .custom-room, #kg-lobby .deck-bar, #kg-lobby .welcome-banner {
      background: linear-gradient(168deg, rgba(34,24,56,0.92), rgba(13,9,24,0.95));
      border: 1px solid rgba(232,195,90,0.34); border-radius: 14px;
      box-shadow: 0 16px 36px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,220,150,0.09);
      padding: 18px 20px; margin-bottom: 16px;
    }
    #kg-lobby .deck-room h3, #kg-lobby .custom-room h3 {
      font-size: 1.13rem; letter-spacing: 0.18em; color: #ffe9a8; margin: 0 0 12px;
      display: flex; align-items: center; gap: 10px;
    }
    #kg-lobby h3 [data-kg-icon], #kg-lobby .split-head [data-kg-icon], #kg-lobby .play-menu-title [data-kg-icon] {
      display: inline-flex; align-items: center; justify-content: center; flex: none;
      width: 34px; height: 34px; border-radius: 50%; color: #ffd454;
      background: radial-gradient(circle at 35% 30%, rgba(255,212,84,0.28), rgba(0,0,0,0.45));
      border: 1px solid rgba(255,212,84,0.55); font-size: 1rem;
    }
    #kg-lobby .deck-actions { gap: 8px; }
    #kg-lobby .deck-actions input, #kg-lobby .deck-actions select,
    #kg-lobby .filter-bar input, #kg-lobby .filter-bar select {
      background: rgba(6,4,12,0.85); border: 1px solid rgba(232,195,90,0.35); border-radius: 10px;
      color: #f2e8d5; min-height: 44px; padding: 8px 12px; font-size: 1rem;
    }
    #kg-lobby .deck-actions input:focus, #kg-lobby .deck-actions select:focus,
    #kg-lobby .filter-bar input:focus, #kg-lobby .filter-bar select:focus {
      outline: none; border-color: #ffd454; box-shadow: 0 0 0 3px rgba(255,212,84,0.22);
    }
    #kg-lobby .btn { border-radius: 10px; }
    #kg-lobby .btn-ghost {
      background: linear-gradient(180deg, rgba(44,32,72,0.85), rgba(20,14,36,0.9));
      border: 1px solid rgba(232,195,90,0.35); color: #efe3c2;
    }
    #kg-lobby .btn-ghost:hover { border-color: rgba(255,212,84,0.85); color: #ffe9a8; }
    #kg-lobby .curve-strip { display: flex; align-items: flex-end; gap: 4px; height: 52px; margin-top: 14px; padding-top: 8px; border-top: 1px solid rgba(232,195,90,0.2); }
    #kg-lobby .curve-bar {
      flex: 1; border-radius: 6px 6px 2px 2px; position: relative;
      background: linear-gradient(180deg, #ffd454, #b8860b);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
    }
    #kg-lobby .curve-bar span {
      position: absolute; left: 0; right: 0; bottom: -17px; text-align: center;
      font-size: .9rem; color: #bdb0d8;
    }
    #kg-lobby .deck-stats { margin-top: 22px; font-size: 1rem; color: #e6dcc4; }
    #kg-lobby .filter-bar { gap: 8px; margin-bottom: 14px; }
    #kg-lobby .deck-bar { align-items: center; }
    #kg-lobby .deck-bar .lbl { font-size: .9rem; letter-spacing: 0.14em; color: #bdb0d8; text-transform: uppercase; }
    #kg-lobby .deck-bar .val { font-size: 1.55rem; color: #ffd454; font-family: var(--ff-head); }
    #kg-lobby #startRunBtn {
      font-size: 1.13rem; padding: 12px 26px; border-radius: 12px; letter-spacing: 0.06em;
      box-shadow: 0 8px 26px rgba(255,166,0,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
    }
    #kg-lobby .play-menu { margin: 22px 0 20px; }
    #kg-lobby .play-menu-title {
      display: flex; align-items: center; gap: 14px; justify-content: center;
      font-size: 1.25rem; letter-spacing: 0.22em; color: #ffe9a8; margin: 0 0 16px;
      text-shadow: 0 2px 0 #000, 0 0 16px rgba(255,166,0,0.3);
    }
    #kg-lobby .play-menu-title::before, #kg-lobby .play-menu-title::after {
      content: ''; flex: 1; height: 1px;
      background: linear-gradient(90deg, rgba(255,212,84,0), rgba(255,212,84,0.55));
    }
    #kg-lobby .play-menu-title::after { background: linear-gradient(90deg, rgba(255,212,84,0.55), rgba(255,212,84,0)); }
    #kg-lobby .play-menu-grid { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
    #kg-lobby .play-card {
      min-height: 128px !important; padding: 18px 12px 14px !important; border-radius: 14px !important;
      gap: 7px; position: relative; overflow: hidden;
      background: linear-gradient(170deg, rgba(38,27,64,0.92), rgba(14,10,26,0.96)) !important;
      border: 1px solid rgba(232,195,90,0.32) !important; color: #f2e8d5 !important;
      box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,220,150,0.08);
      transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }
    #kg-lobby .play-card::before {
      content: ''; position: absolute; inset: 0 0 auto 0; height: 42%;
      background: linear-gradient(180deg, rgba(255,235,190,0.09), rgba(255,235,190,0)); pointer-events: none;
    }
    #kg-lobby .play-card:hover {
      transform: translateY(-3px); border-color: rgba(255,212,84,0.8) !important;
      box-shadow: 0 16px 32px rgba(0,0,0,0.55), 0 0 22px rgba(255,166,0,0.16), inset 0 1px 0 rgba(255,220,150,0.14);
    }
    #kg-lobby .play-card:active { transform: translateY(-1px) scale(0.99); }
    #kg-lobby .play-card .pc-icon {
      display: flex; align-items: center; justify-content: center;
      width: 54px; height: 54px; border-radius: 50%; font-size: 1.45rem;
      background: radial-gradient(circle at 35% 30%, rgba(255,212,84,0.3), rgba(0,0,0,0.5));
      border: 1px solid rgba(255,212,84,0.6); color: #ffd454;
      box-shadow: 0 0 16px rgba(255,166,0,0.22);
    }
    #kg-lobby .play-card .pc-label { font-family: var(--ff-head); font-size: 1.13rem; letter-spacing: 0.1em; color: #ffe9a8; }
    #kg-lobby .play-card .pc-sub { font-size: .93rem; color: #cfc4ab; line-height: 1.35; }
    #kg-lobby .play-card.btn-gold {
      background: linear-gradient(170deg, #ffdf7e, #d99a16 55%, #a96e06) !important;
      border-color: #ffe9a8 !important; color: #241300 !important;
      box-shadow: 0 14px 34px rgba(255,166,0,0.4), inset 0 1px 0 rgba(255,255,255,0.55);
    }
    #kg-lobby .play-card.btn-gold .pc-label { color: #241300; }
    #kg-lobby .play-card.btn-gold .pc-sub { color: #4d3205; }
    #kg-lobby .play-card.btn-gold .pc-icon {
      background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.5), rgba(120,70,0,0.35));
      border-color: rgba(90,55,0,0.55); color: #4d3205; box-shadow: none;
    }
    #kg-lobby .play-menu-grid > button:nth-child(2) .pc-icon { color: #a9c6de; border-color: rgba(169,198,222,0.6); }
    #kg-lobby .play-menu-grid > button:nth-child(3) .pc-icon { color: #7fe0c8; border-color: rgba(127,224,200,0.6); }
    #kg-lobby .play-menu-grid > button:nth-child(4) .pc-icon { color: #d9a0f0; border-color: rgba(217,160,240,0.6); }
    #kg-lobby .play-menu-grid > button:nth-child(5) .pc-icon { color: #9db9ff; border-color: rgba(157,185,255,0.6); }
    #kg-lobby .play-menu-grid > button:nth-child(6) .pc-icon { color: #a8e08a; border-color: rgba(168,224,138,0.6); }
    #kg-lobby .split-head {
      display: flex; align-items: center; gap: 10px;
      font-size: 1rem; letter-spacing: 0.18em; color: #ffe9a8; margin: 20px 0 10px;
    }
    #kg-lobby .split-count {
      background: rgba(255,212,84,0.16); border: 1px solid rgba(255,212,84,0.45);
      color: #ffd454; border-radius: 999px; padding: 2px 10px; font-size: .9rem; letter-spacing: 0.04em;
    }
    @media (max-width: 640px) {
      #kg-lobby { padding: 8px 14px 24px; }
      .game-header { padding: 16px 14px 12px; }
      #kg-lobby .play-menu-grid { grid-template-columns: repeat(2, 1fr); }
      #kg-lobby .play-card { min-height: 118px !important; }
    }

/* ═══ G-B3 + G-B5 (Core lane, appeal pass): HUD rank + the Tab receipt ═══
 * G-B3: the HUD keeps its pinned one-row-of-7 stage geometry; the rank
 * split is emphasis, not reflow. Resources (Spirits/Ash/Clay/Chit) get
 * the inset gold panel + larger values; state readouts (Round/Tide/
 * Signal) go flat and muted behind a hairline before Round. All text
 * stays at or above the 0.9rem readability floor. The Tide/Signal
 * glosses carry the mechanics in the engines' own words (tideAdvance /
 * checkSignal); on the fixed-geometry fullscreen stage they hide and
 * the title/aria text carries the meaning instead. */
#kg-bout .hud .hud-box.hud-res { background: linear-gradient(180deg, rgba(201,162,39,0.16), rgba(0,0,0,0.45)); box-shadow: inset 0 1px 0 rgba(255,226,160,0.20), inset 0 0 0 1px rgba(201,162,39,0.30); }
#kg-bout .hud .hud-box.hud-res .val { font-size: 1.3rem; }
#kg-bout .hud .hud-box.hud-state { background: rgba(0,0,0,0.28); box-shadow: none; }
#kg-bout .hud .hud-box.hud-state .val { font-size: 1.02rem; text-shadow: none; }
#kg-bout .hud .hud-box.hud-state-first { position: relative; }
#kg-bout .hud .hud-box.hud-state-first::before { content: ''; position: absolute; left: -5px; top: 16%; bottom: 16%; width: 1px; background: linear-gradient(180deg, transparent, rgba(201,162,39,0.55), transparent); }
#kg-bout .hud .hud-gloss { display: block; font-size: 0.9rem; line-height: 1.15; color: var(--mist); letter-spacing: 0.02em; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kg-bout .hud .hud-gloss { display: none; }
/* G-B5: the bill slips become the house receipt — parchment stock, a
 * perforated top edge, dotted row ruling, tabular figures, and the
 * total under a double rule. The plate chip by the Stranger wears the
 * same stock so the Tab reads as ONE material everywhere it appears.
 * Numbers, ids and the renderTabs() writers are untouched. */
#kg-bout .bill-slip { background: linear-gradient(180deg, #f4e7c4, #e9d6a9 55%, #dec48f); color: #2c1e0c; border: 1px solid #a97f3f; border-radius: 3px; box-shadow: 0 12px 26px rgba(0,0,0,0.55), inset 0 0 24px rgba(169,127,63,0.18); }
#kg-bout .bill-slip::before { content: ''; display: block; height: 7px; margin: -2px -4px 5px; background-image: radial-gradient(circle at 5px 3px, rgba(44,30,12,0.35) 1.6px, transparent 1.7px); background-size: 11px 7px; background-repeat: repeat-x; }
#kg-bout .bill-slip.foe { background: linear-gradient(180deg, #e9ddf2, #d9c8ea 55%, #c6aede); border-color: #7d5ba6; color: #241433; box-shadow: 0 12px 26px rgba(0,0,0,0.55), inset 0 0 24px rgba(125,91,166,0.20); }
#kg-bout .bill-head { color: #6d4c12; border-bottom: 3px double rgba(109,76,18,0.65); font-variant-numeric: tabular-nums; }
#kg-bout .bill-slip.foe .bill-head { color: #4b2d73; border-bottom-color: rgba(75,45,115,0.6); }
#kg-bout .bill-head b { color: #2c1e0c; text-shadow: none; }
#kg-bout .bill-slip.foe .bill-head b { color: #241433; }
#kg-bout .bill-head b.cutoff { color: #b3271a; }
#kg-bout .bill-items { color: #3a2a12; }
#kg-bout .bill-slip.foe .bill-items { color: #32204d; }
#kg-bout .bill-items .bi { border-bottom: 1px dotted rgba(58,42,18,0.38); font-variant-numeric: tabular-nums; }
#kg-bout .bill-slip.foe .bill-items .bi { border-bottom-color: rgba(50,32,77,0.35); }
#kg-bout .bill-items .bi .amt { color: #6d4c12; }
#kg-bout .bill-slip.foe .bill-items .bi .amt { color: #4b2d73; }
#kg-bout .bill-items .bill-empty { color: rgba(58,42,18,0.62); }
#plateTab { background: linear-gradient(180deg, #f4e7c4, #e2cd97); color: #2c1e0c; border: 1px solid #a97f3f; }
#plateTab b { color: #2c1e0c; }

/* Lane continuation cue (Mobile #626 item 4, Core): a first-time phone
   player's way-down chip. Fixed above the bout's bottom chrome; the JS
   (laneCueBoot in cards.html) owns show/hide/retire — this is paint. */
.lane-cue {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  z-index: 65;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, .75);
  background: linear-gradient(180deg, #f4e7c4, #e2cd97);
  color: #2c1e0c;
  font-family: 'Cinzel', serif;
  font-size: .9rem;
  letter-spacing: .04em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  cursor: pointer;
  animation: kgLaneCueBob 1.8s ease-in-out infinite;
}
@keyframes kgLaneCueBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .lane-cue { animation: none; }
}

/* ═══ STAGE COMPACT BAR (Nov 3, 2026 — Mobile lane #634, routed to Visual
   Appeal In-Game): at short heights the FULL game header renders inside the
   fullscreen container and eats ~253 of 390px (~65%) — title, subtitle,
   Sound/Motion/language row, the whole jukebox bar, Rules/Shop/Support —
   so landscape-phone stage play scrolls instead of fitting. In :fullscreen /
   .kg-fakefs under 500px tall the header collapses to ONE compact bar:
   brand mark + short title + the two controls a duel cannot lose —
   #soundBtn (Sound) and #fullBtn (Exit full) — always visible, never
   folded. Everything else in the header is lobby chrome and folds away
   (subtitle, copper chip, account, Motion, language, the jukebox mount,
   Rules, Shop, Support); it all returns the moment the stage exits or the
   screen stands tall. Ledger: ~253px → ~49px, freeing ~204px back to the
   bout — the envelope the #27–#30 fit program was measured against. */
@media (max-height: 500px) {
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header {
    flex-wrap: nowrap; align-items: center; gap: 8px;
    padding: 4px 8px 5px; min-height: 0;
  }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-brand {
    display: flex; align-items: center; gap: 8px; min-width: 0;
  }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .kg-mark {
    width: 28px; height: 28px; flex: 0 0 auto;
  }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-header h1 {
    font-size: .95rem; letter-spacing: 2px; white-space: nowrap;
  }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .game-sub { display: none; }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .header-btns {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-left: auto;
  }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kgCopperChip,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #acctBtn,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #motionBtn,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #langSel,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #bgmMount,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #helpBtn,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .header-btns a.help-toggle-btn { display: none !important; }
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #soundBtn,
  .kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #fullBtn {
    min-height: 40px; white-space: nowrap; flex: 0 0 auto;
  }
}

/* ── KG immersion (Nov 23, 2026): drag-to-play + log demotion ── */
.hand-card { touch-action: pan-x; }
.hand-card.kg-drag116 { z-index: 60; position: relative; box-shadow: 0 18px 34px rgba(0,0,0,0.6), 0 0 0 2px rgba(87,230,217,0.7); }
#playerBoard .lane.kg-drop-ok { box-shadow: inset 0 0 0 2px rgba(87,230,217,0.9), inset 0 0 24px rgba(87,230,217,0.25); }
.battle-log.kg-folded116 { display: none; }
#kgLogStrip116 { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 8px 14px; background: rgba(0,0,0,0.45); border: 1px solid rgba(201,162,39,0.35); border-radius: 8px; color: #e8dfc8; font-size: .9rem; cursor: pointer; text-align: left; }
#kgLogStrip116 .kls-name { font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
#kgLogStrip116 .kls-latest { opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#kgLogStrip116 .kls-new { color: #ffd27f; font-weight: 700; white-space: nowrap; }
#kgLogStrip116 .kls-chev { opacity: .8; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) #kgLogStrip116 { display: none; }
.kg-container:is(:fullscreen, :-webkit-full-screen, .kg-fakefs) .battle-log.kg-folded116 { display: block; }

/* ═══ POLISH BATCH (Nov 24, 2026) — Gemini verify-first fixes ═══
   (a) The other scrollIntoView targets get the same margin as #kg-app,
       so their headings stop sliding under the fixed site bar. */
.stranger-zone, #outDeckHead { scroll-margin-top: 8rem; }
/* (b) Corner safe zones: the site's fixed medallion (bottom-left) and
   chat button (bottom-right) overlay the app's corners. The first
   campaign card's action buttons keep their content clear of the
   medallion footprint, and the bout + campaign screens carry bottom
   room so end-of-scroll rests clear both discs. (The battle-log
   strip's own left/right padding lives in its fold rule above.) */
.campaign-levels > .campaign-level:first-child .btn-block { padding-left: 92px; }
#kg-campaign, #kg-bout { padding-bottom: 92px; }
