:root{color-scheme:dark;font:15px/1.5 system-ui,sans-serif;color:#e8eee9;background:#101815;--muted:#aebeb4;--border:#35473c;--surface:#1a2620;--accent:#c8ddaa;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--panel-radius:3px;--control-min:42px;--touch-min:44px;--safe-top:max(env(safe-area-inset-top,0px),var(--test-safe-top,0px));--safe-right:max(env(safe-area-inset-right,0px),var(--test-safe-right,0px));--safe-bottom:max(env(safe-area-inset-bottom,0px),var(--test-safe-bottom,0px));--safe-left:max(env(safe-area-inset-left,0px),var(--test-safe-left,0px))}*{box-sizing:border-box}body{max-width:1240px;margin:auto;padding:28px}h1{font-size:clamp(26px,4vw,42px);line-height:1.15;font-weight:650;margin:8px 0 16px}h2{font-size:19px;margin:0 0 12px}h3{font-size:15px;margin:20px 0 8px}p{margin:8px 0 14px}.muted{color:var(--muted)}.small{font-size:12px}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--accent)}header{display:flex;justify-content:space-between;gap:25px;align-items:center;margin-bottom:22px}.header-actions{display:grid;gap:12px}a{color:var(--accent)}button,select,input,textarea{font:inherit;color:inherit;border:1px solid #526859;border-radius:7px;background:#24362a}button{cursor:pointer;padding:10px 13px;min-height:42px}button:hover:not(:disabled){background:#3b5141}button:disabled{opacity:.48;cursor:default}select,input{padding:8px;max-width:100%}input[type=checkbox]{accent-color:var(--accent);width:18px;height:18px}textarea{width:100%;min-height:80px;padding:12px;background:#111e17}button.primary{background:var(--accent);color:#18261a;font-weight:650}.summary{border-block:1px solid var(--border);padding:14px 0;display:flex;gap:20px;align-items:center;flex-wrap:wrap}.summary label{margin-left:auto}.clock-note{font-size:12px;margin:10px 0 24px}.layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:20px}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:20px;margin-bottom:18px}.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat{font-size:12px;color:var(--muted);border-bottom:1px solid var(--border);padding-bottom:8px}.stat b{display:block;color:#e8eee9;font-size:17px}.capacity{border-top:1px solid var(--border);padding:14px 0}.capacity p{margin:4px 0 8px}.capacity button{font-size:12px;width:100%}progress{width:100%;height:12px;accent-color:var(--accent)}.tabs{display:flex;gap:7px;margin-bottom:14px;flex-wrap:wrap}.tabs button[aria-selected=true]{background:#c8ddaa;color:#18261a}.nodes{display:grid;grid-template-columns:1fr 1fr;gap:10px}.node{border:1px solid var(--border);border-radius:8px;padding:14px;display:flex;flex-direction:column}.node p{font-size:13px}.node button{margin-top:auto;font-size:13px}.node .cost{font-size:12px;color:#c8ddaa}.node .reason{font-size:12px;min-height:35px;color:var(--muted)}.node.learned{border-color:#769168}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}.badge{font-size:12px;border:1px solid var(--border);padding:4px 8px;border-radius:20px}.loadout{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.slot{min-width:0}.slot label{font-size:12px;color:var(--muted)}.slot select{width:100%;font-size:13px}.slot p{font-size:11px;margin-top:7px;color:var(--muted)}#loadout-error{color:#f1b69d;min-height:23px}#apply{width:100%}.auto-label{display:flex;align-items:center;gap:8px;color:var(--accent)}.battle-settings,.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.battle-settings>select:first-child{flex:1}.battle-settings input{width:115px}.battle-settings{margin-top:15px}#arena{display:block;width:100%;height:auto;background:#101c16;border:1px solid var(--border);border-radius:9px;margin:18px 0}#actors{display:grid;gap:12px}.actor{padding:12px;border:1px solid var(--border);border-radius:8px}.actor h3{margin:0 0 8px}.skill-row{display:flex;gap:7px;flex-wrap:wrap}.skill-row button{font-size:12px;flex:1;min-width:100px}.passive-list{font-size:12px;color:var(--muted);margin:8px 0 0}#timeline{width:100%;accent-color:var(--accent);padding:0;margin-top:18px}#events{min-height:100px;max-height:270px;overflow:auto;font-size:13px;padding-left:22px}#result:not(:empty){padding:14px;background:#263e2d;border-radius:8px;margin:15px 0}details{border-top:1px solid var(--border);padding-top:12px}summary{cursor:pointer;color:var(--muted)}#battle-log{max-height:300px;overflow:auto;font-size:12px}.log-frame{border-bottom:1px solid var(--border);padding:9px}.history-item{border-top:1px solid var(--border);padding:12px 0;font-size:13px}.history-item button{font-size:12px;margin-top:8px}.notice{background:#3d3024;padding:10px;border-radius:8px;margin-bottom:12px}footer{color:var(--muted);font-size:12px;padding:15px 0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #e6dfa7;outline-offset:3px}@media(max-width:900px){.layout{grid-template-columns:240px minmax(0,1fr)}.loadout{grid-template-columns:1fr 1fr}.nodes{grid-template-columns:1fr}}@media(max-width:680px){body{padding:14px}header{display:block}.header-actions{display:flex;flex-wrap:wrap;align-items:center}.layout{grid-template-columns:1fr}.summary{gap:12px}.summary label{margin:0}.card{padding:16px}.nodes{grid-template-columns:1fr}.loadout{grid-template-columns:1fr 1fr}.battle-settings>select:first-child{flex-basis:100%}}

.quick-nav{position:sticky;top:0;z-index:2;display:flex;gap:18px;background:#101815ee;border-bottom:1px solid var(--border);padding:12px 0;margin-bottom:12px}.quick-nav a{font-size:13px;text-decoration:none}.card{scroll-margin-top:60px}
[hidden]{display:none!important}.screen-nav{position:sticky;top:0;z-index:2;display:flex;gap:8px;background:#101815f5;padding:10px 0;border-bottom:1px solid var(--border);margin-bottom:16px}.screen-nav a{flex:1;text-align:center;padding:10px;border-radius:7px;text-decoration:none}.screen-nav a[aria-current=page]{background:var(--accent);color:#18261a}.screen>h2{font-size:25px;margin:22px 0 12px}.button-link{display:inline-block;border:1px solid var(--border);border-radius:8px;padding:12px;text-decoration:none}#feedback:not(:empty){background:#26392c;padding:10px;border-radius:8px;margin:12px 0}#combat-cue{min-height:45px;padding:12px;border-left:3px solid var(--accent);background:#22342a}.reward-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:25px 0}.reward-item{padding:15px;border:1px solid var(--border);border-radius:8px;font-size:13px}.reward-item strong{display:block;font-size:28px;color:var(--accent)}.outcome{font-size:26px;color:var(--accent)}#report-arena{width:100%;height:auto}#report-stats{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:680px){.screen-nav{gap:2px}.screen-nav a{font-size:13px;padding:10px 4px}.reward-grid{gap:8px}.reward-item{padding:10px;font-size:11px}#report-stats{grid-template-columns:1fr 1fr}}

/* Source identity remains visible under critical emphasis. */
.combat-float{font-size:18px;font-weight:800;fill:#fff;stroke:#122019;stroke-width:3px;paint-order:stroke;pointer-events:none;animation:combat-rise 1.8s ease-out forwards;transform-box:fill-box;transform-origin:center}
.combat-float.weapon{fill:#edb297}.combat-float.weapon.lash{fill:#ed96ad}.combat-float.ability{fill:#b5a5ff}.combat-float.echo{fill:#91dce7}.combat-float.heal{fill:#a7edac}.combat-float.miss{fill:#d0d6d1}.combat-float.resist{fill:#85dbe6}.combat-float.cleanse{fill:#d4bcff}.combat-float.dot{font-size:14px;fill:#e7a2b2}.combat-float.toxin.dot{fill:#c2db81}.combat-float.critical{font-size:22px;font-weight:900;stroke-width:4px}
@keyframes combat-rise{0%{opacity:1;transform:translateY(0)}65%{opacity:1}100%{opacity:0;transform:translateY(-30px)}}
@media(prefers-reduced-motion:reduce){.combat-float{animation-name:combat-fade}@keyframes combat-fade{0%,65%{opacity:1}100%{opacity:0}}}

.combat-float.weapon.fists{fill:#efc28a}.combat-float.weapon.arms{fill:#ed98b7}.combat-float.pressure{fill:#efc28a;font-size:14px}.combat-float.control{fill:#ffd688}.combat-float.opening{fill:#f0d5a5;font-size:14px}.combat-float.recovery{fill:#c9afcb;font-size:14px}.combat-float.pressureReset{fill:#c9c2ac;font-size:13px}

.fracture-effect{pointer-events:none;animation:fracture-fade 1.2s ease-out forwards}.combat-float.doctrineestablished,.combat-float.doctrineextended{fill:#ffe098}.combat-float.doctrineexploited{fill:#ef98b7;font-size:21px}.combat-float.doctrinespent,.combat-float.doctrineexpired,.combat-float.doctrinefailed{font-size:14px;fill:#d3c6bb}#doctrine-controls{border:1px solid #c3a773;padding:12px;border-radius:8px;margin:12px 0}#opportunity-audit-log p{overflow-wrap:anywhere;font-size:13px}@keyframes fracture-fade{0%{opacity:1}100%{opacity:0}}@media(prefers-reduced-motion:reduce){.fracture-effect{animation:none}}

/* Stable contextual options, never cooldown-ready flashing. Text/shape reinforces colour. */
.skill-row button.contextual{opacity:1;border-width:2px}.skill-row button.contextual.establish{border-color:#edc36a;background:#382f1c;color:#ffe3a1}.skill-row button.contextual.exploit{border-color:#cba8ff;background:#30263f;color:#e4ceff}.skill-row button.contextual.recover{border-color:#9dddab;background:#213828;color:#c8f3d1}.skill-row button.contextual.preserve{border:2px dashed #a9d8dc;background:#23373b;color:#cff0f2}.context-label{display:block;font-size:10px;letter-spacing:.07em;margin-top:5px}.contextual:disabled{cursor:default}.combat-float.doctrineestablished,.combat-float.doctrineexploited{fill:#cba8ff}.combat-float.doctrineextended{fill:#a9d8dc}#auto-reason{border-left:2px solid #a5b4ad;padding:8px;min-height:35px}.pressure-bar,.opportunity-window{transition:width .25s ease}@media(prefers-reduced-motion:reduce){.pressure-bar,.opportunity-window{transition:none}}

#teamup-panel{border:2px solid #b997ed;border-radius:9px;padding:14px;margin:14px 0;background:#262231}#teamup-options{display:flex;flex-wrap:wrap;gap:12px}.teamup-option{flex:1;min-width:180px}#teamup-options button{border:2px solid #cba8ff;color:#ead9ff;background:#3b2a50}.autonomous-skill{display:inline-block;padding:6px;border:1px solid #435347;border-radius:5px;font-size:11px}.teamup-signature{font-size:20px;font-weight:800;color:#ead5ff;border-left:4px solid #cba8ff;padding:10px}.active-signature{color:#9cdae8;padding:6px;border-left:2px solid #9cdae8}.combat-float.teamupCall{fill:#e4c5ff;font-size:22px}.combat-float.importantActive{fill:#9cdae8;font-size:13px}

/* Front/Back intent trial: battlefield tells, not a second resource panel. */
#formation-controls{padding:.7rem 0}#formation-controls label{display:inline-block;margin:.3rem .7rem .3rem 0}.intent-windup>rect:first-child{animation:intent-breathe 1.6s ease-in-out infinite}.intent-target{stroke-dasharray:5 3}@keyframes intent-breathe{50%{stroke-width:5;stroke:#ffd1bd}}@media(prefers-reduced-motion:reduce){.intent-windup>rect:first-child{animation:none}}

/* A single bounded combat view keeps intervention controls beside the battlefield. */
#combat-viewport{position:relative;background:#101c16;border:1px solid var(--border);border-radius:10px;scroll-margin-top:76px}
#combat-toolbar{display:none}#combat-details{margin-top:16px}#combat-details>summary{padding:8px 0}
#combat-viewport.live-teamup{position:sticky;top:70px;z-index:1;height:min(640px,calc(100vh - 132px));height:min(640px,calc(100dvh - 132px));display:flex;flex-direction:column;overflow:hidden}
.live-teamup #combat-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;padding:8px;min-height:48px;background:#1a2620}
#intervention-strip{position:absolute;left:10px;bottom:10px;z-index:3;width:min(430px,46%);max-height:42%;overflow:auto;margin:0;padding:8px 10px;border:1px solid #557063;border-radius:8px;background:rgba(15,27,22,.94)}.intervention-heading{display:flex;justify-content:space-between;gap:10px;color:#9cdae8;font-size:10px;letter-spacing:.08em}.intervention-heading span{color:var(--muted);letter-spacing:0}.intervention-option{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:9px;padding:7px 0;border-top:1px solid #30443a}.intervention-copy{display:flex;align-items:baseline;gap:5px;min-width:0;flex-wrap:wrap}.intervention-copy .small{flex-basis:100%;color:var(--muted)}.intervention-option button{min-height:34px;padding:5px 11px}.intervention-option.exploit{border-left:2px solid #cba8ff;padding-left:8px}.intervention-option.recover{border-left:2px solid #9dddab;padding-left:8px}.intervention-option.establish{border-left:2px solid #edc36a;padding-left:8px}.intervention-option.preserve{border-left:2px dashed #a9d8dc;padding-left:8px}
#combat-toolbar button,#combat-toolbar select{font-size:12px;padding:5px 8px;min-height:34px}#combat-toolbar #step{display:none}#combat-toolbar #round{margin-left:auto;font-size:11px}#combat-toolbar .auto-label{font-size:12px;white-space:nowrap}
#combat-viewport.live-teamup #arena{flex:1;min-height:0;height:0;width:100%;margin:0;border:0;border-radius:0}
#combat-viewport #teamup-panel{flex:none;margin:0;padding:8px 10px;border:0;border-top:2px solid #b997ed;border-radius:0;background:#262231}
.teamup-heading{display:flex;align-items:center;gap:12px}.teamup-heading h3{margin:0;font-size:12px}.teamup-heading #teamup-status{margin:0;font-size:11px;color:#c9b8db}
#teamup-options{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:10px;padding:6px 0;overscroll-behavior-x:contain}
#teamup-options .teamup-option{display:flex;align-items:center;gap:8px;flex:0 0 auto;min-width:220px;max-width:310px;padding:6px 8px;border:1px solid #6f5b86;border-radius:7px}
.teamup-choice{flex:1;display:grid;gap:1px;min-width:0;font-size:12px}.teamup-choice strong,.teamup-choice>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:210px}.teamup-choice .small{font-size:10px}#teamup-options button{padding:7px 10px;min-height:40px;font-size:12px}.teamup-empty{margin:6px 0;font-size:12px}
#teamup-moment{margin:0;min-height:22px;max-height:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;padding:0 6px;border-left-width:2px}
.combat-focused .combat-card{padding-bottom:28px}.combat-explanations{margin-top:12px}
@media(max-width:680px){#combat-toolbar{gap:5px!important}#combat-toolbar #round{font-size:10px}#combat-toolbar #speed{max-width:75px}#combat-toolbar button,#combat-toolbar select{padding:4px;font-size:11px}#combat-toolbar .auto-label{font-size:10px}#combat-toolbar #abort{max-width:52px;line-height:1.1}#combat-viewport.live-teamup{top:62px;height:calc(100vh - 124px);height:calc(100dvh - 124px)}#combat-viewport{scroll-margin-top:66px}}

#combat-anchor{scroll-margin-top:76px}@media(max-width:680px){#combat-anchor{scroll-margin-top:66px}}

#combat-details>summary{scroll-margin-top:calc(min(640px,calc(100dvh - 132px)) + 78px)}@media(max-width:680px){#combat-details>summary{scroll-margin-top:calc(100dvh - 54px)}}

@media(max-width:680px){.live-teamup #combat-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 65px 40px 44px;gap:5px;padding:6px}#combat-toolbar #round{grid-column:1/-1;margin-left:0;line-height:1.2;font-size:11px}#combat-toolbar .auto-label{font-size:11px}}

/* CC BY 3.0 Lorc symbols retain text equivalents; no new flashing cues. */
.decision-icon{width:18px;height:18px;flex:none;vertical-align:middle;margin-right:6px}.teamup-heading h3{display:flex;align-items:center}.opportunity-icon{position:absolute;right:0;top:0;color:#cba8ff;pointer-events:none}.teamup-choice{position:relative;padding-right:23px}.asset-credits{max-width:1200px;margin:12px auto;padding:8px 16px;font-size:.8rem;color:#a7b7ac}

/* First-pass house: one state, distinct rooms, Home is the organism's hub. */
:root{--nav-height:62px}
header h1{font-size:24px;margin-bottom:0}header{margin-bottom:16px}.header-actions{font-size:12px}
.screen-nav{align-items:center;flex-wrap:wrap;gap:4px;padding:8px 0}
.screen-nav a{flex:0 0 auto;font-size:12px;padding:10px 9px;min-height:44px;display:flex;align-items:center;justify-content:center}
#navigation-rooms{display:contents}#navigation-toggle{display:none}
.home-layout{display:grid;grid-template-columns:minmax(260px,.95fr) minmax(0,1.3fr);gap:20px;align-items:start}
.organism-home{text-align:center;position:sticky;top:calc(var(--nav-height) + 18px);background:radial-gradient(ellipse at center,#2a3c30,#142119 72%);min-height:590px}
.organism-home h3{font-size:24px;margin-top:12px}.home-organism{display:block;width:100%;max-width:330px;height:370px;margin:auto}.organism-state{font-weight:700}.home-routes{display:grid;grid-template-columns:1fr 1fr;gap:12px}.home-routes .card{margin:0;min-width:0}.home-routes h3{margin-top:0}.home-routes p{font-size:13px;overflow-wrap:anywhere}.home-routes .button-link{font-size:12px}.placeholder{border-style:dashed}.placeholder .badge{display:inline-block}.screen .card details summary,summary{cursor:pointer;min-height:44px;padding:10px 0}.screen h2{scroll-margin-top:calc(var(--nav-height) + 14px)}
#combat-viewport.live-teamup{top:calc(var(--nav-height) + 8px);height:min(640px,calc(100dvh - var(--nav-height) - 72px))}
#combat-anchor,#combat-viewport{scroll-margin-top:calc(var(--nav-height) + 14px)}
#combat-details>summary{scroll-margin-top:calc(min(640px,calc(100dvh - var(--nav-height) - 72px)) + var(--nav-height) + 16px)}
@media(max-width:900px){
.screen-nav{flex-wrap:nowrap;justify-content:space-between;gap:6px}.screen-nav>a{flex:1;font-size:14px}
#navigation-toggle{display:block;min-width:88px;min-height:44px}#navigation-toggle[aria-expanded=true]{background:#3b5141}
#navigation-rooms{display:none;position:absolute;top:100%;left:0;right:0;max-height:calc(100dvh - var(--nav-height) - 16px);overflow-y:auto;padding:10px;gap:8px;background:#15221b;border:1px solid var(--border);border-radius:0 0 10px 10px;box-shadow:0 12px 22px #0008}
.rooms-open #navigation-rooms{display:grid;grid-template-columns:1fr 1fr}.rooms-open #navigation-rooms a{font-size:14px;text-align:left;justify-content:flex-start;border:1px solid var(--border);padding:12px;min-height:48px}
}
@media(max-width:680px){
header{align-items:flex-start;gap:12px}header h1{font-size:18px}.header-actions{font-size:10px;gap:6px}.header-actions button{font-size:11px;padding:6px;min-height:36px}.eyebrow{font-size:9px;letter-spacing:1px}
.home-layout{grid-template-columns:minmax(210px,.9fr) minmax(0,1.3fr);gap:12px}.organism-home{position:static;min-height:0}.home-organism{height:240px;max-width:240px}.organism-home h3{font-size:21px}.home-routes{grid-template-columns:1fr 1fr;gap:8px}.home-routes .card{padding:12px}.home-routes .row{display:grid}.home-routes .button-link{overflow-wrap:anywhere}.home-routes p{font-size:12px}.home-routes .card:last-child{grid-column:1/-1}
#combat-viewport.live-teamup{top:calc(var(--nav-height) + 8px);height:calc(100dvh - var(--nav-height) - 72px)}
#combat-anchor,#combat-viewport{scroll-margin-top:calc(var(--nav-height) + 14px)}
#combat-details>summary{scroll-margin-top:calc(100dvh - 56px)}
}

/* Mobile's only playable orientation is landscape. Portrait is a gate, not another layout. */
.requires-landscape{overflow:hidden}.requires-landscape>:not(#orientation-gate){display:none!important}
#orientation-gate:not([hidden]){position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:24px;background:#101815;text-align:center}#orientation-gate>div{max-width:360px}
@media(pointer:coarse) and (orientation:landscape){body{padding:12px 16px}.home-layout{grid-template-columns:minmax(210px,.9fr) minmax(0,1.3fr)}.organism-home{position:static;min-height:0}.home-organism{height:240px}.home-routes .card{padding:12px}.home-routes p{font-size:12px}header h1{font-size:20px}header{margin-bottom:10px}}

@media(pointer:coarse) and (orientation:landscape) and (max-height:500px){.live-teamup #combat-toolbar{display:flex;min-height:44px}.live-teamup #combat-toolbar #round{margin-left:auto;white-space:nowrap}.live-teamup #combat-toolbar #abort{max-width:none}.live-teamup #combat-toolbar .auto-label{font-size:11px}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px){
.live-teamup #teamup-panel{padding:4px 8px}.teamup-heading{line-height:1.2}#teamup-options{padding:4px 0}.teamup-choice{line-height:1.2}#teamup-options .teamup-option{padding:4px 8px}#teamup-options::-webkit-scrollbar{height:6px}#teamup-options::-webkit-scrollbar-thumb{background:#76608c;border-radius:4px}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:400px){#combat-viewport.live-teamup{height:calc(100dvh - var(--nav-height) - 56px)}#combat-details>summary{scroll-margin-top:calc(100dvh - 40px)}}
/* Short landscape screens attach calls beside the field instead of shrinking it. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px){
#combat-viewport.live-teamup{display:grid;grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:48px minmax(0,1fr)}
.live-teamup #combat-toolbar{grid-column:1/-1;grid-row:1}.live-teamup #arena{grid-column:1;grid-row:2;height:100%!important}
#combat-viewport.live-teamup #teamup-panel{grid-column:2;grid-row:2;min-height:0;display:flex;flex-direction:column;border-top:0;border-left:2px solid #b997ed;overflow:hidden;padding:6px}
.live-teamup .teamup-heading{flex-wrap:wrap;gap:4px;flex:none}.live-teamup #teamup-options{flex:1;min-height:0;flex-direction:column;overflow-x:hidden;overflow-y:auto;gap:6px;padding:6px 0}
.live-teamup #teamup-options .teamup-option{min-width:0;max-width:none;width:100%;flex:none}.live-teamup .teamup-choice{font-size:11px}.live-teamup #teamup-moment{flex:none;font-size:10px}.live-teamup #teamup-options button{min-height:40px;padding:6px}
}

/* Home composition v02: reference hierarchy, live HTML above a text-free scene. */
.visually-hidden{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}
body[data-screen=home]{max-width:none;width:100%;height:100dvh;padding:0;margin:0;overflow:hidden;color:#e8e9ef;background:#090c12}
body[data-screen=home] main{margin:0;padding:0}body[data-screen=home]>footer,body[data-screen=home]>.asset-credits{display:none}
.cinematic-home{position:fixed;inset:0;isolation:isolate;overflow:hidden;font-size:clamp(10px,1vw,14px)}
.home-scene{position:absolute;inset:0;z-index:-2;background:url('../assets/home/home-scene-v01.png') center top/cover no-repeat}
.cinematic-home:before{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(90deg,#05070bdd 0%,#05070b48 19%,transparent 40%,transparent 57%,#05070b33 69%,#05070b70),linear-gradient(0deg,#05070bdd 0%,transparent 28%,transparent 82%,#05070b40)}
.home-character-space{position:absolute;left:35%;top:4%;width:30%;height:70%;pointer-events:none}
body[data-screen=home]>header{position:fixed;left:1.6%;top:1.5%;width:18%;z-index:6;margin:0;display:block;padding:0}
body[data-screen=home] header h1{display:none}body[data-screen=home] header .eyebrow{font-size:clamp(15px,1.6vw,24px);letter-spacing:4px;white-space:nowrap;color:#c1c3cc}.echo-brand{color:#f0717a}
body[data-screen=home] .header-actions{position:fixed;bottom:5px;right:12px;display:flex;gap:14px;align-items:center;font-size:10px}body[data-screen=home] .header-actions button{min-height:28px;padding:4px 8px;font-size:10px;background:#090e15c9;border-color:#434955}
body[data-screen=home]>.summary{position:fixed;right:2%;top:2%;left:56%;z-index:6;margin:0;padding:9px 14px;display:flex;gap:18px;align-items:center;background:#070b12b8;border:1px solid #60677380;color:#e8e9ef;font-size:12px;min-height:40px}
body[data-screen=home] #weapon-summary,body[data-screen=home] #hero-level{display:none}body[data-screen=home] #trajectory:before{content:'◇';color:#8bb4ef;margin-right:8px}
body[data-screen=home]>.screen-nav{position:fixed;top:11.5%;bottom:9%;left:0;width:14%;max-width:185px;min-width:86px;z-index:7;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:3px;padding:0 4px 0 0;margin:0;overflow-x:hidden;overflow-y:auto;border:0;background:linear-gradient(90deg,#06090de8,#070b13b5,transparent)}
body[data-screen=home] #navigation-rooms{display:contents!important}body[data-screen=home] #navigation-toggle{display:none!important}
body[data-screen=home] .screen-nav a{flex:none;justify-content:flex-start;text-align:left;width:100%;min-height:44px;padding:9px 12px 9px 18px;border:0;border-left:2px solid transparent;border-radius:0;color:#c7ccd6;font-size:clamp(10px,1.1vw,15px);letter-spacing:.04em;background:none;box-shadow:none}
body[data-screen=home] .screen-nav a[aria-current=page]{color:#fff;border-left-color:#fa6b77;background:linear-gradient(90deg,#ad344236,transparent)}

.home-glass{background:linear-gradient(115deg,#060b14da,#071019a8);border:1px solid #929eaf70;box-shadow:0 2px 15px #0005;color:#e8e9ef;border-radius:3px;backdrop-filter:blur(3px)}
.cinematic-home h3{margin:0;font-size:clamp(11px,1.25vw,18px);font-weight:550;letter-spacing:.05em}.cinematic-home p{margin:5px 0}.cinematic-home a{color:#e8e9ef}.cinematic-home .button-link{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:5px 10px;border:1px solid #929eaf80;background:linear-gradient(#192331aa,#060a10cc);border-radius:2px;text-decoration:none;font-size:clamp(9px,.9vw,12px);white-space:nowrap}.cinematic-home a:hover,.cinematic-home a:focus-visible{border-color:#e296a0;background-color:#71303d55;outline-color:#efa4b0}
.home-identity{position:absolute;left:17%;top:11%;width:23%;text-shadow:0 2px 7px #000}.home-identity h3{font-size:clamp(18px,2vw,30px);margin:3px 0}.home-identity .eyebrow{font-size:10px;letter-spacing:1px}.home-identity #home-level{font-size:12px}.home-art-note{font-size:10px;color:#abb3c3}.home-identity .identity-link{font-size:10px;min-height:28px}
.home-cultivation{position:absolute;left:15%;top:29%;width:25%;height:43%;padding:14px 16px;display:flex;flex-direction:column;gap:5px;overflow:auto;clip-path:polygon(0 0,87% 0,94% 7%,100% 7%,100% 100%,0 100%)}
.home-panel-title{display:flex;align-items:center;justify-content:space-between;gap:6px}.home-panel-title>span{font-size:9px;color:#b4bcc9}.home-cultivation #home-development{font-size:10px;color:#b7c1cf;margin:0}.home-cultivation>.button-link{align-self:flex-start;margin-top:auto}
#home-tree-summary{display:grid;gap:10px;flex:1;align-content:center}.home-tree-row{display:flex;gap:12px;align-items:center}.home-tree-row>div{flex:1;min-width:0}.home-tree-row strong{display:block;text-transform:uppercase;font-weight:500}.tree-state{font-size:10px;color:#d4d8e0;display:block}.home-tree-row progress{display:block;height:4px;width:100%;margin:3px 0;accent-color:var(--tree-color)}.home-tree-row progress::-webkit-progress-value{background:var(--tree-color)}.home-tree-row[data-tree=mind]{--tree-color:#70b5ff}.home-tree-row[data-tree=body]{--tree-color:#edc9a4}.home-tree-row[data-tree=spirit]{--tree-color:#b594ff}.home-tree-row[data-tree=blood]{--tree-color:#ee7480}.tree-emblem{color:var(--tree-color);font-size:30px;width:36px;text-align:center;filter:drop-shadow(0 0 8px var(--tree-color))}
.home-right{position:absolute;left:67%;right:1.2%;top:10%;bottom:27%;display:grid;grid-template-rows:1.2fr 1fr 1fr;gap:10px}.home-right>section{min-height:0;overflow:hidden;padding:12px}.home-right .home-panel-title h3{font-size:clamp(10px,1.1vw,16px)}
.home-encounter{position:relative;display:flex;align-items:flex-end}.encounter-scene{position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#04070ce8,#060b1640),url('../assets/home/home-scene-v01.png') right 60%/220% auto}.home-encounter .encounter-content{width:100%}.home-encounter .eyebrow{color:#c0cada;letter-spacing:1px;font-size:9px}.home-encounter #home-encounter{font-size:clamp(13px,1.5vw,22px)}.home-encounter #home-battle-state{font-size:10px;color:#c3cada;max-width:70%;line-height:1.2}.home-encounter .deploy-link{position:absolute;right:12px;bottom:12px;border-color:#f36e7f;background:#681b2666;box-shadow:0 0 12px #ca3f4344;min-width:30%;color:#ffbbc1}
.home-equipment #home-weapon{font-size:11px;color:#bdc6d6}#home-slot-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:8px}.home-slot{display:flex;align-items:center;justify-content:center;text-align:center;min-height:45px;min-width:0;padding:4px;font-size:9px;line-height:1.2;overflow-wrap:anywhere;border:1px solid #78869c77;background:#121c2acc;text-decoration:none}
.home-echo-preview{display:flex;align-items:center;gap:10px;margin-top:8px}.echo-silhouette{display:grid;place-items:center;min-width:45px;min-height:45px;border:1px solid #8ca2b3;background:radial-gradient(ellipse,#3b6a7c,#102331);font-size:28px;color:#b7d9e9}.home-echo-preview p{font-size:11px}#home-team{font-size:10px;color:#bdc6d4;line-height:1.2}
.home-infrastructure{position:absolute;left:6%;right:1.2%;top:76%;bottom:6%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:12px 16px}.home-infrastructure article{padding:0 14px;border-right:1px solid #737f9338;min-width:0;display:flex;flex-direction:column;align-items:flex-start}.home-infrastructure article:first-child{padding-left:0}.home-infrastructure article:last-child{border:0}.home-infrastructure h3{font-size:clamp(10px,1vw,14px)}.home-infrastructure p{font-size:11px}.home-infrastructure .button-link{margin-top:auto}.home-unimplemented{font-size:10px;color:#a5adbc}
.home-bottom{position:absolute;bottom:1%;left:2%;display:flex;gap:20px;align-items:center;font-size:10px;color:#7f899a}.home-bottom .button-link{min-height:26px;font-size:10px;padding:2px 8px}.home-credits summary{min-height:26px;padding:2px}.home-credits[open] p{position:fixed;bottom:35px;left:2%;width:320px;padding:12px;background:#080d15f2;border:1px solid #647186;z-index:10;font-size:11px}
body[data-screen=home] #storage-warning:not(:empty),body[data-screen=home] #feedback:not(:empty){position:fixed;left:41%;top:7%;z-index:10;max-width:24%;background:#090f19da;padding:6px;font-size:10px}
@media(max-height:550px),(max-width:1000px){
body[data-screen=home] header .eyebrow{font-size:14px;letter-spacing:2px}body[data-screen=home]>.summary{padding:5px 8px;gap:10px;min-height:28px;font-size:10px;left:55%}
body[data-screen=home]>.screen-nav{top:12%;bottom:8%;width:14%;min-width:80px}body[data-screen=home] .screen-nav a{font-size:10px;min-height:34px;padding:6px 5px 6px 8px}
.home-identity{left:16%;top:10%;width:25%}.home-identity .eyebrow{font-size:8px}.home-identity h3{font-size:19px}.home-identity #home-level{font-size:10px}.home-art-note{font-size:8px}.home-identity .identity-link{min-height:24px;font-size:9px}
.home-cultivation{top:30%;height:43%;padding:7px 8px;gap:3px}.home-cultivation h3{font-size:11px}.home-panel-title>span{display:none}.home-cultivation #home-development{font-size:8px}#home-tree-summary{gap:3px}.home-tree-row{gap:6px}.home-tree-row strong{font-size:10px}.tree-state{font-size:8px}.tree-emblem{font-size:21px;width:20px}.home-tree-row progress{height:3px;margin:1px 0}.cinematic-home .button-link{font-size:9px;min-height:28px;padding:3px 6px}
.home-right{gap:6px;top:10%;bottom:27%;grid-template-rows:1.2fr 1fr 1fr}.home-right>section{padding:7px}.home-right .home-panel-title h3{font-size:10px}.home-right .home-panel-title .button-link{min-height:24px;font-size:8px}.home-encounter #home-encounter{font-size:12px}.home-encounter #home-battle-state{font-size:8px}.home-encounter .eyebrow{font-size:8px}.home-encounter .deploy-link{right:7px;bottom:7px;min-height:30px}
.home-equipment #home-weapon{font-size:9px;margin:3px 0}#home-slot-summary{gap:3px;margin-top:4px}.home-slot{font-size:8px;min-height:32px;padding:2px}.home-echo-preview{margin-top:4px;gap:6px}.echo-silhouette{min-width:26px;min-height:26px;font-size:19px}.home-echo-preview p{font-size:9px}#home-team{font-size:8px}
.home-infrastructure{padding:6px 8px;top:76%;bottom:7%}.home-infrastructure article{padding:0 7px}.home-infrastructure h3{font-size:9px}.home-infrastructure p,.home-unimplemented{font-size:8px;margin:2px 0}.home-infrastructure .button-link{font-size:8px;min-height:25px;padding:2px 5px}.home-bottom{gap:8px;font-size:8px}.home-bottom>span{display:none}.home-bottom .button-link{font-size:8px;min-height:22px}.home-credits summary{font-size:8px}.header-actions a{font-size:8px}body[data-screen=home] .header-actions{gap:8px}body[data-screen=home] .header-actions button{font-size:8px;min-height:24px}
}
.home-tree-row progress{appearance:none;-webkit-appearance:none;border:0;background:#303847}.home-tree-row progress::-webkit-progress-bar{background:#303847}.home-tree-row progress::-webkit-progress-value{background:var(--tree-color)}
body[data-screen=home]>.screen-nav{bottom:27%}
@media(max-height:550px),(max-width:1000px){
.home-identity .home-art-note,.home-identity .identity-link{display:none}.home-identity #home-level{line-height:1.1}
.home-cultivation{top:29%;height:44%;padding:6px 8px;gap:2px}.home-cultivation h3{line-height:1.1}.home-cultivation #home-development{line-height:1.1}.home-tree-row{line-height:1.05}.home-tree-row strong{font-size:10px}.tree-state{font-size:8px}.home-tree-row progress{height:2px;margin:1px 0}.home-cultivation>.button-link{min-height:22px;padding:2px 6px}
.home-right>section{padding:4px 6px}.home-right .home-panel-title .button-link{min-height:20px;padding:1px 5px}.home-right .home-panel-title h3{font-size:10px;line-height:1.1;white-space:nowrap}.home-equipment #home-weapon{line-height:1.1;font-size:8px;margin:2px 0}#home-slot-summary{margin-top:2px}.home-slot{display:block;min-height:24px;height:24px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:8px}
.home-echo-preview p{font-size:8px;line-height:1.15}#home-team{display:none}.home-encounter #home-encounter{font-size:11px;letter-spacing:0}.home-encounter .deploy-link{min-height:28px}
.home-infrastructure{padding:4px 8px}.home-infrastructure article{line-height:1.1;padding:0 6px}.home-infrastructure article>p:not(#home-base){display:none}.home-infrastructure h3{font-size:8px;line-height:1.1;letter-spacing:0;white-space:nowrap}.home-infrastructure #home-base{font-size:8px;line-height:1.1}.home-infrastructure .home-unimplemented{font-size:8px;line-height:1.1}.home-infrastructure .button-link{min-height:24px;font-size:8px;padding:2px 4px}
body[data-screen=home] .header-actions{bottom:1px}
}
.home-credits{padding:0;border:0;margin:0}
@media(max-height:550px),(max-width:1000px){.home-bottom{bottom:1px}.home-credits summary{min-height:22px;padding:2px}.home-cultivation{padding:4px 8px}#home-tree-summary{gap:2px}}
/* Shared semantic SVG glyphs: geometry can change without changing callers. */
.ui-icon{width:18px;height:18px;display:inline-block;vertical-align:middle;margin-right:7px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.screen-nav a{display:flex;align-items:center}.tree-emblem.ui-icon{width:26px;height:26px;margin:0}.lineage-path{display:flex;gap:0;list-style:none;padding:24px 0 12px;margin:0;overflow-x:auto;max-width:100%;scroll-snap-type:x proximity}.lineage-node{position:relative;flex:0 0 125px;display:flex;align-items:center;flex-direction:column;gap:7px;padding:12px 8px;text-align:center;border-top:1px solid #546174;color:#8f9daf;scroll-snap-align:start}.lineage-node .ui-icon{background:#101722;border:1px solid #546174;border-radius:50%;padding:5px;width:32px;height:32px;margin:-29px 0 0}.lineage-node span{font-size:12px}.lineage-node small{font-size:11px}.lineage-node.reached{color:#adc6bc}.lineage-node.current{color:#d6eee2;background:#6cb89714;border-top-color:#8dd4b3}.lineage-node.current .ui-icon{border:2px solid #8dd4b3;box-shadow:0 0 10px #8dd4b329}.lineage-node.important .ui-icon{border-radius:5px}.lineage-node.important strong{font-weight:800}.ceiling-label{color:#edc781}.lineage-summary{font-size:14px}.lineage-action{display:flex;align-items:center;justify-content:space-between;gap:10px}.lineage-action p{margin:0}.lineage-action button{flex:none}.echo-lineage{margin-top:18px}.lineage-card{min-width:0}.lineage-content{min-width:0;overflow:hidden}
body[data-screen=home] .screen-nav .ui-icon{width:20px;height:20px;margin-right:12px;color:#afb9cc}body[data-screen=home] .screen-nav a[aria-current=page] .ui-icon{color:#fa7d85}body[data-screen=home] #resources .ui-icon{width:12px;height:12px;margin-right:7px;color:#ee6873}
@media(max-height:550px),(max-width:1000px){body[data-screen=home] .screen-nav .ui-icon{width:16px;height:16px;margin-right:6px}.tree-emblem.ui-icon{width:21px;height:21px}}

/* Canonical SVG icons own navigation; no generated legacy glyphs. */
.screen-nav a::before,.screen-nav a::after{content:none;display:none}
/* Illustrated combat prototype: profiles may add registered layers without changing combat rules. */
.visual-actor .visual-character{transform-box:fill-box;transform-origin:center bottom;animation:visual-idle 2.8s ease-in-out infinite;filter:drop-shadow(0 10px 8px #0009)}.visual-actor:nth-of-type(even) .visual-character{animation-delay:-1.25s}.visual-actor.defeated .visual-character{animation:none;opacity:.28;filter:grayscale(.75) drop-shadow(0 5px 5px #0008);transform:translateY(8px) rotate(4deg)}@keyframes visual-idle{0%,100%{transform:translateY(0) scaleY(1)}50%{transform:translateY(-2px) scaleY(1.006)}}
.visual-slot ellipse{fill:#10151e99;stroke:#59687c;stroke-width:1}.visual-slot path{fill:none;stroke:#59687c;stroke-width:1}.visual-slot text{fill:#566176;font-size:8px;letter-spacing:1px}.visual-slot.empty{opacity:.58}.visual-slot.occupied ellipse{fill:#18202b88;stroke:#7b8ba1}.visual-slot.occupied text{display:none}

/* Contextual TEAM-UP presentation. The old persistent footer is deliberately absent. */
#combat-viewport.live-teamup{position:sticky;display:grid;grid-template-columns:1fr;grid-template-rows:48px minmax(0,1fr);overflow:hidden}
.live-teamup #combat-toolbar{grid-column:1;grid-row:1}
#combat-viewport.live-teamup #arena{grid-column:1;grid-row:2;width:100%;height:100%!important;min-height:0;margin:0;border:0;border-radius:0}
#teamup-prompt{position:absolute;right:12px;bottom:12px;z-index:4;display:flex;flex-direction:column;width:min(340px,44%);max-height:calc(100% - 72px);box-sizing:border-box;padding:9px;border:1px solid #d7b6ff;border-left:4px solid #a86cf2;border-radius:8px;background:linear-gradient(105deg,#20182ff2,#302042e8);box-shadow:0 0 0 1px #7e55ad66,0 10px 30px #000b,0 0 24px #a86cf244;animation:teamup-arrive .22s ease-out}
#teamup-prompt[hidden]{display:none!important}#teamup-prompt .teamup-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}#teamup-prompt .teamup-heading h3{margin:0;color:#f0ddff;font-size:13px;letter-spacing:.08em}#teamup-prompt #teamup-status{margin:0;color:#cdb8df;font-size:10px;white-space:nowrap}
#teamup-prompt #teamup-options{display:grid;gap:6px;min-height:0;padding:0;overflow-x:hidden;overflow-y:auto}#teamup-prompt .teamup-option{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;max-width:none;width:100%;box-sizing:border-box;padding:5px;border:1px solid #75558f;border-radius:6px;background:#171221b8}#teamup-prompt .teamup-choice{padding:0;font-size:11px}#teamup-prompt .teamup-choice strong{color:#fff;font-size:13px}#teamup-prompt .teamup-choice>span{max-width:170px}#teamup-prompt button{min-height:38px;padding:6px 10px;border:1px solid #d5b0ff;background:#5a347d;color:#fff;font-size:11px;font-weight:800}#teamup-prompt button:disabled{opacity:.78}
.teamup-portrait{display:block;width:48px;height:58px;border:1px solid #a67ac9;border-radius:4px;background-color:#13101b;background-repeat:no-repeat;background-position:center 16%;background-size:85px auto;box-shadow:inset 0 0 14px #9b58ef44;color:#dcbcff;text-align:center;line-height:58px;font-weight:800}
#combat-viewport>#teamup-moment{position:absolute;left:50%;bottom:16px;z-index:5;transform:translateX(-50%);width:max-content;max-width:55%;min-height:0;margin:0;padding:7px 12px;border-radius:4px;background:#15101de8;pointer-events:none}#combat-viewport>#teamup-moment:empty{display:none}
@keyframes teamup-arrive{from{opacity:0;transform:translateX(18px) scale(.97)}to{opacity:1;transform:translateX(0) scale(1)}}
@media(max-width:680px){#teamup-prompt{right:6px;bottom:6px;width:min(260px,52%);padding:5px}#teamup-prompt .teamup-option{grid-template-columns:34px minmax(0,1fr) auto;gap:5px;padding:3px}.teamup-portrait{width:34px;height:42px;background-size:62px auto;line-height:42px}#teamup-prompt .teamup-choice>span{max-width:118px}#teamup-prompt .teamup-choice .small{display:none}#teamup-prompt button{min-height:34px;padding:4px 7px}#combat-viewport>#teamup-moment{bottom:8px;max-width:64%;font-size:10px}}
