:root{font-family:Inter,"Yu Gothic UI",system-ui,sans-serif;background:#0d1117;color:#e6edf3}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at top,#17202b,#0d1117 60%);min-height:100vh}header{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;border-bottom:1px solid #30363d;background:#0d1117dd;position:sticky;top:0;z-index:2}h1{font-size:18px;margin:0;letter-spacing:.04em}h1 small{font-weight:400;color:#8b949e}.seedbar{font-size:12px}input{width:110px;background:#161b22;color:#e6edf3;border:1px solid #30363d;padding:6px}button{background:#21262d;color:#e6edf3;border:1px solid #484f58;border-radius:5px;padding:6px 9px;margin:2px;cursor:pointer}button:hover,.selected{border-color:#58a6ff;background:#26384e}button:disabled{opacity:.4;cursor:not-allowed}main{display:grid;grid-template-columns:minmax(580px,1fr) 380px;gap:12px;padding:12px;max-width:1320px;margin:auto}.board{min-width:0}canvas{width:100%;height:auto;image-rendering:pixelated;border:1px solid #30363d;background:#111;touch-action:none}.panel{background:#161b22;border:1px solid #30363d;border-radius:7px;padding:9px;margin-bottom:8px;font-size:13px;line-height:1.45}.hp{color:#ff7b72}.mp{color:#79c0ff}.item{display:flex;justify-content:space-between;gap:8px;align-items:center;border-top:1px solid #21262d;padding:5px 0}.item>span:first-child{min-width:0}.item-actions{white-space:nowrap}.item button{font-size:11px;padding:3px 6px}.rarity{font-size:10px;font-weight:800;letter-spacing:.08em}.route-list{display:grid;gap:5px;margin-top:5px}.route-card{border:1px solid #30363d;border-left:3px solid #6e7681;border-radius:5px;padding:6px;background:#111820}.route-card.current{border-color:#a371f7;background:#1c1830}.route-element{color:#a5d6ff;font-size:11px}.log{height:150px;overflow:auto;color:#9da7b3}.canvas-wrap{width:100%;overflow:hidden;border-radius:7px}.controls{margin-top:8px}.touch-controller{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;background:#0d1117e8;border:1px solid #30363d;border-radius:10px;padding:8px;touch-action:none;-webkit-tap-highlight-color:transparent}.dpad{display:grid;grid-template-columns:56px 56px 56px;grid-template-rows:56px 56px 56px;gap:4px;place-items:stretch}.dpad button{margin:0;min-width:56px;min-height:56px;font-size:23px;font-weight:800;touch-action:none}.dpad-up-left{grid-column:1;grid-row:1}.dpad-up{grid-column:2;grid-row:1}.dpad-up-right{grid-column:3;grid-row:1}.dpad-left{grid-column:1;grid-row:2}.dpad-center{grid-column:2;grid-row:2}.dpad-right{grid-column:3;grid-row:2}.dpad-down-left{grid-column:1;grid-row:3}.dpad-down{grid-column:2;grid-row:3}.dpad-down-right{grid-column:3;grid-row:3}.touch-actions{display:grid;grid-template-columns:repeat(3,minmax(74px,1fr));gap:6px;align-items:stretch}.touch-actions button{margin:0;min-height:48px;font-size:14px;font-weight:700;touch-action:none}.touch-primary{border-color:#58a6ff}.touch-cancel{grid-column:span 2}.touch-mode{display:grid;place-items:center;min-height:48px;border:1px solid #30363d;border-radius:5px;color:#8b949e;font:700 11px ui-monospace,monospace;padding:4px;text-align:center}.touch-help{grid-column:1/-1;color:#8b949e;font-size:11px;text-align:center}.touch-controller button:active{transform:translateY(1px);background:#30465e}.modal{background:#161b22;border:1px solid #58a6ff;border-radius:10px;padding:20px;max-width:560px;width:min(560px,100%);box-shadow:0 20px 80px #000}.modal button{display:block;width:100%;text-align:left;padding:10px;margin:6px 0}.modal h2{margin-top:0}@media(max-width:940px){main{grid-template-columns:1fr;padding:6px;padding-bottom:calc(8px + env(safe-area-inset-bottom))}aside{display:grid;grid-template-columns:1fr 1fr;gap:6px}.panel{margin:0}header{position:static;padding-top:calc(8px + env(safe-area-inset-top));padding-left:calc(10px + env(safe-area-inset-left));padding-right:calc(10px + env(safe-area-inset-right))}.controls{position:sticky;bottom:0;z-index:4;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:calc(8px + env(safe-area-inset-bottom));padding-left:calc(8px + env(safe-area-inset-left));padding-right:calc(8px + env(safe-area-inset-right));box-shadow:0 -10px 30px #0008}}
@media(max-width:640px){aside{grid-template-columns:1fr}h1{font-size:14px}.seedbar{display:flex;align-items:center}main{display:block}.panel{margin-top:6px}.item{align-items:flex-start}.item-actions{white-space:normal;text-align:right}.touch-controller{grid-template-columns:168px minmax(0,1fr);gap:6px;padding:6px}.dpad{grid-template-columns:52px 52px 52px;grid-template-rows:52px 52px 52px}.dpad button{min-width:52px;min-height:52px}.touch-actions{grid-template-columns:repeat(2,minmax(66px,1fr));gap:5px}.touch-actions button{min-height:50px;font-size:13px}.touch-cancel{grid-column:span 1}.touch-help{font-size:10px}}
@media(max-width:390px){.touch-controller{grid-template-columns:150px minmax(0,1fr)}.dpad{grid-template-columns:46px 46px 46px;grid-template-rows:46px 46px 46px}.dpad button{min-width:46px;min-height:46px;font-size:20px}.touch-actions button{min-height:46px;font-size:12px;padding:4px}.touch-mode{min-height:46px}.seedbar input{width:88px}}
@media(orientation:landscape) and (max-height:560px) and (pointer:coarse){header{display:none}main{max-width:none;grid-template-columns:minmax(0,1fr) minmax(300px,42vw);align-items:start}.board{position:sticky;top:0}.touch-controller{position:sticky;bottom:0}.dpad{grid-template-columns:48px 48px 48px;grid-template-rows:48px 48px 48px}.dpad button{min-width:48px;min-height:48px}.touch-actions button{min-height:48px}.touch-help{display:none}aside{display:block}.panel{margin-bottom:6px}}

.build-row{border-top:1px solid #21262d;padding:5px 0}.upgrade{color:#d2a8ff;font-size:11px}.panel hr{border:0;border-top:1px solid #30363d;margin:7px 0}
.reaction-rule{border-top:1px solid #21262d;padding:4px 0}.reaction-rule b{color:#d2a8ff}.reaction-log{border-left:2px solid #58a6ff;padding-left:6px;margin-top:4px;color:#b7c4d4}

/* v0.6.2 mobile input spike: coarse-pointer geometry + safe-area containment; device feel remains human-unverified. */
@media(max-width:940px),(pointer:coarse){button{min-height:44px}body{overscroll-behavior:none;-webkit-user-select:none;user-select:none}input{-webkit-user-select:text;user-select:text}.touch-controller button{min-height:48px}}
@media(pointer:coarse){button{cursor:default}.panel button{min-height:46px}.touch-controller{touch-action:none}canvas{touch-action:none}}
#saveState{font-size:12px;min-width:72px;opacity:.8;white-space:nowrap}
@media (max-width:640px){.seedbar{flex-wrap:wrap}#saveState{flex-basis:100%}}
/* v0.12.0 release-hardening accessibility/readability layer. */
:root{--text-scale:1}.panel{font-size:calc(13px * var(--text-scale));}.log{font-size:calc(13px * var(--text-scale));}h1{font-size:calc(18px * var(--text-scale));}.seedbar{font-size:calc(12px * var(--text-scale));}.touch-help{font-size:calc(11px * var(--text-scale));}.touch-mode{font-size:calc(11px * var(--text-scale));}.route-element,.upgrade{font-size:calc(11px * var(--text-scale));}
.settings-row{display:flex;flex-wrap:wrap;gap:3px;margin-top:5px}.settings-row button{font-size:11px}.bind-grid{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin-top:6px}.bind-btn{font-size:11px;text-align:left;overflow:hidden;text-overflow:ellipsis}details summary{cursor:pointer;color:#a5d6ff;margin-top:5px}
html[data-high-contrast="1"]{filter:contrast(1.18)}html[data-high-contrast="1"] .panel,html[data-high-contrast="1"] canvas,html[data-high-contrast="1"] button{border-color:#8b949e}html[data-high-contrast="1"] .hp{color:#ff958f}html[data-high-contrast="1"] .mp{color:#9dd2ff}
@keyframes uiActionPulse{0%{box-shadow:inset 0 0 0 0 #58a6ff00}35%{box-shadow:inset 0 0 18px 0 #58a6ff33}100%{box-shadow:inset 0 0 0 0 #58a6ff00}}@keyframes uiImpactPulse{0%{box-shadow:inset 0 0 0 0 #ff7b7200}30%{box-shadow:inset 0 0 26px 2px #ff7b7244}100%{box-shadow:inset 0 0 0 0 #ff7b7200}}body.feedback-action{animation:uiActionPulse 130ms ease-out}body.feedback-impact{animation:uiImpactPulse 130ms ease-out}
html[data-reduced-motion="1"] *,html[data-reduced-motion="1"] *::before,html[data-reduced-motion="1"] *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}html[data-reduced-motion="1"] .touch-controller button:active{transform:none}
@media(max-width:640px){.bind-grid{grid-template-columns:1fr}.settings-row button{flex:1 1 45%}h1{font-size:calc(14px * var(--text-scale));}}

.campaign-gates{display:grid;gap:4px}.campaign-gate{border-top:1px solid #30363d;padding:4px 0}.campaign-gate.locked{opacity:.55}.campaign-gate.clear{color:#7ee787}.village-choice{display:flex;gap:6px;align-items:center;justify-content:space-between;border-top:1px solid #30363d;padding:4px 0}.village-choice button{flex:0 0 auto}

/* v0.14 Spell Book: open-book catalogue with searchable categories. */
#spellBook{position:fixed;inset:0;background:#05070bcc;z-index:8;display:grid;place-items:center;padding:18px}#spellBook[hidden]{display:none}.spellbook-shell{width:min(1040px,96vw);max-height:92vh;overflow:auto;border:1px solid #755d35;border-radius:14px;background:#241c12;box-shadow:0 24px 100px #000}.spellbook-pages{display:grid;grid-template-columns:minmax(250px,.72fr) minmax(0,1.5fr);gap:2px;background:#3b2d1b}.spellbook-page{background:linear-gradient(100deg,#efe1bf,#dfc996);color:#20170e;min-height:620px;padding:20px;box-shadow:inset 0 0 30px #73552c33}.spellbook-left{border-right:1px solid #9e7f4c}.spellbook-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.spellbook-head h2{font-family:Georgia,"Yu Mincho",serif;margin:0}.spellbook-page input,.spellbook-page select{display:block;width:100%;margin:5px 0 12px;background:#fff8e5;color:#20170e;border:1px solid #9e7f4c;border-radius:5px;padding:9px;font-size:16px}.spellbook-sp{font-weight:800;margin:12px 0;padding:8px;border:1px solid #9e7f4c;background:#fff4d3}.spellbook-entry{border-top:1px solid #ab8f62;padding:11px 2px}.spellbook-entry:first-child{border-top:0}.spellbook-entry h3{margin:0 0 3px;font-family:Georgia,"Yu Mincho",serif}.spellbook-entry .spell-meta{font-size:12px;color:#5a462b}.spellbook-entry .spell-tags{font-size:11px;color:#69563a}.spellbook-entry button{background:#4b3822;color:#fff4d3;border-color:#7d6544}.spellbook-entry.owned{opacity:.74}.spellbook-owned-list{font-size:12px;line-height:1.5}.sp{color:#d2a8ff;font-weight:800}@media(max-width:760px){#spellBook{padding:6px}.spellbook-pages{grid-template-columns:1fr}.spellbook-page{min-height:auto}.spellbook-left{border-right:0;border-bottom:1px solid #9e7f4c}.spellbook-shell{max-height:96vh}}
.spellbook-upgrades{margin-top:8px;padding-top:8px;border-top:1px dashed #8a6f45}.spellbook-upgrade{padding:5px 0}.spellbook-upgrade button{margin-top:5px}

/* v0.18 Controller Gameplay Shell */
.product-ui{min-height:100vh;background:#090d12;color:#e6edf3;overflow-x:hidden}.product-header{position:static;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 14px;border-bottom:1px solid #293442;background:#0d131b}.product-brand{display:flex;align-items:baseline;gap:10px;min-width:0}.product-brand h1{margin:0;font-size:17px;white-space:nowrap}.product-brand small{color:#8b9aac;font:700 10px ui-monospace,monospace;white-space:nowrap}.product-hud{display:flex;gap:14px;align-items:center;min-height:42px;padding:6px 14px;background:#101822;border-bottom:1px solid #293442;font:800 13px ui-monospace,monospace}.hud-chip{padding:4px 7px;border:1px solid #344252;border-radius:5px;background:#0b1118}.hud-hp{color:#ff958f}.hud-mp{color:#9dd2ff}.hud-sp{color:#d2a8ff}.hud-route{margin-left:auto;color:#b7c4d4}.product-shell{max-width:none;margin:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:0;min-height:calc(100vh - 166px);padding:0}.product-map-region{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background:#070b10;border-right:1px solid #293442;padding:10px}.product-map-region .canvas-wrap{position:relative;max-width:100%;max-height:calc(100vh - 220px);overflow:auto;border:1px solid #2c3948;background:#05080c;box-shadow:0 8px 28px #0008}.product-map-region canvas{display:block;image-rendering:pixelated;image-rendering:crisp-edges;max-width:100%;height:auto}.target-prompt{position:absolute;left:8px;bottom:8px;max-width:calc(100% - 16px);padding:5px 8px;border:1px solid #536b86;border-radius:4px;background:#07101cdd;color:#dbeeff;font:700 11px ui-monospace,monospace;pointer-events:none}.target-prompt:empty{display:none}.action-sidebar{min-width:0;background:#0d141d;display:flex;flex-direction:column;max-height:calc(100vh - 166px);outline:2px solid transparent;outline-offset:-2px}.focus-sidebar .action-sidebar{outline-color:#79c0ff;box-shadow:inset 0 0 0 1px #79c0ff55}.focus-map .product-map-region{box-shadow:inset 0 0 0 2px #79c0ff55}.sidebar-tab-rail{display:grid;grid-template-columns:auto 1fr auto;align-items:center;border-bottom:1px solid #293442;background:#111a25}.bumper-hint{padding:0 7px;color:#8b9aac;font:800 10px ui-monospace,monospace}.sidebar-tabs{display:grid;grid-template-columns:repeat(5,1fr);min-width:0}.sidebar-tabs button{min-height:38px;padding:4px 2px;margin:0;border:0;border-radius:0;border-left:1px solid #202c39;background:transparent;color:#8190a2;font:800 10px ui-monospace,monospace}.sidebar-tabs button.active{background:#1b2c3e;color:#f0f6fc;box-shadow:inset 0 -2px #79c0ff}.sidebar-subtabs{display:flex;gap:4px;overflow-x:auto;padding:6px;border-bottom:1px solid #24303d;min-height:30px}.sidebar-subtabs:empty{display:none}.sidebar-subtab{flex:0 0 auto;padding:3px 7px;border:1px solid #314154;border-radius:12px;color:#91a2b5;font:700 10px ui-monospace,monospace}.sidebar-subtab.active{border-color:#d2a8ff;color:#eadcff;background:#2a2140}.sidebar-list{flex:1;overflow:auto;padding:6px;scrollbar-width:thin}.sidebar-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 9px;margin:2px 0;border:1px solid transparent;border-radius:6px;background:#101821;color:#c9d1d9;min-height:38px}.sidebar-row.selected{border-color:#79c0ff;background:#18283a;color:#fff;box-shadow:0 0 0 1px #79c0ff33}.sidebar-row.disabled{opacity:.48}.sidebar-row-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-row-meta{font:700 10px ui-monospace,monospace;color:#8b9aac;white-space:nowrap}.sidebar-detail{min-height:94px;max-height:150px;overflow:auto;padding:9px;border-top:1px solid #293442;background:#0a1017;color:#9fb0c2;font-size:11px}.product-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;padding:7px 12px;border-top:1px solid #293442;background:#0d131b;min-height:64px}.product-log{font:12px ui-monospace,monospace;color:#b9c6d4;line-height:1.35;max-height:54px;overflow:hidden}.controller-hints{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end;color:#9fb0c2;font:800 10px ui-monospace,monospace}.controller-hint{padding:3px 6px;border:1px solid #344252;border-radius:4px;background:#111923}.debug-drawer{margin:8px 12px;color:#8b9aac}.debug-drawer>summary{cursor:pointer;font:700 11px ui-monospace,monospace}.debug-grid{display:grid;grid-template-columns:repeat(3,minmax(260px,1fr));gap:7px;margin-top:7px}.product-map-region>.touch-controller{display:none}.product-ui .seedbar{font-size:11px}.product-ui .seedbar button,.product-ui .seedbar input{min-height:28px;padding:3px 6px}
@media(max-width:900px){.product-shell{grid-template-columns:1fr}.action-sidebar{position:fixed;right:8px;top:92px;bottom:70px;width:min(360px,88vw);max-height:none;z-index:6;box-shadow:0 16px 60px #000d;transform:translateX(calc(100% + 20px));transition:transform .12s ease}.focus-sidebar .action-sidebar{transform:translateX(0)}.product-map-region{border-right:0}.product-footer{grid-template-columns:1fr}.controller-hints{justify-content:flex-start}.debug-grid{grid-template-columns:1fr 1fr}}
@media(pointer:coarse){.product-map-region>.touch-controller{display:grid}.product-map-region .canvas-wrap{max-height:none}}
@media(max-width:620px){.product-header{align-items:flex-start;flex-direction:column}.product-brand small{display:none}.product-hud{overflow-x:auto}.debug-grid{grid-template-columns:1fr}.product-map-region{padding:4px}.product-footer{padding-bottom:calc(7px + env(safe-area-inset-bottom))}}

/* v0.20 screenshot-driven product visual polish */
:root{
  --surface-0:#070b10;--surface-1:#0c131c;--surface-2:#111b27;--surface-3:#172433;
  --line:#2b3d50;--line-soft:#1b2936;--text:#eef5fb;--text-dim:#91a4b8;
  --accent-focus:#78d7ff;--accent-magic:#caa7ff;--accent-gold:#e8c66a;--danger:#ff8b93;
  --shadow-deep:0 18px 60px #000a;--radius:10px;
}
html,body{height:100%}.product-ui{background:#05080c;color:var(--text);overflow:hidden;letter-spacing:.01em}
.product-frame{height:100vh;display:grid;grid-template-rows:48px 43px minmax(0,1fr) 66px;background:
  radial-gradient(circle at 38% 0,#17283855,transparent 36%),linear-gradient(180deg,#09111a,#05080c 72%);}
.product-header{height:48px;padding:0 14px;background:linear-gradient(180deg,#111a24,#0b1118);border-bottom:1px solid #26384a;box-shadow:0 5px 18px #0005;z-index:3}
.product-brand h1{font-size:16px;letter-spacing:.055em;text-shadow:0 1px 0 #000}.product-brand small{color:#71869a;font-size:9px;letter-spacing:.11em}
.product-ui .seedbar{display:flex;align-items:center;gap:4px;color:#75889a;font:700 9px ui-monospace,monospace}.product-ui .seedbar input{width:92px;height:28px;background:#090f16;border:1px solid #2b3948;border-radius:5px;color:#b9c8d5;font:700 11px ui-monospace,monospace}
.product-ui .seedbar button{height:28px;min-height:28px;margin:0;border-radius:5px;padding:3px 8px;font:800 10px ui-monospace,monospace;letter-spacing:.035em}.system-button{background:#101820!important;border-color:#283746!important;color:#8195a8!important}.spellbook-button{background:linear-gradient(180deg,#30253f,#201b2d)!important;border-color:#745d96!important;color:#eadcff!important;box-shadow:inset 0 1px #ffffff0f}
.product-hud{height:43px;min-height:43px;padding:5px 14px;gap:8px;background:linear-gradient(180deg,#111b27,#0d151f);border-bottom:1px solid #2d4155;box-shadow:inset 0 -1px #0007;font-size:12px}
.hud-chip{min-height:29px;display:flex;align-items:center;padding:4px 9px;border:1px solid #30465b;border-radius:7px;background:linear-gradient(180deg,#152231,#0c141d);box-shadow:inset 0 1px #ffffff0c,0 2px 5px #0004}
.hud-hp{border-color:#6a3940;color:#ff9ba2}.hud-mp{border-color:#2d526c;color:#9edcff}.hud-sp{border-color:#594475;color:#d8b8ff}.hud-route{color:#a9bac9;letter-spacing:.08em}
.product-shell{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 360px;background:#060a0f}
.product-map-region{min-height:0;padding:10px 12px 9px;background:radial-gradient(ellipse at center,#122131 0,#09121a 48%,#05090e 82%);border-right:1px solid #2c4054;justify-content:center;position:relative;overflow:hidden}
.product-map-region::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#0004,transparent 12%,transparent 88%,#0004),linear-gradient(#ffffff0250 1px,transparent 1px);background-size:auto,100% 4px;opacity:.3}
.product-map-region .canvas-wrap{position:relative;width:min(100%,900px);height:auto;max-height:none;overflow:hidden;border:1px solid #3b5368;border-radius:9px;background:#030609;box-shadow:0 18px 50px #000c,inset 0 0 0 1px #ffffff08;z-index:1}
.product-map-region canvas{display:block;width:100%;height:auto;aspect-ratio:5/3;background:#030609;image-rendering:pixelated;filter:saturate(1.08) contrast(1.04)}
.focus-map .product-map-region{box-shadow:inset 0 0 0 2px #78d7ff26}.focus-map .canvas-wrap{border-color:#4e7998;box-shadow:0 18px 50px #000c,0 0 0 1px #78d7ff22,inset 0 0 0 1px #ffffff08}
.map-legend{position:absolute;right:8px;bottom:8px;display:flex;gap:9px;padding:5px 7px;border:1px solid #2b4155;border-radius:6px;background:#050a10c9;backdrop-filter:blur(3px);color:#7f93a6;font:800 8px ui-monospace,monospace;letter-spacing:.06em;pointer-events:none}.map-legend span{display:flex;align-items:center;gap:4px}.legend-token{display:inline-block;width:8px;height:8px;border-radius:50%;box-shadow:0 0 6px currentColor}.legend-player{background:#80dcff;color:#80dcff;border:1px solid #fff}.legend-orb{background:#caa7ff;color:#caa7ff}.legend-stair{background:#e8c66a;color:#e8c66a;transform:rotate(45deg);border-radius:1px}
.target-prompt{left:10px;bottom:10px;padding:6px 9px;border-color:#6e8aa5;background:#07111bec;color:#e8f6ff;box-shadow:0 5px 18px #0008;font-size:10px}
.action-sidebar{min-height:0;max-height:none;background:linear-gradient(180deg,#101923,#0a1119);border-left:1px solid #0b1016;box-shadow:-12px 0 30px #0003}
.sidebar-tab-rail{height:42px;background:#0d1620;border-bottom:1px solid #2c4052}.bumper-hint{color:#6f8498;font-size:9px;letter-spacing:.08em}.sidebar-tabs button{min-height:42px;color:#74889b;font-size:9px;letter-spacing:.035em;transition:background .08s,border-color .08s,color .08s}.sidebar-tabs button:hover{background:#142231}.sidebar-tabs button.active{background:linear-gradient(180deg,#22384d,#17293a);color:#f4f9fd;box-shadow:inset 0 -3px var(--accent-focus);text-shadow:0 1px #000}
.sidebar-subtabs{padding:7px 8px 6px;gap:5px;background:#0b121a;border-bottom:1px solid #223342}.sidebar-subtab{padding:3px 8px;border-color:#2a4153;color:#7990a5;background:#111c27;font-size:9px}.sidebar-subtab.active{border-color:#8a6fb0;color:#eadcff;background:#2a2038;box-shadow:0 0 0 1px #caa7ff18}
.sidebar-list{padding:8px 8px 4px}.sidebar-row{position:relative;min-height:43px;margin:3px 0;padding:8px 10px;border:1px solid #1c2a37;border-radius:7px;background:linear-gradient(180deg,#121d27,#0e1720);box-shadow:inset 0 1px #ffffff05;transition:transform .08s,border-color .08s,background .08s}.sidebar-row::before{content:"";position:absolute;left:0;top:7px;bottom:7px;width:2px;border-radius:2px;background:transparent}.sidebar-row.selected{border-color:#5e9bc2;background:linear-gradient(180deg,#1b3041,#122536);box-shadow:0 0 0 1px #78d7ff2e,inset 0 1px #ffffff0b}.sidebar-row.selected::before{background:var(--accent-focus);box-shadow:0 0 8px #78d7ff}.focus-sidebar .sidebar-row.selected{transform:translateX(-2px);border-color:#8edfff;box-shadow:0 0 0 2px #78d7ff35,0 6px 18px #0005}.sidebar-row-main{font-size:13px;font-weight:760}.sidebar-row-meta{font-size:9px;color:#8196a9}.sidebar-detail{min-height:96px;padding:10px 11px;border-top:1px solid #26394a;background:linear-gradient(180deg,#091018,#070c12);color:#9aafc1;font-size:10px;line-height:1.5;box-shadow:inset 0 5px 14px #0003}
.product-footer{height:66px;min-height:66px;padding:7px 12px 8px;background:linear-gradient(180deg,#0d151f,#080d13);border-top:1px solid #2a3d50;box-shadow:0 -8px 24px #0004}.product-log{font-size:11px;color:#b8c7d4;line-height:1.45}.product-log>div:first-child{color:#e5edf4}.controller-hints{gap:5px}.controller-hint{padding:4px 7px;border-color:#30485e;border-radius:6px;background:#111d29;color:#a8bdcf;font-size:9px;box-shadow:inset 0 1px #ffffff08}
.debug-drawer{position:fixed;left:10px;bottom:4px;z-index:20;margin:0;opacity:.22;transition:opacity .15s}.debug-drawer:hover,.debug-drawer[open]{opacity:1}.debug-drawer>summary{padding:3px 6px;border:1px solid #293744;border-radius:4px;background:#090f15;color:#718293;font-size:8px}.debug-drawer[open]{right:10px;bottom:8px;max-height:70vh;overflow:auto;padding:8px;background:#05080cf2;border:1px solid #33495d;border-radius:8px;box-shadow:var(--shadow-deep)}
@media(min-width:1450px){.product-shell{grid-template-columns:minmax(0,1fr) 380px}.product-map-region .canvas-wrap{width:min(100%,1020px)}.sidebar-row-main{font-size:14px}.sidebar-detail{font-size:11px}.product-brand h1{font-size:17px}}
@media(max-width:900px){.product-frame{grid-template-rows:auto 43px minmax(0,1fr) auto}.product-shell{grid-template-columns:1fr}.product-map-region .canvas-wrap{width:min(100%,800px)}.action-sidebar{max-height:none}.product-footer{height:auto;min-height:58px}}
@media(prefers-reduced-motion:reduce){.sidebar-tabs button,.sidebar-row,.debug-drawer{transition:none!important}.product-map-region::before{display:none}}
/* v0.20 pass 2: larger local camera + controller category carousel */
.product-map-region .canvas-wrap{width:min(100%,860px)}.product-map-region canvas{aspect-ratio:21/13}
.sidebar-subtabs{display:grid;grid-template-columns:auto minmax(0,.8fr) minmax(86px,1.2fr) minmax(0,.8fr) auto;align-items:center;overflow:hidden;gap:4px;padding:6px 7px}.subtab-trigger{display:grid;place-items:center;min-width:24px;height:24px;border:1px solid #2b4153;border-radius:12px;background:#101a24;color:#97adbf;font:900 9px ui-monospace,monospace}.sidebar-subtab{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;margin:0}.sidebar-subtab.neighbor{opacity:.62}.sidebar-subtab.current{font-size:10px;letter-spacing:.04em;box-shadow:0 0 0 1px #caa7ff1f}.sidebar-row-meta{font-size:10px}.sidebar-detail{font-size:11px}.product-log{font-size:11.5px}
@media(min-width:1450px){.product-map-region .canvas-wrap{width:min(100%,980px)}}
.sidebar-tabs button[data-sidebar-tab]::before{display:inline-block;margin-right:3px;color:#65839c;font-size:8px}.sidebar-tabs button[data-sidebar-tab="SPELL"]::before{content:"✦"}.sidebar-tabs button[data-sidebar-tab="ITEM"]::before{content:"◇"}.sidebar-tabs button[data-sidebar-tab="EQUIP"]::before{content:"⚔"}.sidebar-tabs button[data-sidebar-tab="SUMMON"]::before{content:"◉"}.sidebar-tabs button[data-sidebar-tab="STATUS"]::before{content:"≡"}.sidebar-tabs button.active::before{color:var(--accent-focus)}

/* v0.21 product-surface finishing pass */
.product-header-actions{display:flex;align-items:center;gap:7px}.product-system-menu{position:relative}.product-system-menu>summary{list-style:none;cursor:pointer;height:28px;display:grid;place-items:center;padding:0 9px;border:1px solid #304457;border-radius:5px;background:linear-gradient(180deg,#121d28,#0c131b);color:#92a9bc;font:800 9px ui-monospace,monospace;letter-spacing:.08em}.product-system-menu>summary::-webkit-details-marker{display:none}.product-system-menu[open]>summary{border-color:#5c7c98;color:#e7f3fb;background:#172634}.system-menu-panel{position:absolute;right:0;top:34px;z-index:30;width:252px;padding:10px;border:1px solid #39536a;border-radius:8px;background:linear-gradient(180deg,#111d28,#091018);box-shadow:0 18px 52px #000c}.system-seed{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#859aae;font:800 9px ui-monospace,monospace;letter-spacing:.08em}.system-seed input{width:145px}.system-menu-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:8px}.system-menu-actions button{width:100%}.product-ui .seedbar{display:none}
.hud-meter{position:relative;min-width:142px;height:30px;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;padding:4px 8px;border:1px solid #30465b;border-radius:7px;overflow:hidden;background:#0a121a;box-shadow:inset 0 1px #ffffff0c}.hud-meter-label{position:relative;z-index:2;min-width:62px;font:900 11px ui-monospace,monospace;letter-spacing:.035em}.hud-meter-track{position:relative;z-index:2;height:7px;border-radius:999px;background:#03070b;border:1px solid #26394b;overflow:hidden}.hud-meter-fill{height:100%;border-radius:999px;box-shadow:0 0 10px currentColor;transition:width .12s linear}.hud-meter-hp{border-color:#603b43;color:#ff9ea5}.hud-meter-hp .hud-meter-fill{background:linear-gradient(90deg,#b94955,#ff7e88)}.hud-meter-mp{border-color:#31536b;color:#9edcff}.hud-meter-mp .hud-meter-fill{background:linear-gradient(90deg,#327ea8,#72cfff)}
.sidebar-summary{min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-bottom:1px solid #26394a;background:linear-gradient(180deg,#111b26,#0c141d);color:#8fa4b6;font:800 9px ui-monospace,monospace;letter-spacing:.055em}.sidebar-summary strong{color:#e4eef6;font-size:10px}.sidebar-summary .summary-count{color:#7ccff4}.sidebar-summary .summary-context{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.sidebar-list{background:linear-gradient(180deg,#0d151e,#0a1118)}.sidebar-row{min-height:46px}.sidebar-detail{border-top:1px solid #30475a}.sidebar-detail b{display:inline-block;margin-bottom:4px;color:#dce8f1;letter-spacing:.07em}
@media(max-width:900px){.product-system-menu{position:static}.system-menu-panel{right:8px;top:48px}.hud-meter{min-width:128px}}

/* v0.22 dense spell catalogue + full-village overview */
.spellbook-catalog-shell{width:min(1180px,97vw);height:min(760px,94vh);max-height:94vh;overflow:hidden;background:#2b2115;border-color:#806638;display:grid;grid-template-rows:auto auto minmax(0,1fr)}
.spellbook-global-head{padding:14px 18px 10px;background:linear-gradient(180deg,#ead6a9,#d9bd83);color:#24180c;border-bottom:1px solid #8f7444}.spellbook-eyebrow{display:block;color:#765a2e;font:900 9px ui-monospace,monospace;letter-spacing:.18em}.spellbook-global-head h2{font-size:25px;letter-spacing:.03em}.spellbook-head-stats{display:flex;align-items:center;gap:8px}.spellbook-head-stats .spellbook-sp,.spellbook-owned-summary{margin:0;padding:6px 9px;border:1px solid #a88952;border-radius:5px;background:#f6e7c5;color:#513d20;font:900 10px ui-monospace,monospace;white-space:nowrap}.spellbook-global-head button{background:#49371f;color:#fff1cc;border-color:#81673f}
.spellbook-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) minmax(170px,.45fr) auto;gap:10px;align-items:end;padding:8px 14px;background:#d9c18e;color:#4c391e;border-bottom:1px solid #8f7444}.spellbook-toolbar label{font:900 9px ui-monospace,monospace;letter-spacing:.08em}.spellbook-toolbar .spellbook-search,.spellbook-toolbar .spellbook-category{margin:3px 0 0;height:32px;padding:5px 8px;font-size:13px;background:#fff7df}.spellbook-toolbar-hint{align-self:center;color:#765f38;font:800 9px ui-monospace,monospace;white-space:nowrap}
.spellbook-catalog-layout{min-height:0;display:grid;grid-template-columns:minmax(0,1.65fr) minmax(330px,.85fr);gap:2px;background:#5f492a}.spellbook-catalog-layout .spellbook-page{min-height:0;padding:0;overflow:hidden}.spellbook-catalog-page{display:grid;grid-template-rows:auto minmax(0,1fr);border-right:1px solid #8e7445}.spellbook-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:10px 12px 8px;border-bottom:1px solid #b5965f;color:#3b2b17}.spellbook-section-title b{font:900 10px ui-monospace,monospace;letter-spacing:.13em}.spellbook-section-title small{color:#755f3c;font-size:10px}
.spellbook-list{min-height:0;overflow:auto;padding:7px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(48px,auto);align-content:start;gap:5px;background:linear-gradient(100deg,#f0dfb8,#e3c990)}.spellbook-list-row{width:100%;min-width:0;min-height:48px;margin:0;padding:6px 7px;display:grid;grid-template-columns:25px minmax(0,1fr) auto 17px;align-items:center;gap:6px;text-align:left;border:1px solid #b99b68;border-radius:5px;background:#f9edcf;color:#30210f;box-shadow:inset 0 1px #fff8;transition:none}.spellbook-list-row:hover{background:#fff4d9;border-color:#8f7142}.spellbook-list-row.selected{background:#4a3822;color:#fff0c4;border-color:#d3ae65;box-shadow:0 0 0 2px #5e4526,inset 0 1px #ffffff18}.spellbook-list-row.owned:not(.selected){background:#e4d4ad}.spellbook-list-icon{font-size:17px;text-align:center}.spellbook-list-copy{min-width:0;display:grid}.spellbook-list-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:Georgia,"Yu Mincho",serif;font-size:13px}.spellbook-list-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#806a47;font-size:8px;letter-spacing:.04em}.spellbook-list-row.selected .spellbook-list-copy small{color:#d6c39b}.spellbook-list-meta{color:#6e5938;font:800 9px ui-monospace,monospace;white-space:nowrap}.spellbook-list-row.selected .spellbook-list-meta{color:#ead6a5}.spellbook-list-state{font:900 12px ui-monospace,monospace;color:#557344}.spellbook-list-row.selected .spellbook-list-state{color:#bfe29d}.spellbook-empty{grid-column:1/-1;padding:30px;text-align:center;color:#7a6544}
.spellbook-detail-page{background:linear-gradient(100deg,#e2cb98,#efdfba)}.spellbook-detail{height:100%;overflow:auto;padding:22px 20px;color:#281b0d}.spellbook-detail-kicker{color:#7c6135;font:900 9px ui-monospace,monospace;letter-spacing:.12em}.spellbook-detail h2{margin:5px 0 0;font:700 27px Georgia,"Yu Mincho",serif}.spellbook-detail-en{color:#846b45;font:italic 11px Georgia,serif;margin-bottom:13px}.spellbook-detail-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:5px;margin:10px 0}.spellbook-detail-stats span{padding:6px;border:1px solid #b79a67;border-radius:4px;background:#f8e9c6;font:900 9px ui-monospace,monospace}.spellbook-detail-description{min-height:54px;margin:13px 0;line-height:1.65;font-size:13px}.spellbook-detail-tags{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0 14px}.spellbook-detail-tags span{padding:3px 6px;border:1px solid #b89a69;border-radius:999px;background:#dbc48f;color:#654d2c;font:800 8px ui-monospace,monospace}.spellbook-affinity{margin:10px 0;padding:8px;border-left:3px solid #8262a4;background:#d5c3a0}.spellbook-primary-action button{width:100%;margin:5px 0 12px;background:#49351e;color:#fff0c7;border-color:#866941}.spellbook-detail-upgrades{margin-top:8px;padding-top:10px;border-top:1px solid #a98a58}.spellbook-detail-upgrades h3{margin:0 0 7px;font:900 9px ui-monospace,monospace;letter-spacing:.13em;color:#71582f}.spellbook-detail-upgrade{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 0;border-top:1px dashed #b79b6b}.spellbook-detail-upgrade:first-of-type{border-top:0}.spellbook-detail-upgrade small{display:block;margin-top:2px;color:#6c593b;font-size:10px;line-height:1.35}.spellbook-detail-upgrade button{min-width:72px;margin:0;background:#533d23;color:#ffefc5;border-color:#8b7047}.spellbook-detail button.controller-selected:not(:disabled){outline:3px solid #754fa0;outline-offset:1px}.spellbook-detail-empty{padding:30px;color:#76603b}
.world-village .product-map-region{display:grid;place-items:center;padding:8px 10px}.world-village .product-map-region .canvas-wrap{width:100%;height:100%;max-width:none;display:grid;place-items:center;background:radial-gradient(ellipse at center,#17271e,#07100b 78%)}.world-village .product-map-region canvas.village-map{width:auto;height:auto;max-width:100%;max-height:100%;aspect-ratio:auto;object-fit:contain;border-color:#48604d;box-shadow:0 14px 42px #0009}
@media(max-width:900px){.spellbook-catalog-shell{height:96vh}.spellbook-toolbar{grid-template-columns:1fr 150px}.spellbook-toolbar-hint{display:none}.spellbook-catalog-layout{grid-template-columns:1.35fr 1fr}.spellbook-list{grid-template-columns:1fr}.spellbook-list-meta{font-size:8px}}
@media(max-width:650px){.spellbook-catalog-layout{grid-template-columns:1fr}.spellbook-detail-page{display:none}.spellbook-global-head h2{font-size:20px}.spellbook-head-stats{gap:3px}.spellbook-toolbar{grid-template-columns:1fr}.spellbook-list{grid-template-columns:1fr}}
/* v0.22 village fit correction: always show the complete 31x21 hub inside the map region. */
.world-village .product-map-region canvas.village-map{height:100%;width:auto;max-height:none;max-width:100%;object-fit:contain}
/* Desktop Electron hub: cap by the product-frame vertical budget so no village row is clipped. */
@media(min-width:901px){.world-village .product-map-region canvas.village-map{height:calc(100vh - 180px);width:auto;max-width:100%;max-height:calc(100vh - 180px);aspect-ratio:auto}}

/* v0.23 title / continue / settings / result product flow */
.product-flow-overlay[hidden]{display:none}.product-flow-overlay{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:18px;background:radial-gradient(circle at 50% 35%,#18314ac9 0,#09111bea 42%,#03070bf7 78%),linear-gradient(135deg,#0b1824,#060a10);overflow:auto}.product-flow-overlay::before,.product-flow-overlay::after{content:"";position:fixed;pointer-events:none;border:1px solid #5fbfe326;transform:rotate(45deg)}.product-flow-overlay::before{width:38vmin;height:38vmin;left:-15vmin;top:12vh}.product-flow-overlay::after{width:30vmin;height:30vmin;right:-12vmin;bottom:7vh}.product-flow-panel{position:relative;width:min(700px,94vw);max-height:calc(100vh - 36px);overflow:auto;padding:30px 34px;border:1px solid #385873;border-radius:12px;background:linear-gradient(180deg,#111d29f7,#09121bf9);box-shadow:0 26px 90px #000d,inset 0 1px #ffffff10;color:#dbe8f2}.product-flow-panel::before{content:"";position:absolute;inset:8px;border:1px solid #ffffff08;border-radius:8px;pointer-events:none}.product-flow-kicker{color:#72d1f0;font:900 10px ui-monospace,monospace;letter-spacing:.18em}.product-flow-panel h1,.product-flow-panel h2{position:relative;margin:6px 0 8px;color:#f2f8fc;letter-spacing:.025em}.product-flow-panel h1{font:800 clamp(30px,5vw,52px)/1.05 system-ui,sans-serif}.product-flow-panel h2{font:800 clamp(25px,4vw,38px)/1.1 system-ui,sans-serif}.product-flow-lead{max-width:620px;margin:0 0 22px;color:#9db0c1;font-size:13px;line-height:1.65}.product-flow-actions,.result-bank{display:grid;gap:8px}.product-flow-actions button,.result-bank button,.product-flow-back,.product-setting-row{min-height:52px;border:1px solid #34536c;border-radius:7px;background:linear-gradient(180deg,#142536,#0d1925);color:#dceaf4;text-align:left;padding:10px 13px;box-shadow:inset 0 1px #ffffff0b}.product-flow-actions button span,.result-bank button span{display:block;font:900 12px ui-monospace,monospace;letter-spacing:.06em}.product-flow-actions button small,.result-bank button small{display:block;margin-top:3px;color:#849bad;font-size:10px}.product-flow-actions button:hover,.result-bank button:hover,.product-setting-row:hover,.product-flow-back:hover{border-color:#69bfe3;background:#172d40}.product-flow-actions .product-flow-primary,.result-bank .product-flow-primary{border-color:#4f98b7;background:linear-gradient(180deg,#17415a,#102b3d)}.product-flow-actions button:disabled{opacity:.42;cursor:not-allowed}.product-flow-overlay .controller-selected:not(:disabled){outline:3px solid #8fe4ff;outline-offset:2px;border-color:#b7edff;box-shadow:0 0 24px #52c7f23d,inset 0 1px #ffffff18}.product-flow-seed{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:13px;color:#61788b;font:800 9px ui-monospace,monospace;letter-spacing:.1em}.product-flow-seed input{width:min(250px,60vw);height:32px;margin:0;background:#08111a;color:#bed8e8;border:1px solid #2b465b}.product-flow-footnote{margin-top:12px;text-align:right;color:#536a7c;font:800 8px ui-monospace,monospace;letter-spacing:.07em}.product-settings-list{display:grid;gap:6px}.product-setting-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:18px}.product-setting-row span{display:grid;gap:3px}.product-setting-row b{font-size:12px}.product-setting-row small{color:#849aad;font-size:10px}.product-setting-row strong{color:#82daf5;font:900 11px ui-monospace,monospace;white-space:nowrap}.product-flow-back{width:100%;margin-top:12px;text-align:center;font:900 11px ui-monospace,monospace;letter-spacing:.1em}.result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:18px 0}.result-grid>div{padding:10px;border:1px solid #2b4458;border-radius:6px;background:#09131d}.result-grid span{display:block;color:#70889a;font:800 8px ui-monospace,monospace;letter-spacing:.1em}.result-grid b{display:block;margin-top:4px;color:#e5f3fb;font:900 15px ui-monospace,monospace}.result-cause{margin:0 0 14px;padding:11px 13px;border-left:3px solid #e26f7a;background:#351b22}.result-cause span{display:block;color:#d68b91;font:800 8px ui-monospace,monospace;letter-spacing:.12em}.result-cause b{display:block;margin-top:4px;color:#ffe4e7}.result-section-title{margin:2px 0 5px;color:#89a2b5;font:900 9px ui-monospace,monospace;letter-spacing:.12em}.result-win{border-color:#4c806e}.result-win .product-flow-kicker{color:#7ee7b0}.result-dead{border-color:#714650}.product-flow-blocking .product-frame{filter:saturate(.75) brightness(.55)}
@media(max-width:700px){.product-flow-overlay{padding:8px}.product-flow-panel{width:min(96vw,700px);max-height:calc(100vh - 16px);padding:20px 18px}.result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-flow-lead{margin-bottom:14px}.product-flow-actions button,.result-bank button,.product-setting-row{min-height:48px}.product-setting-row{align-items:flex-start}.product-flow-seed{justify-content:space-between}}
@media(max-height:650px){.product-flow-panel{padding-top:18px;padding-bottom:18px}.product-flow-panel h1{font-size:30px}.product-flow-panel h2{font-size:25px}.product-flow-lead{line-height:1.4;margin-bottom:10px}.product-flow-actions{gap:5px}.product-flow-actions button,.result-bank button,.product-setting-row{min-height:44px;padding:7px 10px}.result-grid{margin:10px 0;gap:5px}.result-grid>div{padding:7px}}

button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[role="dialog"]:focus-visible{outline:2px solid #58a6ff;outline-offset:2px}

.sr-only{
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;border:0!important;
}

/* v0.34 run chronicle result summary */
.product-flow-result-panel{width:min(820px,95vw)}
.result-chronicle{display:grid;gap:10px;margin:0 0 14px;padding:12px;border:1px solid #29455a;border-radius:8px;background:linear-gradient(180deg,#0a1722,#07111a)}
.result-chronicle-header{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding-bottom:8px;border-bottom:1px solid #21394b}
.result-chronicle-header>div{display:grid;gap:2px}.result-chronicle-header span{color:#72d1f0;font:900 8px ui-monospace,monospace;letter-spacing:.15em}.result-chronicle-header b{color:#dcebf4;font-size:12px}.result-chronicle-header code{max-width:55%;overflow-wrap:anywhere;color:#7e99ab;font:800 9px/1.35 ui-monospace,monospace;text-align:right}
.result-chronicle-section{min-width:0}.result-route-trail{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.result-route-trail i{color:#526c7f;font-style:normal;font-size:10px}.result-route-chip{display:inline-flex;gap:4px;align-items:center;padding:4px 7px;border:1px solid #2d4a60;border-radius:999px;background:#0e1d29;color:#b9d3e3;font:800 9px ui-monospace,monospace}.result-route-chip b{color:#77d2ee}
.result-chronicle-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.result-ledger,.result-build{display:grid;gap:4px}.result-ledger-row,.result-build-row{display:grid;grid-template-columns:minmax(56px,.75fr) minmax(82px,1fr) minmax(82px,1fr);gap:6px;align-items:center;padding:6px 7px;border:1px solid #203748;border-radius:5px;background:#08131c}.result-ledger-row>span,.result-build-row>span{color:#7890a2;font:900 8px ui-monospace,monospace;letter-spacing:.08em}.result-ledger-row b{font:900 9px ui-monospace,monospace;text-align:right}.result-source{color:#79d7ac}.result-sink{color:#df8e94}.result-build-row{grid-template-columns:72px minmax(0,1fr)}.result-build-row b{color:#d6e7f2;font-size:10px;line-height:1.35;overflow-wrap:anywhere}.result-empty{color:#6e8597;font-size:10px}
@media(max-width:700px){.result-chronicle-columns{grid-template-columns:1fr}.result-chronicle-header{align-items:flex-start;flex-direction:column}.result-chronicle-header code{max-width:100%;text-align:left}.product-flow-result-panel{width:min(96vw,820px)}}

/* v0.37 Relic Cache */
.hud-relic{font-size:.72rem;letter-spacing:.04em;border-color:#42627b;color:#bdeeff}
.relic-cache-overlay{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;background:rgba(3,9,15,.82);backdrop-filter:blur(2px);padding:24px}
.relic-cache-overlay[hidden]{display:none}
.relic-cache-panel{width:min(1040px,calc(100vw - 48px));max-height:calc(100vh - 48px);overflow:auto;background:#0d1723;border:1px solid #55779b;border-radius:14px;box-shadow:0 24px 80px #000b;padding:20px;color:#dce9f5}
.relic-cache-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;border-bottom:1px solid #344a60;padding-bottom:12px}
.relic-cache-head h2{margin:3px 0 0;font-size:1.65rem;letter-spacing:.04em}.relic-eyebrow,.relic-family{font:700 .7rem ui-monospace,monospace;letter-spacing:.18em;color:#75d9ff}
.relic-slot-row{display:flex;gap:8px}.relic-slot-row button{min-width:150px;text-align:left;background:#0b1520;border:1px solid #3f607b;border-radius:7px;color:#e7f3ff;padding:8px 10px}.relic-slot-row button small,.relic-slot-row button strong{display:block}.relic-slot-row button.selected{outline:2px solid #7edcff;box-shadow:0 0 0 3px #16394a}
.relic-cache-copy{color:#91a6ba;font-size:.85rem}.relic-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.relic-card{min-height:245px;background:#18283a;border:1px solid #35536e;border-radius:10px;padding:15px;display:flex;flex-direction:column}.relic-card.selected{outline:2px solid #83dcff;box-shadow:0 0 0 4px #173b4e}.relic-card h3{font-size:1.35rem;margin:7px 0 12px}.relic-card b{font-size:.82rem}.relic-card p{margin:4px 0 10px;color:#bacadb;font-size:.83rem;line-height:1.45}.relic-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;margin-bottom:12px}.relic-tags span{border:1px solid #46708a;border-radius:999px;padding:2px 7px;font:700 .66rem ui-monospace,monospace;color:#bce9ff}.relic-card button{background:#17283a;border:1px solid #67bce9;color:#eaf7ff;border-radius:5px;padding:9px}.relic-cache-footer{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font:700 .68rem ui-monospace,monospace;color:#7895ad}.relic-cache-footer button{background:#2b3238;color:#edf3f7;border:1px solid #596168;border-radius:6px;padding:8px 12px}
@media(max-width:780px){.relic-cache-head{align-items:flex-start;flex-direction:column}.relic-choice-grid{grid-template-columns:1fr}.relic-slot-row{width:100%}.relic-slot-row button{flex:1;min-width:0}}

/* v0.39 Android Web/PWA mobile shell */
.title-input-badges{display:flex;flex-wrap:wrap;gap:6px;margin:-8px 0 18px}.title-input-badges span{padding:4px 7px;border:1px solid #31556d;border-radius:999px;background:#0b1722;color:#84d8f5;font:800 9px ui-monospace,monospace;letter-spacing:.08em}.product-flow-status{margin:10px 0;padding:9px 11px;border:1px solid #33566d;border-radius:6px;background:#0b1823;color:#abd9ec;font-size:11px;line-height:1.45}.howto-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.howto-grid section{padding:13px;border:1px solid #2d475c;border-radius:7px;background:#0a151f}.howto-grid b{color:#dff4ff;font:900 11px ui-monospace,monospace;letter-spacing:.08em}.howto-grid p{margin:7px 0 0;color:#9fb3c3;font-size:11px;line-height:1.65}.howto-grid strong{color:#8cdef6}

.movement-pad-wrap{display:grid;gap:6px;justify-items:center;align-content:center;min-width:176px}.virtual-stick{display:none;width:168px;height:168px;position:relative;place-items:center;touch-action:none;overscroll-behavior:none;-webkit-tap-highlight-color:transparent}.virtual-stick-ring{width:150px;height:150px;border-radius:50%;display:grid;place-items:center;border:2px solid #49667d;background:radial-gradient(circle,#172b3b 0 24%,#0c1721 25% 58%,#162534 59% 62%,#081018 63%);box-shadow:inset 0 0 25px #0009,0 7px 24px #0008}.virtual-stick-ring::before,.virtual-stick-ring::after{content:"";position:absolute;background:#5c7b9038;pointer-events:none}.virtual-stick-ring::before{width:2px;height:126px}.virtual-stick-ring::after{width:126px;height:2px}.virtual-stick-knob{width:58px;height:58px;border-radius:50%;border:2px solid #86dfff;background:radial-gradient(circle at 35% 30%,#4a7b96,#173247 68%);box-shadow:0 5px 16px #000a,inset 0 1px #ffffff28;transition:transform .035s linear;pointer-events:none;z-index:2}.virtual-stick small{position:absolute;bottom:0;color:#7090a5;font:800 8px ui-monospace,monospace;letter-spacing:.1em}.touch-pad-toggle{width:100%;min-height:32px!important;padding:4px 7px!important;margin:0!important;border-color:#36536a!important;color:#87cfe9!important;background:#0a151f!important;font:900 9px ui-monospace,monospace!important;letter-spacing:.07em}.touch-controller[data-pad-style="stick"] .dpad{display:none}.touch-controller[data-pad-style="stick"] .virtual-stick{display:grid}.touch-controller[data-pad-style="dpad"] .virtual-stick{display:none}

@media(pointer:coarse){
  html,body{width:100%;min-height:100%;overscroll-behavior:none;background:#05090d}
  body.product-ui{min-height:100dvh}
  .product-frame{min-height:100dvh;padding-bottom:calc(206px + env(safe-area-inset-bottom))}
  .product-header{padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left));min-height:45px}
  .product-brand h1{font-size:14px}.product-brand small{font-size:8px}
  .product-header-actions{gap:4px}.spellbook-button,.product-system-menu summary{min-height:38px!important;padding:5px 8px!important;font-size:10px!important}
  .product-hud{min-height:36px;padding:4px 7px;gap:6px;font-size:10px;overflow-x:auto;scrollbar-width:none}.product-hud::-webkit-scrollbar{display:none}.hud-chip{flex:0 0 auto;padding:3px 5px}.hud-route{margin-left:0;white-space:nowrap}
  .product-shell{min-height:0;height:auto}.product-map-region{padding:4px 4px 0}.product-map-region .canvas-wrap{width:100%;max-height:none;overflow:hidden}.product-map-region canvas{width:100%;max-height:calc(100dvh - 294px);object-fit:contain}
  .product-map-region>.touch-controller{display:grid;position:fixed;left:0;right:0;bottom:0;z-index:50;grid-template-columns:180px minmax(0,1fr);gap:7px;align-items:center;margin:0;padding:7px max(7px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));border-radius:12px 12px 0 0;border-left:0;border-right:0;border-bottom:0;background:linear-gradient(180deg,#0a121bea,#05090df8);backdrop-filter:blur(10px);box-shadow:0 -12px 38px #000b}
  .movement-pad-wrap{min-width:172px}.dpad{grid-template-columns:52px 52px 52px;grid-template-rows:52px 52px 52px;gap:3px}.dpad button{min-width:52px;min-height:52px;font-size:20px;border-radius:9px;background:#122130;border-color:#3e566a}.dpad-center{font-size:15px!important;color:#8fdcf5!important}
  .touch-actions{grid-template-columns:repeat(4,minmax(62px,1fr));gap:5px}.touch-actions button{min-height:46px;padding:5px 4px;font-size:11px;border-radius:8px}.touch-cancel{grid-column:span 1}.touch-mode{min-height:46px;font-size:9px}.touch-help{display:none}
  .action-sidebar{z-index:70;top:52px;bottom:calc(8px + env(safe-area-inset-bottom));right:6px;width:min(390px,94vw)}
  .product-footer{display:none}
  .target-prompt{font-size:9px}
}

@media(pointer:coarse) and (orientation:portrait){
  .product-frame{padding-bottom:calc(226px + env(safe-area-inset-bottom))}
  .product-brand small{display:none}.product-map-region canvas{max-height:calc(100dvh - 318px)}
  .product-map-region>.touch-controller{grid-template-columns:168px minmax(0,1fr);padding-top:6px}.movement-pad-wrap{min-width:162px}.dpad{grid-template-columns:48px 48px 48px;grid-template-rows:48px 48px 48px}.dpad button{min-width:48px;min-height:48px}.virtual-stick{width:154px;height:154px}.virtual-stick-ring{width:140px;height:140px}.touch-actions{grid-template-columns:repeat(2,minmax(66px,1fr))}.touch-actions button{min-height:45px}.quick-spell{font-size:10px!important}
}

@media(pointer:coarse) and (orientation:landscape) and (max-height:620px){
  .product-frame{padding-bottom:calc(172px + env(safe-area-inset-bottom))}.product-header{min-height:40px;padding-top:3px;padding-bottom:3px}.product-brand h1{font-size:12px}.product-hud{min-height:31px}
  .product-map-region canvas{max-height:calc(100dvh - 248px);width:auto;max-width:100%}
  .product-map-region>.touch-controller{grid-template-columns:172px minmax(0,1fr);padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom))}.movement-pad-wrap{grid-template-columns:150px 1fr;min-width:170px;gap:3px}.touch-pad-toggle{grid-column:1/-1}.dpad{grid-template-columns:46px 46px 46px;grid-template-rows:46px 46px 46px}.dpad button{min-width:46px;min-height:46px}.virtual-stick{width:145px;height:145px}.virtual-stick-ring{width:132px;height:132px}.virtual-stick-knob{width:52px;height:52px}.touch-actions{grid-template-columns:repeat(4,minmax(58px,1fr));gap:4px}.touch-actions button,.touch-mode{min-height:41px;font-size:10px}.product-flow-panel{max-height:96dvh}.product-flow-actions{grid-template-columns:1fr 1fr}.product-flow-actions button{min-height:46px}
}

@media(max-width:700px){.howto-grid{grid-template-columns:1fr}.title-input-badges{margin-bottom:12px}.product-flow-title-panel .product-flow-actions{gap:6px}}
@media(max-width:430px){.product-header-actions .spellbook-button{font-size:0!important}.product-header-actions .spellbook-button::after{content:"SPELL";font-size:9px}.product-system-menu summary{font-size:0!important}.product-system-menu summary::after{content:"MENU";font-size:9px}.product-hud{gap:4px}.hud-chip{font-size:9px}}

/* v0.39 coarse-pointer sidebar overflow guard */
@media (pointer: coarse) {
  .action-sidebar { width: auto; }
}
@media (pointer: coarse) and (max-width: 900px) {
  .action-sidebar { width: min(390px, 94vw); }
}

/* Prevent transformed off-canvas gameplay UI from widening the PWA title viewport. */
html, body { overflow-x: clip; }

/* Keep compact Android header actions on the same row as the title. */
@media (pointer: coarse) and (max-width: 620px) {
  .product-header { flex-direction: row; align-items: center; }
}

/* v0.40 — free dungeon selection, persistent message log and touch spell targeting */
.message-panel{position:relative;z-index:2;width:min(100%,860px);margin:7px auto 0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start;min-height:48px;max-height:76px;padding:7px 9px;border:1px solid #32495d;border-radius:8px;background:linear-gradient(180deg,#0c1721f2,#081018f7);box-shadow:0 7px 24px #0008;color:#c8d6e2;overflow:hidden}
.message-panel-head{padding:3px 6px;border:1px solid #34586f;border-radius:5px;background:#102535;color:#78d9f5;font:900 8px ui-monospace,monospace;letter-spacing:.12em}
.message-panel .product-log{max-height:61px;overflow:hidden;font:11px/1.35 ui-monospace,monospace;color:#9eb0bf}
.message-panel .product-log>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.message-panel .product-log .log-latest{color:#edf7ff;font-weight:800}
.footer-status{color:#657d90;font:800 9px ui-monospace,monospace;letter-spacing:.08em}
.spell-target-hud{position:absolute;left:8px;top:8px;right:8px;z-index:4;padding:8px 10px;border:1px solid #4c91b8;border-radius:7px;background:linear-gradient(180deg,#0c2030ef,#07131def);box-shadow:0 7px 24px #0009;color:#dff5ff;pointer-events:none;backdrop-filter:blur(4px)}
.spell-target-hud[hidden]{display:none}.spell-target-hud.invalid{border-color:#8d5156;background:linear-gradient(180deg,#2a151bef,#140b0fef)}
.spell-target-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.spell-target-title b{font-size:12px}.spell-target-title span{font:800 9px ui-monospace,monospace;color:#8edcff;white-space:nowrap}.spell-target-hud.invalid .spell-target-title span{color:#ffaaa6}
.spell-target-desc{margin-top:3px;color:#adc0cf;font-size:10px;line-height:1.35}.spell-target-state{display:flex;justify-content:space-between;gap:9px;margin-top:5px;padding-top:5px;border-top:1px solid #ffffff14;font:800 9px ui-monospace,monospace}.spell-target-state strong{color:#9aefbe}.spell-target-hud.invalid .spell-target-state strong{color:#ff9b97}.spell-target-state span{color:#8aa0b2;text-align:right}
.target-confirm{border-color:#7bd7f5!important;background:linear-gradient(180deg,#194a60,#103447)!important;color:#effbff!important;box-shadow:0 0 0 1px #8ce2ff33,inset 0 1px #ffffff18!important}

.product-flow-dungeon-panel{width:min(880px,96vw)}
.dungeon-select-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:min(58vh,520px);overflow:auto;padding:2px}
.dungeon-select-card{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:center;min-height:72px;padding:9px 11px;border:1px solid #304b60;border-radius:8px;background:linear-gradient(180deg,#132433,#0c1924);color:#dce9f3;text-align:left}
.dungeon-select-card:hover,.dungeon-select-card.controller-selected{border-color:#75d7f8;background:linear-gradient(180deg,#193349,#102638)}.dungeon-select-number{display:grid;place-items:center;width:34px;height:34px;border:1px solid #40637c;border-radius:50%;color:#81d9f4;font:900 10px ui-monospace,monospace}.dungeon-select-card b{display:block;font-size:12px}.dungeon-select-card small{display:block;margin-top:3px;color:#859bad;font-size:9px;line-height:1.35}.dungeon-select-card strong{color:#78d8f7;font:900 9px ui-monospace,monospace;letter-spacing:.08em}

/* Mobile message panel remains visible: unlike the former footer it is part of the tactical view. */
@media(pointer:coarse){
  .message-panel{width:100%;margin:4px 0 0;min-height:46px;max-height:62px;padding:5px 7px;gap:6px;border-radius:6px}
  .message-panel .product-log{max-height:48px;font-size:9.5px}.message-panel .product-log>div:nth-child(n+4){display:none}
  .message-panel-head{font-size:7px;padding:3px 4px}
  .spell-target-hud{padding:6px 8px}.spell-target-desc{font-size:9px}.spell-target-title b{font-size:11px}.spell-target-state{font-size:8px}
}

/* Portrait: reserve the bottom touch deck, but keep a visible map + message strip above it. */
@media(pointer:coarse) and (orientation:portrait){
  .product-map-region{justify-content:flex-start!important;overflow:hidden!important}
  .product-map-region .canvas-wrap{flex:0 1 auto}
  .product-map-region canvas{max-height:calc(100dvh - 374px)!important;min-height:180px;object-fit:contain}
}

/* Landscape Android: field first. Controls sit in side gutters instead of covering the map. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:620px){
  html,body,.product-ui{height:100dvh!important;overflow:hidden!important}
  .product-frame{height:100dvh!important;min-height:100dvh!important;padding-bottom:0!important;grid-template-rows:31px minmax(0,1fr)!important}
  .product-header{display:none!important}
  .product-hud{grid-row:1;height:31px!important;min-height:31px!important;padding:2px 154px 2px 154px!important;gap:4px!important;font-size:9px!important;overflow:hidden!important}
  .hud-meter{height:25px!important;min-width:108px!important;padding:2px 5px!important;gap:4px!important}.hud-meter-label{font-size:9px!important;min-width:48px!important}.hud-chip{min-height:25px!important;padding:2px 5px!important;font-size:8px!important}.hud-relic{display:none!important}.hud-route{font-size:8px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .product-shell{grid-row:2;height:100%!important;min-height:0!important;display:block!important;overflow:hidden!important;position:relative!important}
  .product-map-region{position:absolute!important;inset:0!important;height:auto!important;min-height:0!important;padding:4px 154px 4px 154px!important;border:0!important;display:grid!important;grid-template-rows:minmax(0,1fr) auto!important;align-items:center!important;justify-items:center!important;overflow:hidden!important}
  .product-map-region .canvas-wrap{width:100%!important;max-width:100%!important;max-height:100%!important;min-height:0!important;align-self:stretch!important;display:grid!important;place-items:center!important}
  .product-map-region canvas{width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;min-height:0!important;aspect-ratio:21/13!important;object-fit:contain!important}
  .message-panel{width:100%!important;min-height:40px!important;max-height:46px!important;margin:3px 0 0!important;padding:4px 6px!important}.message-panel .product-log{max-height:36px!important;font-size:9px!important}.message-panel .product-log>div:nth-child(n+3){display:none!important}
  .product-map-region>.touch-controller{position:fixed!important;inset:31px 0 0!important;display:block!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;pointer-events:none!important;z-index:55!important}
  .movement-pad-wrap{position:absolute!important;left:5px!important;bottom:5px!important;width:144px!important;min-width:144px!important;display:grid!important;grid-template-columns:1fr!important;gap:4px!important;pointer-events:auto!important;background:#071019dd!important;border:1px solid #29465a!important;border-radius:10px!important;padding:5px!important;box-shadow:0 8px 28px #000b!important}
  .dpad{grid-template-columns:42px 42px 42px!important;grid-template-rows:42px 42px 42px!important;gap:3px!important}.dpad button{min-width:42px!important;min-height:42px!important;font-size:17px!important;border-radius:7px!important}.dpad-center{font-size:12px!important}
  .virtual-stick{width:132px!important;height:132px!important}.virtual-stick-ring{width:120px!important;height:120px!important}.virtual-stick-knob{width:48px!important;height:48px!important}.virtual-stick small{display:none!important}.touch-pad-toggle{min-height:27px!important;font-size:8px!important}
  .touch-actions{position:absolute!important;right:5px!important;bottom:5px!important;width:144px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;padding:5px!important;pointer-events:auto!important;background:#071019dd!important;border:1px solid #29465a!important;border-radius:10px!important;box-shadow:0 8px 28px #000b!important}.touch-actions button,.touch-mode{min-height:34px!important;padding:3px!important;font-size:8.5px!important;border-radius:6px!important}.touch-mode{display:grid!important;place-items:center!important}.quick-spell{font-size:8px!important}.touch-help{display:none!important}
  .action-sidebar{position:fixed!important;top:35px!important;bottom:5px!important;right:5px!important;width:min(340px,62vw)!important;max-height:none!important;z-index:75!important;transform:translateX(calc(100% + 20px))!important;transition:transform .12s ease!important}
  .focus-sidebar .action-sidebar{transform:translateX(0)!important}.focus-map .action-sidebar{transform:translateX(calc(100% + 20px))!important}
  .product-footer{display:none!important}.map-legend{display:none!important}.target-prompt{bottom:6px!important;font-size:8px!important;max-width:calc(100% - 12px)!important}
  .spell-target-hud{left:5px!important;right:5px!important;top:5px!important;padding:5px 7px!important}.spell-target-desc{display:block!important;font-size:7.5px!important;line-height:1.15!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.spell-target-state{font-size:7.5px!important}
}

@media(max-width:700px){.dungeon-select-grid{grid-template-columns:1fr}.product-flow-dungeon-panel{width:min(96vw,620px)}}

/* v0.41 — landscape-only tactical surface, tap inspection, learned-spell dock */
.landscape-gate{display:none}
.tap-inspect-panel,.quick-spell-dock{display:none}

@media (orientation:portrait) and (max-width:900px){
  html,body{width:100%;height:100dvh;overflow:hidden!important;background:#03070b!important}
  .landscape-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 50% 35%,#18314a 0,#07111b 55%,#020508 100%);color:#e8f6ff;text-align:center}
  .landscape-gate>div{display:grid;gap:10px;max-width:360px;padding:24px;border:1px solid #47738e;border-radius:14px;background:#07121ddb;box-shadow:0 20px 70px #000c}
  .landscape-gate strong{font-size:22px;letter-spacing:.04em}.landscape-gate span{color:#91aabd;font-size:12px;line-height:1.6}
  .product-frame,.product-flow-overlay,.relic-cache-overlay,#spellBook{visibility:hidden!important;pointer-events:none!important}
}

@media(pointer:coarse) and (orientation:landscape) and (max-height:700px){
  html,body,.product-ui{height:100dvh!important;min-height:100dvh!important;overflow:hidden!important}
  .landscape-gate{display:none!important}
  .product-frame{height:100dvh!important;min-height:100dvh!important;padding:0!important;grid-template-rows:31px minmax(0,1fr)!important}
  .product-header{display:none!important}
  .product-hud{grid-row:1;height:31px!important;min-height:31px!important;padding:2px 210px 2px 150px!important;gap:4px!important;font-size:9px!important;overflow:hidden!important}
  .hud-meter{height:25px!important;min-width:104px!important;padding:2px 5px!important;gap:4px!important}.hud-meter-label{font-size:9px!important;min-width:46px!important}.hud-chip{min-height:25px!important;padding:2px 5px!important;font-size:8px!important}.hud-relic{display:none!important}.hud-route{font-size:8px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .product-shell{grid-row:2;height:100%!important;min-height:0!important;display:block!important;overflow:hidden!important;position:relative!important}
  .product-map-region{position:absolute!important;inset:0!important;min-height:0!important;padding:4px 210px 4px 150px!important;border:0!important;display:grid!important;grid-template-rows:minmax(0,1fr) 40px!important;align-items:center!important;justify-items:center!important;overflow:hidden!important}
  .product-map-region .canvas-wrap{width:100%!important;height:100%!important;min-height:0!important;max-width:100%!important;max-height:100%!important;display:grid!important;place-items:center!important;overflow:hidden!important}
  .product-map-region canvas{width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;min-height:0!important;aspect-ratio:21/13!important;object-fit:contain!important}
  .message-panel{width:100%!important;height:38px!important;min-height:38px!important;max-height:38px!important;margin:2px 0 0!important;padding:3px 6px!important;gap:5px!important;border-radius:6px!important}.message-panel .product-log{max-height:30px!important;font-size:8.5px!important;line-height:1.25!important}.message-panel .product-log>div:nth-child(n+3){display:none!important}.message-panel-head{font-size:6.5px!important;padding:2px 4px!important}
  .product-map-region>.touch-controller{position:fixed!important;inset:31px 0 0!important;display:block!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;pointer-events:none!important;z-index:55!important}
  .movement-pad-wrap{position:absolute!important;left:5px!important;bottom:5px!important;width:140px!important;min-width:140px!important;display:grid!important;grid-template-columns:1fr!important;gap:4px!important;pointer-events:auto!important;background:#071019e8!important;border:1px solid #29465a!important;border-radius:10px!important;padding:5px!important;box-shadow:0 8px 28px #000b!important}
  .dpad{grid-template-columns:40px 40px 40px!important;grid-template-rows:40px 40px 40px!important;gap:3px!important}.dpad button{min-width:40px!important;min-height:40px!important;font-size:16px!important;border-radius:7px!important}.dpad-center{font-size:11px!important}.virtual-stick{width:128px!important;height:128px!important}.virtual-stick-ring{width:116px!important;height:116px!important}.virtual-stick-knob{width:46px!important;height:46px!important}.virtual-stick small{display:none!important}.touch-pad-toggle{min-height:25px!important;font-size:7.5px!important}
  .touch-actions{position:absolute!important;right:5px!important;bottom:5px!important;width:200px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important;padding:5px!important;pointer-events:auto!important;background:#071019e8!important;border:1px solid #29465a!important;border-radius:10px!important;box-shadow:0 8px 28px #000b!important}.touch-actions button,.touch-mode{min-height:29px!important;padding:2px 3px!important;font-size:8px!important;border-radius:6px!important}.touch-mode{display:grid!important;place-items:center!important}.touch-help{display:none!important}.touch-cancel{grid-column:auto!important}

  .tap-inspect-panel{position:fixed;display:block!important;z-index:58;top:35px;right:5px;width:200px;height:108px;overflow:auto;padding:6px;border:1px solid #35556d;border-radius:8px;background:linear-gradient(180deg,#0a1823f4,#061019f7);box-shadow:0 8px 24px #000a;color:#cfe0eb;pointer-events:auto;scrollbar-width:thin}
  .tap-inspect-head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:4px;border-bottom:1px solid #294154}.tap-inspect-head b{font-size:10px;color:#ecf7fd}.tap-inspect-head span{font:700 7px ui-monospace,monospace;color:#7190a5;white-space:nowrap}
  .tap-inspect-empty{display:grid;gap:4px;place-content:center;height:100%;min-height:34px;text-align:center;color:#7590a3;font-size:8px}.tap-inspect-empty b{color:#9edfff;font:900 9px ui-monospace,monospace;letter-spacing:.1em}
  .inspect-block{display:grid;gap:2px;padding:4px 0;border-top:1px solid #1b3445}.inspect-block:first-of-type{border-top:0}.inspect-block b{font-size:9px;color:#edf7ff}.inspect-block span{font:800 7px ui-monospace,monospace;color:#7bd7f5}.inspect-block small{font-size:7.5px;line-height:1.25;color:#91a9ba}.inspect-enemy span{color:#ffaaa6}.inspect-ally span{color:#9aefbe}.inspect-item span{color:#f0d37b}.inspect-orb span{color:#d7b7ff}.inspect-hazard span{color:#ff9b7b}.inspect-ruin span{color:#e2b36e}

  .quick-spell-dock{position:fixed;display:block!important;z-index:58;top:147px;right:5px;width:200px;height:76px;overflow:hidden;padding:5px;border:1px solid #3b4f6e;border-radius:8px;background:linear-gradient(180deg,#0c1524f4,#070e18f7);box-shadow:0 8px 24px #000a;pointer-events:auto}
  .quick-spell-head{height:17px;display:flex;align-items:center;justify-content:space-between;gap:5px;color:#b6c9d8}.quick-spell-head b{font:900 8px ui-monospace,monospace;letter-spacing:.08em;color:#d9c6ff}.quick-spell-head span{font-size:6.5px;color:#72899c}.quick-spell-list{height:49px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;overflow-y:auto;scrollbar-width:thin}.quick-spell-entry{min-height:22px!important;margin:0!important;padding:2px 4px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:3px;align-items:center;text-align:left;border-color:#3e3856!important;background:#151324!important;font-size:7.5px!important;line-height:1!important}.quick-spell-entry span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quick-spell-entry small{font:700 6.5px ui-monospace,monospace;color:#9a8db9;white-space:nowrap}.quick-spell-entry.selected{border-color:#b18df1!important;background:#2a2042!important;box-shadow:0 0 0 1px #caa7ff44}.quick-spell-empty{display:grid;place-items:center;height:45px;color:#667d90;font-size:7px}

  .action-sidebar{position:fixed!important;top:35px!important;bottom:5px!important;right:5px!important;width:min(370px,68vw)!important;max-height:none!important;z-index:75!important;transform:translateX(calc(100% + 20px))!important;transition:transform .12s ease!important}.focus-sidebar .action-sidebar{transform:translateX(0)!important}.focus-map .action-sidebar{transform:translateX(calc(100% + 20px))!important}
  .product-footer{display:none!important}.map-legend{display:none!important}.target-prompt{bottom:5px!important;font-size:7.5px!important;max-width:calc(100% - 10px)!important}
  .spell-target-hud{left:5px!important;right:5px!important;top:5px!important;padding:5px 7px!important}.spell-target-desc{display:block!important;font-size:7.5px!important;line-height:1.15!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.spell-target-state{font-size:7.5px!important}
}

/* v0.42 — fullscreen Spell Book mode + collision-proof landscape action rail */
body.spellbook-open .product-frame{visibility:hidden!important;pointer-events:none!important}
body.spellbook-open #spellBook{visibility:visible!important;pointer-events:auto!important}
#spellBook{z-index:10050}
.quick-book-button{margin:0!important;min-height:18px!important;padding:2px 7px!important;border:1px solid #7863a0!important;border-radius:5px!important;background:#2a2140!important;color:#eadcff!important;font:900 7px ui-monospace,monospace!important;letter-spacing:.08em}
.quick-book-button:active{background:#42335f!important}

@media(pointer:coarse) and (orientation:landscape) and (max-height:700px){
  /* The Spell Book owns the entire landscape viewport. Gameplay controls are hidden by body.spellbook-open. */
  #spellBook{inset:0!important;width:100vw!important;height:100dvh!important;padding:0!important;place-items:stretch!important;background:#1d160e!important;overflow:hidden!important}
  #spellBook .spellbook-catalog-shell{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;grid-template-rows:auto auto minmax(0,1fr)!important}
  #spellBook .spellbook-global-head{min-height:49px!important;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left))!important}
  #spellBook .spellbook-global-head h2{font-size:22px!important;line-height:1!important}
  #spellBook .spellbook-eyebrow{font-size:7px!important}
  #spellBook .spellbook-head-stats{gap:5px!important}
  #spellBook .spellbook-head-stats .spellbook-sp,#spellBook .spellbook-owned-summary{padding:4px 6px!important;font-size:8px!important}
  #spellBook #spellBookClose{min-height:30px!important;padding:4px 10px!important;font-size:9px!important}
  #spellBook .spellbook-toolbar{min-height:45px!important;grid-template-columns:minmax(180px,1fr) 150px!important;gap:7px!important;padding:4px max(9px,env(safe-area-inset-right)) 5px max(9px,env(safe-area-inset-left))!important}
  #spellBook .spellbook-toolbar-hint{display:none!important}
  #spellBook .spellbook-toolbar label{font-size:7px!important}
  #spellBook .spellbook-toolbar .spellbook-search,#spellBook .spellbook-toolbar .spellbook-category{height:28px!important;margin-top:2px!important;padding:3px 6px!important;font-size:10px!important}
  #spellBook .spellbook-catalog-layout{height:100%!important;min-height:0!important;grid-template-columns:minmax(0,1.45fr) minmax(280px,.85fr)!important;overflow:hidden!important}
  #spellBook .spellbook-catalog-page,#spellBook .spellbook-detail-page{height:100%!important;min-height:0!important;overflow:hidden!important}
  #spellBook .spellbook-section-title{min-height:28px!important;padding:5px 8px!important;gap:8px!important}
  #spellBook .spellbook-section-title b{font-size:8px!important}#spellBook .spellbook-section-title small{font-size:8px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #spellBook .spellbook-list{height:100%!important;min-height:0!important;overflow-y:auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(40px,auto)!important;gap:4px!important;padding:5px!important}
  #spellBook .spellbook-list-row{min-height:40px!important;padding:4px 5px!important;grid-template-columns:20px minmax(0,1fr) auto 14px!important;gap:4px!important}
  #spellBook .spellbook-list-icon{font-size:14px!important}#spellBook .spellbook-list-copy strong{font-size:10px!important}#spellBook .spellbook-list-copy small{font-size:6.5px!important}#spellBook .spellbook-list-meta{font-size:7px!important}#spellBook .spellbook-list-state{font-size:9px!important}
  #spellBook .spellbook-detail{height:100%!important;min-height:0!important;overflow-y:auto!important;padding:10px 12px max(10px,env(safe-area-inset-bottom)) 12px!important}
  #spellBook .spellbook-detail-kicker{font-size:7px!important}#spellBook .spellbook-detail h2{font-size:21px!important;margin-top:3px!important}#spellBook .spellbook-detail-en{font-size:8px!important;margin-bottom:6px!important}
  #spellBook .spellbook-detail-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:3px!important;margin:5px 0!important}#spellBook .spellbook-detail-stats span{padding:4px!important;font-size:7px!important}
  #spellBook .spellbook-detail-description{min-height:0!important;margin:7px 0!important;font-size:10px!important;line-height:1.4!important}#spellBook .spellbook-detail-tags{margin:5px 0 7px!important;gap:3px!important}#spellBook .spellbook-detail-tags span{padding:2px 4px!important;font-size:6.5px!important}
  #spellBook .spellbook-primary-action button{min-height:30px!important;margin:3px 0 6px!important;padding:4px 6px!important;font-size:9px!important}
  #spellBook .spellbook-detail-upgrades{margin-top:4px!important;padding-top:6px!important}#spellBook .spellbook-detail-upgrades h3{font-size:7px!important;margin-bottom:3px!important}#spellBook .spellbook-detail-upgrade{padding:5px 0!important;gap:5px!important}#spellBook .spellbook-detail-upgrade small{font-size:7.5px!important;line-height:1.25!important}#spellBook .spellbook-detail-upgrade button{min-width:58px!important;min-height:28px!important;padding:3px 5px!important;font-size:8px!important}

  /* Fixed vertical bands: LOOK 35-139, QUICK SPELL 143-223, ACTIONS 227-bottom. */
  .tap-inspect-panel{top:35px!important;height:104px!important}
  .quick-spell-dock{top:143px!important;height:80px!important}
  .quick-spell-head{height:18px!important}.quick-spell-head b{font-size:8px!important}.quick-spell-list{height:calc(100% - 20px)!important}.quick-spell-empty{height:calc(100% - 20px)!important}
  .quick-book-button{min-height:16px!important;height:16px!important;padding:0 6px!important;font-size:6.5px!important}
  .touch-actions{top:196px!important;bottom:5px!important;height:auto!important;min-height:0!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;overflow:hidden!important}
  .touch-actions button,.touch-actions .touch-mode{min-height:0!important;height:auto!important;padding:2px 3px!important;font-size:7.5px!important;line-height:1.05!important}
}

/* v0.43 — unobstructed landscape HUD, attribute Spell Book, floor-bonus inspection */
.status-dock{display:none}
.inspect-bonus span{color:#ffd77f!important}
.spellbook-attribute-pages{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;padding:7px 10px;background:#d9c18e;border-bottom:1px solid #8f7444}
.spellbook-attribute-pages button{min-width:0;min-height:38px;margin:0;padding:4px 3px;display:grid;place-items:center;gap:1px;border:1px solid #a98b58;border-radius:5px;background:#f3e0b4;color:#513b1e;font:900 8px ui-monospace,monospace;line-height:1}
.spellbook-attribute-pages button span{font-size:14px}.spellbook-attribute-pages button b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spellbook-attribute-pages button.active{border-color:#5b4123;background:#4a3822;color:#fff0c4;box-shadow:inset 0 0 0 1px #d3ae65}
.spellbook-menu-button{background:#5b3527!important;border-color:#95624e!important}.spellbook-detail-stats .spellbook-base-damage{grid-column:span 2}
.status-dock-equip{display:grid;grid-template-columns:1fr;gap:3px;margin-top:4px}.status-dock-equip button{width:100%;min-width:0;margin:0;padding:3px 4px;text-align:left;border:1px solid #30475a;border-radius:5px;background:#0c1721;color:#bbccda;font:800 7px ui-monospace,monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-dock-equip button:active{border-color:#79c0ff;background:#16293a}.status-dock-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin-top:3px}.status-dock-meta span{padding:2px 3px;border:1px solid #263e50;border-radius:4px;background:#07121b;color:#9fb4c5;font:800 7px ui-monospace,monospace;text-align:center}

@media(pointer:coarse) and (orientation:landscape) and (max-height:700px){
  /* Remove the old horizontal HUD entirely: the playfield owns the full viewport. */
  .product-frame{height:100dvh!important;min-height:100dvh!important;display:block!important;padding:0!important;overflow:hidden!important}
  .product-header,.product-hud,.product-footer{display:none!important}
  .product-shell{position:relative!important;display:block!important;width:100vw!important;height:100dvh!important;min-height:0!important;overflow:hidden!important}
  .product-map-region{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;padding:4px 210px 4px 150px!important;display:grid!important;grid-template-rows:minmax(0,1fr) 40px!important;align-items:center!important;justify-items:center!important;border:0!important;overflow:hidden!important}
  .product-map-region>.touch-controller{inset:0!important}

  /* Compact vertical player dock; no top bar across the field. */
  .status-dock{position:fixed!important;display:block!important;z-index:59!important;left:5px!important;top:5px!important;width:140px!important;max-height:116px!important;overflow:auto!important;padding:5px!important;border:1px solid #35556d!important;border-radius:8px!important;background:linear-gradient(180deg,#0b1824f2,#071019f5)!important;box-shadow:0 8px 24px #0009!important;pointer-events:auto!important;scrollbar-width:thin!important}
  .status-dock .hud-meter{height:22px!important;min-width:0!important;width:100%!important;margin:0 0 3px!important;padding:2px 4px!important;gap:3px!important}.status-dock .hud-meter-label{min-width:40px!important;font-size:7.5px!important}.status-dock .hud-meter-track{height:5px!important}.status-dock .hud-chip{min-height:0!important;padding:2px 3px!important;font-size:7px!important}

  /* Left pad starts below the status dock and never covers it. */
  .movement-pad-wrap{top:125px!important;bottom:5px!important;height:auto!important;align-content:end!important}

  /* Right rail is three non-overlapping vertical bands. */
  .tap-inspect-panel{top:5px!important;height:104px!important}
  .quick-spell-dock{top:113px!important;height:80px!important}
  .touch-actions{top:197px!important;bottom:5px!important;height:auto!important;min-height:0!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;overflow:hidden!important}
  .touch-actions button,.touch-actions .touch-mode{min-height:0!important;height:auto!important;padding:2px 3px!important;font-size:7.5px!important;line-height:1.05!important}
  .touch-menu{border-color:#73504d!important;color:#ffd6c9!important;background:#271717!important}

  /* Fullscreen attribute-paged Spell Book. */
  #spellBook .spellbook-catalog-shell{grid-template-rows:auto auto minmax(0,1fr)!important}
  #spellBook .spellbook-global-head{min-height:45px!important;padding:5px max(8px,env(safe-area-inset-right)) 5px max(8px,env(safe-area-inset-left))!important}
  #spellBook .spellbook-global-head h2{font-size:20px!important}
  #spellBook .spellbook-head-stats{gap:4px!important}
  #spellBook #spellBookMenu,#spellBook #spellBookClose{min-height:29px!important;padding:3px 8px!important;font-size:8px!important}
  #spellBook .spellbook-attribute-pages{height:44px!important;min-height:44px!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:3px!important;padding:4px max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left))!important;overflow:hidden!important}
  #spellBook .spellbook-attribute-pages button{min-height:34px!important;height:34px!important;padding:2px!important;font-size:6.5px!important}
  #spellBook .spellbook-attribute-pages button span{font-size:12px!important}
  #spellBook .spellbook-catalog-layout{height:100%!important;min-height:0!important;grid-template-columns:minmax(0,1.42fr) minmax(285px,.86fr)!important;overflow:hidden!important}
  #spellBook .spellbook-detail-stats{grid-template-columns:minmax(110px,1.6fr) repeat(4,minmax(48px,1fr))!important;gap:3px!important}
  #spellBook .spellbook-detail-stats .spellbook-base-damage{grid-column:auto!important}
}

/* v0.43 status-dock class alignment */
.status-special{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-top:3px;padding:2px 4px;border:1px solid #755a34;border-radius:4px;background:#21180d;color:#ffd98d;font:900 6.8px ui-monospace,monospace;line-height:1.05}.status-special b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-special small{flex:none;color:#c8a96b;font-size:5.8px}
.status-core{display:grid;gap:3px}.status-meter{display:grid;grid-template-columns:auto minmax(30px,1fr);align-items:center;gap:4px;color:#c8d9e6;font:900 7px ui-monospace,monospace}.status-meter i{height:5px;display:block;overflow:hidden;border:1px solid #284153;border-radius:999px;background:#02070b}.status-meter u{height:100%;display:block;text-decoration:none}.status-meter.hp u{background:#e06772}.status-meter.mp u{background:#4ca8d7}.status-inline{font:800 7px ui-monospace,monospace;color:#a8bbca}.status-equipment{display:grid;grid-template-columns:1fr;gap:2px;margin-top:4px}.status-equip{min-width:0;width:100%;margin:0;padding:2px 4px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px;text-align:left;border:1px solid #2e4658;border-radius:4px;background:#0b1620;color:#bfd0dd;font:800 6.8px ui-monospace,monospace}.status-equip small{color:#71899a}.status-equip b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-equip.selected{border-color:#82d7f5;background:#162c3b}

/* v0.49 PC inspection + inline item actions */
.status-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:6px;margin-bottom:6px;border-bottom:1px solid #294154;color:#edf7ff;font:900 10px ui-monospace,monospace;letter-spacing:.08em}.status-title span{color:#7bd7f5;font-size:8px}.status-conditions{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.status-conditions span{padding:2px 5px;border:1px solid #654b3d;border-radius:999px;background:#24170f;color:#ffd4a7;font:800 8px ui-monospace,monospace}.status-conditions.normal span{border-color:#29465a;background:#0b1822;color:#8fb2c7}
.inspect-tile span{color:#86d7ef!important}.inspect-tile small b{color:#ffc879}.item-inline-detail{display:grid;gap:7px}.item-inline-head{display:grid;gap:2px}.item-inline-head b{font-size:13px!important;color:#edf7ff!important}.item-inline-head span{font:800 8px ui-monospace,monospace;color:#7bd7f5;letter-spacing:.06em}.item-inline-copy{font-size:10px;line-height:1.45;color:#a9bac8}.item-inline-copy strong{color:#dce8f1}.item-inline-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.item-inline-actions button{min-width:0;margin:0;padding:6px 7px;display:flex;align-items:center;justify-content:space-between;gap:5px;text-align:left;border:1px solid #30475a;background:#101a24;color:#c9d6df}.item-inline-actions button b{margin:0!important;font-size:10px!important}.item-inline-actions button small{color:#7890a4;font:800 7px ui-monospace,monospace}.item-inline-actions button.selected{border-color:#79c0ff;background:#183047;box-shadow:0 0 0 1px #79c0ff35}.item-inline-action-help,.item-inline-hint{min-height:29px;padding:5px 7px;border-left:2px solid #3f6078;background:#0b141d;color:#91a7b9;font-size:9px;line-height:1.4}.sidebar-detail.item-detail-active{max-height:238px;min-height:172px}

@media (pointer:fine) and (min-width:901px){
  /* Reserve a true visual left rail inside the map region for player and tile state. */
  .product-map-region{padding-left:214px!important}
  .world-village .product-map-region{padding-left:214px!important}
  .status-dock{position:absolute!important;display:block!important;z-index:8!important;left:10px!important;top:10px!important;width:192px!important;max-height:245px!important;overflow:auto!important;padding:9px!important;border:1px solid #35556d!important;border-radius:9px!important;background:linear-gradient(180deg,#0b1824f5,#071019f8)!important;box-shadow:0 10px 30px #0009!important;pointer-events:auto!important;scrollbar-width:thin!important}
  .tap-inspect-panel{position:absolute!important;display:block!important;z-index:8!important;left:10px!important;top:266px!important;bottom:10px!important;width:192px!important;height:auto!important;min-height:128px!important;overflow:auto!important;padding:8px!important;border:1px solid #35556d!important;border-radius:9px!important;background:linear-gradient(180deg,#0a1823f5,#061019f8)!important;box-shadow:0 10px 30px #0009!important;color:#cfe0eb!important;pointer-events:auto!important;scrollbar-width:thin!important}
  .tap-inspect-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important;padding-bottom:6px!important;border-bottom:1px solid #294154!important}.tap-inspect-head b{font-size:10px!important;color:#ecf7fd!important}.tap-inspect-head span{font:700 7px ui-monospace,monospace!important;color:#7190a5!important;white-space:nowrap!important}
  .tap-inspect-empty{display:grid!important;gap:4px!important;place-content:center!important;min-height:54px!important;text-align:center!important;color:#7590a3!important;font-size:9px!important}.inspect-block{display:grid!important;gap:3px!important;padding:7px 0!important;border-top:1px solid #1b3445!important}.inspect-block:first-of-type{border-top:0!important}.inspect-block b{font-size:10px!important;color:#edf7ff!important}.inspect-block span{font:800 8px ui-monospace,monospace!important}.inspect-block small{font-size:8.5px!important;line-height:1.35!important;color:#9bb0bf!important}
  .status-core{gap:5px!important}.status-meter{grid-template-columns:auto minmax(42px,1fr)!important;gap:5px!important;font-size:9px!important}.status-meter i{height:7px!important}.status-inline{font-size:9px!important}.status-dock-meta{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;margin-top:6px!important}.status-dock-meta span{padding:4px!important;font-size:8px!important}.status-equipment{gap:4px!important;margin-top:7px!important}.status-equip{padding:5px 6px!important;font-size:8px!important}.status-equip small{font-size:7px!important}.status-special{margin-top:6px!important;padding:4px 5px!important;font-size:8px!important}.status-special small{font-size:7px!important}
  .target-prompt{left:224px!important;max-width:calc(100% - 236px)!important}
}

/* v0.49 follow-up: inline Spell inspection + persistent run records */
.spell-inline-detail{display:grid;gap:7px}.spell-inline-head{display:grid;gap:1px}.spell-inline-head b{font-size:14px!important;color:#edf7ff!important;margin:0!important}.spell-inline-head span{font:800 8px ui-monospace,monospace;color:#91a7b9;letter-spacing:.08em}.spell-inline-facts{display:flex;gap:4px;flex-wrap:wrap}.spell-inline-facts span,.spell-inline-tags span{padding:2px 5px;border:1px solid #2c4356;border-radius:4px;background:#0d1822;color:#9fc7df;font:800 8px ui-monospace,monospace}.spell-inline-copy{color:#b9c8d4;font-size:10px;line-height:1.45}.spell-inline-mechanics,.spell-inline-upgrades{padding:5px 7px;border-left:2px solid #6f5d9a;background:#111421;color:#aebbc9;font-size:9px}.spell-inline-mechanics b,.spell-inline-upgrades b{margin:0 4px 0 0!important;color:#e2d8ff!important}.spell-inline-tags{display:flex;gap:4px;flex-wrap:wrap}.spell-inline-target{padding-top:6px;border-top:1px solid #283949}.spell-inline-hint{color:#7890a4;font-size:8px}.sidebar-detail.spell-detail-active{min-height:184px;max-height:265px}

.sidebar-detail.run-history-active{min-height:250px;max-height:360px;padding:8px}.run-history-detail{display:grid;gap:7px}.run-history-picker{display:flex;gap:4px;overflow-x:auto;padding-bottom:2px}.run-history-picker button{flex:0 0 auto;min-width:112px;padding:5px 6px;border:1px solid #2b3d4c;background:#0d161e;color:#aebdca;text-align:left}.run-history-picker button.selected{border-color:#79c0ff;background:#173047;color:#fff}.run-history-picker button b,.run-history-picker button span{display:block;margin:0!important}.run-history-picker button b{font-size:9px!important}.run-history-picker button span{font:700 7px ui-monospace,monospace;color:#8499aa}.run-history-head{display:grid;gap:2px}.run-history-head b{font-size:12px!important;color:#edf7ff!important;margin:0!important}.run-history-head span{color:#8fa5b6;font:800 8px ui-monospace,monospace}.run-history-seed{display:block;padding:5px 6px;border:1px solid #30475a;background:#07111a;color:#a8d8f0;font:700 8px ui-monospace,monospace;overflow-wrap:anywhere}.run-history-cause{padding:5px 7px;border-left:2px solid #d36a6a;background:#1a1012;color:#dcb4b4}.run-history-route,.run-history-build{font-size:9px;line-height:1.45;color:#aabac7}.run-history-route b,.run-history-build b,.run-history-actions>b,.run-history-timeline>b{margin:0 4px 0 0!important;color:#dce8f1!important}.run-history-actions>div{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}.run-history-actions span{padding:2px 5px;border:1px solid #30475a;border-radius:4px;background:#0d1720;color:#9eb1c0;font:700 8px ui-monospace,monospace}.run-history-actions span b{margin:0!important;color:#fff!important}.run-history-timeline ol{list-style:none;padding:0;margin:4px 0 0;display:grid;gap:2px}.run-history-timeline li{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px;padding:3px 4px;border-top:1px solid #1d2b36}.run-history-timeline li span{color:#70889a;font:700 7px ui-monospace,monospace}.run-history-timeline li b{margin:0!important;color:#b9c7d2!important;font-size:8px!important;white-space:normal}.run-history-empty{display:grid;gap:5px;padding:8px}.run-history-empty b{font-size:12px!important}.run-history-empty span,.run-history-empty small{color:#91a5b5}

/* v0.49 equipment loot curve: generated quality, affixes and readable comparisons */
.loot-generated{display:grid;gap:5px;padding:7px;border:1px solid #33495c;border-radius:6px;background:#09131c}.loot-quality,.loot-base,.loot-curve,.loot-compare{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px;align-items:start}.loot-generated b{color:#dceaf4;font-size:9px}.loot-generated span{color:#93a9b9;font-size:8.5px;line-height:1.35}.loot-quality{padding-bottom:5px;border-bottom:1px solid #223849}.loot-quality b{color:#ffd78a}.loot-affixes{display:grid;gap:3px;padding:5px 0;border-top:1px solid #1d3140;border-bottom:1px solid #1d3140}.loot-affixes span{display:block}.loot-affixes strong{color:#bde7ff}.loot-affixes.empty span{color:#6f8799}.loot-compare{padding:4px 5px;background:#0d1b25;border-left:2px solid #79c0ff}.sidebar-detail.item-detail-active{max-height:330px;min-height:190px}

/* v0.53 tactical minimap */
.minimap-canvas{position:absolute;right:8px;top:8px;z-index:7;width:184px;height:124px;border:1px solid #51708a;border-radius:6px;background:#04080ce6;box-shadow:0 5px 18px #000b;image-rendering:pixelated;pointer-events:none;opacity:.94}
@media(max-width:900px){.minimap-canvas{right:4px;top:4px;width:92px!important;height:62px!important;border-radius:4px;opacity:.82;box-shadow:0 2px 8px #0008}}
@media(max-width:430px){.minimap-canvas{right:3px;top:3px;width:78px!important;height:52px!important;opacity:.78}}
/* Android/coarse-pointer layouts have generic canvas !important sizing; explicitly keep the minimap a small top-right overlay. */
@media(pointer:coarse){.product-map-region .canvas-wrap>canvas.minimap-canvas{position:absolute!important;right:4px!important;top:4px!important;width:92px!important;height:62px!important;max-width:92px!important;max-height:62px!important;min-width:0!important;min-height:0!important;aspect-ratio:auto!important;object-fit:contain!important;z-index:80!important;opacity:.82!important;box-shadow:0 2px 8px #0008!important}}
@media(pointer:coarse) and (max-width:430px){.product-map-region .canvas-wrap>canvas.minimap-canvas{right:3px!important;top:3px!important;width:78px!important;height:52px!important;max-width:78px!important;max-height:52px!important;opacity:.78!important}}
.world-village .minimap-canvas{display:none}

.spellbook-stat-training{margin:8px 0 12px;padding:10px;border:1px solid #a98a58;border-radius:5px;background:#ead8ad}.spellbook-stat-training h3{margin:0 0 7px;font:900 9px ui-monospace,monospace;letter-spacing:.12em;color:#71582f}.spellbook-stat-training h3 small{float:right;font-size:7px;color:#8a7048}.spellbook-stat-training-grid{display:grid;gap:6px}.spellbook-stat-training-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding-top:6px;border-top:1px dashed #b79b6b}.spellbook-stat-training-row:first-child{border-top:0;padding-top:0}.spellbook-stat-training-row small{display:block;margin-top:2px;color:#6c593b;font-size:10px;line-height:1.35}.spellbook-stat-training-row button{min-width:72px;background:#533d23;color:#ffefc5;border-color:#8b7047}

/* v0.49 Mystery Board Phase 1 */
.sidebar-detail.knowledge-board-active{min-height:300px;max-height:430px;padding:8px}.knowledge-board{display:grid;gap:7px}.knowledge-board-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 2px}.knowledge-board-head b{margin:0!important;color:#dce8f1!important;font:900 10px ui-monospace,monospace;letter-spacing:.08em}.knowledge-board-head span{color:#8da5b7;font:800 8px ui-monospace,monospace}.knowledge-map-scroll{overflow-x:auto;overflow-y:hidden;border:1px solid #273d4f;border-radius:6px;background:radial-gradient(circle at 28% 44%,#14202b 0,#091119 42%,#05090e 100%);scrollbar-width:thin}.knowledge-map-scroll svg{display:block;width:1120px;height:380px;max-width:none}.knowledge-edges line{stroke-width:1.25}.knowledge-edges line.known{stroke:#6ca7c8;opacity:.74}.knowledge-edges line.lead{stroke:#5c6270;stroke-dasharray:5 5;opacity:.55}.knowledge-node circle{fill:#162532;stroke:#78b8d8;stroke-width:1.5}.knowledge-node text{fill:#bad2e0;font:700 10px ui-monospace,monospace;paint-order:stroke;stroke:#071019;stroke-width:3px;stroke-linejoin:round}.knowledge-node.fact circle{stroke:#7bc5e4}.knowledge-node.hypothesis circle{stroke:#d0b36e}.knowledge-node.mystery circle{stroke:#b99ae6}.knowledge-node.lead circle{fill:#10151c;stroke:#606979;stroke-dasharray:3 3}.knowledge-node.lead text{fill:#717d89}.knowledge-node.selected circle{r:14;stroke:#fff3a6;stroke-width:2.5;filter:drop-shadow(0 0 5px #ffe66d66)}.knowledge-node{cursor:pointer}.knowledge-detail{display:grid;gap:5px;padding:7px;border-left:2px solid #6f9fbd;background:#0b141d}.knowledge-detail-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.knowledge-detail-head b{margin:0!important;color:#edf7ff!important;font-size:11px!important}.knowledge-detail-head span{color:#859bad;font:800 7px ui-monospace,monospace}.knowledge-detail p{margin:0;color:#aebfcb;font-size:9px;line-height:1.5}.knowledge-question{display:grid;gap:2px;padding-top:5px;border-top:1px solid #213543;color:#c9b9de;font-size:9px;line-height:1.45}.knowledge-question b{margin:0!important;color:#e1d4f0!important;font-size:8px!important;letter-spacing:.06em}.knowledge-detail small{color:#71899c;font:700 7px ui-monospace,monospace}.knowledge-detail.unknown{border-left-color:#555f6b}.knowledge-detail.unknown b{margin:0!important;color:#8995a1!important}
@media(max-width:700px){.sidebar-detail.knowledge-board-active{max-height:330px;min-height:235px}.knowledge-map-scroll svg{width:980px;height:332px}.knowledge-node text{font-size:9px}.knowledge-detail p,.knowledge-question{font-size:8.5px}}

/* v0.49.0 — Mieyama Observation UI pass
   Quiet post-civilization field gear + repaired legacy observation terminal. */
:root{
  --obs-bg:#080b0c;
  --obs-panel:#101616;
  --obs-panel-2:#141d1d;
  --obs-line:#354342;
  --obs-line-soft:#22302f;
  --obs-text:#e6e9e2;
  --obs-muted:#8d9992;
  --obs-accent:#83b8b0;
  --obs-accent-2:#c3a86f;
  --obs-danger:#c97b72;
  --obs-good:#95b98d;
  --obs-paper:#d4c59c;
  --obs-radius:3px;
}
body.product-ui.world-village{--obs-accent:#a9bf90;--obs-accent-2:#c8aa6c;--obs-panel:#111814;--obs-panel-2:#182019;--obs-line:#3b4a3d;}
body.product-ui.world-dungeon{--obs-accent:#7faaa8;--obs-accent-2:#baa06c;--obs-panel:#0e1516;--obs-panel-2:#131c1e;--obs-line:#334648;}
body.product-ui{
  color:var(--obs-text);
  background:
    radial-gradient(circle at 18% 0,#27302b44 0,transparent 30%),
    radial-gradient(circle at 82% 15%,#1b303244 0,transparent 26%),
    linear-gradient(180deg,#0b1010,#060909 72%);
  font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",system-ui,sans-serif;
}
body.product-ui::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:9998;opacity:.14;
  background:
    repeating-linear-gradient(0deg,#fff0 0 3px,#cbd7cf08 4px),
    radial-gradient(circle at 50% 35%,transparent 0 52%,#0008 100%);
  mix-blend-mode:screen;
}
.product-frame{background:transparent;}
.product-header{
  background:linear-gradient(180deg,#151b19,#0c1110);
  border-bottom:1px solid var(--obs-line);
  box-shadow:0 8px 24px #0008,inset 0 -1px #0008;
}
.product-brand{gap:12px;position:relative;padding-left:12px}
.product-brand::before{content:"OBS";position:absolute;left:0;top:50%;transform:translate(-70%,-50%) rotate(-90deg);color:#728078;font:800 6px ui-monospace,monospace;letter-spacing:.18em}
.product-brand h1{font-size:15px;letter-spacing:.12em;font-weight:650;color:#edf0e9;text-shadow:none}
.product-brand small{color:#78857e;font:750 8px ui-monospace,monospace;letter-spacing:.14em}
.spellbook-button,.product-system-menu summary,.system-button{
  border-radius:var(--obs-radius)!important;
  background:linear-gradient(180deg,#171f1e,#0d1313)!important;
  border-color:#394844!important;color:#aeb9b2!important;box-shadow:inset 0 1px #ffffff08!important;
}
.spellbook-button{color:#d6c69c!important;border-color:#625a43!important}
.product-hud{
  background:
    linear-gradient(90deg,#ffffff08 1px,transparent 1px),
    linear-gradient(180deg,#121918,#0b1111);
  background-size:28px 100%,auto;
  border-bottom:1px solid var(--obs-line);box-shadow:none;
}
.hud-chip{
  position:relative;border-radius:2px;border-color:#32413f;background:#0a100f;padding-left:12px;box-shadow:none;
}
.hud-chip::before{content:"";position:absolute;left:4px;top:5px;bottom:5px;width:2px;background:var(--obs-accent);opacity:.7}
.hud-hp::before{background:#b86f68}.hud-mp::before{background:#6e9eaa}.hud-sp::before{background:#a990b8}
.hud-hp{color:#d89a93}.hud-mp{color:#9bbec6}.hud-sp{color:#c6afcf}.hud-route{color:#98a49e;font-size:10px;letter-spacing:.12em}
.product-map-region{
  background:
    radial-gradient(ellipse at 50% 45%,#182221 0,#0c1212 48%,#050808 82%),
    repeating-linear-gradient(90deg,transparent 0 39px,#82938b0a 40px),
    repeating-linear-gradient(0deg,transparent 0 39px,#82938b08 40px);
  border-right-color:var(--obs-line);
}
.world-village .product-map-region{background:radial-gradient(ellipse at 46% 42%,#263126 0,#141b15 52%,#080c09 86%)}
.product-map-region::before{opacity:.16;background:repeating-linear-gradient(0deg,#fff0 0 4px,#dbe7df08 5px)}
.product-map-region .canvas-wrap{
  border-color:#52615a;border-radius:2px;background:#040706;
  box-shadow:0 20px 50px #000c,0 0 0 1px #050807,inset 0 0 0 1px #ffffff06;
}
.product-map-region .canvas-wrap::before,.product-map-region .canvas-wrap::after{
  content:"";position:absolute;z-index:90;pointer-events:none;width:30px;height:30px;
  border-color:var(--obs-accent);opacity:.55;
}
.product-map-region .canvas-wrap::before{left:6px;top:6px;border-left:1px solid;border-top:1px solid}
.product-map-region .canvas-wrap::after{right:6px;bottom:6px;border-right:1px solid;border-bottom:1px solid}
.focus-map .canvas-wrap{border-color:#6e8880!important;box-shadow:0 20px 50px #000c,0 0 0 1px #8db4aa33!important}
.target-prompt{border-radius:2px;border-color:#4b625e;background:#09100feb;color:#cfd8d2;font-size:10px;box-shadow:0 4px 18px #0009}
.action-sidebar{
  background:linear-gradient(180deg,#111817,#0b1111);border-left:1px solid #111817;
  box-shadow:inset 8px 0 30px #0003;
}
.sidebar-tab-rail{background:#101716;border-bottom-color:var(--obs-line);height:43px}
.sidebar-tabs button{color:#78867f;border-left-color:#24312f;letter-spacing:.08em;font-size:8.5px}
.sidebar-tabs button:hover{background:#18201e;color:#b2bdb6}
.sidebar-tabs button.active{background:linear-gradient(180deg,#202a27,#151e1c);color:#e8ece6;box-shadow:inset 0 -2px var(--obs-accent)}
.bumper-hint{color:#626f69}
.sidebar-summary{background:#0d1413;border-bottom-color:#263431;color:#76857e;letter-spacing:.1em}
.sidebar-summary strong{color:#cbd3cc}.sidebar-summary .summary-count{color:#a3bdb6}
.sidebar-subtabs{border-bottom-color:#24302e;background:#0b1110}.sidebar-subtab{border-radius:2px;border-color:#33413e;color:#82918a}.sidebar-subtab.active{border-color:#7c725d;color:#d2c29c;background:#242117}
.sidebar-list{padding:5px 7px}
.sidebar-row{border-radius:2px;background:transparent;border-bottom:1px solid #1c2927;color:#b9c2bb;margin:0;padding:8px 8px}
.sidebar-row:hover{background:#151d1b}
.sidebar-row.selected{border-color:#526c66;background:linear-gradient(90deg,#25342f,#141d1b 72%);color:#f0f2ed;box-shadow:inset 3px 0 var(--obs-accent)}
.sidebar-row-meta{color:#74817b}.sidebar-detail{border-top-color:var(--obs-line);background:#080d0c;color:#9aa79f}
.message-panel{
  border-radius:2px;border-color:#34433f;background:linear-gradient(180deg,#101716f5,#080d0cf5);box-shadow:0 7px 24px #0009;
}
.message-panel-head{border-radius:1px;background:#1b2420;border-color:#48584e;color:#b5c6b9;letter-spacing:.16em}
.message-panel .product-log{color:#8e9d95}.message-panel .product-log .log-latest{color:#dce2db}
.status-dock{border-radius:3px!important;border-color:#45564f!important;background:linear-gradient(180deg,#111a17f6,#080e0cf8)!important;box-shadow:0 12px 36px #000a!important}
.status-core b{color:#ecede7!important}.status-inline{color:#a3afa7!important}.status-special{border-color:#524e3c!important;background:#18170f!important;color:#c7bb91!important}
.status-equip,.status-dock-equip button{border-radius:2px!important;border-color:#34443f!important;background:#0d1513!important;color:#b5c2ba!important}
.product-map-region .canvas-wrap>canvas.minimap-canvas{
  border:1px solid #6a755f!important;border-radius:1px!important;background:#050908!important;
  box-shadow:0 3px 12px #000b,0 0 0 1px #000!important;filter:saturate(.82) contrast(1.08)!important;
}
.product-footer{background:linear-gradient(180deg,#101615,#080c0c);border-top-color:var(--obs-line)}
.controller-hint{border-radius:2px;border-color:#37443f;background:#111816;color:#88968e}

/* In-world title / field terminal */
.product-flow-overlay{
  background:
    radial-gradient(circle at 16% 24%,#8fae8a15 0 2px,transparent 3px),
    radial-gradient(circle at 72% 31%,#d0b87912 0 1px,transparent 2px),
    radial-gradient(circle at 52% 15%,#26332e 0,transparent 25%),
    linear-gradient(180deg,#101513f2,#050807fb 72%);
}
.product-flow-overlay::before{width:45vmin;height:45vmin;border-color:#8ba69a18;transform:rotate(0deg);border-radius:50%;left:-18vmin;top:-12vmin}
.product-flow-overlay::after{width:62vmin;height:1px;border:0;border-top:1px solid #b4a06d24;transform:rotate(-13deg);right:-10vmin;bottom:18vh}
.product-flow-panel{
  border-radius:3px;border-color:#45564f;background:linear-gradient(180deg,#151d1af4,#0a100ef7);
  box-shadow:0 30px 100px #000e,inset 0 1px #ffffff08;padding:32px 36px;
}
.product-flow-panel::before{inset:7px;border-radius:1px;border-color:#9cad9f12}
.product-flow-title-panel{width:min(760px,94vw)}
.product-flow-kicker{color:#9fb5a7;font-size:8px;letter-spacing:.22em}
.product-flow-panel h1{font-weight:560;letter-spacing:.18em;font-size:clamp(30px,5vw,48px);color:#eef0e9}
.product-flow-panel h2{font-weight:600;letter-spacing:.1em;color:#e8ece5}
.product-flow-lead{color:#9ba79f;line-height:1.85}.title-world-copy{max-width:650px;color:#b0b8ae}
.title-input-badges span{border-radius:1px;border-color:#4b5545;background:#151a13;color:#b9ae86;letter-spacing:.11em}
.product-flow-actions{grid-template-columns:1fr 1fr;gap:6px 8px}
.product-flow-actions button,.result-bank button,.product-flow-back,.product-setting-row{
  position:relative;border-radius:2px;border-color:#35443f;background:#101816;color:#d6dcd6;box-shadow:none;padding-left:16px;
}
.product-flow-actions button::before,.result-bank button::before{content:"";position:absolute;left:6px;top:11px;bottom:11px;width:2px;background:#55675f}
.product-flow-actions button:hover,.result-bank button:hover,.product-setting-row:hover,.product-flow-back:hover{border-color:#62766d;background:#17201d}
.product-flow-actions .product-flow-primary,.result-bank .product-flow-primary{border-color:#65776e;background:linear-gradient(90deg,#21302a,#141c19)}
.product-flow-actions .product-flow-primary::before,.result-bank .product-flow-primary::before{background:#a8bc9f}
.product-flow-actions button span,.result-bank button span{font-size:11px;letter-spacing:.08em}.product-flow-actions button small,.result-bank button small{color:#75857d}
.product-flow-seed{color:#6f7c75}.product-flow-seed b{color:#a99a70}.product-flow-footnote{color:#53615b}
.dungeon-select-card{border-radius:2px;border-color:#35463f;background:#101714}.dungeon-select-card:hover,.dungeon-select-card.controller-selected{border-color:#758b80;background:#1a2521}.dungeon-select-number{border-radius:1px;border-color:#5a675d;color:#b7ac87}.dungeon-select-card strong{color:#a9bcae}

/* Observation board: recovered records, not a generic graph editor. */
.knowledge-board-head{border-bottom:1px solid #293734;padding:5px 2px 8px}.knowledge-board-head b{color:#d9ddd6!important;letter-spacing:.15em}.knowledge-board-head span{color:#829088}
.knowledge-map-scroll{border-radius:2px;border-color:#3c4945;background:
  linear-gradient(90deg,#ffffff05 1px,transparent 1px),
  linear-gradient(0deg,#ffffff04 1px,transparent 1px),
  radial-gradient(circle at 28% 44%,#17211e 0,#0a0f0e 48%,#050807 100%);background-size:32px 32px,32px 32px,auto}
.knowledge-edges line.known{stroke:#819e91}.knowledge-edges line.lead{stroke:#6d6b5f}
.knowledge-node circle{fill:#111a17;stroke:#8ba99b}.knowledge-node text{fill:#c2ccc4;stroke:#070a09}
.knowledge-node.fact circle{stroke:#8ea99a}.knowledge-node.hypothesis circle{stroke:#b8a16d}.knowledge-node.mystery circle{stroke:#9b8aa7}.knowledge-node.selected circle{stroke:#d6c58d;filter:drop-shadow(0 0 5px #d6c58d55)}
.knowledge-detail{border-left-color:#71897e;background:#0c1210}.knowledge-detail-head b{color:#e3e8e1!important}.knowledge-question{color:#baa982;border-top-color:#293833}.knowledge-question b{color:#d1c39e!important}

/* Book UI: field manual rebuilt around old paper and terminal tabs. */
#spellBook{background:#050807e8}.spellbook-shell{border-radius:4px;border-color:#665b42;background:#1b1811}.spellbook-pages{background:#322a1d}.spellbook-page{background:linear-gradient(100deg,#d6c89f,#cbbb8f);color:#262014;box-shadow:inset 0 0 34px #493b223d}.spellbook-entry button{border-radius:2px}.spellbook-eyebrow{letter-spacing:.2em}

/* Equipment / item detail hierarchy. */
.item-inline-detail,.spell-inline-detail,.loot-generated{border-radius:2px!important}.item-inline-head b,.spell-inline-head b{letter-spacing:.035em}.item-inline-head span,.spell-inline-head span{color:#8e9d95!important}.item-inline-facts span,.spell-inline-facts span,.spell-inline-tags span{border-radius:1px!important;border-color:#38463f!important;background:#0f1614!important;color:#9faf9f!important}.loot-generated{border-color:#4a4c3c;background:#0d1210}.loot-quality b{color:#c5ad72}.loot-compare{border-left-color:#879f93;background:#121b18}

/* Village should feel inhabited and warmer than the field terminal. */
.world-village .action-sidebar{background:linear-gradient(180deg,#151d18,#0d120f)}
.world-village .sidebar-row.selected{background:linear-gradient(90deg,#2a3529,#182019 72%);border-color:#64745d;box-shadow:inset 3px 0 #a9bf90}
.world-village .message-panel{border-color:#485146;background:linear-gradient(180deg,#171d16f5,#0c110cf5)}

@media(max-width:700px){
  .product-flow-actions{grid-template-columns:1fr}
  .product-flow-panel{padding:22px 18px}
  .product-flow-panel h1{letter-spacing:.12em}
}
@media(pointer:coarse){
  body.product-ui::before{opacity:.07}
  .product-map-region .canvas-wrap::before,.product-map-region .canvas-wrap::after{width:18px;height:18px}
  .movement-pad-wrap,.touch-actions{border-radius:4px!important;border-color:#384943!important;background:#09100eea!important}
  .dpad button,.touch-actions button{border-radius:3px!important;background:#111a17!important;border-color:#405049!important;color:#c9d3cb!important}
  .dpad-center{color:#b9c99f!important}
}

/* v0.49.0 — Nemure, Nemure, white post-FX pass
   White field terminal + quiet dreamlike game image. Post effects stay inside the map. */
:root{
  --sleep-white:#fbfaf6;
  --sleep-ivory:#f4f1e9;
  --sleep-paper:#ece7dc;
  --sleep-panel:#ffffffeb;
  --sleep-panel-2:#f6f4ee;
  --sleep-ink:#252a2e;
  --sleep-muted:#71787c;
  --sleep-line:#c9c5ba;
  --sleep-line-strong:#aaa59a;
  --sleep-gold:#9d8660;
  --sleep-blue:#688b9d;
  --sleep-red:#a95d5d;
  --sleep-green:#6f8d79;
  --sleep-violet:#81748f;
}
body.product-ui,
body.product-ui.world-village,
body.product-ui.world-dungeon{
  --obs-bg:var(--sleep-ivory);
  --obs-panel:var(--sleep-panel);
  --obs-panel-2:var(--sleep-panel-2);
  --obs-line:var(--sleep-line);
  --obs-line-soft:#ddd9cf;
  --obs-text:var(--sleep-ink);
  --obs-muted:var(--sleep-muted);
  --obs-accent:var(--sleep-blue);
  --obs-accent-2:var(--sleep-gold);
  --obs-danger:var(--sleep-red);
  --obs-good:var(--sleep-green);
  color:var(--sleep-ink);
  background:
    radial-gradient(circle at 18% 0,#fff 0 12%,transparent 38%),
    radial-gradient(circle at 82% 14%,#dfe7e755 0,transparent 27%),
    linear-gradient(180deg,#faf9f4,#efede6 72%,#e7e4dc);
}
body.product-ui::before{
  opacity:.36;
  background:
    repeating-linear-gradient(0deg,#fff0 0 4px,#55636c0a 5px),
    radial-gradient(circle at 50% 30%,transparent 0 58%,#9c978b24 100%);
  mix-blend-mode:multiply;
}
.product-header{
  background:#fbfaf6ee;border-bottom-color:#cbc7bd;color:var(--sleep-ink);
  box-shadow:0 8px 28px #6b66561d,inset 0 -1px #fff;
  backdrop-filter:blur(14px) saturate(.8);
}
.product-brand::before{content:"NN";color:#9b978f}.product-brand h1{color:#1f2427;font-weight:720;letter-spacing:.17em}.product-brand small{color:#87847d}
.spellbook-button,.product-system-menu summary,.system-button{
  background:linear-gradient(180deg,#fff,#f0eee8)!important;border-color:#c8c3b8!important;color:#373c40!important;box-shadow:0 1px 0 #fff,inset 0 -1px #ddd8ce!important;
}
.spellbook-button{color:#6f6047!important;border-color:#c7b899!important}
.system-menu-panel{background:#fbfaf6!important;border-color:#c8c3b8!important;box-shadow:0 18px 44px #6a62542e!important;color:#33383c!important}
.system-seed input,input{background:#fff;color:#252a2e;border-color:#c8c3b8}
.product-hud{background:#f8f6f0e8;background-image:linear-gradient(90deg,#8b94820c 1px,transparent 1px);border-bottom-color:#d1cdc3;box-shadow:0 4px 14px #6f69581a;backdrop-filter:blur(8px)}
.hud-chip{background:#ffffffc7;border-color:#d2cec5;color:#4a5053}.hud-chip::before{background:#8a9ca5}.hud-hp{color:#974e4e}.hud-mp{color:#577d90}.hud-sp{color:#75657f}.hud-route{color:#6c7274}
.product-shell{background:transparent}
.product-map-region{
  background:
    linear-gradient(135deg,#ffffffaa,#eceae3),
    repeating-linear-gradient(90deg,transparent 0 39px,#616d7108 40px),
    repeating-linear-gradient(0deg,transparent 0 39px,#616d7106 40px);
  border-right-color:#cbc7bd;
}
.world-village .product-map-region{background:radial-gradient(ellipse at 46% 42%,#fffdf6 0,#efece2 58%,#ddd9ce 100%)}
.product-map-region::before{opacity:.2;background:repeating-linear-gradient(0deg,#fff0 0 5px,#333b3f0a 6px);mix-blend-mode:multiply}
.product-map-region .canvas-wrap{
  border-color:#b9b5aa;border-radius:8px;background:#171a1c;
  box-shadow:0 18px 46px #605b4e35,0 0 0 7px #fbfaf6,inset 0 0 0 1px #ffffff1f;
  isolation:isolate;
}
.product-map-region canvas#game{filter:saturate(.86) contrast(1.08) brightness(1.05)}
.focus-map .canvas-wrap{border-color:#8ca2ac!important;box-shadow:0 18px 46px #605b4e35,0 0 0 7px #fbfaf6,0 0 0 9px #7a98a42b!important}
/* Game-image effects: deliberately below minimap / targeting UI. */
.map-postfx{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;border-radius:inherit}
.map-postfx::before{
  content:"";position:absolute;inset:-8%;opacity:.42;
  background:
    radial-gradient(circle at 28% 22%,#e9ffff22 0 4%,transparent 16%),
    radial-gradient(circle at 70% 60%,#fff1d11d 0 5%,transparent 18%),
    linear-gradient(90deg,#d34b6513 0 1px,transparent 2px calc(100% - 2px),#4fa6bd16 calc(100% - 1px));
  filter:blur(7px) saturate(1.1);
  mix-blend-mode:screen;
  animation:sleepHaze 7s ease-in-out infinite alternate;
}
.map-postfx::after{
  content:"";position:absolute;inset:0;opacity:.54;
  background:
    repeating-linear-gradient(0deg,rgba(255,255,255,0) 0 3px,rgba(235,242,244,.035) 4px),
    repeating-radial-gradient(circle at 12% 18%,rgba(255,255,255,.026) 0 1px,rgba(0,0,0,.018) 1.4px 2px,transparent 2.4px 5px),
    radial-gradient(ellipse at 50% 45%,transparent 0 58%,rgba(9,12,14,.18) 82%,rgba(7,9,10,.43) 100%);
  box-shadow:inset 2px 0 #e3566d10,inset -2px 0 #57a9bf12;
  mix-blend-mode:normal;
}
@keyframes sleepHaze{0%{transform:translate3d(-.4%,0,0) scale(1.01);opacity:.31}100%{transform:translate3d(.55%,.3%,0) scale(1.025);opacity:.46}}
@media(prefers-reduced-motion:reduce){.map-postfx::before{animation:none;transform:none}}
.minimap-canvas{z-index:7!important;border-color:#bfb9ab!important;background:#f8f5eddf!important;box-shadow:0 3px 14px #5c564936!important;filter:saturate(.75) contrast(1.04)!important}
.target-prompt{z-index:12;border-color:#b7b2a8;background:#fdfcf7e8;color:#252a2e;box-shadow:0 8px 24px #6c67592d;backdrop-filter:blur(10px)}
.action-sidebar{background:#f9f7f1;border-left-color:#d0ccc2;box-shadow:inset 8px 0 30px #7771600b;color:#2a3033}
.sidebar-tab-rail{background:#f1eee7;border-bottom-color:#cbc7bd}.sidebar-tabs button{color:#7b7c79;border-left-color:#d8d4cb}.sidebar-tabs button:hover{background:#fff;color:#31363a}.sidebar-tabs button.active{background:#fff;color:#24292d;box-shadow:inset 0 -2px #7695a2}.bumper-hint{color:#9a9892}
.sidebar-summary{background:#f5f2eb;border-bottom-color:#d4d0c7;color:#7b7c78}.sidebar-summary strong{color:#30363a}.sidebar-summary .summary-count{color:#5f7d89}.sidebar-subtabs{border-bottom-color:#d4d0c8;background:#faf8f3}.sidebar-subtab{border-color:#d1ccc2;color:#737875;background:#fff9}.sidebar-subtab.active{border-color:#aa9e8a;color:#584e3c;background:#ece4d5}
.sidebar-list{background:#f8f6f0}.sidebar-row{background:#ffffff80;color:#353b3e;border-color:transparent}.sidebar-row:hover{background:#fff}.sidebar-row.selected{border-color:#9eaaa9;background:linear-gradient(90deg,#e6efed,#fff 74%);color:#1f2528;box-shadow:inset 3px 0 #6f909a}.sidebar-row-meta{color:#8a8a85}.sidebar-detail{border-top-color:#d0ccc2;background:#f0ede6;color:#62686b}
.message-panel{border-color:#c9c5bb;background:#ffffffdc;box-shadow:0 8px 26px #6f69572c;backdrop-filter:blur(10px)}.message-panel-head{background:#f1eee6;border-color:#c8c2b4;color:#67645c}.message-panel .product-log{color:#737875}.message-panel .product-log .log-latest{color:#282d30}
.status-dock{border-color:#c6c1b6!important;background:#fffffff0!important;color:#303538!important;box-shadow:0 12px 32px #6a65582a!important;backdrop-filter:blur(10px)}.status-core b{color:#24292c!important}.status-inline{color:#62696b!important}.status-special{border-color:#c9bfa9!important;background:#f4ecdc!important;color:#695d45!important}.status-equip,.status-dock-equip button{border-color:#d0cbc1!important;background:#f7f5ef!important;color:#4b5254!important}
.product-footer{background:#f5f2eb;border-top-color:#cbc7bd;color:#62686b}.controller-hint{border-color:#cbc7bd;background:#fff;color:#62686b}.footer-status{color:#777b79}
/* Title: white empty space with a sleeping terminal rather than dark sci-fi chrome. */
.product-flow-overlay{background:
  radial-gradient(circle at 20% 18%,#ffffff 0 11%,transparent 32%),
  radial-gradient(circle at 78% 22%,#dbe5e355 0,transparent 26%),
  linear-gradient(180deg,#f9f8f3f5,#e7e4dcfb 74%)}
.product-flow-overlay::before{border-color:#8a969129;background:transparent}.product-flow-overlay::after{border-top-color:#9d866033}
.product-flow-panel{border-color:#c3beb3;background:#fbfaf6e8;color:#252a2e;box-shadow:0 30px 100px #5e594c2d,inset 0 1px #fff;padding:34px 38px;backdrop-filter:blur(15px)}.product-flow-panel::before{border-color:#8e8b821b}.product-flow-kicker{color:#7d817d}.product-flow-panel h1{color:#1e2326;font-weight:730;letter-spacing:.24em;text-shadow:0 1px #fff}.product-flow-panel h2{color:#282d30}.product-flow-lead,.title-world-copy{color:#646b6d}.title-input-badges span{border-color:#c8c1b2;background:#f3eee4;color:#716248}.product-flow-actions button,.result-bank button,.product-flow-back,.product-setting-row{border-color:#cbc7bd;background:#ffffffb8;color:#33393c}.product-flow-actions button::before,.result-bank button::before{background:#a5a097}.product-flow-actions button:hover,.result-bank button:hover,.product-setting-row:hover,.product-flow-back:hover{border-color:#a8a399;background:#fff}.product-flow-actions .product-flow-primary,.result-bank .product-flow-primary{border-color:#9ca8a5;background:linear-gradient(90deg,#e5eeeb,#fff)}.product-flow-actions .product-flow-primary::before,.result-bank .product-flow-primary::before{background:#6f8f98}.product-flow-actions button small,.result-bank button small{color:#858782}.product-flow-seed{color:#7c7e79}.product-flow-seed b{color:#8b7653}.product-flow-footnote{color:#99968f}.dungeon-select-card{border-color:#d1ccc2;background:#ffffffb0}.dungeon-select-card:hover,.dungeon-select-card.controller-selected{border-color:#9fa9a4;background:#edf2ef}.dungeon-select-number{border-color:#bbb4a7;color:#76684f}.dungeon-select-card strong{color:#45504d}
/* Mystery board becomes a pale archival table with ink-like graph lines. */
.knowledge-board-head{border-bottom-color:#d0cbc1}.knowledge-board-head b{color:#2b3032!important}.knowledge-board-head span{color:#858782}.knowledge-map-scroll{border-color:#c8c3b9;background:linear-gradient(90deg,#8089850c 1px,transparent 1px),linear-gradient(0deg,#8089850b 1px,transparent 1px),radial-gradient(circle at 30% 42%,#fff 0,#f2efe7 58%,#e5e1d7 100%);background-size:32px 32px,32px 32px,auto}.knowledge-edges line.known{stroke:#6f8985}.knowledge-edges line.lead{stroke:#9a9385}.knowledge-node circle{fill:#f8f5ed;stroke:#698b87}.knowledge-node text{fill:#3d4647;stroke:#f8f5ed}.knowledge-node.fact circle{stroke:#648a85}.knowledge-node.hypothesis circle{stroke:#a78a55}.knowledge-node.mystery circle{stroke:#82738f}.knowledge-node.lead circle{fill:#ebe7dd;stroke:#99948a}.knowledge-node.lead text{fill:#92918c}.knowledge-node.selected circle{stroke:#8c744d;filter:drop-shadow(0 0 4px #8c744d33)}.knowledge-detail{border-left-color:#819792;background:#f7f4ed}.knowledge-detail-head b{color:#2a3032!important}.knowledge-detail p{color:#62686a}.knowledge-question{color:#786b52;border-top-color:#d5d0c6}.knowledge-question b{color:#6d5e43!important}.knowledge-detail small{color:#8a8a84}
/* Paper stays warm, but becomes cleaner against the white shell. */
#spellBook{background:#e7e4dcb8;backdrop-filter:blur(10px)}.spellbook-shell{border-color:#aaa08b;background:#e4dccb;box-shadow:0 28px 70px #5c574b42}.spellbook-pages{background:#b9ab90}.spellbook-page{background:linear-gradient(100deg,#fbf5e7,#efe5cf);color:#29241b;box-shadow:inset 0 0 34px #7868441a}
.item-inline-facts span,.spell-inline-facts span,.spell-inline-tags span{border-color:#d0cbc1!important;background:#f7f5ef!important;color:#5d6665!important}.loot-generated{border-color:#c7bda8;background:#f6f2e8}.loot-quality b{color:#806b48}.loot-compare{border-left-color:#7d9690;background:#f1f5f1}
.world-village .action-sidebar{background:#f8f6ef}.world-village .sidebar-row.selected{background:linear-gradient(90deg,#edf2e8,#fff 72%);border-color:#aebaa7;box-shadow:inset 3px 0 #809777}.world-village .message-panel{border-color:#ccc4b5;background:#fffdf8e8}
@media(pointer:coarse){body.product-ui::before{opacity:.18}.movement-pad-wrap,.touch-actions{border-color:#bbb7ad!important;background:#f8f6f0e8!important;box-shadow:0 8px 26px #5f5a4d24!important;backdrop-filter:blur(10px)}.dpad button,.touch-actions button{background:#fffffff0!important;border-color:#c5c0b5!important;color:#3b4244!important;box-shadow:0 1px 0 #fff!important}.dpad-center{color:#697c67!important}.map-postfx::after{opacity:.43}.map-postfx::before{opacity:.3}}

/* v0.49.0 — NEMURE, NEMURE, global white theme + full-screen post-FX
   This layer intentionally comes last so legacy dark prototype surfaces cannot leak through. */
:root{
  --nemure-paper:#f7f4ec;
  --nemure-paper-2:#eeebe3;
  --nemure-paper-3:#e4e0d6;
  --nemure-ink:#272c2f;
  --nemure-muted:#747a7b;
  --nemure-line:#c9c4b9;
  --nemure-line-strong:#a9a398;
  --nemure-accent:#718f98;
  --nemure-accent-warm:#98815e;
  --nemure-danger:#a05f63;
  --nemure-good:#6f8974;
  --global-fx-strength:.55;
  --global-fx-contrast:1.047;
  --global-fx-saturate:.945;
  --global-fx-brightness:1.010;
  --global-fx-grain:.143;
  --global-fx-scan:.088;
  --global-fx-vignette:.187;
  --global-fx-chroma:.110;
  --global-fx-glow:.121;
  --global-fx-text-glow:.099;
}
html,body{background:var(--nemure-paper-2)!important;color:var(--nemure-ink)!important}
body.product-ui{
  background:
    radial-gradient(circle at 16% 9%,#fff 0 12%,transparent 34%),
    radial-gradient(circle at 82% 22%,#dce7e455 0,transparent 28%),
    linear-gradient(180deg,#f8f6f0,#ebe7dd 76%,#dfdbd1)!important;
  color:var(--nemure-ink)!important;
}
/* The complete rendered interface, including text, receives the optical grade. */
body.product-ui > :not(.global-postfx):not(script){
  filter:contrast(var(--global-fx-contrast)) saturate(var(--global-fx-saturate)) brightness(var(--global-fx-brightness));
}
body.product-ui :where(h1,h2,h3,h4,p,span,b,strong,small,label,button,summary,input,code,div,section,aside,nav){
  text-shadow:
    1px 0 rgba(162,82,94,var(--global-fx-text-glow)),
    -1px 0 rgba(72,135,154,var(--global-fx-text-glow)),
    0 0 3px rgba(255,255,255,var(--global-fx-glow));
}
html[data-post-fx="0"] body.product-ui :where(h1,h2,h3,h4,p,span,b,strong,small,label,button,summary,input,code,div,section,aside,nav){text-shadow:none}

/* Absolute final surface palette. */
.product-frame,.product-header,.product-hud,.product-shell,.product-map-region,.action-sidebar,.product-footer,
.sidebar-tab-rail,.sidebar-summary,.sidebar-subtabs,.sidebar-list,.sidebar-detail,.message-panel,.status-dock,
.tap-inspect-panel,.quick-spell-dock,.debug-drawer,.debug-grid,.panel,.system-menu-panel,.controls,
.product-flow-overlay,.product-flow-panel,.relic-cache-panel,#spellBook,.spellbook-shell,.spellbook-head,
.spellbook-pages,.spellbook-page,.landscape-gate>div{
  color:var(--nemure-ink)!important;
}
.product-frame{background:transparent!important}
.product-header{
  background:#fbfaf6ed!important;border-bottom:1px solid var(--nemure-line)!important;
  box-shadow:0 4px 20px #77706118!important;backdrop-filter:blur(12px)!important;
}
.product-brand h1{color:#22272a!important}.product-brand small{color:#7a807f!important}
.product-header button,.product-header summary,.system-button,.spellbook-button{
  background:#ffffffe8!important;color:#343a3c!important;border-color:var(--nemure-line)!important;
}
.product-system-menu[open] summary,.product-header button:hover{background:#fff!important;border-color:var(--nemure-line-strong)!important}
.system-menu-panel{background:#faf8f2f2!important;border-color:var(--nemure-line)!important;box-shadow:0 15px 45px #635e5328!important}
.system-seed,.system-seed input,#saveState{color:#555d5e!important}.system-seed input{background:#fff!important;border-color:var(--nemure-line)!important}
.product-hud{background:#f7f4eee8!important;border-bottom-color:var(--nemure-line)!important;color:#4e5658!important}
.hud-chip{background:#ffffffc9!important;border-color:#d3cec4!important;color:#4a5153!important}

.product-map-region{background:linear-gradient(135deg,#fffdf8,#e8e4da)!important;border-right-color:var(--nemure-line)!important}
.world-village .product-map-region{background:radial-gradient(ellipse at 45% 40%,#fffef8,#ede9de 62%,#ddd8cb)!important}
.product-map-region .canvas-wrap{border-color:#bcb6aa!important;background:#171a1c!important;box-shadow:0 18px 48px #5f594c35,0 0 0 7px #fbfaf6!important}
.map-legend,.spell-target-hud,.target-prompt{
  background:#fbfaf5e8!important;border-color:#beb8ad!important;color:#303638!important;box-shadow:0 8px 24px #6b65572a!important;backdrop-filter:blur(10px)!important;
}
.status-dock,.message-panel,.tap-inspect-panel,.quick-spell-dock{
  background:#fffef9e8!important;border-color:var(--nemure-line)!important;color:#33393b!important;box-shadow:0 10px 30px #665f5022!important;backdrop-filter:blur(12px)!important;
}
.message-panel-head{background:#f0ede5!important;border-color:var(--nemure-line)!important;color:#6b6962!important}
.product-log,.product-log *{color:#686f70!important}.product-log .log-latest{color:#242a2d!important}
.status-core b{color:#24292c!important}.status-inline{color:#697071!important}.status-special{background:#f3ecdc!important;color:#6e6048!important;border-color:#cabfa8!important}

.action-sidebar{background:#f8f6f0f2!important;border-left-color:var(--nemure-line)!important;box-shadow:inset 8px 0 28px #7771600b!important}
.sidebar-tab-rail{background:#eeebe4!important;border-bottom-color:var(--nemure-line)!important}
.sidebar-tabs button{background:transparent!important;color:#797b78!important;border-color:#d5d1c8!important}.sidebar-tabs button:hover{background:#fff!important;color:#303638!important}.sidebar-tabs button.active{background:#fff!important;color:#242a2d!important;box-shadow:inset 0 -2px var(--nemure-accent)!important}
.sidebar-summary{background:#f3f0e9!important;border-color:#d2cec4!important;color:#767b79!important}.sidebar-summary strong{color:#2e3437!important}
.sidebar-subtabs{background:#faf8f3!important;border-color:#d3cec5!important}.sidebar-subtab{background:#fff!important;border-color:#d1ccc2!important;color:#6d7371!important}.sidebar-subtab.active{background:#ece5d8!important;border-color:#aa9d87!important;color:#574c39!important}
.sidebar-list{background:#f8f6f0!important}.sidebar-row{background:#ffffff88!important;color:#353b3e!important}.sidebar-row:hover{background:#fff!important}.sidebar-row.selected{background:linear-gradient(90deg,#e6efed,#fff 74%)!important;border-color:#9eaaa9!important;color:#1f2528!important;box-shadow:inset 3px 0 #6f909a!important}.sidebar-row-meta{color:#858984!important}.sidebar-detail{background:#efebe3!important;border-color:#cec9bf!important;color:#62686a!important}
.item-inline-facts span,.spell-inline-facts span,.spell-inline-tags span,.relic-tags span{background:#f7f4ed!important;border-color:#cec8bd!important;color:#5c6463!important}

.product-footer{background:#f1eee7!important;border-top-color:var(--nemure-line)!important;color:#666c6c!important}.controller-hint{background:#fff!important;border-color:#cbc6bc!important;color:#666c6c!important}

/* Full white presentation for every modal and utility view. */
.product-flow-overlay{background:radial-gradient(circle at 19% 16%,#fff 0 12%,transparent 34%),radial-gradient(circle at 80% 20%,#dce7e455 0,transparent 27%),linear-gradient(180deg,#faf9f4f6,#e8e4dbfa 76%)!important}
.product-flow-panel,.product-flow-title-panel,.product-flow-settings-panel,.product-flow-result-panel,.product-flow-game-menu-panel,.product-flow-howto-panel,.product-flow-dungeon-panel{
  background:#fbfaf6ed!important;border-color:#c4beb2!important;color:#272c2f!important;box-shadow:0 30px 100px #5e594c2c,inset 0 1px #fff!important;backdrop-filter:blur(16px)!important;
}
.product-flow-panel h1,.product-flow-panel h2,.product-flow-panel h3{color:#202529!important}.product-flow-kicker{color:#7d817c!important}.product-flow-lead{color:#656c6d!important}
.product-flow-actions button,.product-flow-back,.product-setting-row,.product-setting-range,.dungeon-select-card,.result-bank button{
  background:#ffffffba!important;border-color:#cbc6bc!important;color:#343a3c!important;
}
.product-flow-actions button:hover,.product-flow-back:hover,.product-setting-row:hover,.dungeon-select-card:hover,.result-bank button:hover{background:#fff!important;border-color:#a7a298!important}
.product-flow-actions .product-flow-primary,.result-bank .product-flow-primary{background:linear-gradient(90deg,#e5eeeb,#fff)!important;border-color:#9ca8a5!important}
.product-flow-actions button small,.product-setting-row small,.product-setting-range small,.result-bank button small{color:#858782!important}
.product-flow-status,.keybind-feedback{background:#f0f4f2!important;border-color:#b7c5c1!important;color:#536866!important}
.title-input-badges span,.result-route-chip{background:#f2ede3!important;border-color:#c8c0b1!important;color:#6d614b!important}
.howto-grid section{background:#f5f2ea!important;border-color:#cbc5b9!important}.howto-grid b{color:#353b3d!important}.howto-grid p{color:#666d6e!important}.howto-grid strong{color:#607f89!important}
.result-summary,.result-cause,.result-chronicle,.result-ledger-row,.result-build-row,.result-route-trail,.result-chronicle-section{background:#f7f4ed!important;border-color:#cec8bd!important;color:#3c4244!important}.result-chronicle-header b,.result-build-row b{color:#303638!important}.result-chronicle-header span,.result-route-chip b{color:#617f89!important}.result-chronicle-header code,.result-empty{color:#808682!important}.result-ledger-row>span,.result-build-row>span{color:#777d7c!important}.result-source{color:#5f846c!important}.result-sink{color:#9b6063!important}

/* Relic choice no longer falls back to the old navy modal. */
.relic-cache-overlay{background:rgba(232,228,218,.78)!important;backdrop-filter:blur(13px)!important}
.relic-cache-panel{background:#faf8f2f2!important;border-color:#bdb7ac!important;color:#303638!important;box-shadow:0 28px 90px #615a4e35!important}
.relic-cache-head{border-color:#d0cbc1!important}.relic-cache-head h2{color:#252a2d!important}.relic-eyebrow,.relic-family{color:#688691!important}.relic-cache-copy{color:#727979!important}
.relic-slot-row button,.relic-card,.relic-cache-footer button{background:#fffdf8!important;border-color:#c8c2b7!important;color:#343a3c!important}.relic-slot-row button.selected,.relic-card.selected{outline-color:#7897a2!important;box-shadow:0 0 0 4px #7897a21f!important}.relic-card p{color:#687071!important}.relic-card button{background:#edf3f1!important;border-color:#91aaa8!important;color:#304043!important}.relic-cache-footer{color:#7a807e!important}

/* Spellbook remains paper-like, but all chrome is pale. */
#spellBook{background:#e8e4dbd8!important;backdrop-filter:blur(14px)!important}.spellbook-shell{background:#e7decc!important;border-color:#a99e8b!important;color:#2d2921!important;box-shadow:0 28px 80px #5a54483a!important}.spellbook-head{background:#eee7d8!important;border-color:#b8ad98!important;color:#302a22!important}.spellbook-head button,.spellbook-attribute-pages button{background:#faf3e4!important;border-color:#c7baa2!important;color:#514638!important}.spellbook-page{background:linear-gradient(100deg,#fff9eb,#eee2ca)!important;color:#29241b!important}.spellbook-row,.spellbook-detail,.spellbook-section-title{color:#332d23!important}.spellbook-row.selected{background:#e7dcc5!important;border-color:#9d8c6f!important}

/* Debug/audit surfaces also use the released visual language. */
.debug-drawer{background:#f0ece3!important;border-color:#c4beb2!important;color:#343a3c!important}.debug-drawer>summary{background:#e7e3da!important;color:#595e5e!important;border-color:#c6c0b5!important}.debug-grid{background:#f4f1ea!important}.panel{background:#fffdf8!important;border-color:#cbc5ba!important;color:#3d4345!important;box-shadow:none!important}.panel b,.panel strong{color:#2e3436!important}.panel small,.panel code{color:#7b817f!important}.panel button{background:#f7f4ed!important;border-color:#c9c3b8!important;color:#454c4e!important}.panel button:hover{background:#fff!important}.log{background:#f8f5ee!important;color:#606767!important}

/* Mobile controls are white as well; the old dark Android dock is explicitly neutralized. */
.movement-pad-wrap,.touch-actions,.product-map-region>.touch-controller{background:#f8f6f0eb!important;border-color:#bbb6ac!important;color:#343a3c!important;box-shadow:0 -10px 30px #5e584b22!important;backdrop-filter:blur(12px)!important}
.dpad button,.touch-actions button,.touch-pad-toggle{background:#ffffffed!important;border-color:#c6c0b5!important;color:#363c3e!important;box-shadow:0 1px #fff!important}.dpad-center{color:#6d8580!important}.touch-mode{background:#eeebe3!important;border-color:#c9c4b9!important;color:#69706f!important}.virtual-stick-ring{background:radial-gradient(circle,#eef2ef 0 24%,#e3e6e2 25% 58%,#d2d7d3 59% 62%,#f6f4ee 63%)!important;border-color:#aeb9b6!important;box-shadow:inset 0 0 18px #7e79691f,0 7px 20px #625c5022!important}.virtual-stick-knob{background:radial-gradient(circle at 35% 30%,#fdfefe,#a9bdbd 72%)!important;border-color:#78949a!important;box-shadow:0 5px 14px #665f5028,inset 0 1px #fff!important}.virtual-stick small{color:#707b79!important}

/* Range setting used in both title settings and developer settings. */
.product-setting-range{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,220px) 54px;align-items:center;gap:12px;padding:11px 12px;border:1px solid #cbc6bc;border-radius:7px;background:#ffffffba;color:#343a3c}.product-setting-range>span{display:grid;gap:3px}.product-setting-range b{font-size:11px}.product-setting-range small{font-size:9px;line-height:1.3}.product-setting-range strong{text-align:right;color:#5d6b6b}.product-setting-range input[type=range],.debug-setting-range input[type=range]{accent-color:#78959b;width:100%}
.debug-setting-range{display:grid;grid-template-columns:auto minmax(110px,1fr) 42px;align-items:center;gap:7px;padding:4px 6px;border:1px solid #cec8bd;border-radius:5px;background:#f7f4ed;color:#5e6565}.debug-setting-range span,.debug-setting-range b{font:800 9px ui-monospace,monospace}

/* Full-screen post effect. It sits above every UI surface, but does not capture input. */
.global-postfx{position:fixed;inset:0;z-index:2147483000;pointer-events:none;overflow:hidden;opacity:1;mix-blend-mode:normal}
.global-postfx::before,.global-postfx::after{content:"";position:absolute;inset:-3%;pointer-events:none}
.global-postfx::before{
  opacity:calc(var(--global-fx-grain) + var(--global-fx-scan));
  background:
    repeating-linear-gradient(0deg,rgba(80,92,96,0) 0 3px,rgba(78,93,98,var(--global-fx-scan)) 4px),
    repeating-radial-gradient(circle at 19% 23%,rgba(38,48,52,var(--global-fx-grain)) 0 .55px,rgba(255,255,255,var(--global-fx-grain)) .9px 1.45px,transparent 1.7px 4px);
  mix-blend-mode:multiply;
  animation:nemureGlobalGrain .26s steps(2,end) infinite;
}
.global-postfx::after{
  opacity:1;
  background:
    radial-gradient(ellipse at 50% 46%,transparent 0 56%,rgba(54,55,50,var(--global-fx-vignette)) 86%,rgba(42,43,39,var(--global-fx-vignette)) 100%),
    linear-gradient(90deg,rgba(190,72,92,var(--global-fx-chroma)) 0 1px,transparent 1px calc(100% - 1px),rgba(67,147,169,var(--global-fx-chroma)) calc(100% - 1px)),
    radial-gradient(circle at 24% 14%,rgba(255,255,255,var(--global-fx-glow)) 0 2%,transparent 18%),
    radial-gradient(circle at 73% 68%,rgba(219,236,233,var(--global-fx-glow)) 0 3%,transparent 20%);
  mix-blend-mode:multiply;
}
@keyframes nemureGlobalGrain{0%{transform:translate3d(-.25%,.15%,0)}50%{transform:translate3d(.2%,-.2%,0)}100%{transform:translate3d(.1%,.25%,0)}}
html[data-post-fx="0"] .global-postfx{display:none}
html[data-reduced-motion="1"] .global-postfx::before{animation:none!important}
@media(prefers-reduced-motion:reduce){.global-postfx::before{animation:none!important}}

/* Keep pale appearance in coarse-pointer layouts where older rules used hard black. */
@media(pointer:coarse){
  html,body{background:#ece8df!important}
  .product-map-region>.touch-controller{background:#f8f6f0ed!important}
  .action-sidebar{background:#faf8f3f6!important}
}
@media(max-width:650px){.product-setting-range{grid-template-columns:1fr 48px}.product-setting-range input{grid-column:1/-1}.product-setting-range strong{grid-column:2;grid-row:1}}

/* v0.49.0 — NEMURE, NEMURE, white-theme completion pass
   Explicitly neutralize the last legacy dark component interiors. */
.status-title{border-bottom-color:#d1ccc2!important;color:#303638!important}.status-title span{color:#678b94!important}
.status-meter{color:#4b5355!important}.status-meter i{background:#e5e2da!important;border-color:#beb9af!important;box-shadow:inset 0 1px 2px #776f6030!important}
.status-dock-meta span{background:#f6f3ec!important;border-color:#ccc7bd!important;color:#4f5859!important;box-shadow:inset 0 1px #fff!important}
.status-conditions span{background:#f4eadc!important;border-color:#cbb89d!important;color:#725c42!important}.status-conditions.normal span{background:#edf2ef!important;border-color:#b8c7c1!important;color:#516b64!important}
.status-equip small,.status-dock-equip button small{color:#858985!important}.status-equip.selected,.status-dock-equip button:active{background:#e7efed!important;border-color:#91aaa8!important;color:#283336!important}

.tap-inspect-head{border-bottom-color:#cec9bf!important}.tap-inspect-head b{color:#303638!important}.tap-inspect-head span{color:#7e8584!important}.tap-inspect-empty{color:#838986!important}.tap-inspect-empty b{color:#627f88!important}
.inspect-block{border-top-color:#ddd8cf!important}.inspect-block b{color:#303638!important}.inspect-block small{color:#697071!important}.inspect-block span{color:#668995!important}
.inspect-tile span{color:#587f89!important}.inspect-tile small b{color:#8b7048!important}.inspect-enemy span{color:#a35f63!important}.inspect-ally span{color:#5e846a!important}.inspect-item span{color:#8a7347!important}.inspect-orb span{color:#7d6993!important}.inspect-hazard span{color:#9d6957!important}.inspect-bonus span{color:#8b7346!important}

.item-inline-head b,.spell-inline-head b{color:#2c3235!important}.item-inline-head span,.spell-inline-head span{color:#6c858c!important}.item-inline-copy,.spell-inline-copy{color:#626a6b!important}.item-inline-copy strong{color:#31383a!important}
.item-inline-actions button{background:#fff!important;border-color:#cbc6bc!important;color:#3e4648!important}.item-inline-actions button small{color:#818683!important}.item-inline-actions button.selected{background:#e7efed!important;border-color:#8fa8a6!important;box-shadow:0 0 0 1px #6f909a24!important}.item-inline-action-help,.item-inline-hint{background:#f2efe7!important;border-left-color:#81999a!important;color:#687170!important}
.spell-inline-facts span,.spell-inline-tags span{background:#f7f4ed!important;border-color:#cec8bd!important;color:#607174!important}.spell-inline-mechanics,.spell-inline-upgrades{background:#f1eee8!important;border-left-color:#8e8197!important;color:#656b6e!important}.spell-inline-mechanics b,.spell-inline-upgrades b{color:#645a6d!important}.spell-inline-target{border-top-color:#d5d0c6!important}.spell-inline-hint{color:#858b88!important}

.run-history-picker button{background:#fff!important;border-color:#cdc8be!important;color:#555d5f!important}.run-history-picker button span{color:#858b89!important}.run-history-picker button.selected{background:#e7efed!important;border-color:#88a3a2!important;color:#263033!important}.run-history-head b{color:#303638!important}.run-history-head span{color:#747d7e!important}.run-history-seed{background:#f7f4ed!important;border-color:#cbc6bc!important;color:#5e7e86!important}.run-history-cause{background:#f4e8e6!important;border-left-color:#b8797b!important;color:#7b5a5c!important}.run-history-route,.run-history-build{color:#626a6b!important}.run-history-route b,.run-history-build b,.run-history-actions>b,.run-history-timeline>b{color:#333a3c!important}.run-history-actions span{background:#f6f3ec!important;border-color:#cec8bd!important;color:#626a69!important}.run-history-actions span b{color:#343a3c!important}.run-history-timeline li{border-top-color:#ddd8cf!important}.run-history-timeline li span{color:#848986!important}.run-history-timeline li b{color:#4a5253!important}.run-history-empty span,.run-history-empty small{color:#7c8381!important}

.loot-generated{background:#f8f5ee!important;border-color:#cbc5ba!important}.loot-generated b{color:#343b3d!important}.loot-generated span{color:#6e7575!important}.loot-quality{border-bottom-color:#d9d3c9!important}.loot-quality b{color:#826c48!important}.loot-affixes{border-top-color:#ddd7cd!important;border-bottom-color:#ddd7cd!important}.loot-affixes strong{color:#577983!important}.loot-affixes.empty span{color:#8b8e89!important}.loot-compare{background:#eef3f0!important;border-left-color:#799699!important}

.spellbook-stat-training{background:#f1e6cc!important;border-color:#b9a27b!important}.spellbook-stat-training-row button{background:#fff8e9!important;color:#5b4c34!important;border-color:#b7a17d!important}.spellbook-stat-training-row button:hover{background:#fff!important}

.result-grid>div{background:#f5f2eb!important;border-color:#cbc6bc!important;color:#353b3d!important;box-shadow:inset 0 1px #fff!important}.result-grid span{color:#818784!important}.result-grid b{color:#303638!important}.result-section-title{color:#71858a!important}.result-cause{background:#f4e7e5!important;border-left-color:#b36d73!important;color:#6f5558!important}.result-cause span{color:#9b686b!important}.result-cause b{color:#684e51!important}.result-win{border-color:#9eb8aa!important}.result-win .product-flow-kicker{color:#668c77!important}.result-dead{border-color:#b99a9c!important}

/* Avoid old black utility islands in settings/debug surfaces. */
.settings-row button,.bind-grid button,.debug-grid button,.panel input,.panel select,.panel textarea{background:#fff!important;border-color:#cbc6bc!important;color:#40484a!important}.settings-row button:hover,.bind-grid button:hover{background:#f3f5f2!important}.panel input,.panel select,.panel textarea{box-shadow:inset 0 1px 2px #6c665817!important}

/* The game field may be dark for depth/visibility, but its chrome is never the old dark UI theme. */
.map-legend{color:#4e5657!important}.map-legend span{color:#5f6667!important}

@media(pointer:coarse){
  .status-dock-meta span,.status-conditions span,.status-conditions.normal span,.item-inline-actions button,.run-history-picker button{box-shadow:none!important}
}

/* Android/WebView compositors can drop a filtered ancestor canvas layer.
   Keep the global overlay + text chroma/grain FX on coarse pointers, but do not
   filter the entire product-frame layer itself. */
@media(pointer:coarse){
  body.product-ui > :not(.global-postfx):not(script){filter:none!important}
}

/* Mobile landscape: the full-screen touch-controller is only a positioning layer.
   White styling belongs to the left/right control islands, never the whole overlay. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:700px){
  .product-map-region>.touch-controller{
    background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;
  }
}


/* v0.50 — integrated field menu + Android list-first density */
.sidebar-tabs{grid-template-columns:repeat(6,minmax(0,1fr))}
.sidebar-tabs button{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* The field menu is a catalogue first. Description is secondary on touch screens. */
@media (pointer:coarse) and (max-width:1100px){
  .action-sidebar{
    width:min(430px,94vw)!important;
    max-width:94vw!important;
    display:flex!important;
    flex-direction:column!important;
    min-height:0!important;
  }
  .sidebar-tab-rail{flex:0 0 auto!important}
  .sidebar-tabs button{min-height:32px!important;padding:3px 1px!important;font-size:8px!important}
  .sidebar-summary{flex:0 0 auto!important;min-height:24px!important;padding:3px 7px!important}
  .sidebar-subtabs{flex:0 0 auto!important;min-height:26px!important;padding:3px 5px!important}
  .sidebar-subtab{padding:2px 5px!important;font-size:8px!important}
  .sidebar-list{
    flex:1 1 auto!important;
    min-height:120px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    padding:4px 5px!important;
  }
  .sidebar-row{min-height:32px!important;padding:4px 7px!important;margin:1px 0!important;gap:5px!important}
  .sidebar-row-main{font-size:9px!important}
  .sidebar-row-meta{font-size:7px!important}
  .sidebar-detail{
    flex:0 0 auto!important;
    min-height:44px!important;
    max-height:92px!important;
    padding:5px 7px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    font-size:8.5px!important;
    line-height:1.3!important;
  }
  .sidebar-detail.spell-detail-active,
  .sidebar-detail.item-detail-active{
    min-height:44px!important;
    max-height:92px!important;
  }
  .spell-inline-detail,.item-inline-detail{gap:3px!important}
  .spell-inline-head,.item-inline-head{gap:1px!important}
  .spell-inline-head b,.item-inline-head b{font-size:10px!important}
  .spell-inline-head span,.item-inline-head span{font-size:7px!important}
  .spell-inline-facts,.item-inline-facts{gap:2px!important}
  .spell-inline-facts span,.spell-inline-tags span{padding:1px 3px!important;font-size:6.5px!important}
  .spell-inline-copy,.spell-inline-mechanics,.spell-inline-upgrades,
  .item-inline-copy,.item-inline-action-help,.item-inline-hint{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
    min-height:0!important;
    margin:0!important;
    padding-top:2px!important;
    padding-bottom:2px!important;
    font-size:8px!important;
    line-height:1.25!important;
  }
  .spell-inline-tags,.loot-generated{display:none!important}
  .item-inline-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important}
  .item-inline-actions button{min-height:27px!important;padding:2px 4px!important}
  .item-inline-actions button b{font-size:8px!important}
  .item-inline-actions button small{font-size:6px!important}
}

/* Typical Android landscape: keep at least half the drawer available to the actual list. */
@media (pointer:coarse) and (orientation:landscape) and (max-height:700px){
  .action-sidebar{top:35px!important;bottom:5px!important}
  .sidebar-list{min-height:0!important}
  .sidebar-detail.spell-detail-active,
  .sidebar-detail.item-detail-active{
    min-height:38px!important;
    max-height:72px!important;
  }
  .spell-inline-mechanics{display:none!important}
  .item-inline-action-help{display:none!important}

  /* Spell Book modal: catalogue gets most of the horizontal space. */
  #spellBook .spellbook-catalog-layout{
    grid-template-columns:minmax(0,1.8fr) minmax(220px,.62fr)!important;
  }
  #spellBook .spellbook-detail{padding:7px 8px max(7px,env(safe-area-inset-bottom)) 8px!important}
  #spellBook .spellbook-detail-description{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:3!important;
    overflow:hidden!important;
    margin:4px 0!important;
    font-size:8px!important;
    line-height:1.25!important;
  }
  #spellBook .spellbook-detail-tags{display:none!important}
  #spellBook .spellbook-detail-upgrades{margin-top:3px!important;padding-top:4px!important}
  #spellBook .spellbook-detail-upgrade small{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
  }
}

/* Very narrow touch screens: list-only Spell Book; selecting a formula remains possible. */
@media (pointer:coarse) and (max-width:650px){
  #spellBook .spellbook-catalog-layout{grid-template-columns:1fr!important}
  #spellBook .spellbook-detail-page{display:none!important}
}


/* v0.51 — hand-inked 32px / HD-2D field pass */
:root{
  --ink:#343334;--ink-soft:#74716c;--paper:#ece9e1;--paper-deep:#d7d3c9;
  --hd-depth:9px;--hd-vignette:.72;--hd-grain:.23;
}
.product-map-region{
  isolation:isolate;
  overflow:hidden;
  background:
    linear-gradient(to bottom,rgba(248,246,239,.94) 0 17%,rgba(211,209,198,.82) 42%,rgba(98,97,92,.4) 100%);
}
.product-map-region::before,.product-map-region::after{
  content:"";position:absolute;inset:-10% -8% 30%;pointer-events:none;z-index:-2;
  transform:translate3d(var(--parallax-x,0),var(--parallax-y,0),0);
}
.product-map-region::before{
  opacity:.62;filter:blur(1.8px);background:
    linear-gradient(164deg,transparent 0 56%,#77746e22 56.5% 58%,transparent 58.5%),
    repeating-linear-gradient(97deg,transparent 0 47px,#54514d18 48px 49px,transparent 50px 86px);
  clip-path:polygon(0 66%,7% 48%,14% 61%,22% 32%,31% 58%,42% 23%,51% 57%,61% 35%,69% 62%,78% 28%,87% 58%,95% 41%,100% 63%,100% 100%,0 100%);
  animation:ink-parallax-far 22s ease-in-out infinite alternate;
}
.product-map-region::after{
  inset:25% -12% -15%;z-index:-1;opacity:.42;filter:blur(5px);
  background:repeating-linear-gradient(88deg,transparent 0 54px,#3e3c3928 56px 59px,transparent 61px 103px);
  clip-path:polygon(0 58%,9% 45%,18% 61%,29% 38%,37% 55%,49% 35%,60% 63%,72% 41%,84% 59%,93% 39%,100% 52%,100% 100%,0 100%);
  animation:ink-parallax-near 13s ease-in-out infinite alternate;
}
.canvas-wrap{
  perspective:980px;
  transform-style:preserve-3d;
  background:#d8d4ca;
  box-shadow:0 18px 36px #27262445,0 -8px 30px #fff9,inset 0 0 28px #514e4933;
}
.canvas-wrap>canvas#game{
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  transform-origin:50% 62%;
  transform:none;
  filter:none;
}
.canvas-wrap::before{
  content:"";position:absolute;inset:-2px;z-index:3;pointer-events:none;
  background:
    radial-gradient(ellipse at 50% 53%,transparent 35%,rgba(38,37,35,.16) 76%,rgba(24,23,22,var(--hd-vignette)) 125%),
    linear-gradient(to bottom,rgba(255,255,255,.28),transparent 24%,transparent 73%,rgba(29,28,27,.16));
  mix-blend-mode:multiply;
}
.canvas-wrap::after{
  content:"";position:absolute;inset:-3%;z-index:4;pointer-events:none;opacity:var(--hd-grain);
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.46'/%3E%3C/svg%3E");
  mix-blend-mode:multiply;animation:paper-grain .23s steps(2) infinite;
}
.map-postfx{
  backdrop-filter:blur(.18px);
  -webkit-backdrop-filter:blur(.18px);
  background:linear-gradient(to bottom,rgba(255,255,255,.13),transparent 25% 72%,rgba(39,38,36,.15));
}
.product-header,.status-dock,.action-sidebar,.message-panel,.tap-inspect-panel,.product-footer,
.product-flow-panel,.spellbook-shell{
  color:var(--ink)!important;
  border-color:#77736c88!important;
  background-color:rgba(239,237,230,.9)!important;
  background-image:linear-gradient(91deg,transparent 0 49%,#514f4b09 50% 51%,transparent 52%)!important;
  box-shadow:0 5px 18px #302f2c24,inset 0 0 0 1px #fff8!important;
}
.product-header h1,.panel h2,.spellbook-head h2{
  font-family:"Yu Mincho","Hiragino Mincho ProN",serif!important;
  font-weight:500!important;letter-spacing:.12em;
  text-shadow:1px 0 #3a383622,-1px 1px #fff;
}
button,.sidebar-row,.status-card,.hud-chip,input,select{
  border-radius:2px!important;
  border-color:#77736c70!important;
}
button,.sidebar-row{box-shadow:1px 2px 0 #4b484633!important}
.global-postfx{opacity:calc(var(--global-fx-strength, .55) * .72)!important}
@keyframes paper-grain{0%{transform:translate(0,0)}25%{transform:translate(-1%,1%)}50%{transform:translate(1%,-1%)}75%{transform:translate(.5%,1%)}100%{transform:translate(-.5%,-1%)}}
@keyframes ink-parallax-far{from{transform:translate3d(-1.1%,.2%,0)}to{transform:translate3d(1.1%,-.5%,0)}}
@keyframes ink-parallax-near{from{transform:translate3d(1.4%,0,0)}to{transform:translate3d(-1.4%,.8%,0)}}
/* Actual projected field stays unfiltered; only the paper UI is monochrome. */
.product-header,.product-hud,.status-dock,.action-sidebar,.message-panel,.tap-inspect-panel,.product-footer,.product-flow-panel,.spellbook-shell,.quick-spell-dock,.touch-controller{filter:grayscale(1)!important}
.product-map-region::before,.product-map-region::after{animation:none!important}
.canvas-wrap::after{opacity:calc(var(--global-fx-strength,.55) * .2)}
.canvas-wrap::before{opacity:var(--global-fx-strength,.55)}
.map-postfx{backdrop-filter:blur(calc(var(--global-fx-strength,.55) * 2.8px));-webkit-backdrop-filter:blur(calc(var(--global-fx-strength,.55) * 2.8px));mask-image:linear-gradient(#000,transparent 23% 78%,#000);pointer-events:none}
html[data-post-fx="0"] .map-postfx,html[data-post-fx="0"] .canvas-wrap::before,html[data-post-fx="0"] .canvas-wrap::after{opacity:0!important}
html[data-reduced-motion="1"] .canvas-wrap::after{animation:none!important}
@font-face{font-family:InkJournal;src:url('assets/fonts/ink-japanese.woff') format('woff');font-weight:100 900;font-style:normal;font-display:swap}
#miniMap,.map-legend,.relic-cache-panel{filter:grayscale(1)!important}
.product-ui{background-color:#eee!important}
.product-map-region{background-color:#eee!important}
.product-ui button,.product-ui .status-card,.product-ui .tap-inspect-panel{border-radius:2px 4px 3px 5px / 4px 2px 5px 2px!important}
@font-face{font-family:InkLatin;src:url('assets/fonts/zen-kurenaido-latin-400-normal.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
.product-ui,.product-ui button,.product-ui input,.product-ui select,.product-ui small,.product-ui span,.product-ui b,.product-ui strong,.product-ui div,.product-ui h1,.product-ui h2,.product-ui h3{font-family:InkLatin,InkJournal,"Yu Gothic",sans-serif!important}
.product-ui .product-brand h1{font-family:InkJournal,serif!important}
.product-map-region .canvas-wrap{min-height:0!important;background:#ededeb var(--ruin-paper-image,url('assets/ruins/background-boundary.png')) center/cover no-repeat!important;overflow:hidden!important;display:grid!important;place-items:center!important}
.product-map-region .canvas-wrap>canvas#game,.world-village .product-map-region .canvas-wrap>canvas#game.village-map{display:block!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;aspect-ratio:auto!important;border:0!important;background:transparent!important;filter:none!important;box-shadow:none!important}
.product-map-region .canvas-wrap::before,.product-map-region .canvas-wrap::after{inset:0!important;width:auto!important;height:auto!important;border:0!important;z-index:3!important}
.product-map-region .canvas-wrap::after{opacity:calc(var(--global-fx-strength,.55) * .13)!important}
.product-map-region .canvas-wrap::before{opacity:var(--global-fx-strength,.55)!important}
@media(prefers-reduced-motion:reduce){
  .product-map-region::before,.product-map-region::after,.canvas-wrap::after{animation:none!important}
}
@media(pointer:coarse){
  .canvas-wrap>canvas#game{transform:none}
  .canvas-wrap::after{opacity:.12}
  .product-map-region::before,.product-map-region::after{filter:none}
}


/* 2026-09-21 readable mechanics template: Shiren-like scanability + explicit systemic values. */
.mechanics-template{display:grid;gap:6px;min-width:0;margin:2px 0}
.mechanics-facts{display:flex;flex-wrap:wrap;gap:4px}
.mechanics-facts>span{display:inline-flex;gap:4px;align-items:baseline;padding:2px 5px;border:1px solid #33495a;border-radius:3px;background:#0d1720;color:#9fb2c0;font:800 8px ui-monospace,monospace;letter-spacing:.025em}
.mechanics-facts>span>b{margin:0!important;color:#dce8f1!important;font-size:8px!important;letter-spacing:.06em}
.mechanics-rows{display:grid;gap:2px}
.mechanics-row{display:grid;grid-template-columns:minmax(72px,.33fr) minmax(0,1fr);gap:7px;align-items:start;padding:4px 6px;border-left:2px solid #526675;background:#0a131b;color:#aebdca;line-height:1.35}
.mechanics-row>b{margin:0!important;color:#dce8f1!important;font:900 8px ui-monospace,monospace!important;letter-spacing:.04em}
.mechanics-row>span{min-width:0;overflow-wrap:anywhere;font-size:9px}
.mechanics-row.tone-primary{border-left-color:#d7b96a}.mechanics-row.tone-primary>b{color:#f0d58e!important}
.mechanics-row.tone-control{border-left-color:#9c83c7}.mechanics-row.tone-control>b{color:#d9c7f5!important}
.mechanics-row.tone-terrain{border-left-color:#699b86}.mechanics-row.tone-terrain>b{color:#a9d8c2!important}
.mechanics-row.tone-synergy{border-left-color:#70a9c4}.mechanics-row.tone-synergy>b{color:#b8e5f5!important}
.mechanics-row.tone-risk{border-left-color:#b96d73}.mechanics-row.tone-risk>b{color:#efb2b6!important}
.mechanics-row.tone-condition{border-left-color:#aa8c61}.mechanics-row.tone-condition>b{color:#e4c99e!important}
.mechanics-row.tone-utility{border-left-color:#708f75}.mechanics-row.tone-utility>b{color:#b9d7bd!important}
.mechanics-tags{display:flex;flex-wrap:wrap;gap:3px}.mechanics-tags>span{padding:1px 5px;border:1px solid #33495a;border-radius:999px;color:#8197a8;font:800 7px ui-monospace,monospace}
.mechanics-note{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px;padding:5px 6px;border-top:1px dashed #304354;color:#8196a6;font-size:8.5px;line-height:1.4}
.mechanics-note>b,.mechanics-linked>b{margin:0!important;color:#a8b8c5!important;font:900 8px ui-monospace,monospace!important;letter-spacing:.08em}
.mechanics-linked{display:grid;gap:4px;padding-top:5px;border-top:1px solid #293c4b}.mechanics-linked .mechanics-template{margin-left:5px;padding-left:6px;border-left:1px solid #344b5c}
.spellbook-detail .mechanics-template{margin:10px 0 12px;gap:7px}.spellbook-detail .mechanics-facts>span{border-color:#b79a67;background:#f8e9c6;color:#604c2d}.spellbook-detail .mechanics-facts>span>b{color:#3d2c18!important}.spellbook-detail .mechanics-row{background:#f5e7c7;color:#4a3a24;border-left-color:#9b8159;padding:6px 7px}.spellbook-detail .mechanics-row>b{color:#503d22!important}.spellbook-detail .mechanics-row.tone-primary{border-left-color:#9a7139}.spellbook-detail .mechanics-row.tone-control{border-left-color:#806a9b}.spellbook-detail .mechanics-row.tone-terrain{border-left-color:#64806a}.spellbook-detail .mechanics-row.tone-synergy{border-left-color:#577f8b}.spellbook-detail .mechanics-row.tone-risk{border-left-color:#9c5f5f}.spellbook-detail .mechanics-row.tone-condition{border-left-color:#917447}.spellbook-detail .mechanics-row.tone-utility{border-left-color:#657c5e}.spellbook-detail .mechanics-tags>span{border-color:#b89a69;color:#6b5738}.spellbook-detail .mechanics-note{border-top-color:#b99d6e;color:#6d5b40}.spellbook-detail .mechanics-note>b,.spellbook-detail .mechanics-linked>b{color:#594425!important}
.tap-inspect-panel .mechanics-template{gap:3px}.tap-inspect-panel .mechanics-facts>span{padding:1px 3px;font-size:6.5px}.tap-inspect-panel .mechanics-row{grid-template-columns:55px minmax(0,1fr);gap:4px;padding:2px 4px}.tap-inspect-panel .mechanics-row>b{font-size:6.5px!important}.tap-inspect-panel .mechanics-row>span{font-size:7px}.tap-inspect-panel .mechanics-note{display:none}
@media(max-width:650px){.mechanics-row{grid-template-columns:64px minmax(0,1fr)}.spellbook-detail .mechanics-row{grid-template-columns:72px minmax(0,1fr)}}


/* 2026-09-21 spellbook sections + Life resource */
.spellbook-attribute-pages{grid-template-columns:repeat(auto-fit,minmax(68px,1fr))}
.spellbook-attribute-pages .spellbook-section-tab{border-color:#887553;background:#ead8af;color:#46351f;box-shadow:inset 0 -2px #a48855}
.spellbook-attribute-pages .spellbook-section-tab.active{background:#2f3a32;color:#f4f0df;border-color:#5f7164;box-shadow:inset 0 -3px #91aa91}
.spellbook-attribute-pages .spellbook-category-tab{background:#f5e5bf}
.spellbook-free-action-note{display:block;margin-top:4px;color:#725f42;font:800 8px ui-monospace,monospace;letter-spacing:.04em}
.spellbook-detail-stats span b{margin:0 3px 0 0!important}
@media(max-width:900px){
  #spellBook .spellbook-attribute-pages{height:auto!important;min-height:44px!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;overflow:auto!important}
}
@media(max-width:650px){
  #spellBook .spellbook-attribute-pages{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
