:root{color-scheme:dark;--bg:#0f100c;--panel:#191b15;--panel2:#20231b;--line:#353a2c;--text:#ece9dd;--muted:#aaa995;--accent:#c5b26f;--danger:#b85858;--ok:#7ca36c}*{box-sizing:border-box}body{margin:0;background:linear-gradient(#0b0c09,#12140f);color:var(--text);font-family:Georgia,'Times New Roman',serif;min-height:100vh}button,input{font:inherit}.app-header{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:1rem max(1rem,calc((100vw - 980px)/2));background:rgba(15,16,12,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(8px)}.app-header h1{font-size:1.35rem;margin:.15rem 0}.eyebrow{font:700 .72rem/1.2 system-ui,sans-serif;letter-spacing:.16em;color:var(--accent)}#header-stats{display:flex;gap:.75rem;flex-wrap:wrap;font:600 .8rem system-ui,sans-serif;color:var(--muted)}.main-nav{display:flex;gap:.4rem;overflow-x:auto;padding:.7rem max(1rem,calc((100vw - 980px)/2));background:#11130e;border-bottom:1px solid var(--line)}.main-nav a{color:var(--text);text-decoration:none;padding:.55rem .8rem;border:1px solid transparent;border-radius:6px;font:700 .82rem system-ui,sans-serif}.main-nav a:hover{border-color:var(--line);background:var(--panel)}#app-view{max-width:980px;margin:0 auto;padding:1rem;transition:opacity .15s ease}.view-changing{opacity:.45}.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:1rem;margin-bottom:1rem;box-shadow:0 8px 28px rgba(0,0,0,.18)}.panel h2,.panel h3{margin-top:.3rem}.hero-card{background:linear-gradient(145deg,#1f2118,#151711)}.tag-row,.button-row,.button-grid{display:flex;gap:.5rem;flex-wrap:wrap}.tag{font:700 .72rem system-ui,sans-serif;padding:.3rem .5rem;border:1px solid #575b44;border-radius:999px;color:#d9d2b3}.stat-strip,.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:.65rem;margin-bottom:1rem}.stat-strip>div,.stat-grid>div{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:.75rem}.stat-strip span,.stat-grid span{display:block;color:var(--muted);font:700 .7rem system-ui,sans-serif;text-transform:uppercase}.stat-strip strong,.stat-grid strong{font-size:1.05rem}.card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.75rem}.travel-card,.quest-card,.inventory-row,.crew-card,.ability-card{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:.8rem;margin:.55rem 0}.travel-card{display:flex;flex-direction:column;gap:.35rem}.travel-card span,.travel-card small,.quest-status{color:var(--muted);font:600 .75rem system-ui,sans-serif}.inventory-row{display:flex;justify-content:space-between;gap:1rem;align-items:center}.inventory-row p,.quest-card p{margin:.35rem 0;color:#cbc8ba}button{border:1px solid #61593c;background:#3a3423;color:#f6efd1;padding:.58rem .78rem;border-radius:6px;cursor:pointer;font:700 .8rem system-ui,sans-serif}button:hover:not(:disabled){filter:brightness(1.12)}button:disabled{opacity:.45;cursor:not-allowed}button.secondary{background:#25271f;border-color:var(--line);margin-left:.5rem}.warning{color:#e6b0a8}.combat-panel{border-color:#684644}.meter{display:flex;justify-content:space-between;background:#2a1e1b;border:1px solid #63413b;padding:.7rem;border-radius:7px}.combat-log{margin-top:1rem;border-top:1px solid var(--line);padding-top:.75rem}.combat-log p{margin:.3rem 0;color:#c7c3b2}.auth-card{max-width:560px;margin:2rem auto}.auth-card form{display:grid;gap:.75rem}.auth-card label{display:grid;gap:.3rem;color:var(--muted);font:700 .8rem system-ui,sans-serif}.auth-card input{width:100%;padding:.65rem;background:#0f100c;color:var(--text);border:1px solid var(--line);border-radius:6px}.modal{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.72);display:grid;place-items:center;padding:1rem}.modal[hidden]{display:none}.modal-card{max-width:460px;background:#1d1f18;border:1px solid #5d573e;border-radius:10px;padding:1.2rem}.modal-card .button-row{justify-content:flex-end}#toast-stack{position:fixed;right:1rem;bottom:1rem;z-index:60;display:grid;gap:.5rem;max-width:min(90vw,420px)}.toast{background:#22251d;border:1px solid #5a6047;border-radius:7px;padding:.7rem .85rem;opacity:0;transform:translateY(8px);transition:.2s ease;font:600 .8rem system-ui,sans-serif}.toast.show{opacity:1;transform:none}@media(max-width:620px){.app-header{align-items:flex-start;flex-direction:column}.main-nav{position:sticky;top:78px;z-index:9}.inventory-row{align-items:flex-start;flex-direction:column}.panel{border-radius:8px}}

/* Patch 002: account, quest log, inventory grid, and grim-dark combat layout */
.header-account-zone{display:flex;align-items:center;gap:.8rem}.header-logout{padding:.45rem .65rem;background:#211d18;border-color:#4b4234;color:#cfc5ad}.auth-active{background:#080907}.auth-active .app-header,.auth-active .main-nav{display:none!important}#app-view.auth-mode{max-width:1240px;padding:clamp(.75rem,2vw,1.5rem);min-height:100vh;display:grid;align-items:center}.auth-screen{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.78fr);min-height:min(760px,calc(100vh - 3rem));border:1px solid #403b30;background:#0c0d0a;box-shadow:0 30px 90px rgba(0,0,0,.62);overflow:hidden}.title-screen-art{position:relative;min-height:620px;background-image:url('/assets/images/ui/titlescreen_background.webp?v=3');background-size:cover;background-position:center;display:flex;align-items:flex-end;isolation:isolate}.title-screen-art::after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,rgba(8,9,7,.18),rgba(8,9,7,.45) 55%,rgba(8,9,7,.85)),linear-gradient(to top,rgba(6,7,5,.85),transparent 55%);z-index:-1}.title-screen-shade{position:absolute;inset:0;background:radial-gradient(circle at 38% 42%,transparent 0 18%,rgba(0,0,0,.12) 42%,rgba(0,0,0,.48) 100%);mix-blend-mode:multiply}.title-screen-content{position:relative;z-index:1;padding:clamp(2rem,6vw,5rem);text-shadow:0 4px 24px #000}.title-emblem{width:74px;height:74px;object-fit:cover;border-radius:18px;opacity:.92;box-shadow:0 8px 30px rgba(0,0,0,.45);animation:titleEmblemFloat 6s ease-in-out infinite}.title-kicker{display:block;margin-top:1.2rem;font:700 .78rem/1.2 system-ui,sans-serif;letter-spacing:.38em;color:#b9a66c}.realmwalker-title{font-size:clamp(3rem,7vw,6.7rem);line-height:.82;letter-spacing:.025em;margin:.5rem 0 1.1rem;color:#eee5cf;max-width:8ch;animation:titleBreath 7s ease-in-out infinite}.realmwalker-title span{display:block;font-size:.24em;letter-spacing:.52em;color:#b8aa83;margin-bottom:.65rem}.title-rule{width:min(340px,68%);height:1px;background:linear-gradient(90deg,#b69c55,transparent);margin-bottom:.8rem}.title-screen-content p{font-style:italic;color:#c9c2ae;font-size:1.03rem}.account-panel-wrap{display:flex;align-items:center;justify-content:center;padding:clamp(1.2rem,4vw,3rem);background:radial-gradient(circle at 50% 20%,rgba(84,72,47,.12),transparent 45%),#11120e}.account-panel{width:100%;max-width:430px}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid #403b30;background:#0c0d0a;margin-bottom:1.3rem}.auth-tab{border:0;border-radius:0;background:transparent;color:#898677;padding:.85rem 1rem;letter-spacing:.08em}.auth-tab.active{background:#262219;color:#e8dec3;box-shadow:inset 0 -2px #a48c4c}.auth-tab-panel h2{font-size:1.55rem;margin:.3rem 0 1.25rem}.auth-tab-panel form{display:grid;gap:.9rem}.auth-tab-panel label{display:grid;gap:.38rem;color:#b4ae9e;font:700 .76rem/1.4 system-ui,sans-serif;letter-spacing:.02em}.auth-tab-panel label small{font-weight:500;color:#7f7d72;letter-spacing:0}.auth-tab-panel input:not([type="checkbox"]){width:100%;padding:.75rem .8rem;background:#090a08;color:var(--text);border:1px solid #3e3c32;border-radius:4px;outline:none}.auth-tab-panel input:focus{border-color:#8d7d4d;box-shadow:0 0 0 2px rgba(141,125,77,.14)}.check-label{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:.55rem!important}.check-label input{width:17px;height:17px;accent-color:#897542}.auth-primary{margin-top:.3rem;background:linear-gradient(#433923,#302817);border-color:#7b6736;color:#f2e7c6;padding:.72rem 1rem}.auth-tab-panel[hidden]{display:none}@keyframes titleBreath{0%,100%{filter:brightness(.93);transform:translateY(0)}50%{filter:brightness(1.08);transform:translateY(-2px)}}@keyframes titleEmblemFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}

.quest-card-heading{display:flex;justify-content:space-between;gap:1rem;align-items:center}.quest-card-active{border-left:3px solid #8c7844}.quest-next-location{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-top:.7rem;padding:.55rem .65rem;background:#171812;border:1px solid #373a2d}.quest-next-location span,.quest-reward-summary>span{font:700 .67rem/1 system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#8f8d81}.quest-next-location strong{font-size:.9rem;color:#d8c88e}.completed-quest-panel{padding:.15rem 1rem}.completed-quests-details>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:1rem 0}.completed-quests-details>summary::-webkit-details-marker{display:none}.completed-quests-details>summary strong{display:block;margin-top:.2rem}.completed-count{display:grid;place-items:center;min-width:34px;height:34px;border:1px solid #4c493a;border-radius:999px;color:#aaa58f;font:700 .8rem system-ui,sans-serif}.completed-quest-list{padding:0 0 .7rem}.quest-card-completed{opacity:.82;background:#181a15}.quest-reward-summary{margin-top:.65rem;border-top:1px solid #32352a;padding-top:.6rem}.quest-reward-summary p{margin:.25rem 0 0}

.inventory-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.75rem}.inventory-card{position:relative;display:flex;flex-direction:column;min-width:0;background:linear-gradient(160deg,#202219,#171812);border:1px solid #34382b;border-radius:8px;overflow:hidden}.inventory-icon-wrap{position:relative;aspect-ratio:1/1;background:#0c0d0a;border-bottom:1px solid #34382b}.inventory-icon{width:100%;height:100%;display:block;object-fit:cover}.inventory-quantity{position:absolute;right:.45rem;bottom:.4rem;min-width:32px;padding:.23rem .4rem;border-radius:999px;background:rgba(5,6,4,.86);border:1px solid #57513d;text-align:center;color:#eee4c8;font:800 .72rem system-ui,sans-serif}.inventory-card-copy{padding:.72rem .72rem .35rem}.inventory-card-copy strong{display:block;font-size:.98rem}.inventory-card-copy p{font-size:.82rem;line-height:1.35;color:#aaa898;margin:.38rem 0}.inventory-actions{display:flex;gap:.4rem;padding:.4rem .72rem .75rem;margin-top:auto}.inventory-actions button{flex:1}

.combat-screen{display:grid;gap:1rem}.combat-section{background:linear-gradient(155deg,rgba(28,28,22,.98),rgba(16,17,13,.99));border:1px solid #4c4637;box-shadow:0 14px 34px rgba(0,0,0,.3);position:relative}.combat-section::before{content:"";position:absolute;inset:5px;pointer-events:none;border:1px solid rgba(169,145,78,.12)}.combat-command-block{display:grid;grid-template-columns:minmax(240px,.75fr) minmax(0,1.5fr);min-height:320px}.combat-menu-column{padding:1rem;border-right:1px solid #3d392e}.combat-round-label{font:800 .63rem/1.2 system-ui,sans-serif;letter-spacing:.15em;color:#827c69}.combat-actor-heading{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin:.35rem 0 .8rem}.combat-actor-heading h2{margin:0;font-size:1.55rem}.stance-toggle{display:flex;align-items:center;gap:.45rem;padding:.35rem .48rem;border-radius:999px;background:#181914;border-color:#4a463a;min-width:132px;justify-content:flex-start}.stance-toggle strong{font-size:.69rem}.stance-track{position:relative;display:block;width:34px;height:17px;border-radius:999px;background:#632f2c;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}.stance-track i{position:absolute;width:13px;height:13px;left:2px;top:2px;border-radius:50%;background:#e7d7be;transition:.18s}.stance-toggle.defensive .stance-track{background:#263f62}.stance-toggle.defensive .stance-track i{left:19px}.stance-toggle.offensive{color:#e2a29b}.stance-toggle.defensive{color:#a7c8ef}.combat-action-stack{display:grid;gap:.48rem}.combat-action-stack>button,.combat-action-dropdown>summary{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;padding:.68rem .75rem;border:1px solid #554b35;border-radius:4px;background:linear-gradient(90deg,#30291a,#262219);color:#eee2c0;font:800 .78rem system-ui,sans-serif;cursor:pointer}.combat-action-stack>button:hover,.combat-action-dropdown>summary:hover{filter:brightness(1.12)}.combat-action-dropdown>summary{list-style:none}.combat-action-dropdown>summary::-webkit-details-marker{display:none}.combat-action-dropdown>summary::after{content:"▾";color:#998658}.combat-action-dropdown[open]>summary::after{transform:rotate(180deg)}.combat-dropdown-menu{display:grid;gap:.35rem;padding:.42rem;background:#0d0e0b;border:1px solid #363329;border-top:0}.combat-dropdown-menu button{display:flex;justify-content:space-between;gap:.7rem;background:#1c1d17;border-color:#3d3a2f;text-align:left}.combat-dropdown-menu button small{font-size:.65rem;color:#aaa58f}.combat-empty-option{padding:.55rem;color:#77766c;font:600 .72rem system-ui,sans-serif}.combat-flee-button{background:linear-gradient(90deg,#3b2220,#2d1b1a)!important;border-color:#6b3933!important;color:#e3b0a9!important}.combat-log-column{display:flex;flex-direction:column;padding:1rem;min-width:0}.combat-log-heading{display:flex;justify-content:space-between;gap:1rem;border-bottom:1px solid #363329;padding-bottom:.6rem}.combat-log-heading span{font:800 .65rem system-ui,sans-serif;letter-spacing:.14em;text-transform:uppercase;color:#858171}.combat-log-heading strong{color:#c6b271}.combat-latest-line{margin:.8rem 0;padding:.8rem;border-left:3px solid #8e7844;background:#141510;color:#e3dcc9;font-size:1rem}.combat-log-scroll{overflow:auto;max-height:210px;padding-right:.3rem}.combat-log-scroll p{margin:.38rem 0;padding-bottom:.38rem;border-bottom:1px solid rgba(67,65,54,.45);color:#9e9c91;font-size:.82rem}.combat-enemy-block{padding:1rem}.enemy-readout{display:flex;justify-content:space-between;gap:1rem;margin-bottom:.45rem}.enemy-readout div{display:grid}.enemy-readout span{font:800 .62rem system-ui,sans-serif;letter-spacing:.13em;color:#827d6e}.enemy-readout strong{font-size:1rem}.enemy-hp-bar{height:9px;background:#170d0c;border:1px solid #59312e;margin-bottom:.7rem;overflow:hidden}.enemy-hp-bar i{display:block;height:100%;background:linear-gradient(90deg,#7f2e2c,#b14e43)}.enemy-portrait-frame{aspect-ratio:5/3;overflow:hidden;border:1px solid #5b513c;background:#080906;box-shadow:inset 0 0 45px #000}.enemy-portrait-frame img{width:100%;height:100%;object-fit:cover;display:block;filter:saturate(.78) contrast(1.08)}.combat-crew-block{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#3e392d;padding:1px}.combat-crew-card{display:grid;grid-template-columns:112px 1fr;gap:.8rem;padding:.8rem;background:#171813;min-width:0}.combat-crew-card.empty{display:flex;align-items:center;min-height:150px;color:#6f7067}.empty-companion-mark{display:grid;place-items:center;width:72px;height:72px;border:1px dashed #46473c;border-radius:50%;font-size:2rem}.combat-crew-card.empty span{font:800 .62rem system-ui,sans-serif;letter-spacing:.12em}.combat-crew-card.empty strong{display:block;color:#8f8e82;margin:.2rem 0}.combat-crew-card.empty p{font-size:.78rem;margin:0}.combat-crew-portrait{width:112px;height:145px;object-fit:cover;border:1px solid #4d493b;background:#0b0c09}.combat-crew-info{min-width:0}.combat-crew-name{display:flex;justify-content:space-between;gap:.5rem;align-items:baseline;border-bottom:1px solid #34362b;padding-bottom:.45rem;margin-bottom:.55rem}.combat-crew-name span{font:800 .61rem system-ui,sans-serif;letter-spacing:.13em;color:#77776d}.combat-crew-name strong{font-size:1.05rem}.vital-row{margin:.48rem 0}.vital-label{display:flex;justify-content:space-between;font:700 .68rem system-ui,sans-serif;color:#a8a497}.vital-bar{height:8px;border:1px solid #3d3d33;background:#0b0c09;overflow:hidden;margin-top:.2rem}.vital-bar i{display:block;height:100%}.vital-bar.hp i{background:linear-gradient(90deg,#78312e,#a64941)}.vital-bar.mp i{background:linear-gradient(90deg,#283e5d,#426b9a)}.status-effects{display:flex;gap:.3rem;flex-wrap:wrap;margin-top:.65rem}.status-effects span{padding:.22rem .38rem;border:1px solid #4c4738;background:#222219;color:#cbbf9e;font:700 .62rem system-ui,sans-serif}.status-effects .status-none{color:#73736a;border-color:#34362d;background:transparent}

@media(max-width:840px){.auth-screen{grid-template-columns:1fr}.title-screen-art{min-height:360px}.title-screen-content{padding:2rem}.realmwalker-title{font-size:clamp(2.8rem,12vw,5.2rem)}.account-panel-wrap{padding:1.5rem}.combat-command-block{grid-template-columns:1fr}.combat-menu-column{border-right:0;border-bottom:1px solid #3d392e}.combat-log-scroll{max-height:150px}.combat-crew-block{grid-template-columns:1fr}}@media(max-width:520px){.header-account-zone{width:100%;justify-content:space-between}.inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}.inventory-card-copy p{font-size:.75rem}.combat-crew-card{grid-template-columns:86px 1fr}.combat-crew-portrait{width:86px;height:116px}.combat-actor-heading{align-items:flex-start;flex-direction:column}.stance-toggle{width:auto}.enemy-readout{font-size:.9rem}.title-screen-art{min-height:300px}.title-emblem{width:58px;height:58px}}

/* ===== Patch 003: Crew, music, animated panels, and combat presentation ===== */
.header-account-zone{display:flex;align-items:center;gap:.65rem}.music-toggle{width:38px;height:36px;display:grid;place-items:center;padding:0;border-radius:999px;background:#202219;border-color:#4c493b;color:#d8ca9f;transition:transform .2s ease,box-shadow .25s ease,border-color .25s ease}.music-toggle:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 0 0 2px rgba(171,148,82,.08),0 0 16px rgba(171,148,82,.14)}.music-toggle .music-icon{width:20px;height:20px;fill:currentColor}.music-toggle .music-icon-off{display:none}.music-toggle.muted{color:#8f7c78;border-color:#513b39;background:#221918}.music-toggle.muted .music-icon-on{display:none}.music-toggle.muted .music-icon-off{display:block}

/* Smooth native-details replacements driven by app.js */
details[data-animated-details]>summary{user-select:none}details[data-animated-details]>[data-details-content]{overflow:hidden;transition:height .3s cubic-bezier(.2,.75,.25,1),opacity .24s ease;will-change:height,opacity}.completed-quests-details>summary::after{content:"▾";margin-left:.7rem;color:#9c8953;transition:transform .28s ease}.completed-quests-details[open]>summary::after{transform:rotate(180deg)}

/* Crew page */
.crew-roster-panel{position:relative;overflow:hidden;background:radial-gradient(circle at 16% 0%,rgba(127,101,49,.12),transparent 34%),linear-gradient(145deg,#1b1c16,#11120e);border-color:#494536}.crew-roster-panel::before{content:"";position:absolute;inset:5px;pointer-events:none;border:1px solid rgba(180,151,78,.10);border-radius:7px}.crew-page-heading{position:relative;display:flex;justify-content:space-between;align-items:end;gap:2rem;padding:.3rem .25rem 1rem;border-bottom:1px solid #36352c}.crew-page-heading h2{font-size:1.8rem;margin:.15rem 0 0}.crew-page-heading p{max-width:520px;margin:0;color:#9e9b8d;font-size:.9rem;line-height:1.45}.crew-status-grid{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}.crew-profile-card{position:relative;overflow:hidden;background:linear-gradient(165deg,#22231c,#151611 68%);border:1px solid #4a4637;box-shadow:0 16px 34px rgba(0,0,0,.28)}.crew-card-ornament{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(172,141,65,.13),transparent 18%,transparent 82%,rgba(172,141,65,.08));border-top:2px solid rgba(155,128,64,.48)}.crew-profile-top{display:grid;grid-template-columns:155px minmax(0,1fr);gap:1rem;padding:1rem}.crew-portrait-frame{position:relative;height:205px;border:1px solid #5d543d;background:#090a08;box-shadow:inset 0 0 30px #000,0 8px 20px rgba(0,0,0,.25);overflow:hidden}.crew-portrait-frame::after{content:"";position:absolute;inset:0;box-shadow:inset 0 -55px 60px rgba(0,0,0,.45);pointer-events:none}.crew-portrait-frame img{width:100%;height:100%;display:block;object-fit:cover;filter:saturate(.82) contrast(1.06)}.crew-portrait-frame>span{position:absolute;left:.5rem;bottom:.45rem;z-index:1;font:800 .58rem/1 system-ui,sans-serif;letter-spacing:.16em;color:#d7c590}.crew-identity{min-width:0;align-self:center}.crew-role{font:800 .62rem/1.2 system-ui,sans-serif;letter-spacing:.15em;text-transform:uppercase;color:#9b8752}.crew-identity h3{font-size:1.55rem;margin:.2rem 0 .45rem}.crew-level-line{display:flex;justify-content:space-between;gap:.8rem;padding-bottom:.45rem;margin-bottom:.6rem;border-bottom:1px solid #39382f;color:#9c998d;font:700 .68rem system-ui,sans-serif}.crew-vital{margin:.55rem 0}.crew-vital>div:first-child{display:flex;justify-content:space-between;gap:1rem;font:700 .68rem system-ui,sans-serif}.crew-vital>div:first-child span{letter-spacing:.08em;color:#989488}.crew-vital-bar{height:9px;margin-top:.22rem;background:#0a0b09;border:1px solid #3d3d34;overflow:hidden}.crew-vital-bar i{display:block;height:100%}.crew-vital.vital-hp .crew-vital-bar i{background:linear-gradient(90deg,#75312f,#a84c42);box-shadow:0 0 9px rgba(165,68,58,.28)}.crew-vital.vital-mp .crew-vital-bar i{background:linear-gradient(90deg,#263d5d,#456d9b);box-shadow:0 0 9px rgba(66,104,151,.25)}.crew-stat-rune-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:#3c392f;border-top:1px solid #403d32;border-bottom:1px solid #403d32}.crew-stat-rune-grid>div{display:grid;place-items:center;min-width:0;padding:.65rem .3rem;background:#181914}.crew-stat-rune-grid span{font:800 .55rem system-ui,sans-serif;letter-spacing:.13em;color:#887a54}.crew-stat-rune-grid strong{font-size:1.3rem;line-height:1.05;color:#e6dec7}.crew-stat-rune-grid small{font:600 .57rem system-ui,sans-serif;color:#75756c;margin-top:.15rem}.crew-card-section{padding:.85rem 1rem}.crew-card-section+.crew-card-section{padding-top:.15rem}.crew-section-heading{display:flex;align-items:center;gap:.55rem;margin-bottom:.6rem}.crew-section-heading span{font:800 .62rem system-ui,sans-serif;letter-spacing:.14em;text-transform:uppercase;color:#a9955f}.crew-section-heading i{height:1px;flex:1;background:linear-gradient(90deg,#4a4536,transparent)}.crew-equipment-list{display:grid;gap:.35rem}.crew-equipment-slot{display:grid;grid-template-columns:78px minmax(0,1fr) auto;align-items:center;gap:.55rem;min-height:38px;padding:.4rem .45rem;border:1px solid #36362e;background:#12130f}.crew-equipment-slot>span{font:700 .6rem system-ui,sans-serif;text-transform:uppercase;color:#74736a}.crew-equipment-slot>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.84rem}.crew-equipment-slot.empty strong{color:#66675f;font-weight:400}.crew-equipped-item{display:flex;align-items:center;gap:.45rem;min-width:0}.crew-equipped-icon{width:24px;height:24px;object-fit:cover;flex:0 0 24px;border:1px solid #4d4739;background:#0c0d0a}.unequip-button{padding:.32rem .45rem;font-size:.62rem;background:#292820;border-color:#4a473a;color:#c9c0a7}.crew-ability-list{display:flex;gap:.4rem;flex-wrap:wrap}.crew-ability-chip{display:flex;align-items:center;gap:.55rem;padding:.38rem .5rem;border:1px solid #464234;background:#1b1a14}.crew-ability-chip strong{font-size:.76rem}.crew-ability-chip span{color:#7893b0;font:700 .6rem system-ui,sans-serif}.muted-copy{color:#71726a;font-size:.8rem}.crew-empty-slot{display:flex;align-items:center;justify-content:center;gap:1rem;min-height:260px;padding:2rem;color:#77776f;border-style:dashed}.crew-empty-sigil{display:grid;place-items:center;width:76px;height:76px;border:1px solid #4a493f;border-radius:50%;font-size:2.2rem;color:#706a59}.crew-empty-slot>div:last-child>span{font:800 .6rem system-ui,sans-serif;letter-spacing:.13em;color:#777369}.crew-empty-slot h3{margin:.25rem 0;color:#9b9a90}.crew-empty-slot p{max-width:300px;margin:0;color:#77776f;font-size:.82rem}

/* Combat layout refinements */
.combat-screen{gap:.7rem}.combat-section{border-color:#514937;background:radial-gradient(circle at 50% -20%,rgba(104,80,38,.10),transparent 38%),linear-gradient(155deg,rgba(28,28,22,.99),rgba(12,13,10,.995));box-shadow:0 12px 30px rgba(0,0,0,.36)}.combat-section::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(155,128,62,.08),transparent 4%,transparent 96%,rgba(155,128,62,.08));opacity:.75}.combat-command-block{grid-template-columns:minmax(250px,.72fr) minmax(0,1.55fr);min-height:0}.combat-menu-column{padding:.78rem .9rem}.combat-round-label{display:flex;align-items:center;gap:.5rem}.combat-round-label i{height:1px;flex:1;background:linear-gradient(90deg,#4a4537,transparent)}.combat-actor-heading{margin:.22rem 0 .55rem}.combat-actor-heading>div small{font:800 .52rem system-ui,sans-serif;letter-spacing:.16em;color:#777163}.combat-actor-heading h2{font-size:1.35rem}.combat-action-stack{gap:.34rem}.combat-action-stack>button,.combat-action-dropdown>summary{min-height:41px;padding:.48rem .62rem}.combat-command,.combat-action-dropdown>summary{position:relative;overflow:hidden}.combat-command>span,.combat-action-dropdown>summary>span{font-weight:800}.combat-command>small,.combat-action-dropdown>summary>small{color:#858173;font:600 .58rem system-ui,sans-serif;margin-left:auto;margin-right:.45rem}.combat-action-stack>button::before,.combat-action-dropdown>summary::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:#846f3d;opacity:.55}.combat-command.attack::before{background:#9c4a3e}.combat-command.defend::before{background:#557aa0}.combat-dropdown-menu{gap:.25rem;padding:.32rem}.combat-dropdown-menu button{min-height:34px;padding:.42rem .55rem}.combat-log-column{padding:.78rem .9rem}.combat-log-heading{padding-bottom:.45rem}.combat-latest-line{display:grid;grid-template-columns:18px 1fr;gap:.45rem;align-items:start;margin:.55rem 0;padding:.62rem .7rem;background:linear-gradient(90deg,#171712,#11120e);font-size:.9rem}.combat-latest-line p{margin:0}.combat-log-mark{color:#aa8e4a;font-size:.65rem;margin-top:.2rem}.combat-log-scroll{max-height:130px}.combat-log-scroll p{display:flex;gap:.45rem;margin:.27rem 0;padding-bottom:.27rem;font-size:.75rem}.combat-log-scroll p span{color:#706849}.combat-enemy-block{padding:.7rem .9rem .8rem}.enemy-readout{align-items:end;margin-bottom:.32rem}.enemy-vital-readout{text-align:right}.enemy-hp-bar{height:8px;margin-bottom:.5rem}.enemy-stage-wrap{display:grid;place-items:center}.enemy-portrait-frame{position:relative;width:50%;max-width:470px;min-width:320px;aspect-ratio:5/3;overflow:hidden;border:1px solid #64563c;background:#070806;box-shadow:inset 0 0 46px #000,0 10px 28px rgba(0,0,0,.45)}.enemy-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 58px 14px rgba(0,0,0,.58);border:1px solid rgba(184,148,68,.08)}.combat-crew-block{min-height:0}.combat-crew-card{grid-template-columns:88px 1fr;gap:.7rem;padding:.62rem .72rem;min-height:126px}.combat-portrait-stage{position:relative;width:88px;height:112px;overflow:hidden;border:1px solid #504a3a;background:#090a08}.combat-crew-portrait{width:100%;height:100%;border:0;object-fit:cover}.combat-crew-name{padding-bottom:.32rem;margin-bottom:.4rem}.vital-row{margin:.33rem 0}.status-effects{margin-top:.42rem}.stance-toggle{position:relative;overflow:visible;transition:color .3s ease,border-color .3s ease,box-shadow .35s ease,background .3s ease;isolation:isolate}.stance-track{transition:background .32s ease,box-shadow .32s ease}.stance-track i{transition:left .32s cubic-bezier(.18,.8,.22,1),background .32s ease,box-shadow .32s ease}.stance-toggle.offensive .stance-track{box-shadow:inset 0 0 0 1px rgba(255,180,150,.12),0 0 8px rgba(178,56,38,.18)}.stance-toggle.defensive .stance-track{box-shadow:inset 0 0 0 1px rgba(170,210,255,.12),0 0 8px rgba(49,104,172,.18)}.stance-flare{position:absolute;inset:-10px;border-radius:999px;z-index:-1;opacity:0;pointer-events:none}.stance-toggle.stance-ignite.offensive .stance-flare{animation:stanceFlareRed .82s ease-out}.stance-toggle.stance-ignite.defensive .stance-flare{animation:stanceFlareBlue .82s ease-out}.stance-toggle.stance-ignite.offensive{box-shadow:0 0 17px rgba(217,69,42,.72),0 0 34px rgba(150,38,24,.32)}.stance-toggle.stance-ignite.defensive{box-shadow:0 0 17px rgba(67,137,224,.72),0 0 34px rgba(41,80,151,.32)}

/* Combat feedback effects */
.combat-fx-target{position:relative}.combat-fx-overlay{position:absolute;inset:0;pointer-events:none;opacity:0;z-index:4}.combat-fx-target.fx-damage{animation:combatImpactShake .38s ease}.combat-fx-target.fx-damage img{animation:combatDamageFlash .55s ease}.combat-fx-target.fx-damage .combat-fx-overlay{opacity:1;animation:combatImpactBurst .58s ease-out;background:radial-gradient(circle at 50% 46%,rgba(255,234,198,.95) 0 2%,rgba(212,65,48,.82) 5%,rgba(118,19,16,.34) 18%,transparent 42%)}.combat-fx-target.fx-buff{animation:combatBuffLift .75s ease}.combat-fx-target.fx-buff img{animation:combatBuffImage .82s ease}.combat-fx-target.fx-buff .combat-fx-overlay{opacity:1;animation:combatBuffGlow .85s ease-out;background:radial-gradient(circle at 50% 54%,rgba(255,225,125,.28),transparent 52%),linear-gradient(0deg,rgba(198,154,49,.28),transparent 55%)}.combat-fx-target.fx-negative img{animation:combatNegativeImage 1.05s ease}.combat-fx-target.fx-negative .combat-fx-overlay{opacity:1;animation:combatNegativeSmoke 1.08s ease-out;background:radial-gradient(ellipse at 25% 92%,rgba(91,36,116,.72),transparent 38%),radial-gradient(ellipse at 68% 105%,rgba(54,20,74,.82),transparent 46%),linear-gradient(0deg,rgba(41,12,49,.62),transparent 65%)}
@keyframes combatImpactShake{0%,100%{transform:translateX(0)}18%{transform:translateX(-8px) rotate(-.5deg)}38%{transform:translateX(7px) rotate(.4deg)}58%{transform:translateX(-4px)}78%{transform:translateX(2px)}}@keyframes combatDamageFlash{0%,100%{filter:saturate(.82) contrast(1.06)}18%{filter:sepia(.3) saturate(3.4) hue-rotate(325deg) brightness(1.5) contrast(1.15)}48%{filter:saturate(1.6) brightness(.8) contrast(1.2)}}@keyframes combatImpactBurst{0%{transform:scale(.25);opacity:0}18%{opacity:1}100%{transform:scale(1.55);opacity:0}}@keyframes combatBuffLift{0%,100%{transform:translateY(0)}35%{transform:translateY(-3px)}}@keyframes combatBuffImage{0%,100%{filter:saturate(.82) contrast(1.06)}35%{filter:sepia(.18) saturate(1.6) brightness(1.28)}}@keyframes combatBuffGlow{0%{opacity:0;transform:translateY(20px)}28%{opacity:1}100%{opacity:0;transform:translateY(-12px)}}@keyframes combatNegativeImage{0%,100%{filter:saturate(.82) contrast(1.06)}35%,65%{filter:saturate(.55) hue-rotate(255deg) brightness(.55) contrast(1.25)}}@keyframes combatNegativeSmoke{0%{opacity:0;transform:translateY(26px) scaleY(.7)}35%{opacity:.95}100%{opacity:0;transform:translateY(-18px) scaleY(1.18)}}@keyframes stanceFlareRed{0%{opacity:0;transform:scale(.55);background:radial-gradient(ellipse at 50% 70%,rgba(255,126,72,.95),rgba(180,44,23,.65) 28%,transparent 64%)}30%{opacity:1}100%{opacity:0;transform:scale(1.35);background:radial-gradient(ellipse at 50% 35%,rgba(255,104,52,.7),rgba(130,28,18,.25) 45%,transparent 72%)}}@keyframes stanceFlareBlue{0%{opacity:0;transform:scale(.55);background:radial-gradient(ellipse at 50% 70%,rgba(125,194,255,.95),rgba(44,103,192,.65) 28%,transparent 64%)}30%{opacity:1}100%{opacity:0;transform:scale(1.35);background:radial-gradient(ellipse at 50% 35%,rgba(92,167,255,.7),rgba(30,72,151,.25) 45%,transparent 72%)}}

button.is-loading{opacity:.68;cursor:progress}

@media(max-width:840px){.crew-status-grid{grid-template-columns:1fr}.crew-page-heading{align-items:start;flex-direction:column;gap:.45rem}.combat-command-block{grid-template-columns:1fr}.combat-log-scroll{max-height:110px}.enemy-portrait-frame{width:72%;min-width:0}.combat-crew-block{grid-template-columns:1fr}.combat-crew-card{grid-template-columns:88px 1fr}}
@media(max-width:560px){.app-header{align-items:flex-start}.header-account-zone{width:auto}.music-toggle{width:34px;height:34px}.crew-profile-top{grid-template-columns:112px 1fr}.crew-portrait-frame{height:158px}.crew-stat-rune-grid small{display:none}.crew-equipment-slot{grid-template-columns:64px minmax(0,1fr) auto}.enemy-portrait-frame{width:100%;max-width:100%}.combat-menu-column,.combat-log-column{padding:.68rem}.combat-crew-card{grid-template-columns:72px 1fr}.combat-portrait-stage{width:72px;height:94px}.combat-crew-name strong{font-size:.92rem}.status-effects span{font-size:.56rem}}
@media(prefers-reduced-motion:reduce){details[data-animated-details]>[data-details-content],.stance-toggle,.stance-track,.stance-track i{transition:none!important}.combat-fx-target,.combat-fx-target img,.combat-fx-overlay,.stance-flare{animation:none!important}}
.enemy-status-effects{display:flex;justify-content:center;gap:.3rem;flex-wrap:wrap;margin:.1rem 0 .45rem}.enemy-status-effects span{padding:.2rem .38rem;border:1px solid #574060;background:#241729;color:#c8a7d0;font:700 .58rem system-ui,sans-serif}

/* Patch 004: development cache mode, location art, ability help, compact combat */

/* Login/title containment: never allow REALMWALKER to invade the account column. */
.auth-screen,.title-screen-art,.title-screen-content{min-width:0}
.title-screen-content{max-width:100%;padding:clamp(1.75rem,4.5vw,4rem)}
.realmwalker-title{max-width:100%;width:100%;font-size:clamp(2.65rem,5.7vw,5.65rem);line-height:.88;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:clip}
.realmwalker-title span{white-space:normal}

/* Location identity art. Temporary files can later be replaced without changing markup. */
.location-hero-card{position:relative;isolation:isolate;overflow:hidden;min-height:260px;display:flex;align-items:flex-end;padding:0;background:#11130f}
.location-hero-card::before{content:"";position:absolute;inset:0;z-index:-2;background-image:var(--location-image);background-size:cover;background-position:center;filter:saturate(.78) contrast(1.08);transform:scale(1.015)}
.location-hero-scrim{position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(6,8,7,.94) 0%,rgba(7,9,8,.72) 48%,rgba(5,6,5,.34) 100%),linear-gradient(0deg,rgba(4,5,4,.88),transparent 64%)}
.location-hero-content{width:min(650px,100%);padding:1.35rem 1.4rem;text-shadow:0 2px 12px #000}
.location-hero-content h2{font-size:clamp(1.8rem,4vw,2.8rem);margin:.25rem 0 .55rem}
.location-hero-content p{color:#d1cdbf;max-width:58ch}
.location-travel-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.location-travel-card{position:relative;isolation:isolate;overflow:hidden;min-height:190px;padding:0;background:#11130f;justify-content:flex-end}
.location-travel-card::before{content:"";position:absolute;inset:0;z-index:-2;background-image:var(--location-image);background-size:cover;background-position:center;filter:saturate(.72) brightness(.72) contrast(1.1);transition:transform .35s ease,filter .35s ease}
.location-travel-card:hover::before{transform:scale(1.035);filter:saturate(.84) brightness(.82) contrast(1.08)}
.location-card-scrim{position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,rgba(5,6,5,.98) 0%,rgba(7,8,7,.78) 45%,rgba(6,7,6,.18) 100%)}
.location-card-content{display:flex;flex-direction:column;gap:.32rem;padding:.8rem;min-height:100%;justify-content:flex-end;text-shadow:0 2px 8px #000}
.location-card-content>strong{font-size:1.05rem;color:#f1ead5}
.location-card-content button{margin-top:.25rem;text-shadow:none}

/* Crew ability help: hover on desktop, tap/click to pin open on touch screens. */
.crew-profile-card{overflow:visible}
.crew-ability-list{position:relative}
.crew-ability-button{position:relative;overflow:visible;text-align:left;color:var(--text);cursor:help}
.crew-ability-button::after{content:"?";display:grid;place-items:center;width:15px;height:15px;border:1px solid #6b6045;border-radius:50%;color:#b7a46b;font:800 .55rem system-ui,sans-serif;margin-left:.05rem}
.crew-ability-tooltip{position:absolute;left:50%;bottom:calc(100% + .65rem);z-index:80;width:min(320px,calc(100vw - 2rem));padding:.78rem .82rem;border:1px solid #75633c;background:linear-gradient(160deg,#242219,#11120e 78%);box-shadow:0 16px 40px rgba(0,0,0,.68),inset 0 0 0 1px rgba(199,168,91,.07);opacity:0;visibility:hidden;transform:translate(-50%,8px) scale(.98);transition:opacity .18s ease,transform .18s ease,visibility .18s ease;pointer-events:none;text-transform:none;letter-spacing:normal}
.crew-ability-tooltip::after{content:"";position:absolute;left:50%;top:100%;transform:translateX(-50%);border:7px solid transparent;border-top-color:#75633c}
.crew-ability-button:hover .crew-ability-tooltip,.crew-ability-button:focus-visible .crew-ability-tooltip,.crew-ability-button.is-open .crew-ability-tooltip{opacity:1;visibility:visible;transform:translate(-50%,0) scale(1)}
.ability-tooltip-kicker{display:block!important;color:#9b8957!important;font:800 .56rem system-ui,sans-serif!important;letter-spacing:.16em!important;margin-bottom:.3rem}
.crew-ability-tooltip>strong{display:block;font-size:.94rem;color:#eee4c9;margin-bottom:.1rem}
.ability-tooltip-meta{display:block!important;color:#7395ba!important;font:700 .62rem system-ui,sans-serif!important;margin-bottom:.48rem}
.ability-tooltip-description{display:block!important;color:#c9c3b2!important;font:500 .76rem/1.5 system-ui,sans-serif!important}

/* Combat-specific shell: gameplay tabs and global HP/MP/Hunger readout are intentionally hidden. */
body.combat-active .main-nav{display:none!important}
body.combat-active #header-stats{display:none!important}
body.combat-active .app-header{padding-top:.55rem;padding-bottom:.55rem}
body.combat-active #app-view{padding-top:.65rem}

/* Compact two-column command board. */
.combat-command-block{display:block;min-height:0}
.combat-menu-column{padding:.68rem .82rem;border-right:0!important}
.combat-actor-heading{margin:.15rem 0 .48rem}
.combat-action-columns{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;align-items:start}
.combat-action-column{display:grid;gap:.36rem;min-width:0}
.combat-action-column>.combat-command,.combat-action-column>.combat-action-dropdown{width:100%;margin:0}
.combat-action-column>.combat-command,.combat-action-dropdown>summary{min-height:40px;padding:.46rem .6rem}
.combat-action-column .combat-command{display:flex;align-items:center;justify-content:space-between;text-align:left}
.combat-action-column .combat-command small,.combat-action-dropdown>summary small{font-size:.56rem;white-space:normal;text-align:right}
.combat-dropdown-menu{position:relative;z-index:6}

/* Enemy stage is deliberately smaller and its edges dissolve into smoky black. */
.combat-enemy-block{padding:.56rem .8rem .62rem;overflow:hidden}
.enemy-readout{margin-bottom:.25rem}
.enemy-hp-bar{height:7px;margin-bottom:.35rem}
.enemy-portrait-frame{width:38%;max-width:350px;min-width:250px;aspect-ratio:5/3;border-color:#534832;background:#030403;box-shadow:inset 0 0 52px 22px #000,0 9px 24px rgba(0,0,0,.5)}
.enemy-portrait-frame>img{width:100%;height:100%;object-fit:cover;display:block;filter:saturate(.72) contrast(1.12) brightness(.84);-webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 14%,#000 86%,transparent 100%);mask-image:linear-gradient(90deg,transparent 0%,#000 14%,#000 86%,transparent 100%);animation:enemyDreadBreath 6s ease-in-out infinite}
.enemy-vignette{box-shadow:inset 0 0 46px 18px rgba(0,0,0,.72);border-color:rgba(184,148,68,.05);z-index:3}
.enemy-smoke{position:absolute;top:-12%;bottom:-14%;width:38%;z-index:2;pointer-events:none;opacity:.88;filter:blur(10px);mix-blend-mode:multiply;background:radial-gradient(ellipse at center,rgba(0,0,0,.94) 0 24%,rgba(4,6,5,.75) 44%,rgba(20,24,21,.2) 68%,transparent 78%)}
.enemy-smoke-left{left:-12%;animation:enemySmokeLeft 5.5s ease-in-out infinite alternate}
.enemy-smoke-right{right:-12%;animation:enemySmokeRight 6.3s ease-in-out infinite alternate}
@keyframes enemyDreadBreath{0%,100%{transform:scale(1.015);filter:saturate(.72) contrast(1.12) brightness(.82)}50%{transform:scale(1.035);filter:saturate(.79) contrast(1.16) brightness(.9)}}
@keyframes enemySmokeLeft{from{transform:translateX(-3%) scaleY(.94)}to{transform:translateX(8%) scaleY(1.08)}}
@keyframes enemySmokeRight{from{transform:translateX(4%) scaleY(1.05)}to{transform:translateX(-8%) scaleY(.93)}}

/* Chronicle is separate from the command board and closed by default. */
.combat-chronicle-block{margin-top:0;border:1px solid #423d31;background:#11120e;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.combat-chronicle-details>summary{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.64rem .78rem;cursor:pointer;list-style:none;color:#bba96f;font:800 .67rem system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase}
.combat-chronicle-details>summary::-webkit-details-marker{display:none}
.combat-chronicle-details>summary::after{content:"+";font-size:1rem;color:#8c805f;margin-left:auto}
.combat-chronicle-details[open]>summary::after{content:"−"}
.combat-chronicle-details>summary small{color:#777468;font:600 .58rem system-ui,sans-serif;letter-spacing:0;text-transform:none;margin-left:auto}
.combat-chronicle-content{overflow:hidden;padding:0 .72rem .68rem}
.combat-chronicle-content .combat-latest-line{margin:.2rem 0 .45rem}
.combat-chronicle-content .combat-log-scroll{max-height:180px;overflow:auto}

@media(max-width:840px){
  .realmwalker-title{font-size:clamp(2.7rem,10.5vw,5rem);white-space:normal;overflow:visible}
  .enemy-portrait-frame{width:48%;min-width:220px}
}
@media(max-width:560px){
  body.combat-active .app-header{flex-direction:row;align-items:center;padding:.42rem .65rem}
  body.combat-active .app-header>div:first-child .eyebrow{display:none}
  body.combat-active .app-header h1{font-size:1rem;margin:0}
  body.combat-active #app-view{padding:.45rem .55rem}
  .combat-round-label{font-size:.58rem}
  .combat-actor-heading{display:flex;align-items:center!important;flex-direction:row!important;justify-content:space-between;gap:.55rem;margin:.08rem 0 .42rem}
  .combat-actor-heading h2{font-size:1.12rem}
  .stance-toggle{margin-left:auto;flex:0 0 auto;padding:.38rem .48rem;gap:.35rem}
  .stance-toggle strong{font-size:.62rem}
  .stance-track{width:34px;height:17px}
  .stance-track i{width:13px;height:13px}
  .stance-toggle.defensive .stance-track i{left:18px}
  .combat-action-columns{gap:.38rem}
  .combat-action-column>.combat-command,.combat-action-dropdown>summary{min-height:38px;padding:.4rem .45rem}
  .combat-action-column .combat-command small,.combat-action-dropdown>summary small{display:none}
  .combat-command>span,.combat-action-dropdown>summary>span{font-size:.72rem}
  .combat-enemy-block{padding:.45rem .55rem .5rem}
  .enemy-readout span{font-size:.52rem}
  .enemy-readout strong{font-size:.88rem}
  .enemy-portrait-frame{width:70%;max-width:260px;min-width:0}
  .combat-crew-card{min-height:106px;padding:.48rem .55rem;grid-template-columns:66px 1fr}
  .combat-portrait-stage{width:66px;height:86px}
  .vital-row{margin:.22rem 0}
  .status-effects{margin-top:.28rem}
  .combat-chronicle-details>summary{padding:.55rem .62rem}
  .combat-chronicle-details>summary small{display:none}
  .location-hero-card{min-height:220px}
  .location-hero-content{padding:1rem}
  .location-travel-grid{grid-template-columns:1fr 1fr;gap:.55rem}
  .location-travel-card{min-height:170px}
  .location-card-content{padding:.65rem}
  .location-card-content small{font-size:.66rem}
}
@media(max-width:390px){
  .realmwalker-title{font-size:2.55rem}
  .location-travel-grid{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .location-travel-card::before,.enemy-portrait-frame>img,.enemy-smoke{animation:none!important;transition:none!important}
  .crew-ability-tooltip{transition:none!important}
}

/* === Patch 006: install flow, floating status HUD, hunting presentation, mobile ability popovers === */
.pwa-install-button{width:100%;margin-top:.75rem;background:linear-gradient(180deg,#2b3027,#161a15);border:1px solid #646b55;color:#d9dec9;box-shadow:inset 0 0 0 1px rgba(225,235,202,.04)}
.pwa-install-button:hover{border-color:#939d77;background:linear-gradient(180deg,#353d30,#1b2119)}

.install-app-modal,.hunting-result-modal{position:fixed;inset:0;z-index:240;display:grid;place-items:center;padding:1rem;background:rgba(3,4,3,.76);backdrop-filter:blur(7px);opacity:0;transition:opacity .22s ease}
.install-app-modal.is-visible,.hunting-result-modal.is-visible{opacity:1}
.install-app-card{width:min(430px,100%);padding:1.35rem;border:1px solid #6c6042;background:radial-gradient(circle at 50% 0,rgba(130,109,58,.14),transparent 36%),linear-gradient(150deg,#24241c,#0f110e 78%);box-shadow:0 28px 80px rgba(0,0,0,.7),inset 0 0 0 1px rgba(211,180,102,.06);text-align:center;transform:translateY(12px) scale(.985);transition:transform .22s ease}
.install-app-modal.is-visible .install-app-card{transform:translateY(0) scale(1)}
.install-app-emblem{width:76px;height:76px;object-fit:contain;margin:0 auto .7rem;filter:drop-shadow(0 6px 18px rgba(0,0,0,.62))}
.install-app-card h2{margin:.25rem 0 .5rem}.install-app-card p{color:#bbb7a8;line-height:1.55}

/* The old header stat readout has been replaced by the persistent footer HUD. */
body.hud-visible #app-view{padding-bottom:128px;transition:padding-bottom .34s cubic-bezier(.2,.78,.24,1)}
body.hud-visible.hud-minimized #app-view{padding-bottom:34px}
.player-hud{position:fixed;z-index:180;left:50%;bottom:max(0px,env(safe-area-inset-bottom));width:min(980px,calc(100% - 1rem));transform:translate(-50%,0);transition:transform .38s cubic-bezier(.2,.82,.22,1);filter:drop-shadow(0 -10px 25px rgba(0,0,0,.42))}
.player-hud::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(33,32,25,.98),rgba(12,14,11,.99));border:1px solid #59513e;border-bottom:0;clip-path:polygon(0 10px,11px 0,calc(100% - 11px) 0,100% 10px,100% 100%,0 100%);z-index:-1}
.player-hud.is-minimized{transform:translate(-50%,calc(100% - 13px - env(safe-area-inset-bottom)))}
.player-hud-toggle{position:absolute;left:50%;top:-25px;transform:translateX(-50%);width:58px;height:27px;padding:0;border:1px solid #665b42;border-bottom:0;border-radius:10px 10px 0 0;background:#1d1e17;color:#c8b77f;display:grid;place-items:center;box-shadow:0 -5px 14px rgba(0,0,0,.3)}
.player-hud-toggle span{display:block;font-size:1rem;line-height:1;transition:transform .3s ease}.player-hud-toggle:hover{background:#29291f;color:#eadcae}
.player-hud-inner{display:grid;grid-template-columns:minmax(230px,1.4fr) minmax(230px,1.4fr) minmax(92px,.55fr) minmax(76px,.45fr);gap:.55rem;padding:.65rem .75rem calc(.65rem + env(safe-area-inset-bottom));align-items:stretch}
.hud-character{display:grid;grid-template-columns:minmax(82px,.5fr) 1fr;gap:.55rem;align-items:center;padding:.42rem .52rem;border:1px solid #3f3c31;background:linear-gradient(135deg,rgba(52,49,37,.66),rgba(15,17,14,.84))}
.hud-character-copy{min-width:0}.hud-character-copy>span,.hud-resource>span{display:block;color:#887e62;font:800 .53rem/1 system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase}.hud-character-copy>strong{display:block;color:#ede5cc;font-size:.82rem;margin-top:.18rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hud-character-copy small{display:block;color:#706e64;font-size:.56rem;margin-top:.14rem}
.hud-mini-vitals{display:grid;gap:.26rem}.hud-mini-vital>span{display:block;color:#c7c1ad;font:700 .58rem system-ui,sans-serif;margin-bottom:.14rem}.hud-mini-vital>i{display:block;height:6px;background:#090a08;border:1px solid #3b3a31;overflow:hidden}.hud-mini-vital>i>b{display:block;height:100%;transition:width .35s ease}.hud-mini-hp>i>b{background:linear-gradient(90deg,#6c211b,#b84535)}.hud-mini-mp>i>b{background:linear-gradient(90deg,#253e66,#4779ae)}
.hud-resource{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;border:1px solid #3f3c31;background:#12140f;padding:.4rem}.hud-resource>strong{font-size:1rem;color:#e5dcc1;margin-top:.24rem}

.hunting-result-card{position:relative;overflow:hidden;width:min(610px,100%);display:grid;grid-template-columns:42% 58%;min-height:330px;border:1px solid #756343;background:#13140f;box-shadow:0 30px 90px rgba(0,0,0,.78),inset 0 0 0 1px rgba(225,190,112,.06);transform:translateY(15px) scale(.985);transition:transform .24s ease}
.hunting-result-modal.is-visible .hunting-result-card{transform:translateY(0) scale(1)}
.hunting-close{position:absolute;z-index:4;right:.55rem;top:.45rem;width:31px;height:31px;padding:0;border-radius:50%;background:rgba(8,9,7,.78);border:1px solid #6c624e;color:#d6c8a0;font-size:1.25rem;line-height:1}
.hunting-result-visual{min-height:330px;background-size:cover;background-position:center;filter:saturate(.72) contrast(1.06)}
.hunting-result-visual.success{background-image:linear-gradient(90deg,rgba(15,11,7,.18),rgba(15,11,7,.42)),repeating-linear-gradient(45deg,rgba(143,112,73,.88) 0 3px,rgba(106,81,52,.9) 3px 6px,rgba(128,99,64,.9) 6px 9px),repeating-linear-gradient(-45deg,rgba(47,31,18,.16) 0 2px,transparent 2px 5px)}
.hunting-result-visual.failure{background-image:linear-gradient(90deg,rgba(3,5,4,.25),rgba(3,5,4,.72)),url('/assets/images/locations/black_swamp.webp')}
.hunting-result-copy{padding:1.25rem 1.35rem;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(90deg,rgba(17,18,14,.88),#11120e 20%)}
.hunting-result-copy h2{margin:.22rem 0 .45rem}.hunting-result-copy>p{color:#bdb7a7;line-height:1.5;margin-bottom:.7rem}
.hunting-reward-list{display:grid;gap:.36rem;margin:.25rem 0 .85rem}.hunting-reward-row{display:grid;grid-template-columns:36px 1fr auto;gap:.55rem;align-items:center;padding:.34rem .48rem;border:1px solid #514936;background:rgba(10,11,9,.62);opacity:0;transform:translateY(-9px);animation:huntRewardReveal .42s ease forwards;animation-delay:var(--reward-delay)}.hunting-reward-row img{width:36px;height:36px;object-fit:contain}.hunting-reward-row span{font-size:.8rem;color:#ddd4ba}.hunting-reward-row strong{color:#d4ba76}.hunting-empty-result{padding:.65rem;border:1px dashed #4f4b3d;color:#928f84;font-size:.76rem;line-height:1.45}
@keyframes huntRewardReveal{to{opacity:1;transform:translateY(0)}}

/* Mobile ability help is centered to the viewport; JS moves the arrow to the tapped ability. */
@media(max-width:560px){
  body.hud-visible #app-view{padding-bottom:152px}body.hud-visible.hud-minimized #app-view{padding-bottom:34px}
  .player-hud{width:calc(100% - .5rem)}
  .player-hud-inner{grid-template-columns:1fr 1fr auto auto;gap:.3rem;padding:.48rem .42rem calc(.48rem + env(safe-area-inset-bottom))}
  .hud-character{grid-template-columns:1fr;gap:.3rem;padding:.34rem}.hud-character-copy>strong{font-size:.72rem}.hud-character-copy>span{font-size:.46rem}.hud-character-copy small{display:none}.hud-mini-vital>span{font-size:.5rem}.hud-mini-vital>i{height:5px}
  .hud-resource{padding:.28rem;min-width:50px}.hud-resource>span{font-size:.45rem}.hud-resource>strong{font-size:.82rem}
  .crew-ability-tooltip{position:fixed;left:50%;bottom:auto;width:min(330px,calc(100vw - 24px));transform:translate(-50%,8px) scale(.98);z-index:260}
  .crew-ability-button:hover .crew-ability-tooltip,.crew-ability-button:focus-visible .crew-ability-tooltip,.crew-ability-button.is-open .crew-ability-tooltip{transform:translate(-50%,0) scale(1)}
  .crew-ability-tooltip::after{left:var(--ability-arrow-left,24px);transform:translateX(-50%)}
  .hunting-result-card{grid-template-columns:1fr;min-height:0;max-height:calc(100vh - 2rem);overflow:auto}.hunting-result-visual{min-height:145px}.hunting-result-copy{padding:1rem}.hunting-reward-list{max-height:210px;overflow:auto}
}

@media(prefers-reduced-motion:reduce){.player-hud,.install-app-modal,.install-app-card,.hunting-result-modal,.hunting-result-card,.hunting-reward-row{transition:none!important;animation:none!important}.hunting-reward-row{opacity:1;transform:none}}

.install-app-modal[hidden],.hunting-result-modal[hidden],.player-hud[hidden]{display:none!important}

/* === Patch 007: combat readability, taller HUD, travel transitions === */
body.auth-active .main-nav{display:none!important}

/* Travel pauses briefly on departure and the arriving location fades back into view. */
.location-hero-card,.travel-panel{transition:opacity .5s ease,filter .5s ease,transform .5s ease}
.location-hero-card.travel-transition-out,.travel-panel.travel-transition-out{opacity:.18;filter:brightness(.42) saturate(.65);transform:scale(.992);pointer-events:none}
.location-hero-card.travel-transition-in,.travel-panel.travel-transition-in{opacity:.18;filter:brightness(.48) saturate(.7);transform:scale(.994)}

/* Combat crew portraits now sit above each character's stat/readout area. */
.combat-crew-card{display:grid;grid-template-columns:1fr!important;grid-template-rows:auto 1fr;gap:.5rem;align-content:start;padding:.58rem .68rem;min-height:0}
.combat-portrait-stage{width:100%!important;height:88px!important;max-width:none;overflow:hidden;border:1px solid #504a3a;background:#090a08}
.combat-crew-portrait{width:100%;height:100%;object-fit:cover;object-position:center 28%;display:block}
.combat-crew-info{width:100%}
.combat-crew-card.empty{display:flex;min-height:132px}

/* Enemy art is a clean framed portrait again; no side masks/smoke fades. */
.enemy-portrait-frame>img{-webkit-mask-image:none!important;mask-image:none!important;animation:enemyDreadBreath 6s ease-in-out infinite}
.enemy-smoke,.enemy-vignette{display:none!important}

/* Ability options include a compact functional description under their names. */
.combat-ability-option{display:grid!important;grid-template-columns:1fr auto;grid-template-areas:"name cost" "desc desc";align-items:center;column-gap:.5rem;row-gap:.12rem;text-align:left!important}
.combat-ability-option>span{grid-area:name;font-weight:800}
.combat-ability-option>small{grid-area:cost;color:#8fa5bb!important;text-align:right}
.combat-ability-option>em{grid-area:desc;font:500 .58rem/1.35 system-ui,sans-serif;color:#8e8b80;font-style:normal;white-space:normal}
.combat-controls-locked{opacity:.6;cursor:wait}

/* The persistent status footer is intentionally about twice its prior visual height. */
body.hud-visible #app-view{padding-bottom:225px}
body.hud-visible.hud-minimized #app-view{padding-bottom:34px}
.player-hud-inner{min-height:126px;padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));gap:.8rem}
.hud-character{padding:.72rem .78rem;gap:.72rem}
.hud-character-copy>strong{font-size:1rem}.hud-character-copy>span,.hud-resource>span{font-size:.6rem}
.hud-mini-vitals{gap:.48rem}.hud-mini-vital>span{font-size:.68rem}.hud-mini-vital>i{height:9px}
.hud-resource{padding:.65rem;min-width:82px}.hud-resource>strong{font-size:1.2rem}

@media(max-width:560px){
  body.hud-visible #app-view{padding-bottom:220px}
  body.hud-visible.hud-minimized #app-view{padding-bottom:34px}
  .player-hud-inner{min-height:122px;grid-template-columns:1fr 1fr auto auto;gap:.42rem;padding:.72rem .5rem calc(.72rem + env(safe-area-inset-bottom))}
  .hud-character{padding:.55rem .45rem;gap:.42rem}.hud-character-copy>strong{font-size:.78rem}.hud-character-copy>span{font-size:.49rem}
  .hud-mini-vital>span{font-size:.56rem}.hud-mini-vital>i{height:7px}
  .hud-resource{min-width:52px;padding:.42rem .28rem}.hud-resource>strong{font-size:.92rem}
  .combat-portrait-stage{height:72px!important}
  .combat-crew-card{padding:.44rem .5rem;gap:.35rem}
  .combat-ability-option>em{font-size:.55rem}
}

@media(prefers-reduced-motion:reduce){
  .location-hero-card,.travel-panel{transition:none!important}
}

/* === Patch 008: GUI repair after Patch 007 === */

/* Restore the Travel area as the deliberate card-grid/map layout. */
.location-travel-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:.72rem!important;
  align-items:stretch;
}
.location-travel-card{
  margin:0!important;
  min-width:0;
  min-height:184px;
}
.location-travel-card .location-card-content{height:100%}
@media(max-width:380px){
  .location-travel-grid{grid-template-columns:1fr!important}
}

/* Hunting always keeps a real visual panel. These are temporary assets and can be replaced later. */
.hunting-result-visual{display:block!important;opacity:1!important;background-repeat:no-repeat;background-size:cover;background-position:center}
.hunting-result-visual.success{
  background-image:linear-gradient(90deg,rgba(15,11,7,.14),rgba(15,11,7,.42)),url('/assets/images/ui/hunting_success.webp')!important;
}
.hunting-result-visual.failure{
  background-image:linear-gradient(90deg,rgba(3,5,4,.18),rgba(3,5,4,.68)),url('/assets/images/ui/hunting_fail.webp')!important;
}

/* Crew combat cards stay SIDE-BY-SIDE. Each portrait sits above that character's readout. */
.combat-crew-block{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:.7rem!important;
  padding:0!important;
  background:transparent!important;
  align-items:stretch;
}
.combat-crew-card{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto 1fr!important;
  gap:.48rem!important;
  min-width:0!important;
  min-height:0!important;
  padding:.56rem!important;
  background:linear-gradient(180deg,#181914,#11120f)!important;
  border:1px solid #4a4435!important;
}
.combat-crew-card.empty{
  display:flex!important;
  min-height:160px!important;
}
.combat-portrait-stage{
  width:100%!important;
  height:104px!important;
  max-width:none!important;
  overflow:hidden!important;
  border:1px solid #504a3a!important;
  background:#090a08!important;
}
.combat-crew-portrait{
  width:100%!important;
  height:100%!important;
  display:block!important;
  object-fit:cover!important;
  object-position:center 24%!important;
  border:0!important;
}
.combat-crew-info{width:100%!important;min-width:0!important}
.combat-crew-name{margin-bottom:.36rem!important;padding-bottom:.3rem!important}
.combat-crew-name strong{font-size:.98rem!important}
.combat-crew-card .vital-row{margin:.28rem 0!important}
.combat-crew-card .status-effects{margin-top:.36rem!important}

/* Keep the enemy clean-framed as requested, but restore the stronger 006 proportions. */
.enemy-portrait-frame{
  width:42%!important;
  max-width:390px!important;
  min-width:250px!important;
}
.enemy-portrait-frame>img{
  -webkit-mask-image:none!important;
  mask-image:none!important;
}
.enemy-smoke,.enemy-vignette{display:none!important}

@media(max-width:840px){
  .combat-crew-block{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  .combat-portrait-stage{height:86px!important}
  .enemy-portrait-frame{width:58%!important;min-width:0!important}
}
@media(max-width:560px){
  .combat-crew-block{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:.42rem!important}
  .combat-crew-card{padding:.4rem!important;gap:.32rem!important}
  .combat-portrait-stage{height:70px!important}
  .combat-crew-name{gap:.25rem!important}
  .combat-crew-name strong{font-size:.82rem!important}
  .combat-crew-name span{font-size:.48rem!important}
  .combat-crew-card .vital-label{font-size:.56rem!important}
  .combat-crew-card .vital-bar{height:7px!important}
  .combat-crew-card .status-effects span{font-size:.5rem!important;padding:.16rem .25rem!important}
  .enemy-portrait-frame{width:72%!important;max-width:270px!important;min-width:0!important}
}


/* === Patch 009: feature restoration after 007/008 regression === */
/* Repeatable random-combat action. */
.fight-panel{display:flex;align-items:center;justify-content:space-between;gap:1rem;border-color:#4d3a32;background:radial-gradient(circle at 100% 50%,rgba(111,43,34,.15),transparent 42%),linear-gradient(145deg,#1b1b15,#141510)}
.fight-panel-copy h3{margin:.18rem 0 .28rem}.fight-panel-copy p{margin:0;color:#aaa596;max-width:650px}.fight-action-button{min-width:112px;background:linear-gradient(180deg,#5b2925,#3e201d);border-color:#815046;color:#f1d6cb;text-transform:uppercase;letter-spacing:.08em;box-shadow:inset 0 0 0 1px rgba(255,255,255,.035),0 5px 15px rgba(0,0,0,.24)}

/* Attack-direction lane: intentionally independent of crew/enemy card layout. */
.combat-direction-lane{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.65rem;min-height:35px;margin:-.25rem 0;color:#665f4e;pointer-events:none;overflow:visible}
.combat-direction-rune{font-size:.56rem;color:#776a48;opacity:.75;text-shadow:0 0 9px rgba(180,142,65,.18)}
.combat-direction-arrow{display:flex;align-items:center;gap:.4rem;opacity:.58;font:800 .49rem/1 system-ui,sans-serif;letter-spacing:.13em;white-space:nowrap;transition:opacity .18s ease,color .18s ease,filter .18s ease,transform .18s ease}
.combat-direction-arrow i{display:block;height:1px;flex:1;min-width:28px;background:linear-gradient(90deg,transparent,#665f4e)}
.combat-direction-arrow b{font-size:.8rem;font-weight:900;line-height:1}
.combat-direction-arrow.enemy-to-crew{justify-content:flex-start}.combat-direction-arrow.enemy-to-crew i{background:linear-gradient(90deg,#665f4e,transparent)}
.combat-direction-arrow.crew-to-enemy{justify-content:flex-end;text-align:right}
.combat-direction-lane.direction-crew-fired .crew-to-enemy{opacity:1;color:#d3ae59;filter:drop-shadow(0 0 7px rgba(206,149,48,.9));transform:translateY(-3px);animation:combatArrowCrew .68s ease-out}
.combat-direction-lane.direction-crew-fired .crew-to-enemy i{background:linear-gradient(90deg,transparent,#d3ae59)}
.combat-direction-lane.direction-enemy-fired .enemy-to-crew{opacity:1;color:#c76458;filter:drop-shadow(0 0 7px rgba(185,61,48,.9));transform:translateY(3px);animation:combatArrowEnemy .68s ease-out}
.combat-direction-lane.direction-enemy-fired .enemy-to-crew i{background:linear-gradient(90deg,#c76458,transparent)}
@keyframes combatArrowCrew{0%{opacity:.18;transform:translateY(7px) scale(.97)}35%{opacity:1;transform:translateY(-5px) scale(1.025)}100%{opacity:.58;transform:none}}
@keyframes combatArrowEnemy{0%{opacity:.18;transform:translateY(-7px) scale(.97)}35%{opacity:1;transform:translateY(5px) scale(1.025)}100%{opacity:.58;transform:none}}

@media(max-width:560px){
  .fight-panel{align-items:stretch;flex-direction:column}.fight-action-button{width:100%}
  .combat-direction-lane{gap:.3rem;min-height:30px}.combat-direction-arrow{font-size:.42rem;letter-spacing:.08em;gap:.24rem}.combat-direction-arrow i{min-width:12px}.combat-direction-arrow b{font-size:.7rem}
}
@media(prefers-reduced-motion:reduce){.combat-direction-arrow{animation:none!important;transition:none!important}}

/* === Patch 010: current-baseline restoration + travel map + account/save polish === */

/* Compact sticky header with gameplay controls immediately beside the Realmwalker wordmark. */
.app-header{position:sticky!important;top:0!important;z-index:120!important;min-height:58px;padding:.55rem max(.75rem,calc((100vw - 980px)/2))!important;justify-content:flex-start!important;align-items:center!important;background:rgba(13,14,11,.97)!important}
.header-brand-zone{display:flex;align-items:center;gap:.7rem;width:100%;min-width:0}
.app-header h1{margin:0!important;font-size:1.22rem!important;white-space:nowrap;letter-spacing:.015em}
.header-account-zone{display:flex;align-items:center;gap:.38rem;min-width:0;flex-wrap:nowrap}
.header-account-button,.header-logout,.music-toggle{min-height:34px;padding:.4rem .58rem!important}
.header-account-button{background:#26241d;border-color:#4b4637;color:#d9cfb5}
.music-toggle{width:36px;display:grid;place-items:center;padding:.35rem!important}
.main-nav{position:sticky!important;top:58px!important;z-index:110!important;background:rgba(17,19,14,.98)!important;backdrop-filter:blur(8px)}
body.account-saves-active .main-nav{display:none!important}
body.account-saves-active #app-view{padding-top:1rem}

/* Logged-in account/save selector. */
.account-saves-screen{max-width:980px;margin:0 auto;padding:.25rem 0 1.5rem}
.account-saves-heading{margin-bottom:1rem;padding:.2rem .2rem .7rem;border-bottom:1px solid #34352d}
.account-saves-heading h2{font-size:1.65rem;margin:.2rem 0 .35rem}.account-saves-heading p{margin:0;color:#9f9c8d}
.save-slot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.save-slot-card{position:relative;min-width:0;padding:1rem;background:radial-gradient(circle at 100% 0,rgba(151,124,61,.09),transparent 38%),linear-gradient(155deg,#202019,#141510);border:1px solid #494536;border-radius:10px;box-shadow:0 12px 28px rgba(0,0,0,.25)}
.save-slot-card.is-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border-style:dashed;min-height:260px}.save-slot-number{font:800 .58rem/1 system-ui,sans-serif;letter-spacing:.16em;color:#9b8754;margin-bottom:.7rem}.save-slot-empty-mark{display:grid;place-items:center;width:62px;height:62px;border:1px solid #55503e;border-radius:50%;font-size:2rem;color:#88784f;margin:.15rem auto .55rem}.save-slot-card h3{margin:.18rem 0}.save-slot-card p{color:#8f8d82}.save-slot-heading{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start}.save-slot-heading span,.save-slot-card>small{font:700 .61rem/1.35 system-ui,sans-serif;color:#827f72}.save-slot-heading>strong{color:#c7b779;font-size:.78rem}.save-slot-crew{display:flex;gap:.35rem;margin:.8rem 0}.save-slot-crew img{width:46px;height:46px;border-radius:7px;border:1px solid #4d4838;object-fit:cover}.save-slot-crew span{color:#77776d;font-size:.74rem}.save-slot-card>button{width:100%;margin-top:.75rem}

/* Chapter travel map: fixed 4x4 tile grid, with server-authoritative direct connection travel. */
.chapter-map-panel{overflow:hidden}
.chapter-map-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:.8rem}.chapter-map-heading h3{margin:.12rem 0}.chapter-map-heading p{max-width:480px;margin:0;color:#8f8d82;font-size:.78rem;text-align:right}
.chapter-map-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,1fr);gap:.52rem;padding:.65rem;background:linear-gradient(145deg,#10110d,#161811);border:1px solid #33362b;border-radius:12px;box-shadow:inset 0 0 35px rgba(0,0,0,.35)}
.chapter-map-tile{position:relative;aspect-ratio:1/1;min-width:0;overflow:hidden;border-radius:10px;border:1px solid #30332a;background:#11120e;color:var(--text);padding:0;margin:0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.015);isolation:isolate}
.chapter-map-tile.map-empty{background:linear-gradient(145deg,rgba(44,47,38,.28),rgba(17,18,14,.25));border-color:#252820;box-shadow:inset 0 0 18px rgba(0,0,0,.26)}
.chapter-map-tile.map-empty span{position:absolute;inset:18%;border:1px dashed rgba(93,94,80,.12);border-radius:8px}
.map-location-tile{background-image:var(--location-image);background-size:cover;background-position:center;display:block;text-align:left;cursor:default}
button.map-location-tile{cursor:pointer;font:inherit}
.map-tile-scrim{position:absolute;inset:0;background:linear-gradient(to top,rgba(6,7,5,.94) 0 24%,rgba(7,8,6,.22) 66%,rgba(7,8,6,.08));z-index:0}.map-location-tile.is-distant .map-tile-scrim{background:linear-gradient(rgba(6,7,5,.48),rgba(6,7,5,.8))}.map-location-tile.is-unvisited{filter:saturate(.7) brightness(.84)}
.map-tile-copy{position:absolute;z-index:1;left:.55rem;right:.55rem;bottom:.48rem;display:grid;gap:.12rem}.map-tile-copy strong{font-size:clamp(.72rem,1.5vw,.95rem);line-height:1.08;text-shadow:0 2px 8px #000}.map-tile-copy small{font:800 .5rem/1 system-ui,sans-serif;letter-spacing:.11em;text-transform:uppercase;color:#aaa58f}.map-location-tile.is-reachable{border-color:#5b5135;box-shadow:inset 0 0 0 1px rgba(194,166,90,.12)}.map-location-tile.is-reachable:hover{filter:brightness(1.12);transform:translateY(-1px);border-color:#8b7543}.map-location-tile.is-reachable .map-tile-copy small{color:#d2bd75}
.map-location-tile.is-current{border-color:#c2a653;box-shadow:0 0 0 1px rgba(199,169,78,.35),0 0 16px rgba(207,169,65,.36),inset 0 0 24px rgba(205,165,58,.13);animation:currentMapTilePulse 2.1s ease-in-out infinite}.map-location-tile.is-current .map-tile-copy small{color:#e3ca78}
@keyframes currentMapTilePulse{0%,100%{box-shadow:0 0 0 1px rgba(199,169,78,.32),0 0 10px rgba(207,169,65,.24),inset 0 0 20px rgba(205,165,58,.1)}50%{box-shadow:0 0 0 2px rgba(220,187,91,.62),0 0 24px rgba(222,178,60,.48),inset 0 0 28px rgba(219,177,61,.16)}}

/* Rest & Recover presentation. */
.rest-recover-panel{position:relative;overflow:hidden;background:radial-gradient(circle at 12% 15%,rgba(75,91,109,.14),transparent 36%),linear-gradient(145deg,#181a17,#11130f)}
.rest-recover-button{background:linear-gradient(180deg,#384055,#242938);border-color:#65708a;color:#e0e6ef}
.rest-recover-fx{position:fixed;inset:0;z-index:420;display:grid;place-items:center;background:rgba(5,7,8,0);opacity:0;pointer-events:none;transition:opacity .3s ease,background .35s ease}.rest-recover-fx.is-visible{opacity:1;background:rgba(5,7,8,.64)}.rest-recover-fx.is-leaving{opacity:0;background:rgba(5,7,8,0)}.rest-recover-night{position:relative;width:min(380px,82vw);height:180px;border:1px solid #4f5870;border-radius:16px;background:radial-gradient(circle at 50% 120%,rgba(104,120,153,.24),transparent 48%),linear-gradient(180deg,#101522,#090c12);box-shadow:0 20px 60px rgba(0,0,0,.58),inset 0 0 34px rgba(103,119,153,.08);overflow:hidden}.rest-moon{position:absolute;width:62px;height:62px;border-radius:50%;left:50%;top:28px;transform:translateX(-50%);background:#d8d5c4;box-shadow:0 0 24px rgba(218,216,194,.32)}.rest-moon::after{content:"";position:absolute;width:56px;height:56px;border-radius:50%;left:17px;top:-5px;background:#101522}.rest-recover-night>i{position:absolute;width:3px;height:3px;border-radius:50%;background:#d8d8ca;box-shadow:0 0 7px #d8d8ca;animation:restStar 1.2s ease-in-out infinite alternate}.rest-recover-night>i:nth-of-type(1){left:18%;top:25%}.rest-recover-night>i:nth-of-type(2){left:78%;top:31%;animation-delay:.2s}.rest-recover-night>i:nth-of-type(3){left:29%;top:52%;animation-delay:.45s}.rest-recover-night>i:nth-of-type(4){left:69%;top:58%;animation-delay:.65s}.rest-recover-copy{position:absolute;left:0;right:0;bottom:22px;text-align:center;text-shadow:0 2px 12px #000}.rest-recover-copy small{display:block;font:800 .55rem/1 system-ui,sans-serif;letter-spacing:.22em;color:#8fa0bd;margin-bottom:.25rem}.rest-recover-copy strong{font-size:1.25rem;color:#e7e5d9}@keyframes restStar{to{opacity:.2;transform:scale(.65)}}

/* Quest archive: one chevron only, with the circled count grouped against it at far right. */
.completed-quests-details>summary{list-style:none!important}.completed-quests-details>summary::marker{content:""}.completed-quests-details>summary::after{content:none!important;display:none!important}.completed-summary-meta{margin-left:auto;display:flex;align-items:center;gap:.45rem}.completed-chevron{display:inline-block;font-size:.95rem;color:#9c8953;transition:transform .28s ease}.completed-quests-details[open] .completed-chevron{transform:rotate(180deg)}

/* Inventory: four columns on desktop; recipes communicate readiness at a glance. */
.inventory-panel .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:stretch}.inventory-card{min-width:0}
.crafting-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem}.recipe-button{width:100%;min-height:44px;transition:filter .18s ease,transform .18s ease,background .18s ease,border-color .18s ease}.recipe-button.recipe-ready{background:linear-gradient(180deg,#31452a,#21351e)!important;border-color:#638058!important;color:#e2f0da!important;box-shadow:inset 0 0 0 1px rgba(157,199,136,.06)}.recipe-button.recipe-ready:hover{transform:translateY(-1px);filter:brightness(1.1)}.recipe-button.recipe-locked{background:#252621!important;border-color:#393b33!important;color:#777970!important;opacity:.62!important;filter:grayscale(.35)}

/* Equipment stat preview: inline popover avoids viewport clipping and compares against the equipped slot. */
.equipment-preview-details{position:relative;min-width:0}.equipment-preview-details>summary{list-style:none;cursor:pointer;padding:.48rem .58rem;border:1px solid #4b4638;border-radius:5px;background:#24241d;color:#d0c5a8;font:800 .66rem/1 system-ui,sans-serif;text-align:center}.equipment-preview-details>summary::-webkit-details-marker{display:none}.equipment-preview-details>summary::after{content:" ▾";color:#958253}.equipment-preview-details[open]>summary::after{content:" ▴"}.equipment-preview-popover{display:grid;gap:.4rem;margin-top:.38rem;padding:.55rem;background:#11120e;border:1px solid #464236;border-radius:5px}.equipment-preview-replace{display:grid;grid-template-columns:1fr auto;gap:.2rem .5rem;align-items:center;padding-bottom:.38rem;border-bottom:1px solid #33342c}.equipment-preview-replace>span{font:800 .54rem/1 system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:#9b8857}.equipment-preview-replace>small{font-size:.56rem;color:#77766d}.equipment-preview-replace>strong{grid-column:1/-1;font-size:.74rem;color:#d9d0b9}.equipment-preview-row{display:grid;grid-template-columns:1fr auto auto;gap:.35rem;align-items:center;font:700 .62rem system-ui,sans-serif}.equipment-preview-row span{color:#b7b2a3}.equipment-preview-row small{color:#77786f}.equipment-preview-row strong{min-width:30px;text-align:right}.equipment-preview-row strong.positive{color:#8ec77f}.equipment-preview-row strong.negative{color:#d17870}.equipment-preview-row strong.neutral{color:#8f8e84}.equipment-preview-neutral{margin:0;color:#86867d;font-size:.68rem}

/* Crew ability help: viewport-safe on phones/tablets; only pinned-open state displays on touch widths. */
@media(max-width:760px){
  .crew-ability-tooltip{position:fixed!important;left:50%!important;right:auto!important;bottom:auto!important;width:min(340px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;transform:translate(-50%,8px) scale(.98)!important;z-index:360!important}
  .crew-ability-button:not(.is-open):hover .crew-ability-tooltip,.crew-ability-button:not(.is-open):focus-visible .crew-ability-tooltip{opacity:0!important;visibility:hidden!important;transform:translate(-50%,8px) scale(.98)!important}
  .crew-ability-button.is-open .crew-ability-tooltip{opacity:1!important;visibility:visible!important;transform:translate(-50%,0) scale(1)!important}
  .crew-ability-tooltip::after{left:var(--ability-arrow-left,24px)!important;top:100%;bottom:auto;border:7px solid transparent;border-top-color:#75633c!important;transform:translateX(-50%)!important}
  .crew-ability-tooltip.tooltip-below::after{top:auto!important;bottom:100%!important;border-top-color:transparent!important;border-bottom-color:#75633c!important}
}

/* Fade into any newly-entered combat, regardless of whether it came from travel, Fight, or a quest. */
#app-view.combat-transition-in::before{content:"";position:fixed;inset:0;z-index:250;pointer-events:none;background:#050604;animation:combatCurtain .58s ease-out forwards}
#app-view.combat-transition-in .combat-screen{animation:combatScreenArrival .56s cubic-bezier(.2,.75,.25,1) both}
@keyframes combatCurtain{0%{opacity:.82}100%{opacity:0}}@keyframes combatScreenArrival{0%{opacity:.12;transform:scale(.985);filter:brightness(.6)}100%{opacity:1;transform:none;filter:none}}

@media(max-width:760px){
  .save-slot-grid{grid-template-columns:1fr}
  .save-slot-card.is-empty{min-height:190px}
  .chapter-map-heading{align-items:flex-start;flex-direction:column;gap:.35rem}.chapter-map-heading p{text-align:left}
  .chapter-map-grid{gap:.34rem;padding:.42rem}.map-tile-copy{left:.32rem;right:.32rem;bottom:.3rem}.map-tile-copy strong{font-size:.62rem}.map-tile-copy small{font-size:.42rem;letter-spacing:.06em}
  .inventory-panel .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .crafting-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .app-header{flex-direction:row!important;align-items:center!important;min-height:54px!important;padding:.42rem .55rem!important}.header-brand-zone{gap:.42rem}.app-header h1{font-size:1.03rem!important}.header-account-zone{gap:.25rem}.header-account-button,.header-logout{font-size:.62rem;padding:.34rem .42rem!important}.music-toggle{width:32px;min-height:31px!important}.main-nav{top:54px!important;padding:.45rem .55rem!important}.main-nav a{padding:.48rem .62rem;font-size:.72rem}
}
@media(max-width:390px){.inventory-panel .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.crafting-grid{grid-template-columns:1fr}.map-tile-copy small{display:none}.map-tile-copy strong{font-size:.56rem}}
@media(prefers-reduced-motion:reduce){.map-location-tile.is-current,.rest-recover-night>i,#app-view.combat-transition-in::before,#app-view.combat-transition-in .combat-screen{animation:none!important}.rest-recover-fx{transition:none!important}}


/* === Patch 011: save management, hunger danger states, event rewards, and header stabilization === */
html{scrollbar-gutter:stable}
.header-account-zone{margin-left:auto!important;justify-content:flex-end!important}
.header-account-button.is-current{border-color:#7a6940!important;color:#eadcae!important;background:#312c20!important}
.header-account-button:disabled.is-current{opacity:.9!important;cursor:default}

/* Save cards: crew first, then location/GP/last-played, with asymmetric continue/delete actions. */
.save-slot-card.has-save{display:flex;flex-direction:column;min-height:360px}
.save-slot-card.has-save .save-slot-number{margin-bottom:.8rem}
.save-slot-card.has-save .save-slot-crew{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;margin:.15rem 0 .85rem}
.save-slot-crew-member{min-width:0;display:grid;grid-template-columns:54px minmax(0,1fr);grid-template-rows:auto auto;column-gap:.55rem;align-items:center;padding:.45rem;background:#11130f;border:1px solid #38392f;border-radius:8px}
.save-slot-crew-member img{grid-row:1/3;width:54px!important;height:64px!important;border-radius:6px!important;object-fit:cover}
.save-slot-crew-member strong{font-size:.78rem;color:#e6ddc4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.save-slot-crew-member span{font:800 .58rem/1.2 system-ui,sans-serif;color:#a89459;letter-spacing:.05em;text-transform:uppercase}
.save-slot-detail{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:.58rem 0;border-top:1px solid #34352d}
.save-slot-detail span{font:800 .57rem/1.25 system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#7f7b6d}
.save-slot-detail strong{font-size:.76rem;color:#d9d0b9;text-align:right}
.save-slot-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;margin-top:auto;padding-top:.9rem}
.save-slot-actions button{margin:0!important}
.save-continue-button{min-height:48px;background:linear-gradient(180deg,#41663a,#294726)!important;border-color:#719267!important;color:#eff7e9!important;font-size:.86rem!important;letter-spacing:.08em;box-shadow:0 0 18px rgba(87,133,70,.12)}
.save-delete-button{min-width:88px;background:linear-gradient(180deg,#622c29,#461e1c)!important;border-color:#8c4e47!important;color:#f0c5bf!important;font-size:.68rem!important;letter-spacing:.07em}

/* Confirmation modal is reusable; destructive saves get a warning-sign red treatment. */
.modal{z-index:520!important;backdrop-filter:blur(6px)}
.modal-card{width:min(470px,calc(100vw - 2rem));padding:1.3rem!important;background:radial-gradient(circle at 50% 0,rgba(125,101,51,.10),transparent 42%),linear-gradient(160deg,#1f2119,#11130f)!important;box-shadow:0 22px 70px rgba(0,0,0,.62)}
.modal-kicker{font:900 .58rem/1 system-ui,sans-serif;letter-spacing:.18em;color:#ad965a;margin-bottom:.35rem}
.modal-card h2{margin:.2rem 0 .55rem;color:#ece2c8}
.modal-card p{color:#b8b3a5;line-height:1.55}
.modal.danger-confirm .modal-card{border-color:#79403b!important;background:radial-gradient(circle at 50% 0,rgba(125,35,29,.19),transparent 45%),linear-gradient(160deg,#211817,#120d0c)!important}
.modal.danger-confirm .modal-kicker{color:#e06c5f}
.modal.danger-confirm .modal-card h2{color:#f0cbc6}
.warning-delete-button{background:linear-gradient(180deg,#a12e25,#6e1713)!important;border-color:#e15c50!important;color:#fff1ee!important;animation:deleteWarningPulse 1.05s ease-in-out infinite}
@keyframes deleteWarningPulse{0%,100%{box-shadow:0 0 0 rgba(226,68,54,0),0 0 8px rgba(226,68,54,.12)}50%{box-shadow:0 0 0 2px rgba(245,92,77,.45),0 0 24px rgba(226,68,54,.5)}}

/* Hunger danger feedback in the floating HUD and World stat strip. */
.hud-hunger-resource,.world-hunger-indicator{position:relative;transition:background .25s ease,border-color .25s ease,color .25s ease,box-shadow .25s ease}
.hud-hunger-resource.hunger-low,.world-hunger-indicator.hunger-low{border-color:#7a592b!important;background:#21190f!important;animation:hungerPulseSlow 2.4s ease-in-out infinite}
.hud-hunger-resource.hunger-warning,.world-hunger-indicator.hunger-warning{border-color:#a86d2c!important;background:#2a1b0d!important;animation:hungerPulseWarning 1.35s ease-in-out infinite}
.hud-hunger-resource.hunger-danger,.world-hunger-indicator.hunger-danger{border-color:#9b3e35!important;background:#281110!important;animation:hungerPulseDanger .95s ease-in-out infinite}
.hud-hunger-resource.hunger-starving,.world-hunger-indicator.hunger-starving{border-color:#df443a!important;background:#3a0e0b!important;animation:hungerPulseStarving .58s ease-in-out infinite}
.hud-hunger-resource.hunger-low>strong,.world-hunger-indicator.hunger-low strong{color:#e5aa57!important}
.hud-hunger-resource.hunger-warning>strong,.world-hunger-indicator.hunger-warning strong{color:#ffb34f!important}
.hud-hunger-resource.hunger-danger>strong,.world-hunger-indicator.hunger-danger strong{color:#ee7469!important}
.hud-hunger-resource.hunger-starving>strong,.world-hunger-indicator.hunger-starving strong{color:#ff6a5f!important;text-shadow:0 0 10px rgba(255,70,58,.65)}
@keyframes hungerPulseSlow{50%{box-shadow:0 0 14px rgba(220,133,35,.18);filter:brightness(1.08)}}
@keyframes hungerPulseWarning{50%{box-shadow:0 0 19px rgba(242,140,37,.32);filter:brightness(1.18)}}
@keyframes hungerPulseDanger{50%{box-shadow:0 0 18px rgba(210,62,49,.34);filter:brightness(1.18)}}
@keyframes hungerPulseStarving{50%{box-shadow:0 0 26px rgba(255,50,38,.62);filter:brightness(1.33)}}

/* Shared story/reward popup for quest completion, combat victory, levels, starvation, and defeat. */
.game-event-modal{position:fixed;inset:0;z-index:500;display:grid;place-items:center;padding:1rem;background:rgba(3,4,3,.8);backdrop-filter:blur(7px);opacity:0;transition:opacity .22s ease}
.game-event-modal[hidden]{display:none!important}
.game-event-modal.is-visible{opacity:1}
.game-event-card{position:relative;width:min(500px,calc(100vw - 2rem));padding:1.35rem;border:1px solid #63573c;border-radius:12px;background:radial-gradient(circle at 50% -10%,rgba(152,122,52,.16),transparent 46%),linear-gradient(160deg,#202119,#11120e);box-shadow:0 24px 75px rgba(0,0,0,.67),inset 0 0 40px rgba(154,124,57,.04);transform:translateY(12px) scale(.985);transition:transform .23s ease}
.game-event-modal.is-visible .game-event-card{transform:none}
.game-event-kicker{font:900 .59rem/1 system-ui,sans-serif;letter-spacing:.19em;color:#b9a15f;margin-bottom:.38rem}
.game-event-card h2{margin:.15rem 0 .55rem;color:#eee4c8;font-size:1.55rem}
.game-event-card>p{margin:.1rem 0 .85rem;color:#bdb8a8;line-height:1.55}
.game-event-rewards{display:grid;gap:.38rem;margin:.65rem 0 1rem}
.game-event-reward{display:grid;grid-template-columns:auto 1fr;gap:.48rem;align-items:center;padding:.52rem .58rem;border:1px solid #3c3b30;border-radius:6px;background:#12140f}
.game-event-reward span{color:#ac9250;font-size:.58rem}
.game-event-reward strong{font-size:.76rem;color:#dcd3bb}
.game-event-card>button{width:100%;min-height:44px}
.event-level_up .game-event-card{border-color:#75694a;box-shadow:0 24px 75px rgba(0,0,0,.67),0 0 28px rgba(199,168,84,.14)}
.event-combat_victory .game-event-card{border-color:#6d623e;background:radial-gradient(circle at 50% -10%,rgba(174,139,52,.2),transparent 46%),linear-gradient(160deg,#242218,#11120e)}
.event-starvation_warning .game-event-card,.event-defeat .game-event-card{border-color:#79423b;background:radial-gradient(circle at 50% -10%,rgba(143,47,37,.22),transparent 46%),linear-gradient(160deg,#231714,#120d0c)}
.event-starvation_warning .game-event-kicker,.event-defeat .game-event-kicker{color:#e06c5e}
.event-starvation_warning .game-event-card h2,.event-defeat .game-event-card h2{color:#efcbc5}

/* Keep Seek Out Trouble copy left and its Fight button on the right, including phones. */
.fight-panel{flex-direction:row!important;align-items:center!important}
.fight-action-button{width:auto!important;flex:0 0 auto}

/* Stabilize the header during combat-only rerenders and stance switches. */
.stance-toggle{will-change:box-shadow,background,border-color}
@media(max-width:620px){
  .header-brand-zone{width:100%!important}
  .header-account-zone{margin-left:auto!important;gap:.22rem!important}
  .fight-panel{gap:.55rem!important}
  .fight-panel-copy p{font-size:.74rem}
  .fight-action-button{min-width:82px!important;padding:.52rem .58rem!important}
}
@media(max-width:520px){
  .save-slot-card.has-save{min-height:0}
  .save-slot-crew{grid-template-columns:1fr 1fr!important}
  .save-slot-crew-member{grid-template-columns:44px minmax(0,1fr);padding:.38rem}
  .save-slot-crew-member img{width:44px!important;height:54px!important}
  .save-slot-actions{grid-template-columns:minmax(0,1fr) 78px}
  .save-delete-button{min-width:78px}
}
@media(prefers-reduced-motion:reduce){
  .warning-delete-button,.hud-hunger-resource,.world-hunger-indicator,.game-event-modal,.game-event-card{animation:none!important;transition:none!important}
}

/* === Patch 012: combat pacing, stable stance control, compact HUD, and mobile Den repair === */

/* Combat turn pacing and acting-character presentation. */
.combat-actor-heading{margin-bottom:.28rem}
.combat-round-label{margin:.18rem 0 .68rem!important}
.combat-enemy-turn-wait{display:flex;align-items:center;gap:.55rem;min-height:76px;padding:.75rem .85rem;border:1px solid #4c3f34;background:radial-gradient(circle at 15% 50%,rgba(130,56,43,.12),transparent 38%),linear-gradient(135deg,#181510,#10110d);color:#c8beaa}
.combat-enemy-turn-wait>span{width:12px;height:12px;border-radius:50%;border:2px solid #6b5740;border-top-color:#c17b55;animation:enemyTurnSpinner .8s linear infinite;flex:0 0 auto}
.combat-enemy-turn-wait strong{font-size:.78rem;letter-spacing:.02em}
@keyframes enemyTurnSpinner{to{transform:rotate(360deg)}}

/* Keep crew side-by-side, while doubling portrait height from the current Patch 011 baseline. */
.combat-portrait-stage{height:208px!important;position:relative;z-index:1;transform-origin:center bottom;will-change:transform,filter}
.combat-portrait-stage.combat-attack-lunge{z-index:8;animation:combatPortraitAttackLunge .56s cubic-bezier(.18,.78,.2,1)}
@keyframes combatPortraitAttackLunge{
  0%{transform:translateY(0) scale(1);filter:brightness(1)}
  34%{transform:translateY(-30px) scale(1.035);filter:brightness(1.17)}
  58%{transform:translateY(-23px) scale(1.025);filter:brightness(1.08)}
  100%{transform:translateY(0) scale(1);filter:brightness(1)}
}

/* A defeated enemy gets a readable beat before the reward/victory view replaces combat. */
.combat-screen{position:relative}
.combat-screen.combat-victory-transition{pointer-events:none}
.combat-screen.combat-victory-transition .enemy-portrait-frame{animation:enemyDefeatCollapse .86s cubic-bezier(.24,.7,.24,1) forwards}
.combat-screen.combat-victory-transition .combat-enemy-block{animation:enemyDefeatBlock .86s ease forwards}
.combat-screen.combat-victory-transition::after{content:"";position:fixed;inset:0;z-index:260;pointer-events:none;background:#050604;opacity:0;animation:victoryCurtain .9s ease forwards}
@keyframes enemyDefeatCollapse{0%{transform:none;filter:none;opacity:1}35%{transform:scale(1.025);filter:brightness(1.28) saturate(.72);opacity:1}100%{transform:scale(.94) translateY(16px);filter:brightness(.25) saturate(.45);opacity:.08}}
@keyframes enemyDefeatBlock{0%,45%{filter:none}100%{filter:brightness(.45)}}
@keyframes victoryCurtain{0%,48%{opacity:0}100%{opacity:.9}}

/* Restore an audible, stable stance toggle without causing layout reflow. */
.stance-toggle{contain:layout paint;min-width:126px}
.stance-toggle strong{min-width:58px;text-align:left}

/* Footer reduced by one-third from the current 126px desktop / 122px mobile baseline. */
body.hud-visible #app-view{padding-bottom:92px!important}
.player-hud-inner{min-height:84px!important;padding:.52rem .7rem calc(.52rem + env(safe-area-inset-bottom))!important;gap:.5rem!important}
.hud-character{padding:.34rem .46rem!important}
.hud-resource{padding:.3rem!important}

/* Den: give the current markup explicit game-card styling instead of letting generic cards overflow on phones. */
.den-crew-list{display:grid;gap:.75rem;min-width:0}
.den-character-tile{min-width:0;border:1px solid #35372d;border-radius:9px;background:linear-gradient(155deg,#181a15,#11130f);overflow:visible}
.den-crew-card{display:grid;grid-template-columns:112px minmax(0,1fr);gap:.8rem;align-items:stretch;margin:0!important;padding:.7rem!important;border:0!important;border-radius:8px 8px 0 0!important;background:radial-gradient(circle at 0 0,rgba(146,119,59,.08),transparent 44%),linear-gradient(150deg,#202119,#151711)!important}
.den-crew-portrait-frame{position:relative;width:100%;height:142px;overflow:hidden;border:1px solid #4a4638;border-radius:6px;background:#090a08;box-shadow:inset 0 0 24px rgba(0,0,0,.32)}
.den-crew-portrait{width:100%;height:100%;display:block;object-fit:cover;object-position:center 24%}
.den-crew-portrait-frame.is-ko .den-crew-portrait{filter:grayscale(.8) brightness(.55)}
.ko-stamp{position:absolute;right:.35rem;bottom:.35rem;padding:.2rem .32rem;border:1px solid #8c473e;background:rgba(66,17,14,.9);color:#edaaa1;font:900 .62rem/1 system-ui,sans-serif;letter-spacing:.09em}
.den-crew-copy{min-width:0;display:flex;flex-direction:column;justify-content:center}
.den-crew-name{display:flex;align-items:baseline;justify-content:space-between;gap:.6rem;padding-bottom:.4rem;margin-bottom:.4rem;border-bottom:1px solid #393a31}
.den-crew-name strong{font-size:1.08rem;color:#eee4c9;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.den-crew-name span{font:800 .6rem/1 system-ui,sans-serif;letter-spacing:.09em;color:#ad9659;white-space:nowrap}
.den-crew-copy>p{margin:.08rem 0 .55rem;color:#b8b3a4;font-size:.78rem}
.den-xp-row{display:grid;gap:.28rem}
.den-xp-label{display:flex;justify-content:space-between;gap:.5rem;align-items:center;font:800 .57rem/1 system-ui,sans-serif;letter-spacing:.08em;color:#8f8b7d;text-transform:uppercase}
.den-xp-label strong{color:#cdbd88;font-size:.58rem}
.den-xp-bar{height:8px;overflow:hidden;border:1px solid #3b3b31;background:#0b0c09}
.den-xp-bar i{display:block;height:100%;background:linear-gradient(90deg,#67552f,#ad9150)}
.ability-path-details{border-top:1px solid #33352b;background:#10120e;min-width:0}
.ability-path-details>summary{list-style:none;display:flex;align-items:center;gap:.5rem;padding:.7rem .8rem;cursor:pointer;font:800 .7rem/1 system-ui,sans-serif;color:#d4cab0;background:linear-gradient(180deg,rgba(168,136,66,.06),transparent)}
.ability-path-details>summary::-webkit-details-marker{display:none}
.ability-path-details>summary small{margin-left:auto;color:#77776e;font-size:.55rem;font-weight:700}
.ability-path-chevron{display:inline-flex;align-items:center;justify-content:center;min-width:1.2rem;margin-left:.15rem;color:#d4b15b;font-style:normal;font-size:1.15rem;line-height:1;font-weight:900;text-shadow:0 0 8px rgba(212,177,91,.28);transition:transform .25s ease,color .25s ease}
.ability-path-details:hover .ability-path-chevron{color:#efd28a}.ability-path-details[open] .ability-path-chevron{transform:rotate(180deg)}
.ability-path-content{min-width:0;padding:0 .75rem .75rem;overflow:hidden}
.ability-path-start,.ability-path-milestone{min-width:0;padding:.62rem;border:1px solid #35372d;background:#171914;margin-top:.55rem}
.ability-path-level{display:inline-block;margin-bottom:.4rem;color:#a58c50;font:900 .54rem/1 system-ui,sans-serif;letter-spacing:.12em}
.ability-path-learned,.ability-path-pending,.ability-path-option{min-width:0;padding:.5rem;background:#11130f;border:1px solid #303229;margin-top:.38rem}
.ability-path-learned strong,.ability-path-pending strong,.ability-path-option strong{display:block;color:#ddd4bb;font-size:.77rem;overflow-wrap:anywhere}
.ability-path-learned small,.ability-path-pending small,.ability-path-option small{display:block;margin-top:.25rem;color:#908f84;font-size:.65rem;line-height:1.42;overflow-wrap:anywhere}
.ability-path-option button{width:100%;margin-top:.45rem}
.storage-panel{min-width:0;overflow:hidden}
.storage-panel .storage-grid{min-width:0}
.storage-boundary-divider{display:flex;align-items:center;gap:.6rem;margin:1rem 0;color:#7f7353;font:900 .54rem/1 system-ui,sans-serif;letter-spacing:.16em}
.storage-boundary-divider::before,.storage-boundary-divider::after{content:"";height:1px;background:#39382f;flex:1}

@media(max-width:840px){
  .combat-portrait-stage{height:172px!important}
}

@media(max-width:620px){
  body.hud-visible #app-view{padding-bottom:104px!important}
  .player-hud-inner{min-height:82px!important;padding:.38rem .4rem calc(.38rem + env(safe-area-inset-bottom))!important;gap:.28rem!important}
  .hud-character{padding:.25rem .3rem!important}

  .den-crew-panel,.storage-panel{padding:.62rem!important;overflow:hidden}
  .den-crew-list{gap:.62rem}
  .den-crew-card{grid-template-columns:78px minmax(0,1fr)!important;gap:.55rem!important;padding:.48rem!important}
  .den-crew-portrait-frame{height:104px}
  .den-crew-name{gap:.32rem;margin-bottom:.3rem;padding-bottom:.3rem}
  .den-crew-name strong{font-size:.88rem}
  .den-crew-name span{font-size:.5rem}
  .den-crew-copy>p{font-size:.65rem;margin-bottom:.4rem;white-space:normal}
  .den-xp-label{font-size:.49rem}.den-xp-label strong{font-size:.5rem}.den-xp-bar{height:6px}
  .ability-path-details>summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.35rem;padding:.62rem}
  .ability-path-details>summary small{display:none}
  .ability-path-content{padding:0 .5rem .55rem}
  .ability-path-start,.ability-path-milestone{padding:.48rem;margin-top:.45rem}
  .ability-path-learned,.ability-path-pending,.ability-path-option{padding:.42rem}
  .ability-path-learned small,.ability-path-pending small,.ability-path-option small{font-size:.61rem}
  .storage-panel .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.42rem!important}
  .storage-item-card .inventory-card-copy{padding:.45rem .42rem .24rem!important}
  .storage-item-card .inventory-card-copy strong{font-size:.72rem!important;overflow-wrap:anywhere}
  .storage-item-card .inventory-actions{padding:.28rem .4rem .45rem!important}
  .storage-item-card .inventory-actions button{padding:.42rem .3rem!important;font-size:.62rem!important;min-width:0}
}

@media(max-width:560px){
  .combat-portrait-stage{height:140px!important}
  .combat-enemy-turn-wait{min-height:64px;padding:.6rem}.combat-enemy-turn-wait strong{font-size:.69rem}
}

@media(max-width:390px){
  .den-crew-card{grid-template-columns:68px minmax(0,1fr)!important;gap:.42rem!important}
  .den-crew-portrait-frame{height:92px}
  .den-crew-name strong{font-size:.8rem}
  .storage-panel .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(prefers-reduced-motion:reduce){
  .combat-portrait-stage.combat-attack-lunge,.combat-screen.combat-victory-transition .enemy-portrait-frame,.combat-screen.combat-victory-transition .combat-enemy-block,.combat-screen.combat-victory-transition::after,.combat-enemy-turn-wait>span{animation:none!important}
}

/* === Patch 013: mobile-first combat, inventory density, quest context, and cinematic feedback === */

/* Combat is ordered for phone play: enemy threat, crew status, then commands. */
.combat-enemy-block{order:1}
.combat-crew-block{order:2}
.combat-command-block{order:3}
.combat-chronicle-block{order:4}
.combat-direction-lane{display:none!important}

/* The active combatant is communicated by the card itself instead of directional arrows. */
.combat-enemy-block.is-active-turn,.combat-crew-card.is-active-turn{
  border-color:#c8a85a!important;
  box-shadow:0 0 0 1px rgba(228,198,109,.34),0 0 18px rgba(205,163,66,.34),inset 0 0 24px rgba(151,111,34,.08)!important;
  animation:activeTurnBorderGlow 1.65s ease-in-out infinite;
}
.combat-enemy-block.is-active-turn::before{border-color:rgba(226,196,109,.28)!important}
.combat-crew-card.is-active-turn .combat-portrait-stage{border-color:#9f874f!important;box-shadow:0 0 16px rgba(205,163,66,.18)}
@keyframes activeTurnBorderGlow{0%,100%{filter:brightness(1);box-shadow:0 0 0 1px rgba(228,198,109,.24),0 0 12px rgba(205,163,66,.22),inset 0 0 20px rgba(151,111,34,.06)}50%{filter:brightness(1.06);box-shadow:0 0 0 1px rgba(240,211,126,.48),0 0 25px rgba(215,170,71,.46),inset 0 0 30px rgba(151,111,34,.12)}}

/* Tighter ability copy on combat buttons. */
.combat-ability-option>em{line-height:1.08!important;margin-top:-.02rem}

/* Replace the old red target burst with a sprite-based slash and white/gold impact flash. */
.combat-fx-target.fx-damage{animation:combatHitHitch .46s cubic-bezier(.2,.82,.2,1)!important;box-shadow:0 0 0 1px rgba(255,224,139,.8),0 0 22px rgba(231,186,83,.36)}
.combat-fx-target.fx-damage img{animation:combatDamageGoldFlash .62s ease!important}
.combat-fx-target.fx-damage .combat-fx-overlay{opacity:1!important;animation:combatImpactGoldWash .58s ease-out!important;background:radial-gradient(circle at 50% 50%,rgba(255,248,216,.5),rgba(235,193,91,.18) 34%,transparent 68%)!important}
.combat-fx-target.fx-damage::after{
  content:"";
  position:absolute;
  z-index:9;
  left:50%;top:50%;
  width:min(76%,190px);
  aspect-ratio:1/1;
  transform:translate(-50%,-50%) scale(.72) rotate(-8deg);
  pointer-events:none;
  background-image:url('/assets/images/ui/combat_slash.png');
  background-repeat:no-repeat;
  background-size:500% 100%;
  background-position:0 0;
  filter:drop-shadow(0 0 5px rgba(255,232,170,.8));
  opacity:0;
  animation:combatSlashSprite .48s linear forwards;
}
@keyframes combatHitHitch{0%,100%{transform:translate(0,0) rotate(0)}14%{transform:translate(-6px,-2px) rotate(-.45deg)}28%{transform:translate(7px,1px) rotate(.55deg)}43%{transform:translate(-4px,0) rotate(-.25deg)}62%{transform:translate(2px,0) rotate(.15deg)}}
@keyframes combatDamageGoldFlash{0%,100%{filter:saturate(.82) contrast(1.06)}12%{filter:brightness(2.1) saturate(.3) sepia(.18) contrast(1.05)}31%{filter:brightness(1.55) sepia(.35) saturate(1.4) contrast(1.08)}58%{filter:brightness(.86) saturate(1.1) contrast(1.16)}}
@keyframes combatImpactGoldWash{0%{opacity:0;transform:scale(.82)}18%{opacity:1}100%{opacity:0;transform:scale(1.18)}}
@keyframes combatSlashSprite{
  0%{opacity:0;background-position:0 0;transform:translate(-50%,-50%) scale(.64) rotate(-9deg)}
  8%{opacity:1}
  19%{background-position:0 0}
  20%,39%{background-position:25% 0}
  40%,59%{background-position:50% 0}
  60%,79%{background-position:75% 0}
  80%,96%{background-position:100% 0;opacity:1}
  100%{background-position:100% 0;opacity:0;transform:translate(-50%,-50%) scale(1.08) rotate(-4deg)}
}

/* Mobile-first inventory density: four item tiles per row on Inventory and Den storage. */
.inventory-panel .inventory-grid,.storage-panel .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:.42rem!important}

/* The persistent HUD is reduced by another one-third from the Patch 012 height. */
body.hud-visible #app-view{padding-bottom:66px!important}
body.hud-visible.hud-minimized #app-view{padding-bottom:34px!important}
.player-hud-inner{min-height:56px!important;padding:.3rem .5rem calc(.3rem + env(safe-area-inset-bottom))!important;gap:.32rem!important}
.hud-character{padding:.2rem .3rem!important;gap:.28rem!important}
.hud-character-copy>strong{font-size:.72rem!important}.hud-character-copy>span{font-size:.45rem!important}
.hud-mini-vitals{gap:.18rem!important}.hud-mini-vital>span{font-size:.48rem!important}.hud-mini-vital>i{height:5px!important}
.hud-resource{padding:.2rem!important;min-width:48px!important}.hud-resource>span{font-size:.43rem!important}.hud-resource>strong{font-size:.8rem!important}

/* Crew ability click-help uses a body-level portal so it cannot be clipped by cards or the viewport. */

.crew-stat-rune{appearance:none;background:rgba(14,12,10,.78);border:1px solid rgba(154,132,82,.42);border-radius:18px;padding:.8rem .55rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.16rem;color:inherit;text-align:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.02)}
.crew-stat-rune:hover,.crew-stat-rune:focus-visible{border-color:rgba(199,168,91,.72);transform:translateY(-1px)}
.crew-stat-rune-grid>.crew-stat-rune span,.crew-stat-rune-grid>.crew-stat-rune strong,.crew-stat-rune-grid>.crew-stat-rune small{pointer-events:none}
.crew-ability-tooltip-portal{
  position:fixed;
  z-index:760;
  width:min(340px,calc(100vw - 24px));
  padding:.82rem .88rem;
  border:1px solid #806d43;
  border-radius:8px;
  background:radial-gradient(circle at 20% 0,rgba(170,139,66,.12),transparent 36%),linear-gradient(160deg,#242219,#11120e 78%);
  box-shadow:0 18px 48px rgba(0,0,0,.78),inset 0 0 0 1px rgba(199,168,91,.08);
  opacity:0;
  transform:translateY(5px) scale(.985);
  transition:opacity .16s ease,transform .16s ease;
  pointer-events:none;
}
.crew-ability-tooltip-portal[hidden]{display:none!important}
.crew-ability-tooltip-portal.is-visible{opacity:1;transform:none}
.crew-ability-tooltip-portal::after{content:"";position:absolute;left:var(--ability-arrow-left,24px);top:100%;transform:translateX(-50%);border:7px solid transparent;border-top-color:#806d43}
.crew-ability-tooltip-portal.tooltip-below::after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:#806d43}
.crew-ability-tooltip-portal>strong{display:block;font-size:.98rem;color:#eee4c9;margin-bottom:.1rem}
.crew-ability-tooltip-portal .ability-tooltip-description{font-size:.78rem!important;line-height:1.42!important}
.crew-ability-button.using-portal>.crew-ability-tooltip{display:none!important}

/* Quest acceptance finally surfaces the context already supplied by QuestService. */
.event-quest_accept .game-event-card{border-color:#6d603e;background:radial-gradient(circle at 50% -5%,rgba(141,111,49,.17),transparent 46%),linear-gradient(160deg,#211f17,#11120e)}
.event-quest_accept .game-event-kicker{color:#c5a960;text-align:center}
.game-event-detail{display:grid;gap:.22rem;padding:.65rem .7rem;margin:.2rem 0 .55rem;border:1px solid #66583a;background:linear-gradient(90deg,rgba(85,68,34,.19),rgba(20,21,16,.82))}
.game-event-detail span{font:900 .53rem/1 system-ui,sans-serif;letter-spacing:.16em;color:#b99b55}
.game-event-detail strong{font-size:.8rem;line-height:1.4;color:#e5dcc5}

/* Victory and Level Up are milestone screens, not generic web modals. */
.event-combat_victory .game-event-card,.event-level_up .game-event-card{
  overflow:hidden;
  padding:1.55rem 3rem 1.4rem!important;
  border:1px solid #9b8145!important;
  background:radial-gradient(circle at 50% -5%,rgba(201,159,55,.25),transparent 42%),radial-gradient(circle at 50% 110%,rgba(91,72,32,.2),transparent 46%),linear-gradient(160deg,#29251a,#11120e 74%)!important;
  box-shadow:0 28px 90px rgba(0,0,0,.76),0 0 34px rgba(210,169,67,.2),inset 0 0 55px rgba(196,153,58,.08)!important;
}
.event-combat_victory .game-event-card::before,.event-combat_victory .game-event-card::after,.event-level_up .game-event-card::before,.event-level_up .game-event-card::after{
  content:"";
  position:absolute;
  top:10px;bottom:10px;
  width:24px;
  border-top:3px solid #ad9250;
  border-bottom:3px solid #ad9250;
  background:
    radial-gradient(circle at 50% 15%,transparent 0 6px,rgba(181,151,76,.6) 7px 8px,transparent 9px 18px),
    radial-gradient(circle at 50% 42%,transparent 0 7px,rgba(120,115,56,.46) 8px 9px,transparent 10px 19px),
    radial-gradient(circle at 50% 70%,transparent 0 6px,rgba(169,139,65,.5) 7px 8px,transparent 9px 18px),
    linear-gradient(90deg,#4f3d20 0,#c6a659 35%,#6e572c 62%,#332714 100%);
  box-shadow:inset 0 0 8px rgba(255,225,140,.18),0 0 10px rgba(0,0,0,.6);
  opacity:.9;
}
.event-combat_victory .game-event-card::before,.event-level_up .game-event-card::before{left:10px}
.event-combat_victory .game-event-card::after,.event-level_up .game-event-card::after{right:10px;transform:scaleX(-1)}
.event-combat_victory .game-event-kicker,.event-level_up .game-event-kicker{
  position:relative;z-index:1;text-align:center;
  font:900 clamp(1.65rem,7vw,2.35rem)/1 Georgia,'Times New Roman',serif;
  letter-spacing:.08em;color:#f0d98e;
  text-shadow:0 2px 0 #5c4520,0 0 18px rgba(236,195,87,.44);
  margin:.25rem 0 .45rem;
  animation:epicEventTitleGlow 1.7s ease-in-out infinite;
}
.event-combat_victory .game-event-card h2,.event-level_up .game-event-card h2{position:relative;z-index:1;text-align:center;font-size:1.15rem;margin:.25rem 0 .5rem;color:#eee4c9}
.event-combat_victory .game-event-card>p,.event-level_up .game-event-card>p{text-align:center;position:relative;z-index:1}
.event-combat_victory .game-event-rewards,.event-level_up .game-event-rewards,.event-combat_victory .game-event-card>button,.event-level_up .game-event-card>button{position:relative;z-index:1}
.event-combat_victory .game-event-card>button,.event-level_up .game-event-card>button{background:linear-gradient(180deg,#705b2d,#46391f);border-color:#a98d4d;color:#fff0bd}
@keyframes epicEventTitleGlow{0%,100%{filter:brightness(.94);transform:scale(1)}50%{filter:brightness(1.12);transform:scale(1.015)}}

@media(max-width:620px){
  /* Four-across inventories remain four-across on phones, with compact card chrome. */
  .inventory-panel .inventory-grid,.storage-panel .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:.25rem!important}
  .inventory-card{border-radius:5px!important}
  .inventory-card-copy{padding:.34rem .28rem .18rem!important}
  .inventory-card-copy strong{font-size:.62rem!important;line-height:1.12;overflow-wrap:anywhere}
  .inventory-card-copy p{display:block!important;font-size:.5rem!important;line-height:1.15!important;margin:.2rem 0!important;overflow-wrap:anywhere}
  .inventory-quantity{right:.2rem!important;bottom:.2rem!important;min-width:23px!important;padding:.12rem .22rem!important;font-size:.52rem!important}
  .inventory-stat-chips{gap:.12rem!important}.inventory-stat-chips span{font-size:.45rem!important;padding:.12rem .16rem!important}
  .inventory-actions{display:grid!important;grid-template-columns:1fr!important;gap:.2rem!important;padding:.22rem .25rem .3rem!important}
  .inventory-actions button,.inventory-actions summary{min-width:0!important;width:100%!important;padding:.32rem .15rem!important;font-size:.52rem!important;line-height:1.05}
  .equipment-preview-details summary{font-size:.5rem!important}
  .storage-item-card .inventory-actions button{font-size:.52rem!important;padding:.3rem .12rem!important}

  body.hud-visible #app-view{padding-bottom:65px!important}
  body.hud-visible.hud-minimized #app-view{padding-bottom:34px!important}
  .player-hud-inner{min-height:55px!important;grid-template-columns:1fr 1fr auto auto!important;gap:.2rem!important;padding:.24rem .28rem calc(.24rem + env(safe-area-inset-bottom))!important}
  .hud-character{padding:.16rem .2rem!important;gap:.18rem!important}
  .hud-character-copy>strong{font-size:.62rem!important}.hud-character-copy>span{font-size:.39rem!important}
  .hud-mini-vital>span{font-size:.43rem!important}.hud-mini-vital>i{height:4px!important}
  .hud-resource{min-width:42px!important;padding:.14rem!important}.hud-resource>span{font-size:.38rem!important}.hud-resource>strong{font-size:.7rem!important}

  .event-combat_victory .game-event-card,.event-level_up .game-event-card{padding:1.3rem 2.1rem 1.15rem!important}
  .event-combat_victory .game-event-card::before,.event-combat_victory .game-event-card::after,.event-level_up .game-event-card::before,.event-level_up .game-event-card::after{width:17px;left:auto}
  .event-combat_victory .game-event-card::before,.event-level_up .game-event-card::before{left:7px}
  .event-combat_victory .game-event-card::after,.event-level_up .game-event-card::after{right:7px}

  /* Nested tooltips are suppressed on touch layouts; the fixed portal is used instead. */
  .crew-ability-button>.crew-ability-tooltip{display:none!important}
}

@media(prefers-reduced-motion:reduce){
  .combat-enemy-block.is-active-turn,.combat-crew-card.is-active-turn,.combat-fx-target.fx-damage,.combat-fx-target.fx-damage img,.combat-fx-target.fx-damage::after,.combat-fx-target.fx-damage .combat-fx-overlay,.event-combat_victory .game-event-kicker,.event-level_up .game-event-kicker{animation:none!important}
}

/* === Patch 014: mobile-first hunt/map/status/combat feedback restoration === */

/* Quest and Hunting calls-to-action stay anchored to the right edge of their block. */
.world-action-row,.quest-offer-row,.quest-action-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:.7rem!important;
}
.world-action-copy,.quest-offer-copy,.quest-action-copy{min-width:0}
.world-action-button,.quest-offer-button,.quest-action-row>button{
  justify-self:end!important;
  align-self:center!important;
  width:auto!important;
  min-width:104px;
  margin:0!important;
}

/* The Chapter 1 map is a compact 3x4 sticky strip directly below the sticky tabs. */
.chapter-map-panel{
  position:sticky!important;
  top:108px!important;
  z-index:104!important;
  overflow:visible!important;
  margin-top:0!important;
  padding:.42rem!important;
  background:linear-gradient(180deg,rgba(18,20,15,.99),rgba(13,15,11,.985))!important;
  border-color:#454331!important;
  box-shadow:0 8px 22px rgba(0,0,0,.4)!important;
  backdrop-filter:blur(8px);
}
.chapter-map-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(3,1fr)!important;
  gap:.3rem!important;
  padding:.34rem!important;
}
.chapter-map-tile{border-radius:7px!important}

/* Stored items should read as a separate chest compartment, not a continuation of carried Inventory. */
.storage-boundary-divider{
  margin:1.25rem -.65rem .2rem!important;
  padding:.72rem .65rem .15rem!important;
  color:#c4a06b!important;
  font-size:.62rem!important;
  text-shadow:0 1px 8px rgba(0,0,0,.65);
}
.storage-boundary-divider::before,.storage-boundary-divider::after{
  height:2px!important;
  background:linear-gradient(90deg,transparent,#8b6740 30%,#b0804d 70%,transparent)!important;
  box-shadow:0 1px 0 rgba(0,0,0,.85);
}
.stored-items-zone{
  margin:0 -.45rem -.45rem!important;
  padding:.78rem .45rem .5rem!important;
  border:1px solid #5d412c;
  border-top:2px solid #8b6541;
  border-radius:7px;
  background:radial-gradient(circle at 50% 0,rgba(139,91,50,.17),transparent 42%),linear-gradient(160deg,rgba(66,43,29,.82),rgba(31,25,19,.94))!important;
  box-shadow:inset 0 10px 24px rgba(89,50,27,.08),inset 0 0 18px rgba(0,0,0,.24);
}
.stored-heading{margin-top:0!important;color:#d1b289!important}

/* Misses should feel like evasions: the intended target slips out of the attack line. */
.combat-fx-target.fx-miss{animation:combatTargetDodge .54s cubic-bezier(.2,.86,.25,1)!important}
.combat-fx-target.fx-miss img{animation:combatTargetDodgeImage .54s cubic-bezier(.2,.86,.25,1)!important}
@keyframes combatTargetDodge{
  0%,100%{transform:translateX(0) rotate(0)}
  25%{transform:translateX(-13px) rotate(-1.7deg)}
  48%{transform:translateX(7px) rotate(.8deg)}
  72%{transform:translateX(-3px) rotate(-.35deg)}
}
@keyframes combatTargetDodgeImage{
  0%,100%{filter:brightness(1)}
  26%{filter:brightness(1.08) contrast(1.04)}
  52%{filter:brightness(.92)}
}

/* Active combat effect badges: compact, tappable iconography with the existing viewport-safe tooltip portal. */
.combat-effect-badges{display:flex;flex-wrap:wrap;gap:.3rem;margin:.38rem 0 .18rem}
.combat-effect-badge{
  display:inline-flex;align-items:center;gap:.26rem;min-width:0!important;min-height:30px!important;
  padding:.22rem .35rem!important;margin:0!important;border-radius:999px!important;
  background:#22251d!important;border:1px solid #59604a!important;color:#bfcba4!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025);font:800 .5rem/1 system-ui,sans-serif!important;
}
.combat-effect-icon{display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px}
.combat-effect-icon svg{width:100%;height:100%;fill:currentColor}
.combat-effect-label{white-space:nowrap}
.combat-effect-badge.effect-howl{color:#e1c477;border-color:#806b39!important;background:#312b1b!important}
.combat-effect-badge.effect-light_step{color:#9ccbc1;border-color:#46766e!important;background:#172924!important}
.combat-effect-badge.effect-deft_hands{color:#e2ba73;border-color:#825f31!important;background:#302417!important}
.combat-effect-badge.effect-poison{color:#9fcf74;border-color:#4f7b3b!important;background:#1a2d18!important}
.combat-effect-badge .status-icon-cut{fill:#172016}

/* Poison visibly stains the afflicted character card for the rest of combat. */
.combat-crew-card.is-poisoned{
  border-color:#5e8a48!important;
  background:radial-gradient(circle at 50% 0,rgba(92,141,65,.18),transparent 38%),linear-gradient(160deg,#1d291a,#11160f)!important;
  box-shadow:0 0 0 1px rgba(105,159,75,.14),inset 0 0 28px rgba(80,132,57,.12)!important;
}
.combat-crew-card.is-poisoned .combat-portrait-stage::before{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(rgba(67,132,53,.12),rgba(23,87,34,.22));mix-blend-mode:screen;
}
.combat-crew-card.is-poisoned .combat-crew-portrait{filter:saturate(.82) sepia(.08) hue-rotate(42deg) contrast(1.05)}

/* Lone Wolf relationship sequence uses the same event system but feels like a character moment. */
.game-event-image{display:block;width:100%;max-height:210px;object-fit:cover;object-position:center 34%;margin:.15rem 0 .7rem;border:1px solid #4e493a;border-radius:7px;box-shadow:0 12px 28px rgba(0,0,0,.38)}
.game-event-image[hidden]{display:none!important}
.event-wolf_bond .game-event-card,.event-wolf_check_success .game-event-card,.event-wolf_check_failure .game-event-card{
  background:radial-gradient(circle at 50% -5%,rgba(114,102,71,.14),transparent 40%),linear-gradient(160deg,#24231d,#12130f)!important;
  border-color:#70684d!important;
}
.event-wolf_bond .game-event-kicker,.event-wolf_check_success .game-event-kicker{color:#c7b57b}
.event-wolf_check_failure .game-event-kicker{color:#b97a70}
.event-wolf_bond [data-game-event-close]{background:linear-gradient(180deg,#575037,#393524);border-color:#817451;color:#efe3c2;font-weight:900}

/* Combat should not gain artificial scroll space from the persistent HUD while the HUD is forced closed. */
body.combat-active #app-view,body.combat-active.hud-visible #app-view,body.combat-active.hud-minimized #app-view{padding-bottom:.35rem!important}
body.combat-active .combat-screen{padding-bottom:0!important;margin-bottom:0!important}
body.combat-active .combat-chronicle-block{margin-bottom:.2rem!important}

@media(max-width:620px){
  .world-action-row,.quest-offer-row,.quest-action-row{grid-template-columns:minmax(0,1fr) auto!important;gap:.45rem!important}
  .world-action-button,.quest-offer-button,.quest-action-row>button{min-width:92px!important;max-width:128px!important;padding:.55rem .52rem!important;font-size:.64rem!important}

  .chapter-map-panel{top:100px!important;padding:.3rem!important;margin-left:-.2rem!important;margin-right:-.2rem!important}
  .chapter-map-grid{gap:.22rem!important;padding:.24rem!important}
  .map-tile-copy{left:.23rem!important;right:.23rem!important;bottom:.2rem!important}
  .map-tile-copy strong{font-size:.58rem!important;line-height:1.02!important}
  .map-tile-copy small{font-size:.36rem!important;letter-spacing:.04em!important}

  .storage-boundary-divider{margin:1rem -.35rem .18rem!important;padding:.6rem .35rem .12rem!important}
  .stored-items-zone{margin:0 -.2rem -.25rem!important;padding:.62rem .2rem .3rem!important}

  .combat-effect-badges{gap:.22rem;margin:.28rem 0 .1rem}
  .combat-effect-badge{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;padding:.22rem!important;justify-content:center;border-radius:7px!important}
  .combat-effect-label{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .combat-effect-icon{width:20px;height:20px;flex-basis:20px}

  .game-event-image{max-height:180px;margin-bottom:.58rem}
}

@media(prefers-reduced-motion:reduce){
  .combat-fx-target.fx-miss,.combat-fx-target.fx-miss img{animation:none!important}
}

/* === Patch 015: mobile-first KO, Stagger, targeted healing, and quest/combat polish === */

/* A permanently chosen Ability Path option reads immediately as selected. */
.ability-path-option.chosen{
  border-color:#c8a753!important;
  box-shadow:0 0 0 1px rgba(217,181,91,.24),0 0 14px rgba(205,164,64,.13),inset 0 0 18px rgba(164,126,44,.08)!important;
  background:linear-gradient(145deg,rgba(53,45,25,.92),rgba(20,20,15,.98))!important;
}
.ability-path-option.chosen>span{color:#e0c477!important;font-weight:900;letter-spacing:.08em}

/* KO is deliberately stark: desaturated portrait, black diagonal strike and centered KO stamp. */
.crew-portrait-frame.is-ko,.den-crew-portrait-frame.is-ko,.combat-portrait-stage.is-ko{position:relative;isolation:isolate}
.crew-portrait-frame.is-ko img,.den-crew-portrait-frame.is-ko img,.combat-portrait-stage.is-ko img{
  filter:grayscale(1) brightness(.48)!important;
}
.crew-portrait-frame.is-ko::after,.den-crew-portrait-frame.is-ko::after{
  content:"";position:absolute;z-index:7;left:-12%;top:48%;width:124%;height:7px;
  background:#020202;box-shadow:0 1px 0 rgba(255,255,255,.07);transform:rotate(-34deg);transform-origin:center;pointer-events:none;
}
.ko-stamp{
  z-index:8!important;left:50%!important;right:auto!important;top:50%!important;bottom:auto!important;transform:translate(-50%,-50%)!important;
  padding:0!important;border:0!important;background:transparent!important;color:#030303!important;
  font:1000 1.65rem/1 system-ui,sans-serif!important;letter-spacing:.08em!important;
  text-shadow:0 0 2px rgba(226,219,195,.88),0 1px 0 rgba(226,219,195,.55)!important;
}
.combat-ko-slash{position:absolute;z-index:8;left:-12%;top:49%;width:124%;height:8px;background:#020202;transform:rotate(-34deg);pointer-events:none;box-shadow:0 1px 0 rgba(255,255,255,.06)}
.combat-ko-label{position:absolute;z-index:9;left:50%;top:50%;transform:translate(-50%,-50%);color:#020202;font:1000 1.7rem/1 system-ui,sans-serif;letter-spacing:.08em;text-shadow:0 0 2px rgba(226,219,195,.9),0 1px 0 rgba(226,219,195,.6);pointer-events:none}
.combat-crew-card.is-ko{border-color:#34342f!important;background:linear-gradient(160deg,#171814,#10110e)!important;box-shadow:none!important}
.combat-crew-card.is-ko .combat-effect-badges,.combat-crew-card.is-ko .status-effects{opacity:.46}

/* Footer: character name stays left while compact HP/MP readouts sit beside it on the same row. */
.hud-character{grid-template-columns:minmax(54px,.42fr) minmax(0,1fr)!important;align-items:center!important;gap:.28rem!important}
.hud-mini-vitals{display:grid!important;grid-template-columns:1fr 1fr!important;gap:.28rem!important;align-items:center!important;min-width:0}
.hud-mini-vital{min-width:0}
.hud-mini-vital>span{white-space:nowrap;overflow:hidden;text-overflow:clip}
.hud-mini-vital>i{width:100%;max-width:76px;margin-left:auto}

/* Enemy Stagger meter lives directly under Vitality. */
.enemy-stagger-readout{display:flex;justify-content:space-between;align-items:center;margin:.18rem 0 .16rem;color:#d8c97b;font:800 .52rem/1 system-ui,sans-serif;letter-spacing:.11em}
.enemy-stagger-readout strong{font-size:.54rem;color:#e5d98e;letter-spacing:.04em}
.enemy-stagger-bar{height:7px;margin:0 0 .48rem;border:1px solid #6f6638;background:#17160d;overflow:hidden;box-shadow:inset 0 0 8px rgba(0,0,0,.55)}
.enemy-stagger-bar i{display:block;height:100%;background:linear-gradient(90deg,#c8b958,#efe39a);box-shadow:0 0 8px rgba(234,216,113,.25);transition:width .26s ease}
.combat-enemy-block.is-staggered{border-color:#b69b4a!important;box-shadow:0 0 0 1px rgba(219,187,85,.18),0 0 22px rgba(208,166,54,.15),0 12px 30px rgba(0,0,0,.38)!important}
.combat-enemy-block.is-staggered .enemy-stagger-readout strong{color:#f3d66b;text-shadow:0 0 9px rgba(245,204,76,.42)}
.enemy-stagger-bar.is-broken{border-color:#9f7f31;background:#271f0b}
.enemy-stagger-bar.is-broken i{width:0!important}
.combat-fx-target.fx-stagger-break{animation:staggerBreakHit .7s cubic-bezier(.18,.78,.2,1)}
@keyframes staggerBreakHit{0%,100%{transform:none;filter:none}18%{transform:translateX(-5px) rotate(-.5deg);filter:brightness(1.55)}35%{transform:translateX(6px) rotate(.5deg)}52%{transform:translateX(-3px)}70%{transform:translateX(2px);filter:brightness(1.18)}}

/* MISS art: hold over the target, then drop and dissolve. */
.combat-fx-target{position:relative}
.combat-miss-text{position:absolute;z-index:24;left:50%;top:50%;width:min(44%,150px);height:auto;transform:translate(-50%,-50%) scale(.92);opacity:0;pointer-events:none;filter:drop-shadow(0 4px 8px rgba(0,0,0,.68))}
.combat-miss-text.is-playing{animation:combatMissText .76s ease-out forwards}
@keyframes combatMissText{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.82)}
  10%{opacity:1;transform:translate(-50%,-50%) scale(1.02)}
  53%{opacity:1;transform:translate(-50%,-50%) scale(1)}
  100%{opacity:0;transform:translate(-50%,calc(-50% + 34px)) scale(.96)}
}

/* Targeted Press On keeps the ability readable while making the target choice explicit. */
.combat-targeted-ability{display:grid;gap:.35rem;padding:.5rem;border:1px solid #3c3b31;background:#161812}
.combat-targeted-ability-copy{display:grid;gap:.1rem}
.combat-targeted-ability-copy>span{font-weight:900;color:#e4dcc3;font-size:.72rem}
.combat-targeted-ability-copy>em{font-style:normal;color:#999487;font-size:.58rem;line-height:1.08}
.combat-targeted-ability-copy>small{color:#7f7d72;font-size:.52rem}
.combat-target-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.3rem}
.combat-target-buttons button{min-width:0!important;padding:.42rem .3rem!important;background:#25271f!important;border-color:#55513e!important;color:#ddd3b8!important;font-size:.62rem!important}

.combat-flee-button.awaiting-flee-confirm{background:linear-gradient(90deg,#5d251f,#381814)!important;border-color:#b45d4d!important;box-shadow:0 0 14px rgba(168,60,45,.22)!important}

/* The world map touches the bottom edge of the measured sticky header + tab stack. */
.chapter-map-panel{top:var(--rw-sticky-map-top,100px)!important}

/* Quest story updates use the normal event system with a little more narrative breathing room. */
.event-quest_story_update .game-event-card{background:radial-gradient(circle at 50% 0,rgba(118,91,45,.14),transparent 40%),linear-gradient(160deg,#211f18,#10110d)!important;border-color:#6f6040!important}
.event-quest_story_update [data-game-event-message]{line-height:1.6;color:#d2caba}

@media(max-width:620px){
  .hud-character{grid-template-columns:minmax(50px,.38fr) minmax(0,1fr)!important;gap:.2rem!important}
  .hud-mini-vitals{grid-template-columns:1fr 1fr!important;gap:.18rem!important}
  .hud-mini-vital>span{font-size:.42rem!important}
  .hud-mini-vital>i{height:4px!important;max-width:54px}
  .combat-miss-text{width:min(48%,120px)}
  .enemy-stagger-readout{font-size:.46rem}.enemy-stagger-readout strong{font-size:.47rem}.enemy-stagger-bar{height:6px}
  .combat-targeted-ability{padding:.38rem}.combat-target-buttons button{font-size:.56rem!important;padding:.36rem .2rem!important}
}

@media(prefers-reduced-motion:reduce){
  .combat-miss-text.is-playing,.combat-fx-target.fx-stagger-break{animation:none!important;opacity:1!important}
}

/* Patch 015: evenly distributed mobile-first page tabs */
.main-nav:not([hidden]) {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .2rem !important;
    width: 100%;
    overflow: hidden !important;
}

.main-nav:not([hidden]) a {
    min-width: 0;
    width: 100%;
    text-align: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .main-nav:not([hidden]) {
        gap: .12rem !important;
    }

    .main-nav:not([hidden]) a {
        padding-left: .18rem !important;
        padding-right: .18rem !important;
        letter-spacing: .015em;
    }
}

/* PATCH 016 — mobile-first progression, Turning Point, tooltips and tutorial */
.ability-path-option.chosen{
  border-color:#c7a94d!important;
  box-shadow:0 0 0 1px rgba(225,194,98,.42),0 0 18px rgba(185,142,38,.24)!important;
  background:linear-gradient(145deg,rgba(70,57,27,.46),rgba(18,19,14,.96))!important;
}

.combat-actor-controls{display:flex;align-items:center;justify-content:flex-end;gap:.42rem;min-width:0}
.turning-point-button{border:1px solid #5dad5f!important;background:linear-gradient(180deg,#2b8839,#175c29)!important;color:#f2ffe8!important;box-shadow:0 0 15px rgba(70,205,94,.28),inset 0 1px rgba(255,255,255,.16)!important;font:900 .62rem/1 system-ui,sans-serif!important;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;padding:.62rem .7rem!important}
.turning-point-button:active{transform:translateY(1px)}
.turning-point-button.is-spent{border-color:#464840!important;background:linear-gradient(180deg,#343730,#252822)!important;color:#7d8178!important;box-shadow:none!important;cursor:help}

.equipment-preview-trigger,.equipped-item-tooltip-trigger{border:1px solid #5d5135!important;background:#1c1d17!important;color:#d7c895!important;box-shadow:none!important;font-weight:800!important}
.equipment-preview-trigger{width:100%;font-size:.55rem!important;padding:.42rem .35rem!important}
.equipped-item-tooltip-trigger{display:block;width:100%;text-align:left;padding:.2rem .28rem!important;margin:.15rem 0!important;font-size:.72rem!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* Footer character vitals are deliberately stacked: HP on top, MP below. */
.hud-mini-vitals{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto!important;gap:.12rem!important;min-width:0}
.hud-mini-vital>i{width:100%!important;max-width:72px!important;margin-left:auto!important}

/* MISS is half-size and reads as a quick game-style pop before falling away. */
.combat-miss-text{width:min(22%,72px)!important;transform:translate(-50%,-50%) scale(.62)!important;opacity:0}
.combat-miss-text.is-playing{animation:combatMissTextPatch16 .72s cubic-bezier(.16,.84,.28,1) forwards!important}
@keyframes combatMissTextPatch16{
  0%{opacity:0;transform:translate(-50%,-44%) scale(.45)}
  15%{opacity:1;transform:translate(-50%,-56%) scale(1.08)}
  44%{opacity:1;transform:translate(-50%,-50%) scale(.9)}
  100%{opacity:0;transform:translate(-50%,20%) scale(.84)}
}

/* Tutorial modal — intentionally independent from reward modals so onboarding cannot consume reward events. */
.tutorial-dialog-overlay{position:fixed;inset:0;z-index:880;display:grid;place-items:center;padding:1rem;background:rgba(3,4,3,.84);backdrop-filter:blur(7px);opacity:0;transition:opacity .18s ease}
.tutorial-dialog-overlay.is-visible{opacity:1}
.tutorial-dialog-card{width:min(430px,calc(100vw - 1.4rem));padding:1.25rem 1.05rem 1rem;border:1px solid #806c3e;background:radial-gradient(circle at 50% 0,rgba(149,118,52,.18),transparent 42%),linear-gradient(155deg,#222019,#0e100d 74%);box-shadow:0 22px 65px rgba(0,0,0,.68),inset 0 0 26px rgba(139,105,42,.08);clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px)}
.tutorial-dialog-kicker{color:#bda259;font:900 .58rem/1 system-ui,sans-serif;letter-spacing:.16em;text-transform:uppercase}
.tutorial-dialog-card h2{margin:.35rem 0 .58rem;color:#f0e4c5;font-size:1.45rem;line-height:1.08}.tutorial-dialog-card img{display:block;width:100%;max-height:220px;object-fit:cover;border:1px solid #5f5232;background:#0a0b08;margin:0 0 .75rem}
.tutorial-dialog-card p{margin:0 0 1rem;color:#cbc3ad;font-size:.84rem;line-height:1.58}
.tutorial-dialog-card button{width:100%;background:linear-gradient(180deg,#796331,#4c3d1f);border-color:#ad9251;color:#fff2c9;font-weight:900}

.tutorial-coachmark-overlay{position:fixed;inset:0;z-index:870;background:rgba(0,0,0,.42);opacity:0;transition:opacity .14s ease;pointer-events:auto}
.tutorial-coachmark-overlay.is-visible{opacity:1}
.tutorial-coachmark-bubble{position:fixed;width:min(330px,calc(100vw - 24px));padding:.78rem .82rem .72rem;border:1px solid #887344;background:linear-gradient(155deg,#25231b,#11130f);box-shadow:0 12px 35px rgba(0,0,0,.68);color:#d8d0b9;border-radius:7px}
.tutorial-coachmark-bubble>small{display:block;color:#b99d58;font:900 .52rem/1 system-ui,sans-serif;letter-spacing:.15em;margin-bottom:.35rem}
.tutorial-coachmark-bubble p{margin:0 0 .65rem;font-size:.76rem;line-height:1.48}
.tutorial-coachmark-bubble button{width:100%;padding:.5rem;background:#6f5a2d;border-color:#a68b4b;color:#fff1c8;font-weight:900}
.tutorial-coachmark-bubble::after{content:"";position:absolute;left:var(--tutorial-arrow-left,50%);transform:translateX(-50%);border:8px solid transparent}
.tutorial-coachmark-bubble.points-down::after{top:100%;border-top-color:#887344}
.tutorial-coachmark-bubble.points-up::after{bottom:100%;border-bottom-color:#887344}
.tutorial-target-highlight{position:relative!important;z-index:875!important;box-shadow:0 0 0 2px #d4b451,0 0 24px rgba(218,179,67,.72)!important;animation:tutorialTargetPulse 1.15s ease-in-out infinite alternate!important}
@keyframes tutorialTargetPulse{from{filter:brightness(1)}to{filter:brightness(1.18)}}
.tutorial-hp-text{color:#df5a50}.tutorial-stagger-text{color:#e3c75a}

@media(max-width:700px){
  .combat-actor-controls{gap:.28rem}
  .turning-point-button{padding:.5rem .46rem!important;font-size:.5rem!important;letter-spacing:.02em}
  .stance-toggle{min-width:0!important}
  .hud-mini-vital>i{max-width:54px!important}
  .combat-miss-text{width:min(22%,58px)!important}
  .tutorial-dialog-card h2{font-size:1.22rem}
  .tutorial-dialog-card p{font-size:.78rem}
  .tutorial-coachmark-bubble{width:min(310px,calc(100vw - 18px));padding:.68rem .7rem}
  .tutorial-coachmark-bubble p{font-size:.72rem}
}

@media(prefers-reduced-motion:reduce){
  .combat-miss-text.is-playing,.tutorial-target-highlight{animation:none!important}
  .tutorial-dialog-overlay,.tutorial-coachmark-overlay{transition:none!important}
}
.tutorial-target-highlight{pointer-events:none!important}


/* PATCH 017 — enemy condition secrecy, compact HUD vitals, reliable MISS overlay */
.enemy-readout{justify-content:flex-start!important;margin-bottom:.22rem!important}
.enemy-health-state{font-weight:900!important;transition:color .22s ease,text-shadow .22s ease}
.enemy-health-healthy{color:#68c879!important;text-shadow:0 0 9px rgba(80,190,103,.18)}
.enemy-health-wounded{color:#e0bd56!important;text-shadow:0 0 9px rgba(218,177,63,.18)}
.enemy-health-critical{color:#e45e52!important;text-shadow:0 0 10px rgba(218,63,54,.23)}
.enemy-vital-readout,.enemy-hp-bar{display:none!important}
.hud-mini-vital>i{max-width:36px!important}
.combat-miss-text{display:block!important;z-index:42!important;visibility:visible!important}
.tutorial-enemy-green{color:#68c879}.tutorial-enemy-yellow{color:#e0bd56}.tutorial-enemy-red{color:#e45e52}
@media(max-width:700px){.hud-mini-vital>i{max-width:27px!important}}


/* PATCH 018 — mobile HUD/map compression, combat audio/status polish */
/* Give names/titles the flexible space; compact vitals sit to their right. */
.hud-character{grid-template-columns:minmax(0,1fr) auto!important;gap:.3rem!important}
.hud-mini-vitals{width:76px!important;grid-template-columns:1fr!important;grid-template-rows:auto auto!important;gap:.12rem!important}
.hud-mini-vital{display:grid!important;grid-template-columns:minmax(24px,36px) auto!important;align-items:center!important;column-gap:.2rem!important}
.hud-mini-vital>i{grid-column:1!important;grid-row:1!important;width:100%!important;max-width:36px!important;margin:0!important}
.hud-mini-vital>span{grid-column:2!important;grid-row:1!important;margin:0!important;text-align:left!important;font-size:.44rem!important;line-height:1!important;overflow:visible!important}

/* Preserve the 4-column x 3-row map topology but halve tile height. */
.chapter-map-grid{grid-template-rows:repeat(3,auto)!important}
.chapter-map-tile{aspect-ratio:2/1!important;min-height:0!important}
.map-tile-copy{bottom:.18rem!important}

/* Enemy condition name is intentionally more prominent than exact hidden HP. */
.enemy-health-state{font-size:1.22rem!important;line-height:1.05!important;display:inline-block}
.enemy-health-wounded{animation:enemyConditionWounded 1.9s ease-in-out infinite}
.enemy-health-critical{animation:enemyConditionCritical .78s ease-in-out infinite}
@keyframes enemyConditionWounded{0%,100%{opacity:.9;text-shadow:0 0 5px rgba(218,177,63,.18)}50%{opacity:1;text-shadow:0 0 14px rgba(236,194,72,.52)}}
@keyframes enemyConditionCritical{0%,100%{opacity:.78;text-shadow:0 0 5px rgba(218,63,54,.2)}48%{opacity:1;text-shadow:0 0 16px rgba(239,70,58,.7)}}

/* Stagger is now a row of discrete golden points instead of a progress bar. */
.enemy-stagger-readout,.enemy-stagger-bar{display:none!important}
.enemy-stagger-orbs{display:flex;align-items:center;gap:.42rem;margin:.18rem 0 .48rem;min-height:18px}
.enemy-stagger-label{color:#d8c97b;font:900 .5rem/1 system-ui,sans-serif;letter-spacing:.13em}
.enemy-stagger-orb-row{display:flex;align-items:center;gap:.34rem}
.enemy-stagger-orb{display:block;width:13px;height:13px;border-radius:50%;border:1px solid #8b7938;background:#292716;box-shadow:inset 0 0 5px rgba(0,0,0,.72);transition:background .2s ease,box-shadow .2s ease,border-color .2s ease,transform .2s ease}
.enemy-stagger-orb.is-lit{background:radial-gradient(circle at 36% 30%,#fff0a0 0 14%,#e1bf49 35%,#8f7021 78%);border-color:#e6cc69;box-shadow:0 0 8px rgba(230,197,77,.5),inset 0 0 3px rgba(255,245,167,.5)}
.enemy-stagger-orb.is-empty{background:#17170f;border-color:#4a4630;box-shadow:inset 0 0 6px rgba(0,0,0,.9)}
.enemy-stagger-orbs.is-broken .enemy-stagger-orb{background:#35110f;border-color:#bc4138;animation:brokenStaggerOrb .72s ease-in-out infinite;box-shadow:0 0 9px rgba(210,55,45,.48),inset 0 0 6px rgba(0,0,0,.8)}
@keyframes brokenStaggerOrb{0%,100%{opacity:.58;transform:scale(.92)}50%{opacity:1;transform:scale(1.08);box-shadow:0 0 15px rgba(235,67,54,.72),inset 0 0 6px rgba(0,0,0,.8)}}

/* MISS image: prior !important opacity prevented animation keyframes from ever showing it. */
.combat-miss-text{opacity:0}
.combat-miss-text.is-playing{animation:combatMissVisible .72s cubic-bezier(.16,.84,.28,1) forwards!important}
@keyframes combatMissVisible{
  0%{opacity:0;transform:translate(-50%,-44%) scale(.42)}
  14%{opacity:1;transform:translate(-50%,-56%) scale(.78)}
  48%{opacity:1;transform:translate(-50%,-50%) scale(.66)}
  100%{opacity:0;transform:translate(-50%,18%) scale(.62)}
}

@media(max-width:700px){
  .hud-mini-vitals{width:66px!important}
  .hud-mini-vital{grid-template-columns:minmax(20px,28px) auto!important;column-gap:.16rem!important}
  .hud-mini-vital>i{max-width:28px!important}
  .hud-mini-vital>span{font-size:.4rem!important}
  .enemy-health-state{font-size:1.16rem!important}
  .enemy-stagger-orb{width:11px;height:11px}
  .enemy-stagger-orb-row{gap:.27rem}
  .chapter-map-grid{gap:.22rem!important}
  .chapter-map-tile{aspect-ratio:2/1!important}
  .map-tile-copy strong{font-size:.55rem!important}
  .map-tile-copy small{display:none!important}
}
@media(prefers-reduced-motion:reduce){
  .enemy-health-wounded,.enemy-health-critical,.enemy-stagger-orbs.is-broken .enemy-stagger-orb{animation:none!important}
}

/* PATCH 019 RETRY — based directly on files_for_chat12 master */
/* MISS: use a consistent mobile-readable size instead of target-percentage scaling. */
.combat-enemy-block .combat-miss-text,
.combat-crew-card .combat-miss-text{
  width:74px!important;
  max-width:64%!important;
  height:auto!important;
}
.combat-enemy-block .combat-miss-text{max-width:30%!important}

/* Beast impacts keep the hitch/white-gold flash, but intentionally do NOT invoke the normal slash sprite. */
.combat-fx-target.fx-beast{animation:combatHitHitch .46s cubic-bezier(.2,.82,.2,1)!important;box-shadow:0 0 0 1px rgba(255,224,139,.8),0 0 22px rgba(231,186,83,.36)}
.combat-fx-target.fx-beast img:not(.combat-miss-text){animation:combatDamageGoldFlash .62s ease!important}
.combat-fx-target.fx-beast .combat-fx-overlay{opacity:1!important;animation:combatImpactGoldWash .58s ease-out!important;background:radial-gradient(circle at 50% 50%,rgba(255,248,216,.48),rgba(235,193,91,.16) 34%,transparent 68%)!important}

/* JS advances the actual sprite-sheet frame so arbitrary row/column sheets work reliably. */
.combat-sprite-fx{position:absolute;z-index:38;left:50%;top:50%;pointer-events:none;background-repeat:no-repeat;transform:translate(-50%,-50%);filter:drop-shadow(0 0 7px rgba(0,0,0,.42));animation:combatSpriteFxEnvelope .72s ease-out both}
.combat-sprite-beast{width:min(58%,128px);aspect-ratio:1/1;mix-blend-mode:screen}
.combat-sprite-poison{width:min(72%,150px);aspect-ratio:1/1;filter:drop-shadow(0 0 8px rgba(94,220,78,.42));animation-duration:.82s}
@keyframes combatSpriteFxEnvelope{0%{opacity:0;transform:translate(-50%,-50%) scale(.72)}12%{opacity:1;transform:translate(-50%,-50%) scale(.94)}72%{opacity:1;transform:translate(-50%,-50%) scale(1.02)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.08)}}

/* Save slot actions: brighter game-like Continue and warning-red Delete. */
.save-continue-button{background:linear-gradient(180deg,#56a94f,#287232)!important;border-color:#82d27a!important;color:#f5fff1!important;box-shadow:0 0 16px rgba(78,190,76,.28),inset 0 1px rgba(255,255,255,.12)!important}
.save-delete-button{background:linear-gradient(180deg,#a12e25,#6e1713)!important;border-color:#e15c50!important;color:#fff1ee!important;box-shadow:0 0 14px rgba(226,68,54,.28),inset 0 1px rgba(255,255,255,.08)!important}

@media(max-width:700px){
  .combat-enemy-block .combat-miss-text,
  .combat-crew-card .combat-miss-text{width:64px!important}
  .combat-enemy-block .combat-miss-text{max-width:34%!important}
  .combat-crew-card .combat-miss-text{max-width:68%!important}
  .combat-sprite-beast{width:min(62%,112px)}
  .combat-sprite-poison{width:min(76%,126px)}
}
@media(prefers-reduced-motion:reduce){
  .combat-fx-target.fx-beast,.combat-fx-target.fx-beast img,.combat-fx-target.fx-beast .combat-fx-overlay,.combat-sprite-fx{animation:none!important}
}


/* PATCH 019 HUD HOTFIX — portrait-first mobile footer */
.hud-character{
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:center!important;
  gap:.28rem!important;
}
.hud-character-portrait{
  position:relative;
  width:34px;
  height:34px;
  border:1px solid #6a6049;
  border-radius:4px;
  overflow:hidden;
  background:linear-gradient(145deg,#302d22,#11130f);
  box-shadow:inset 0 0 0 1px rgba(214,183,103,.06),0 2px 7px rgba(0,0,0,.34);
}
.hud-character-portrait img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center 18%;
}
.hud-character-portrait>span{
  width:100%;height:100%;display:grid;place-items:center;
  color:#756d58;font:800 .72rem/1 system-ui,sans-serif;
}
.hud-character-portrait.is-ko img{filter:grayscale(1) brightness(.48)}
.hud-character-portrait.is-ko::after{
  content:"";position:absolute;left:-8%;top:48%;width:116%;height:3px;
  background:#050505;transform:rotate(-38deg);box-shadow:0 1px 2px rgba(255,255,255,.08)
}
.hud-character-copy{display:none!important}
.hud-mini-vitals{
  width:auto!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto auto!important;
  gap:.12rem!important;
}
.hud-mini-vital{
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(24px,36px) auto!important;
  align-items:center!important;
  column-gap:.18rem!important;
}
.hud-mini-vital>i{
  grid-column:1!important;grid-row:1!important;
  width:100%!important;max-width:36px!important;margin:0!important;
}
.hud-mini-vital>span{
  grid-column:2!important;grid-row:1!important;
  margin:0!important;text-align:left!important;
  font-size:.6rem!important;line-height:1!important;
  white-space:nowrap!important;overflow:visible!important;
}
.hud-empty-vitals{min-width:0!important}

@media(max-width:620px){
  .hud-character{grid-template-columns:32px minmax(0,1fr)!important;gap:.2rem!important}
  .hud-character-portrait{width:32px;height:32px}
  .hud-mini-vital{grid-template-columns:minmax(22px,28px) auto!important;column-gap:.14rem!important}
  .hud-mini-vital>i{max-width:28px!important}
  .hud-mini-vital>span{font-size:.6rem!important}
}

@media(max-width:390px){
  .hud-character{grid-template-columns:30px minmax(0,1fr)!important;gap:.16rem!important}
  .hud-character-portrait{width:30px;height:30px}
  .hud-mini-vital{grid-template-columns:22px auto!important;column-gap:.12rem!important}
  .hud-mini-vital>i{max-width:22px!important}
  .hud-mini-vital>span{font-size:.6rem!important;letter-spacing:-.01em}
}

/* PATCH 019 HUD TYPOGRAPHY HOTFIX — larger Georgia vitals + 48px resources */
.hud-mini-vital>span{
  font-family:Georgia,'Times New Roman',serif!important;
  font-size:.7rem!important;
  font-weight:700!important;
}
.hud-resource{
  min-width:48px!important;
}

@media(max-width:620px){
  .hud-mini-vital>span{
    font-family:Georgia,'Times New Roman',serif!important;
    font-size:.7rem!important;
  }
  .hud-resource{
    min-width:48px!important;
  }
}

@media(max-width:390px){
  .hud-mini-vital>span{
    font-family:Georgia,'Times New Roman',serif!important;
    font-size:.7rem!important;
    letter-spacing:-.01em;
  }
  .hud-resource{
    min-width:48px!important;
  }
}

/* PATCH 019 MOBILE HEADER/NAV HOTFIX — header scrolls away, nav alone stays sticky */
@media(max-width:620px){
  .app-header{
    position:relative!important;
    top:auto!important;
    z-index:120!important;
  }

  .main-nav{
    position:sticky!important;
    top:0!important;
    z-index:110!important;
  }

  /* The Chapter Map should sit immediately below the sticky nav, not reserve header space. */
  .chapter-map-panel{
    top:var(--rw-sticky-map-top,0px)!important;
  }
}

/* PATCH 019 MOBILE STICKY MAP SPACING HOTFIX — keep breathing room below sticky nav */
@media(max-width:620px){
  .chapter-map-panel{
    top:calc(var(--rw-sticky-map-top,0px) + 8px)!important;
  }
}

/* === CHAPTER COLOR THEME FRAMEWORK ===
   Chapter 1 intentionally remains the established Black Swamp palette.
   Chapter 2 is the Windblown Foothills: iron-red earth, dark rock, dirt brown,
   warm ember accents, and pale stone highlights. Semantic colors such as HP,
   MP, Hunger warnings, Stagger, success, and destructive actions stay stable. */

body[data-chapter-theme="1"]{
  --rw-chapter-name:"Black Swamp";
  --rw-chapter-bg:#0f100c;
  --rw-chapter-panel:#191b15;
  --rw-chapter-panel-2:#20231b;
  --rw-chapter-line:#353a2c;
  --rw-chapter-accent:#c5b26f;
  --rw-chapter-accent-bright:#e2cf82;
  --rw-chapter-glow:rgba(197,178,111,.24);
}

/* Chapter 2 — Windblown Foothills */
body[data-chapter-theme="2"]{
  --bg:#120c09;
  --panel:#211611;
  --panel2:#2b1c15;
  --line:#56392f;
  --text:#f0e3d6;
  --muted:#b49e8f;
  --accent:#dd7049;

  --rw-chapter-name:"Windblown Foothills";
  --rw-chapter-bg:#120c09;
  --rw-chapter-panel:#211611;
  --rw-chapter-panel-2:#2b1c15;
  --rw-chapter-line:#56392f;
  --rw-chapter-rock:#71645c;
  --rw-chapter-dirt:#815039;
  --rw-chapter-rust:#9d402d;
  --rw-chapter-accent:#dd7049;
  --rw-chapter-accent-bright:#ff9a64;
  --rw-chapter-pale:#f0d8c4;
  --rw-chapter-glow:rgba(221,91,55,.34);

  background:
    radial-gradient(circle at 50% -12%,rgba(150,61,39,.17),transparent 36rem),
    radial-gradient(circle at 12% 42%,rgba(105,72,56,.12),transparent 30rem),
    linear-gradient(180deg,#0d0907 0%,#17100c 48%,#0b0807 100%)!important;
}

/* App shell */
body[data-chapter-theme="2"] .app-header{
  background:linear-gradient(180deg,rgba(29,18,13,.98),rgba(18,12,9,.98))!important;
  border-bottom-color:#5b3b2f!important;
  box-shadow:0 4px 18px rgba(0,0,0,.26),inset 0 -1px rgba(221,112,73,.07);
}
body[data-chapter-theme="2"] .main-nav{
  background:linear-gradient(180deg,rgba(31,18,13,.985),rgba(20,13,10,.985))!important;
  border-bottom-color:#604033!important;
  box-shadow:0 5px 18px rgba(0,0,0,.27)!important;
}
body[data-chapter-theme="2"] .main-nav a{
  color:#decbbd;
}
body[data-chapter-theme="2"] .main-nav a:hover,
body[data-chapter-theme="2"] .main-nav a.active,
body[data-chapter-theme="2"] .main-nav a.is-active,
body[data-chapter-theme="2"] .main-nav a[aria-current="page"]{
  color:#fff0e3!important;
  border-color:#a9573c!important;
  background:linear-gradient(180deg,rgba(139,57,37,.42),rgba(74,35,26,.28))!important;
  box-shadow:inset 0 -2px var(--rw-chapter-accent-bright),0 0 14px rgba(221,91,55,.13);
}
body[data-chapter-theme="2"] .eyebrow{
  color:var(--rw-chapter-accent-bright)!important;
}

/* Common chapter surfaces. */
body[data-chapter-theme="2"] .panel{
  border-color:var(--rw-chapter-line);
}
body[data-chapter-theme="2"] .quest-card,
body[data-chapter-theme="2"] .inventory-card,
body[data-chapter-theme="2"] .crew-profile-card,
body[data-chapter-theme="2"] .den-character-tile,
body[data-chapter-theme="2"] .travel-card,
body[data-chapter-theme="2"] .ability-card{
  border-color:#5c3c31!important;
  background:
    radial-gradient(circle at 100% 0,rgba(160,67,43,.08),transparent 36%),
    linear-gradient(155deg,#2a1c15,#17100d)!important;
}
body[data-chapter-theme="2"] .stat-strip>div,
body[data-chapter-theme="2"] .stat-grid>div{
  background:#261a14!important;
  border-color:#53382e!important;
}
body[data-chapter-theme="2"] .tag{
  border-color:#74503f!important;
  color:#e0c3ae!important;
}

/* Location art gets a subtle warm rock/dirt grade without changing the supplied art. */
body[data-chapter-theme="2"] .location-hero-card::before{
  filter:saturate(.88) sepia(.13) contrast(1.1) brightness(.9)!important;
}
body[data-chapter-theme="2"] .location-hero-scrim{
  background:
    linear-gradient(90deg,rgba(24,12,8,.93) 0%,rgba(35,18,12,.69) 48%,rgba(20,12,9,.32) 100%),
    linear-gradient(0deg,rgba(18,9,7,.9),transparent 64%)!important;
}
body[data-chapter-theme="2"] .location-travel-card::before{
  filter:saturate(.84) sepia(.14) brightness(.72) contrast(1.12)!important;
}

/* Chapter map */
body[data-chapter-theme="2"] .chapter-map-panel{
  background:linear-gradient(180deg,rgba(35,22,16,.99),rgba(22,14,11,.985))!important;
  border-color:#694437!important;
  box-shadow:0 8px 22px rgba(0,0,0,.42),0 0 18px rgba(145,56,37,.07)!important;
}
body[data-chapter-theme="2"] .chapter-map-grid{
  background:linear-gradient(145deg,#160f0c,#281a14)!important;
  border-color:#54372d!important;
}
body[data-chapter-theme="2"] .chapter-map-tile{
  border-color:#493129!important;
  background:#1b120f!important;
}
body[data-chapter-theme="2"] .chapter-map-tile.map-empty{
  background:linear-gradient(145deg,rgba(76,55,44,.28),rgba(29,18,14,.34))!important;
  border-color:#382720!important;
}
body[data-chapter-theme="2"] .map-tile-scrim{
  background:linear-gradient(to top,rgba(22,10,7,.96) 0 24%,rgba(30,15,10,.27) 66%,rgba(25,14,10,.08))!important;
}
body[data-chapter-theme="2"] .map-location-tile.is-reachable{
  border-color:#8e593f!important;
  box-shadow:inset 0 0 0 1px rgba(224,112,73,.13)!important;
}
body[data-chapter-theme="2"] .map-location-tile.is-reachable .map-tile-copy small{
  color:#e4a178!important;
}
body[data-chapter-theme="2"] .map-location-tile.is-current{
  border-color:#ef8258!important;
  animation:currentMapTilePulseFoothills 2.1s ease-in-out infinite!important;
}
body[data-chapter-theme="2"] .map-location-tile.is-current .map-tile-copy small{
  color:#ffab7a!important;
}
@keyframes currentMapTilePulseFoothills{
  0%,100%{
    box-shadow:0 0 0 1px rgba(229,108,72,.32),0 0 10px rgba(199,70,41,.26),inset 0 0 20px rgba(171,64,39,.1)
  }
  50%{
    box-shadow:0 0 0 2px rgba(255,143,97,.64),0 0 25px rgba(221,82,47,.5),inset 0 0 28px rgba(192,73,43,.18)
  }
}

/* Buttons: quiet earth for utility actions, brighter ember/rust for story and combat CTAs. */
body[data-chapter-theme="2"] button:not(.save-delete-button):not(.warning-delete-button):not(.combat-flee-button):not(.turning-point-button){
  border-color:#765040;
  background:linear-gradient(180deg,#4a3024,#322019);
  color:#f2dfcf;
}
body[data-chapter-theme="2"] button.secondary{
  background:linear-gradient(180deg,#352923,#241c18)!important;
  border-color:#5d4a40!important;
}
body[data-chapter-theme="2"] .world-action-button,
body[data-chapter-theme="2"] .quest-offer-button,
body[data-chapter-theme="2"] .quest-action-row>button,
body[data-chapter-theme="2"] .fight-action-button{
  background:
    radial-gradient(circle at 50% 0,rgba(255,163,108,.19),transparent 58%),
    linear-gradient(180deg,#a84b32,#6f2b20)!important;
  border-color:#e17d58!important;
  color:#fff0e5!important;
  box-shadow:0 0 16px rgba(207,75,42,.2),inset 0 1px rgba(255,214,181,.11)!important;
}
body[data-chapter-theme="2"] .rest-recover-button{
  background:linear-gradient(180deg,#5d514a,#3b332f)!important;
  border-color:#88756a!important;
  color:#f1e6dd!important;
}
body[data-chapter-theme="2"] .combat-action-stack>button:not(.combat-flee-button),
body[data-chapter-theme="2"] .combat-action-dropdown>summary{
  background:linear-gradient(90deg,#4a2c20,#302019)!important;
  border-color:#704636!important;
  color:#f2dfca!important;
}
body[data-chapter-theme="2"] .combat-action-stack>button::before,
body[data-chapter-theme="2"] .combat-action-dropdown>summary::before{
  background:#c85d3d!important;
}

/* Combat and HUD inherit the chapter atmosphere while keeping semantic combat colors unchanged. */
body[data-chapter-theme="2"] .combat-section{
  border-color:#624035!important;
  background:
    radial-gradient(circle at 50% -20%,rgba(145,55,35,.12),transparent 38%),
    linear-gradient(155deg,rgba(42,25,18,.99),rgba(17,11,9,.995))!important;
}
body[data-chapter-theme="2"] .combat-crew-card{
  background:linear-gradient(180deg,#2a1c16,#17110e)!important;
  border-color:#5e3d31!important;
}
body[data-chapter-theme="2"] .combat-chronicle-block{
  border-color:#57392f!important;
  background:#17100d!important;
}
body[data-chapter-theme="2"] .player-hud::before{
  background:linear-gradient(180deg,rgba(47,30,22,.99),rgba(19,13,10,.995))!important;
  border-color:#6a4638!important;
}
body[data-chapter-theme="2"] .hud-character{
  border-color:#573a30!important;
  background:linear-gradient(135deg,rgba(72,44,32,.74),rgba(24,16,13,.88))!important;
}
body[data-chapter-theme="2"] .hud-resource{
  border-color:#573a30!important;
  background:#211611!important;
}
body[data-chapter-theme="2"] .hud-character-portrait{
  border-color:#805442!important;
  background:linear-gradient(145deg,#4c3125,#1d1410)!important;
}

/* Small chapter-colored details that help the whole UI read as a new region. */
body[data-chapter-theme="2"] .quest-card-active{
  border-left-color:#d76745!important;
}
body[data-chapter-theme="2"] .quest-next-location{
  background:#211510!important;
  border-color:#57382d!important;
}
body[data-chapter-theme="2"] .quest-next-location strong,
body[data-chapter-theme="2"] .crew-role,
body[data-chapter-theme="2"] .ability-path-level{
  color:#e08b65!important;
}
body[data-chapter-theme="2"] .storage-boundary-divider{
  color:#d58a61!important;
}
body[data-chapter-theme="2"] .toast{
  background:#2b1c16!important;
  border-color:#694538!important;
}

/* Keep reduced-motion users free from the chapter's map glow animation. */
@media(prefers-reduced-motion:reduce){
  body[data-chapter-theme="2"] .map-location-tile.is-current{animation:none!important}
}

/* === Patch 021: moonlit Account screen + chapter-skinned save cards ===
   The Account screen itself uses Realmwalker's moonlit icon palette.
   Occupied saves then inherit the environmental colors of their own chapter,
   while semantic destructive red remains consistent. */
body.account-saves-active{
  --save-moon-night:#08131f;
  --save-moon-deep:#0d1d2d;
  --save-moon-panel:#12283d;
  --save-moon-blue:#32679e;
  --save-moon-steel:#6f8ca3;
  --save-moon-mist:#b9c8d2;
  --save-moon-white:#edf8ff;
  --save-moon-bright:#67d4ff;
  background:
    radial-gradient(circle at 50% -14%,rgba(81,149,201,.26),transparent 34rem),
    radial-gradient(circle at 8% 52%,rgba(45,92,133,.16),transparent 28rem),
    linear-gradient(180deg,#081724 0%,#07111c 58%,#050c13 100%)!important;
}
body.account-saves-active .app-header{
  background:linear-gradient(180deg,rgba(11,29,44,.98),rgba(7,19,30,.98))!important;
  border-bottom-color:rgba(151,186,210,.25)!important;
}
body.account-saves-active .header-account-button{
  background:#16324b!important;
  border-color:#426b8a!important;
  color:#d9edf7!important;
}
body.account-saves-active .header-account-button.is-current{
  background:#1b4264!important;
  border-color:#67b9e9!important;
  color:#f0fbff!important;
  box-shadow:0 0 16px rgba(83,184,239,.16)!important;
}
body.account-saves-active .header-logout,
body.account-saves-active .music-toggle{
  background:#10273b!important;
  border-color:#385875!important;
  color:#bcd4e2!important;
}
body.account-saves-active #app-view{
  max-width:980px;
  padding-top:1rem;
}
.account-saves-screen{
  position:relative;
  color:var(--save-moon-white);
}
.account-saves-screen::before{
  content:"";
  position:absolute;
  z-index:-1;
  inset:-1rem -1rem -2rem;
  pointer-events:none;
  background:
    radial-gradient(circle at 88% 5%,rgba(104,191,239,.08),transparent 20rem),
    radial-gradient(circle at 15% 46%,rgba(52,104,148,.08),transparent 24rem);
}
.account-saves-heading{
  margin-bottom:1rem!important;
  padding:.25rem .25rem .8rem!important;
  border-bottom:1px solid rgba(151,186,210,.28)!important;
}
.account-saves-heading .eyebrow{
  color:#79c8ef!important;
}
.account-saves-heading h2{
  color:var(--save-moon-white)!important;
  text-shadow:0 0 18px rgba(103,212,255,.10);
}
.account-saves-heading p{
  color:#9fb5c3!important;
}

/* Every slot begins from the moonlit Account palette. Occupied slots override
   the variables below according to their saved chapter. */
.save-slot-card{
  --save-card-bg:#10283d;
  --save-card-deep:#091a29;
  --save-card-line:#466b87;
  --save-card-accent:#67d4ff;
  --save-card-accent-soft:#32679e;
  --save-card-text:#edf8ff;
  --save-card-muted:#a7bbc8;
  --save-card-glow:rgba(64,169,232,.22);
  isolation:isolate;
  overflow:hidden;
  border-color:var(--save-card-line)!important;
  background:
    radial-gradient(circle at 100% 0,var(--save-card-glow),transparent 42%),
    linear-gradient(155deg,var(--save-card-bg),var(--save-card-deep))!important;
  box-shadow:
    0 14px 32px rgba(0,0,0,.34),
    inset 0 0 0 1px rgba(220,241,251,.025)!important;
}
.save-slot-card::after{
  content:"";
  position:absolute;
  z-index:1;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(4,12,19,.18),rgba(4,12,19,.78) 72%,rgba(4,10,16,.93)),
    linear-gradient(90deg,var(--save-card-deep),transparent 54%,var(--save-card-deep));
}
.save-slot-card > :not(.save-slot-location-art){
  position:relative;
  z-index:2;
}
.save-slot-location-art{
  position:absolute;
  z-index:0;
  inset:0;
  pointer-events:none;
}
.save-slot-location-art img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
  opacity:.34;
  filter:saturate(.72) contrast(1.08) brightness(.72);
  transform:scale(1.025);
}
.save-slot-number{
  color:var(--save-card-accent)!important;
  text-shadow:0 0 10px var(--save-card-glow);
}
.save-slot-card h3{
  color:var(--save-card-text)!important;
}
.save-slot-card p{
  color:var(--save-card-muted)!important;
}

/* Chapter 1 — Black Swamp save card. */
.save-slot-card.has-save[data-save-chapter="1"]{
  --save-card-bg:#1b2119;
  --save-card-deep:#0c120e;
  --save-card-line:#536247;
  --save-card-accent:#d6c378;
  --save-card-accent-soft:#657552;
  --save-card-text:#f0ead8;
  --save-card-muted:#aeb29d;
  --save-card-glow:rgba(197,178,111,.22);
}
.save-slot-card.has-save[data-save-chapter="1"]::after{
  background:
    linear-gradient(180deg,rgba(8,14,10,.20),rgba(9,16,11,.76) 68%,rgba(7,12,9,.94)),
    linear-gradient(90deg,rgba(15,22,16,.92),rgba(28,43,31,.22) 54%,rgba(12,18,13,.84));
}
.save-slot-card.has-save[data-save-chapter="1"] .save-slot-location-art img{
  opacity:.38;
  filter:saturate(.78) sepia(.08) hue-rotate(42deg) contrast(1.08) brightness(.66);
}

/* Chapter 2 — Windblown Foothills save card. */
.save-slot-card.has-save[data-save-chapter="2"]{
  --save-card-bg:#2a1913;
  --save-card-deep:#120b08;
  --save-card-line:#7a4938;
  --save-card-accent:#ff9660;
  --save-card-accent-soft:#9d402d;
  --save-card-text:#f4e3d4;
  --save-card-muted:#c2a99a;
  --save-card-glow:rgba(221,91,55,.28);
}
.save-slot-card.has-save[data-save-chapter="2"]::after{
  background:
    linear-gradient(180deg,rgba(23,11,7,.18),rgba(27,14,10,.75) 66%,rgba(15,9,7,.95)),
    linear-gradient(90deg,rgba(30,16,11,.94),rgba(113,69,49,.20) 55%,rgba(27,13,9,.86));
}
.save-slot-card.has-save[data-save-chapter="2"] .save-slot-location-art img{
  opacity:.40;
  filter:saturate(.82) sepia(.16) hue-rotate(338deg) contrast(1.08) brightness(.68);
}

/* Unknown future chapters still get a graceful moonlit card until a palette is authored. */
.save-slot-card.has-save:not([data-save-chapter="1"]):not([data-save-chapter="2"]):not([data-save-chapter="3"]):not([data-save-chapter="4"]){
  --save-card-bg:#152d43;
  --save-card-deep:#091725;
  --save-card-line:#537b98;
  --save-card-accent:#79d7ff;
  --save-card-accent-soft:#32679e;
  --save-card-text:#edf8ff;
  --save-card-muted:#afc0ca;
  --save-card-glow:rgba(71,174,233,.24);
}

/* Crew and details inherit each save's own chapter skin. */
.save-slot-card.has-save .save-slot-crew-member{
  background:color-mix(in srgb,var(--save-card-deep) 86%,transparent)!important;
  border-color:color-mix(in srgb,var(--save-card-line) 72%,transparent)!important;
  backdrop-filter:blur(3px);
}
.save-slot-card.has-save .save-slot-crew-member img{
  border-color:var(--save-card-line)!important;
  box-shadow:0 3px 12px rgba(0,0,0,.36);
}
.save-slot-card.has-save .save-slot-crew-member strong{
  color:var(--save-card-text)!important;
}
.save-slot-card.has-save .save-slot-crew-member span{
  color:var(--save-card-accent)!important;
}
.save-slot-card.has-save .save-slot-detail{
  border-top-color:color-mix(in srgb,var(--save-card-line) 52%,transparent)!important;
}
.save-slot-card.has-save .save-slot-detail span{
  color:var(--save-card-muted)!important;
}
.save-slot-card.has-save .save-slot-detail strong{
  color:var(--save-card-text)!important;
}
.save-slot-card.has-save .save-continue-button{
  background:
    radial-gradient(circle at 50% 0,color-mix(in srgb,var(--save-card-accent) 34%,transparent),transparent 56%),
    linear-gradient(180deg,
      color-mix(in srgb,var(--save-card-accent-soft) 72%,#4d9fc8),
      color-mix(in srgb,var(--save-card-deep) 70%,var(--save-card-accent-soft)))!important;
  border-color:var(--save-card-accent)!important;
  color:#fff!important;
  box-shadow:
    0 0 0 1px color-mix(in srgb,var(--save-card-accent) 18%,transparent),
    0 0 19px var(--save-card-glow)!important;
  text-shadow:0 1px 5px rgba(0,0,0,.48);
}
.save-slot-card.has-save .save-continue-button:hover:not(:disabled){
  filter:brightness(1.16);
  box-shadow:0 0 26px var(--save-card-glow)!important;
}

/* Delete remains semantic danger red instead of changing by chapter. */
.save-slot-card .save-delete-button{
  background:linear-gradient(180deg,#d63d32,#8b1e18)!important;
  border-color:#ff776b!important;
  color:#fff3f1!important;
  box-shadow:0 0 14px rgba(225,57,46,.18)!important;
}

/* Empty slots belong to no chapter, so they remain purely moonlit. */
.save-slot-card.is-empty{
  border-color:#43647e!important;
  background:
    radial-gradient(circle at 50% 8%,rgba(85,177,229,.13),transparent 40%),
    linear-gradient(155deg,#132b41,#091925)!important;
}
.save-slot-card.is-empty::after{
  background:linear-gradient(180deg,rgba(8,23,36,.08),rgba(5,15,24,.44));
}
.save-slot-card.is-empty .save-slot-empty-mark{
  border-color:#5d8cab!important;
  color:#9edfff!important;
  background:rgba(22,60,88,.42);
  box-shadow:0 0 22px rgba(72,172,228,.12);
}
.save-slot-card.is-empty>button{
  background:linear-gradient(180deg,#168eff,#0759b4)!important;
  border-color:#8ee5ff!important;
  color:#fff!important;
  box-shadow:0 0 20px rgba(25,145,255,.34)!important;
}

/* Mobile cards become compact adventure snapshots instead of tall form panels. */
@media(max-width:760px){
  body.account-saves-active #app-view{
    padding:.75rem .55rem 1.25rem!important;
  }
  .account-saves-heading{
    margin-bottom:.72rem!important;
  }
  .save-slot-grid{
    gap:.62rem!important;
  }
  .save-slot-card{
    padding:.78rem!important;
    border-radius:9px!important;
  }
  .save-slot-card.has-save{
    min-height:0!important;
  }
  .save-slot-card.has-save .save-slot-number{
    margin-bottom:.55rem!important;
  }
  .save-slot-card.has-save .save-slot-crew{
    margin:.1rem 0 .62rem!important;
    gap:.4rem!important;
  }
  .save-slot-detail{
    padding:.46rem 0!important;
  }
  .save-slot-actions{
    padding-top:.68rem!important;
  }
  .save-slot-location-art img{
    opacity:.30;
  }
  .save-slot-card.has-save[data-save-chapter="1"] .save-slot-location-art img,
  .save-slot-card.has-save[data-save-chapter="2"] .save-slot-location-art img{
    opacity:.34;
  }
}

@supports not (color:color-mix(in srgb,#000,#fff)){
  .save-slot-card.has-save .save-slot-crew-member{
    background:rgba(8,13,16,.76)!important;
    border-color:var(--save-card-line)!important;
  }
  .save-slot-card.has-save .save-slot-detail{
    border-top-color:var(--save-card-line)!important;
  }
  .save-slot-card.has-save .save-continue-button{
    background:linear-gradient(180deg,var(--save-card-accent-soft),var(--save-card-deep))!important;
  }
}


/* === Patch 022: soft moon-silver Account + Login palette ===
   Neutral shell colors are intentionally desaturated so chapter save palettes
   remain the visual focus. Inspired by the Realmwalker crescent/mountain icon. */

/* Shared moon-silver neutrals for UI that lives outside an active chapter. */
body.account-saves-active,
body.auth-active{
  --moon-silver-white:#e5edf1;
  --moon-silver-pale:#c4d1d8;
  --moon-silver-mist:#9daeb8;
  --moon-silver-steel:#687c88;
  --moon-silver-slate:#42535d;
  --moon-silver-deep:#1d2b33;
  --moon-silver-night:#101a20;
  --moon-silver-shadow:#090f13;
}

/* Account / save-selector shell: quiet silver-blue instead of vivid blue. */
body.account-saves-active{
  --save-moon-night:var(--moon-silver-shadow);
  --save-moon-deep:var(--moon-silver-night);
  --save-moon-panel:#263740;
  --save-moon-blue:#536a78;
  --save-moon-steel:var(--moon-silver-steel);
  --save-moon-mist:var(--moon-silver-pale);
  --save-moon-white:var(--moon-silver-white);
  --save-moon-bright:#b8c9d2;
  background:
    radial-gradient(circle at 50% -16%,rgba(169,190,201,.13),transparent 34rem),
    radial-gradient(circle at 8% 52%,rgba(93,116,129,.08),transparent 28rem),
    linear-gradient(180deg,#17242b 0%,#10191f 58%,#090f13 100%)!important;
}
body.account-saves-active .app-header{
  background:linear-gradient(180deg,rgba(35,51,60,.98),rgba(20,31,38,.98))!important;
  border-bottom-color:rgba(178,196,205,.20)!important;
}
body.account-saves-active .header-account-button{
  background:#2b3d47!important;
  border-color:#607682!important;
  color:#d5e0e5!important;
}
body.account-saves-active .header-account-button.is-current{
  background:#344a56!important;
  border-color:#8298a3!important;
  color:#eef4f6!important;
  box-shadow:0 0 14px rgba(188,207,216,.09)!important;
}
body.account-saves-active .header-logout,
body.account-saves-active .music-toggle{
  background:#22343e!important;
  border-color:#536a76!important;
  color:#c0ced5!important;
}
.account-saves-screen::before{
  background:
    radial-gradient(circle at 88% 5%,rgba(192,207,214,.045),transparent 20rem),
    radial-gradient(circle at 15% 46%,rgba(111,135,148,.045),transparent 24rem)!important;
}
.account-saves-heading{
  border-bottom-color:rgba(177,195,204,.22)!important;
}
.account-saves-heading .eyebrow{
  color:#a9bac3!important;
}
.account-saves-heading h2{
  color:#e6edf0!important;
  text-shadow:0 0 16px rgba(203,218,224,.06)!important;
}
.account-saves-heading p{
  color:#94a6b0!important;
}

/* Neutral/empty saves should recede visually behind chapter-colored saves. */
.save-slot-card{
  --save-card-bg:#283b45;
  --save-card-deep:#17252d;
  --save-card-line:#617783;
  --save-card-accent:#b9c8cf;
  --save-card-accent-soft:#526976;
  --save-card-text:#e7edef;
  --save-card-muted:#9fadb4;
  --save-card-glow:rgba(178,199,208,.10);
}
.save-slot-card.has-save:not([data-save-chapter="1"]):not([data-save-chapter="2"]):not([data-save-chapter="3"]):not([data-save-chapter="4"]){
  --save-card-bg:#293b44;
  --save-card-deep:#17242b;
  --save-card-line:#657983;
  --save-card-accent:#c0ccd2;
  --save-card-accent-soft:#566b76;
  --save-card-text:#e8eef0;
  --save-card-muted:#a2afb6;
  --save-card-glow:rgba(182,199,207,.10);
}
.save-slot-card.is-empty{
  border-color:#5e727d!important;
  background:
    radial-gradient(circle at 50% 8%,rgba(188,204,212,.075),transparent 40%),
    linear-gradient(155deg,#293c46,#17262e)!important;
}
.save-slot-card.is-empty::after{
  background:linear-gradient(180deg,rgba(19,32,39,.05),rgba(11,19,24,.40))!important;
}
.save-slot-card.is-empty .save-slot-empty-mark{
  border-color:#778d98!important;
  color:#c5d1d7!important;
  background:rgba(63,82,92,.35)!important;
  box-shadow:0 0 18px rgba(184,202,211,.07)!important;
}
.save-slot-card.is-empty>button{
  background:linear-gradient(180deg,#586f7b,#3b505b)!important;
  border-color:#879aa4!important;
  color:#eef3f5!important;
  box-shadow:0 0 14px rgba(178,197,207,.09)!important;
}
.save-slot-card.is-empty>button:hover:not(:disabled){
  filter:brightness(1.09)!important;
}

/* Login / registration screen now belongs to the same moon-silver family. */
body.auth-active{
  background:
    radial-gradient(circle at 78% 10%,rgba(172,191,201,.10),transparent 34rem),
    linear-gradient(180deg,#18252c,#0c1419 72%)!important;
}
body.auth-active #app-view.auth-mode{
  background:transparent!important;
}
.auth-screen{
  border-color:#566873!important;
  background:#101a20!important;
  box-shadow:0 30px 90px rgba(0,0,0,.58),0 0 0 1px rgba(203,218,225,.025)!important;
}
.title-screen-art::after{
  background:
    linear-gradient(115deg,rgba(14,24,30,.12),rgba(19,31,38,.42) 55%,rgba(13,22,27,.88)),
    linear-gradient(to top,rgba(8,15,19,.90),transparent 55%)!important;
}
.title-screen-shade{
  background:radial-gradient(circle at 38% 42%,transparent 0 18%,rgba(31,49,59,.08) 42%,rgba(7,12,15,.50) 100%)!important;
}
.title-emblem{
  box-shadow:0 8px 30px rgba(0,0,0,.45),0 0 22px rgba(204,220,227,.08)!important;
}
.title-kicker{
  color:#a8b8c0!important;
}
.realmwalker-title{
  color:#e5edef!important;
  text-shadow:0 4px 24px #000,0 0 24px rgba(207,221,227,.06)!important;
}
.realmwalker-title span{
  color:#aab9c0!important;
}
.title-rule{
  background:linear-gradient(90deg,#9cafb8,rgba(156,175,184,.12),transparent)!important;
}
.title-screen-content p{
  color:#bcc8cd!important;
}
.account-panel-wrap{
  background:
    radial-gradient(circle at 50% 18%,rgba(153,174,184,.09),transparent 45%),
    linear-gradient(180deg,#1b2a32,#111c22)!important;
}
.auth-tabs{
  border-color:#52646e!important;
  background:#111c22!important;
}
.auth-tab{
  color:#8e9da5!important;
}
.auth-tab.active{
  background:#2b3d46!important;
  color:#e1e9ec!important;
  box-shadow:inset 0 -2px #8da0aa!important;
}
.auth-tab-panel .eyebrow{
  color:#9dafb8!important;
}
.auth-tab-panel h2{
  color:#e4ebee!important;
}
.auth-tab-panel label{
  color:#aab8bf!important;
}
.auth-tab-panel label small{
  color:#7e8e96!important;
}
.auth-tab-panel input:not([type="checkbox"]){
  background:#0d171c!important;
  color:#e8eef0!important;
  border-color:#465a65!important;
}
.auth-tab-panel input:not([type="checkbox"]):focus{
  border-color:#81959f!important;
  box-shadow:0 0 0 2px rgba(157,178,188,.10)!important;
}
.check-label input{
  accent-color:#788d98!important;
}
.auth-primary{
  background:linear-gradient(180deg,#556b76,#354953)!important;
  border-color:#8397a1!important;
  color:#f0f4f5!important;
  box-shadow:0 0 16px rgba(186,203,211,.08)!important;
}
.auth-primary:hover:not(:disabled){
  filter:brightness(1.09)!important;
}
.pwa-install-button{
  background:linear-gradient(180deg,#31434c,#22323a)!important;
  border-color:#667b86!important;
  color:#d1dde2!important;
  box-shadow:inset 0 0 0 1px rgba(224,235,240,.025)!important;
}
.pwa-install-button:hover:not(:disabled){
  background:linear-gradient(180deg,#394d57,#293b44)!important;
  border-color:#82949d!important;
}

/* === Patch 023: deeper moonlit blacks ===
   Keep the existing moon-silver buttons unchanged while pushing the neutral
   Account/Login shell closer to charcoal-black so chapter colors carry focus. */
body.account-saves-active,
body.auth-active{
  --moon-silver-deep:#11181d;
  --moon-silver-night:#090f13;
  --moon-silver-shadow:#04080b;
}

/* Account/save selector: near-black foundation with only a restrained silver-blue cast. */
body.account-saves-active{
  --save-moon-night:#04080b;
  --save-moon-deep:#090f13;
  --save-moon-panel:#162128;
  background:
    radial-gradient(circle at 50% -18%,rgba(151,174,185,.055),transparent 31rem),
    radial-gradient(circle at 10% 54%,rgba(84,106,118,.035),transparent 26rem),
    linear-gradient(180deg,#0b1217 0%,#070c10 58%,#030609 100%)!important;
}
body.account-saves-active .app-header{
  background:linear-gradient(180deg,rgba(16,25,31,.99),rgba(8,14,18,.99))!important;
  border-bottom-color:rgba(172,192,202,.14)!important;
}
body.account-saves-active #app-view{
  background:linear-gradient(180deg,rgba(10,17,21,.72),rgba(4,8,11,.18))!important;
}
.account-saves-screen::before{
  background:
    radial-gradient(circle at 86% 3%,rgba(190,207,215,.022),transparent 18rem),
    radial-gradient(circle at 14% 44%,rgba(99,123,136,.026),transparent 22rem)!important;
}
.account-saves-heading{
  background:linear-gradient(180deg,rgba(14,23,28,.78),rgba(7,12,16,.18))!important;
  border-bottom-color:rgba(177,195,204,.15)!important;
}

/* Neutral save slots become darker so occupied chapter cards read as the color. */
.save-slot-card{
  --save-card-bg:#17242b;
  --save-card-deep:#0a1116;
}
.save-slot-card.has-save:not([data-save-chapter="1"]):not([data-save-chapter="2"]):not([data-save-chapter="3"]):not([data-save-chapter="4"]){
  --save-card-bg:#18252c;
  --save-card-deep:#0a1116;
}
.save-slot-card.is-empty{
  background:
    radial-gradient(circle at 50% 8%,rgba(188,204,212,.045),transparent 38%),
    linear-gradient(155deg,#17252c,#090f13)!important;
  border-color:#465a65!important;
}
.save-slot-card.is-empty::after{
  background:linear-gradient(180deg,rgba(10,17,21,.03),rgba(3,7,10,.58))!important;
}

/* Login/register: same silver cast, with the dark end of the palette almost black. */
body.auth-active{
  background:
    radial-gradient(circle at 78% 8%,rgba(164,186,197,.055),transparent 31rem),
    linear-gradient(180deg,#0d151a,#04080b 76%)!important;
}
.auth-screen{
  background:#080e12!important;
  border-color:#40515a!important;
  box-shadow:0 30px 90px rgba(0,0,0,.72),0 0 0 1px rgba(203,218,225,.018)!important;
}
.title-screen-art::after{
  background:
    linear-gradient(115deg,rgba(8,14,18,.10),rgba(12,20,25,.37) 55%,rgba(5,9,12,.91)),
    linear-gradient(to top,rgba(3,7,10,.93),transparent 55%)!important;
}
.title-screen-shade{
  background:radial-gradient(circle at 38% 42%,transparent 0 18%,rgba(22,36,44,.055) 42%,rgba(2,5,7,.60) 100%)!important;
}
.account-panel-wrap{
  background:
    radial-gradient(circle at 50% 18%,rgba(149,172,183,.045),transparent 43%),
    linear-gradient(180deg,#10191e,#070c10)!important;
}
.auth-tabs{
  background:#080e12!important;
  border-color:#3e5059!important;
}
.auth-tab-panel input:not([type="checkbox"]){
  background:#060b0e!important;
  border-color:#384b55!important;
}


/* === Patch 024: mobile HUD order/length + installed-PWA pull-to-refresh suppression === */
@media (display-mode: standalone){
  html,body{overscroll-behavior-y:none!important}
}
html.pwa-standalone,html.pwa-standalone body{overscroll-behavior-y:none!important}

/* Vitals read naturally left-to-right on mobile: HP/MP value first, then a longer bar. */
.hud-mini-vitals{width:auto!important}
.hud-mini-vital{
  grid-template-columns:auto minmax(44px,72px)!important;
  column-gap:.22rem!important;
}
.hud-mini-vital>span{
  grid-column:1!important;
  grid-row:1!important;
  text-align:right!important;
  margin:0!important;
}
.hud-mini-vital>i{
  grid-column:2!important;
  grid-row:1!important;
  width:72px!important;
  max-width:72px!important;
  margin:0!important;
}
@media(max-width:620px){
  .hud-mini-vital{grid-template-columns:auto 56px!important;column-gap:.18rem!important}
  .hud-mini-vital>i{width:56px!important;max-width:56px!important}
}
@media(max-width:390px){
  .hud-mini-vital{grid-template-columns:auto 44px!important;column-gap:.14rem!important}
  .hud-mini-vital>i{width:44px!important;max-width:44px!important}
}


/* === Patch 025: Chapter 2 quest requirements + tappable enemy ability badges === */
.enemy-effect-badges{justify-content:center;margin:.18rem 0 .42rem!important}
.enemy-ability-badge{color:#c8b39b!important;border-color:#6e5947!important;background:#261f1a!important}
.enemy-ability-badge.is-active{box-shadow:0 0 0 1px rgba(210,170,121,.18),0 0 14px rgba(164,103,55,.22)!important;filter:brightness(1.08)}
.enemy-ability-badge.effect-enemy_howl{color:#d2c29a!important;border-color:#776a4e!important;background:#29251c!important}
.enemy-ability-badge.effect-cornered{color:#d6b28e!important;border-color:#82583f!important;background:#2b1e18!important}
.enemy-ability-badge.effect-bloodlust{color:#d79a90!important;border-color:#7d403b!important;background:#2d1716!important}
.quest-item-requirement{margin:.32rem 0 0!important;color:#c5aa78!important;font:800 .62rem/1.3 system-ui,sans-serif!important;letter-spacing:.04em}
.quest-action-row .quest-offer-button:disabled{opacity:.42!important;filter:grayscale(.45);cursor:not-allowed}
@media(max-width:620px){
  .enemy-effect-badges{margin:.12rem 0 .3rem!important}
  .quest-item-requirement{font-size:.56rem!important}
}

/* === Patch 028: mobile combat damage feedback, clearer checks, HUD containment === */
.combat-damage-number{
  position:absolute;
  left:50%;
  top:38%;
  z-index:70;
  pointer-events:none;
  opacity:0;
  color:#ff4d46;
  font:900 1.8rem/1 system-ui,sans-serif;
  letter-spacing:-.04em;
  text-shadow:0 2px 2px rgba(0,0,0,.9),0 0 8px rgba(255,45,38,.72),0 0 18px rgba(194,26,22,.42);
  transform:translate(-50%,-50%) scale(.72);
  will-change:transform,opacity,filter;
}
.combat-damage-number.is-playing{animation:combatDamageNumberDrop 1.12s cubic-bezier(.18,.72,.24,1) forwards}
@keyframes combatDamageNumberDrop{
  0%{opacity:0;transform:translate(-50%,-48%) scale(.68);filter:brightness(1)}
  10%{opacity:1;transform:translate(-50%,-52%) scale(1.34);filter:brightness(1.9)}
  20%{opacity:.48;transform:translate(-50%,-50%) scale(1.08);filter:brightness(1.2)}
  29%{opacity:1;transform:translate(-50%,-48%) scale(1.16);filter:brightness(1.65)}
  42%{opacity:1;transform:translate(-50%,-35%) scale(1);filter:brightness(1)}
  100%{opacity:0;transform:translate(-50%,44px) scale(.88);filter:brightness(.9)}
}

.game-event-check-result{
  display:grid;
  gap:.2rem;
  margin:.15rem 0 .72rem;
  padding:.78rem .85rem;
  border:1px solid #605c4c;
  border-radius:8px;
  text-align:center;
  background:#151611;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025),0 8px 22px rgba(0,0,0,.22);
}
.game-event-check-result>span{
  font:900 1.05rem/1 system-ui,sans-serif;
  letter-spacing:.14em;
}
.game-event-check-result>strong{font-size:.86rem;line-height:1.35;color:#efe8d4}
.game-event-check-result>small{font:600 .62rem/1.35 system-ui,sans-serif;color:#969384}
.game-event-check-result.is-success{border-color:#477a59;background:linear-gradient(180deg,#17261c,#101811);box-shadow:0 0 18px rgba(67,139,86,.16),inset 0 0 0 1px rgba(122,203,145,.05)}
.game-event-check-result.is-success>span{color:#7ed093;text-shadow:0 0 12px rgba(88,192,116,.25)}
.game-event-check-result.is-failure{border-color:#864a43;background:linear-gradient(180deg,#2a1715,#180e0d);box-shadow:0 0 18px rgba(185,58,46,.16),inset 0 0 0 1px rgba(234,111,94,.05)}
.game-event-check-result.is-failure>span{color:#ef786c;text-shadow:0 0 12px rgba(221,70,56,.25)}

.enemy-ability-badge.effect-gore{color:#d5c7a2!important;border-color:#786b4a!important;background:#282319!important}

/* Final mobile HUD constraint: the HP/MP text gets its natural width and the bar
   uses only the remaining space inside each character frame. */
.hud-character{min-width:0!important;overflow:hidden!important}
.hud-mini-vitals{width:100%!important;min-width:0!important;max-width:100%!important}
.hud-mini-vital{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  width:100%!important;
  min-width:0!important;
  column-gap:.18rem!important;
  align-items:center!important;
}
.hud-mini-vital>span{
  grid-column:1!important;
  grid-row:1!important;
  min-width:0!important;
  white-space:nowrap!important;
  text-align:left!important;
}
.hud-mini-vital>i{
  grid-column:2!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
}
@media(max-width:620px){
  .combat-damage-number{font-size:1.5rem;top:36%}
  .game-event-check-result{padding:.7rem .68rem;margin-bottom:.6rem}
  .game-event-check-result>span{font-size:.95rem}
  .game-event-check-result>strong{font-size:.78rem}
  .game-event-check-result>small{font-size:.57rem}
  .hud-mini-vital{column-gap:.12rem!important}
  .hud-mini-vital>span{font-size:.56rem!important;letter-spacing:-.015em!important}
}
@media(max-width:390px){
  .hud-mini-vital>span{font-size:.52rem!important}
}
@media(prefers-reduced-motion:reduce){
  .combat-damage-number.is-playing{animation:none!important;opacity:1!important;transform:translate(-50%,-50%)!important}
}
.combat-sprite-ki_wind{width:min(84%,180px);aspect-ratio:1/1;mix-blend-mode:screen;filter:drop-shadow(0 0 10px rgba(128,224,92,.52));animation-duration:.82s}
.combat-sprite-doom{width:min(90%,196px);aspect-ratio:1/1;mix-blend-mode:screen;filter:drop-shadow(0 0 10px rgba(173,72,224,.52));animation-duration:.9s}
@media(max-width:620px){.combat-sprite-ki_wind{width:min(88%,145px)}.combat-sprite-doom{width:min(92%,156px)}}


/* === Patch 030: Chapter 3 broad green repaint removed. Shop styling retained. === */
.shop-preview-panel{position:relative;overflow:hidden;display:flex;align-items:stretch;gap:.75rem;min-height:154px}
.shop-preview-copy{position:relative;z-index:1;flex:1;padding-right:6rem}
.shop-preview-copy h3{margin:.12rem 0 .32rem}
.shop-preview-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-top:.7rem}
.shop-preview-actions .world-action-button{min-width:96px}
.shop-preview-actions .secondary{background:linear-gradient(180deg,#d6dad3,#bcc3b8);color:#172217}
.shop-preview-art{position:absolute;right:0;top:0;bottom:0;width:44%;background-image:var(--shopkeeper-image);background-size:cover;background-position:right center;opacity:.5;pointer-events:none;-webkit-mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.05) 5%,rgba(0,0,0,.45) 14%,#000 27%);mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.05) 5%,rgba(0,0,0,.45) 14%,#000 27%)}
.shop-page-copy{margin:.1rem 0 .8rem}
.shop-page-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-bottom:.8rem}
.shop-item-card .inventory-quantity{font-size:.64rem;letter-spacing:.04em}
@media (max-width:620px){
  .shop-preview-panel{min-height:140px}
  .shop-preview-copy{padding-right:5rem}
  .shop-preview-art{width:47%;background-position:84% center}
}



/* === Patch 031: storage stack controls + compact crafting thumbnails === */
.storage-stack-actions{display:grid!important;grid-template-columns:1fr;gap:.28rem!important}
.storage-stack-actions .storage-all-button{font-weight:900;border-color:#7c6e48;background:linear-gradient(180deg,#3a3425,#252219)}
.recipe-button{display:flex!important;align-items:center;justify-content:space-between;gap:.55rem;text-align:left}
.recipe-button>span{min-width:0;flex:1}
.recipe-button-image{width:28px;height:28px;flex:0 0 28px;object-fit:contain;border-radius:4px;opacity:.92;filter:drop-shadow(0 2px 3px rgba(0,0,0,.45));pointer-events:none}
@media(max-width:620px){
  .recipe-button-image{width:24px;height:24px;flex-basis:24px}
  .storage-stack-actions{gap:.22rem!important}
}

/* === Patch 032: companion equipment targeting + cross-chapter trail === */
.equipment-target-actions{display:grid;gap:.38rem;width:100%}
.equipment-target-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.38rem;align-items:stretch}
.equipment-target-row>button{min-width:0;width:100%;font-size:.68rem;padding:.52rem .35rem}
.cross-chapter-travel-row{border-style:solid}
.cross-chapter-travel-row .world-action-button{white-space:normal;text-align:center}
@media(max-width:620px){
  .equipment-target-row{grid-template-columns:1fr 1fr;gap:.28rem}
  .equipment-target-row>button{font-size:.62rem;padding:.48rem .25rem}
}

/* === Patch 033: Spell/Skill readability + scripted Devil flash === */
.ability-type-spell{color:#8edcff!important}
.ability-type-skill{color:#f4a3c5!important}
.ability-type-help{
  margin-left:auto!important;
  padding:.28rem .45rem!important;
  min-height:0!important;
  border:1px solid #3d4c53!important;
  background:#141a1d!important;
  color:#a9c7d6!important;
  font:800 .54rem/1 system-ui,sans-serif!important;
  letter-spacing:.02em;
  white-space:nowrap;
}
.ability-path-details>summary .ability-type-help{justify-self:end}
.combat-scripted-flash{
  position:fixed;
  inset:0;
  z-index:140;
  pointer-events:none;
  background:#fff;
  opacity:0;
}
.combat-scripted-flash.is-playing{animation:combatScriptedFlash .68s ease-out forwards}
@keyframes combatScriptedFlash{
  0%{opacity:0}
  12%{opacity:1}
  30%{opacity:.94}
  100%{opacity:0}
}
@media(max-width:620px){
  .ability-path-details>summary{grid-template-columns:minmax(0,1fr) auto auto!important}
  .ability-type-help{font-size:.5rem!important;padding:.24rem .35rem!important}
}

/* Patch 034: compact Turning Point info control. */
.turning-point-control{display:flex;align-items:center;gap:.35rem;min-width:0}
.turning-point-info{width:1.8rem!important;min-width:1.8rem!important;height:1.8rem!important;min-height:1.8rem!important;padding:0!important;border-radius:999px!important;font:800 .9rem/1 system-ui,sans-serif!important;display:grid!important;place-items:center!important;background:rgba(255,255,255,.06)!important;border:1px solid rgba(220,205,151,.5)!important;color:#e9dbac!important;box-shadow:none!important}
@media(max-width:620px){.turning-point-control{gap:.25rem}.turning-point-info{width:1.65rem!important;min-width:1.65rem!important;height:1.65rem!important;min-height:1.65rem!important;font-size:.82rem!important}}


.shop-preview-panel.no-shopkeeper-art .shop-preview-copy{padding-right:0}


/* Patch 034: direct map-tile art layer avoids blank CSS-background tiles on mobile/PWA caches. */
.map-tile-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:0;pointer-events:none}
.map-location-tile .map-tile-scrim{z-index:1}
.map-location-tile .map-tile-copy{z-index:2}

/* === Patch 037: Kara Shadow Step tokens === */
.shadow-token-orbs{display:flex;align-items:center;gap:.42rem;margin:.32rem 0 .22rem;font:800 .56rem/1 system-ui,sans-serif;letter-spacing:.12em;color:#bfa2ff}
.shadow-token-orbs>div{display:flex;gap:.3rem;align-items:center}
.shadow-token-orbs i{display:block;width:11px;height:11px;border-radius:50%;border:1px solid #594375;background:#17121f;box-shadow:inset 0 0 5px rgba(0,0,0,.8)}
.shadow-token-orbs i.is-lit{background:radial-gradient(circle at 35% 30%,#f0ddff 0 13%,#ae72f0 36%,#6633a1 78%);border-color:#c49af5;box-shadow:0 0 9px rgba(167,93,235,.58),inset 0 0 3px rgba(245,222,255,.45)}
.combat-fx-target.fx-shadow-dodge{animation:shadowDodgeFlash .56s ease-out!important}
@keyframes shadowDodgeFlash{0%{box-shadow:0 0 0 rgba(165,93,235,0);filter:brightness(1)}35%{box-shadow:0 0 26px rgba(171,98,241,.72);filter:brightness(1.35) saturate(1.25)}100%{box-shadow:0 0 0 rgba(165,93,235,0);filter:brightness(1)}}
@media(max-width:620px){.shadow-token-orbs{margin:.25rem 0 .15rem}.shadow-token-orbs i{width:10px;height:10px}}

/* Patch 027: mobile-first shop selling + locked-recipe help */
.shop-sell-actions{display:grid!important;grid-template-columns:1fr!important;gap:.3rem!important}
.recipe-button.recipe-locked{cursor:help}

/* Patch 029: ending lock + mobile credits links */
.game-event-links{display:grid;gap:.55rem;margin-top:.8rem}.game-event-links:empty{display:none}.game-event-links a{display:block;text-align:center;text-decoration:none;border:1px solid #75643a;background:linear-gradient(180deg,#463b24,#2e281b);color:#f0e5c7;padding:.72rem .85rem;border-radius:6px;font:800 .78rem system-ui,sans-serif;letter-spacing:.02em}.game-event-links a:active{transform:translateY(1px)}
.game-event-modal.event-ending_locked{z-index:110;inset:58px 0 0;padding:.75rem}.event-ending_locked .game-event-card{max-height:calc(100dvh - 74px);overflow-y:auto;-webkit-overflow-scrolling:touch}.event-ending_locked [data-game-event-close]{display:none!important}
body.ending-locked .main-nav,body.ending-locked #player-hud{display:none!important}
@media(max-width:560px){.game-event-modal.event-ending_locked{inset:54px 0 0;padding:.55rem}.event-ending_locked .game-event-card{width:min(100%,520px);max-height:calc(100dvh - 64px);padding:.85rem}.game-event-links a{min-height:44px;display:grid;place-items:center}}


/* === Chat 31 mobile polish === */
/* Make the Den progression affordance impossible to miss on touch screens. */
.ability-path-details>summary{min-height:46px!important}
.ability-path-chevron{display:grid!important;place-items:center!important;width:32px!important;min-width:32px!important;height:32px!important;margin-left:.25rem!important;border:1px solid #8f7438!important;border-radius:999px!important;background:radial-gradient(circle at 35% 30%,#4a3b1f,#211b11 72%)!important;color:#f1d078!important;font-size:1.22rem!important;line-height:1!important;font-weight:900!important;text-shadow:0 0 8px rgba(241,208,120,.35)!important;box-shadow:inset 0 0 0 1px rgba(255,236,172,.06),0 0 10px rgba(173,137,54,.16)!important}
.ability-path-details[open] .ability-path-chevron{transform:rotate(180deg)!important}

/* Three-across shop/inventory cards on phones: fewer tiles, larger art and tap targets. */
@media(max-width:620px){
  .inventory-panel .inventory-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.42rem!important}
  .inventory-panel .inventory-card{border-radius:7px!important}
  .inventory-panel .inventory-card-copy{padding:.48rem .42rem .28rem!important}
  .inventory-panel .inventory-card-copy strong{font-size:.76rem!important;line-height:1.16!important}
  .inventory-panel .inventory-card-copy p{font-size:.61rem!important;line-height:1.25!important;margin:.28rem 0!important}
  .inventory-panel .inventory-quantity{right:.3rem!important;bottom:.28rem!important;min-width:27px!important;padding:.16rem .28rem!important;font-size:.6rem!important}
  .inventory-panel .inventory-stat-chips span{font-size:.52rem!important;padding:.15rem .2rem!important}
  .inventory-panel .inventory-actions{gap:.28rem!important;padding:.3rem .38rem .42rem!important}
  .inventory-panel .inventory-actions button,.inventory-panel .inventory-actions summary{min-height:38px!important;padding:.42rem .22rem!important;font-size:.63rem!important;line-height:1.12!important}
  /* Storage matches the other mobile item grids: three cards across. */
  .storage-panel .inventory-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.38rem!important}
}

.storage-boundary-divider{overflow:visible!important}
.storage-info-button{display:grid!important;place-items:center!important;width:25px!important;min-width:25px!important;height:25px!important;min-height:25px!important;padding:0!important;border-radius:999px!important;border:1px solid #76643b!important;background:#1d1b13!important;color:#e7ce88!important;font:900 .75rem/1 system-ui,sans-serif!important;box-shadow:none!important}
.gp-storage-card{display:grid;grid-template-columns:1fr 1fr;gap:.55rem;margin:.1rem 0 1rem;padding:.7rem;border:1px solid #45402f;border-radius:8px;background:linear-gradient(155deg,#1d1d16,#11120e)}
.gp-storage-readout{display:grid;gap:.15rem;padding:.55rem;border:1px solid #37362c;background:#0e100c;text-align:center}
.gp-storage-readout span{color:#8e897a;font:800 .56rem/1 system-ui,sans-serif;letter-spacing:.09em;text-transform:uppercase}
.gp-storage-readout strong{color:#e7d49a;font-size:1.15rem}
.gp-storage-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.gp-storage-actions button{min-height:42px;padding:.48rem .35rem;font-size:.68rem}
@media(max-width:390px){.gp-storage-card{gap:.42rem;padding:.58rem}.gp-storage-actions{gap:.3rem}.gp-storage-actions button{font-size:.62rem}}

/* === Chat 32 mobile touch-ups === */
@media(max-width:620px){
  .storage-panel .inventory-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.36rem!important}
  .storage-item-card .inventory-card-copy{padding:.38rem .3rem .2rem!important}
  .storage-item-card .inventory-card-copy strong{font-size:.66rem!important;line-height:1.15!important}
  .storage-item-card .inventory-actions{padding:.24rem .28rem .35rem!important;gap:.2rem!important}
  .storage-item-card .inventory-actions button{min-height:34px!important;padding:.34rem .15rem!important;font-size:.56rem!important;line-height:1.08!important}
}
.den-crew-panel .ability-path-chevron{width:38px!important;min-width:38px!important;height:38px!important;font-size:1.5rem!important;border-width:2px!important;box-shadow:0 0 0 2px rgba(212,177,91,.08),0 0 15px rgba(212,177,91,.30)!important}

/* === Chapter 3 & 4 Color Themes — Verdant Moon / Obsidian & Amethyst ===
   Chapter 3: cool nocturnal teal, jade, and moonlit mint.
   Chapter 4: near-black violet, royal amethyst, and restrained arcane cyan.
   Semantic combat colors (HP, MP, Hunger danger, Stagger, success, destructive red)
   intentionally remain governed by their existing rules. */

/* --------------------------------------------------------------------------
   CHAPTER 3 — VERDANT MOON
   -------------------------------------------------------------------------- */
body[data-chapter-theme="3"]{
  --bg:#071416;
  --panel:#0e2424;
  --panel2:#153331;
  --line:#285b56;
  --text:#e7f2eb;
  --muted:#91aaa2;
  --accent:#42b89f;

  --rw-chapter-name:"Verdant Moon";
  --rw-chapter-bg:#071416;
  --rw-chapter-panel:#0e2424;
  --rw-chapter-panel-2:#153331;
  --rw-chapter-line:#285b56;
  --rw-chapter-deep:#061113;
  --rw-chapter-forest:#16433e;
  --rw-chapter-jade:#42b89f;
  --rw-chapter-accent:#42b89f;
  --rw-chapter-accent-bright:#75e2c5;
  --rw-chapter-pale:#c4efe1;
  --rw-chapter-glow:rgba(66,184,159,.30);

  background:
    radial-gradient(circle at 52% -12%,rgba(67,180,158,.14),transparent 35rem),
    radial-gradient(circle at 8% 48%,rgba(39,104,92,.15),transparent 29rem),
    linear-gradient(180deg,#051012 0%,#0a1b1c 52%,#050d0f 100%)!important;
}

body[data-chapter-theme="3"] .app-header{
  background:linear-gradient(180deg,rgba(10,33,33,.98),rgba(6,20,21,.98))!important;
  border-bottom-color:#285851!important;
  box-shadow:0 4px 18px rgba(0,0,0,.3),inset 0 -1px rgba(117,226,197,.06);
}
body[data-chapter-theme="3"] .main-nav{
  background:linear-gradient(180deg,rgba(12,39,38,.985),rgba(7,25,25,.985))!important;
  border-bottom-color:#2c6159!important;
  box-shadow:0 5px 18px rgba(0,0,0,.29)!important;
}
body[data-chapter-theme="3"] .main-nav a{color:#bdd5cd}
body[data-chapter-theme="3"] .main-nav a:hover,
body[data-chapter-theme="3"] .main-nav a.active,
body[data-chapter-theme="3"] .main-nav a.is-active,
body[data-chapter-theme="3"] .main-nav a[aria-current="page"]{
  color:#effff9!important;
  border-color:#3f9b88!important;
  background:linear-gradient(180deg,rgba(42,122,108,.42),rgba(22,76,69,.28))!important;
  box-shadow:inset 0 -2px var(--rw-chapter-accent-bright),0 0 14px rgba(66,184,159,.14);
}
body[data-chapter-theme="3"] .eyebrow{color:var(--rw-chapter-accent-bright)!important}

body[data-chapter-theme="3"] .panel{border-color:var(--rw-chapter-line)}
body[data-chapter-theme="3"] .quest-card,
body[data-chapter-theme="3"] .inventory-card,
body[data-chapter-theme="3"] .crew-profile-card,
body[data-chapter-theme="3"] .den-character-tile,
body[data-chapter-theme="3"] .travel-card,
body[data-chapter-theme="3"] .ability-card{
  border-color:#2b625b!important;
  background:
    radial-gradient(circle at 100% 0,rgba(70,183,158,.07),transparent 36%),
    linear-gradient(155deg,#14312f,#091a1a)!important;
}
body[data-chapter-theme="3"] .stat-strip>div,
body[data-chapter-theme="3"] .stat-grid>div{
  background:#102a29!important;
  border-color:#27554f!important;
}
body[data-chapter-theme="3"] .tag{
  border-color:#39756c!important;
  color:#c3e0d6!important;
}

body[data-chapter-theme="3"] .location-hero-card::before{
  filter:saturate(.90) hue-rotate(5deg) contrast(1.08) brightness(.86)!important;
}
body[data-chapter-theme="3"] .location-hero-scrim{
  background:
    linear-gradient(90deg,rgba(4,22,22,.94) 0%,rgba(8,40,37,.68) 48%,rgba(5,25,25,.30) 100%),
    linear-gradient(0deg,rgba(4,18,19,.90),transparent 64%)!important;
}
body[data-chapter-theme="3"] .location-travel-card::before{
  filter:saturate(.88) hue-rotate(4deg) brightness(.72) contrast(1.1)!important;
}

body[data-chapter-theme="3"] .chapter-map-panel{
  background:linear-gradient(180deg,rgba(14,43,41,.99),rgba(7,26,26,.985))!important;
  border-color:#326960!important;
  box-shadow:0 8px 22px rgba(0,0,0,.42),0 0 18px rgba(66,184,159,.08)!important;
}
body[data-chapter-theme="3"] .chapter-map-grid{
  background:linear-gradient(145deg,#071819,#12312f)!important;
  border-color:#28544f!important;
}
body[data-chapter-theme="3"] .chapter-map-tile{
  border-color:#234b47!important;
  background:#0a1d1d!important;
}
body[data-chapter-theme="3"] .chapter-map-tile.map-empty{
  background:linear-gradient(145deg,rgba(39,84,78,.25),rgba(10,30,29,.34))!important;
  border-color:#1d3a37!important;
}
body[data-chapter-theme="3"] .map-tile-scrim{
  background:linear-gradient(to top,rgba(4,23,22,.96) 0 24%,rgba(8,36,33,.28) 66%,rgba(6,28,27,.08))!important;
}
body[data-chapter-theme="3"] .map-location-tile.is-reachable{
  border-color:#478f82!important;
  box-shadow:inset 0 0 0 1px rgba(117,226,197,.12)!important;
}
body[data-chapter-theme="3"] .map-location-tile.is-reachable .map-tile-copy small{color:#82d6c0!important}
body[data-chapter-theme="3"] .map-location-tile.is-current{
  border-color:#70d8be!important;
  animation:currentMapTilePulseVerdant 2.1s ease-in-out infinite!important;
}
body[data-chapter-theme="3"] .map-location-tile.is-current .map-tile-copy small{color:#9aefd9!important}
@keyframes currentMapTilePulseVerdant{
  0%,100%{box-shadow:0 0 0 1px rgba(92,201,174,.30),0 0 10px rgba(67,183,158,.24),inset 0 0 20px rgba(58,158,139,.10)}
  50%{box-shadow:0 0 0 2px rgba(124,234,205,.60),0 0 25px rgba(68,196,166,.46),inset 0 0 28px rgba(70,180,157,.16)}
}

body[data-chapter-theme="3"] button:not(.save-delete-button):not(.warning-delete-button):not(.combat-flee-button):not(.turning-point-button){
  border-color:#3d756c;
  background:linear-gradient(180deg,#24564f,#163b37);
  color:#e3f5ee;
}
body[data-chapter-theme="3"] button.secondary{
  background:linear-gradient(180deg,#1c3936,#122826)!important;
  border-color:#355e59!important;
}
body[data-chapter-theme="3"] .world-action-button,
body[data-chapter-theme="3"] .quest-offer-button,
body[data-chapter-theme="3"] .quest-action-row>button,
body[data-chapter-theme="3"] .fight-action-button{
  background:
    radial-gradient(circle at 50% 0,rgba(164,245,222,.16),transparent 58%),
    linear-gradient(180deg,#31957f,#1e695d)!important;
  border-color:#68cdb4!important;
  color:#f0fff9!important;
  box-shadow:0 0 16px rgba(64,188,159,.20),inset 0 1px rgba(218,255,244,.10)!important;
}
body[data-chapter-theme="3"] .rest-recover-button{
  background:linear-gradient(180deg,#315a5d,#213e45)!important;
  border-color:#5d8a8d!important;
  color:#e7f5f2!important;
}
body[data-chapter-theme="3"] .combat-action-stack>button:not(.combat-flee-button),
body[data-chapter-theme="3"] .combat-action-dropdown>summary{
  background:linear-gradient(90deg,#19443f,#112f2d)!important;
  border-color:#356a62!important;
  color:#dff2eb!important;
}
body[data-chapter-theme="3"] .combat-action-stack>button::before,
body[data-chapter-theme="3"] .combat-action-dropdown>summary::before{background:#4ebda4!important}

body[data-chapter-theme="3"] .combat-section{
  border-color:#2d605a!important;
  background:
    radial-gradient(circle at 50% -20%,rgba(70,176,153,.10),transparent 38%),
    linear-gradient(155deg,rgba(17,48,45,.99),rgba(6,21,21,.995))!important;
}
body[data-chapter-theme="3"] .combat-crew-card{
  background:linear-gradient(180deg,#14322f,#0a1d1c)!important;
  border-color:#2e5e58!important;
}
body[data-chapter-theme="3"] .combat-chronicle-block{
  border-color:#2b5651!important;
  background:#091d1c!important;
}
body[data-chapter-theme="3"] .player-hud::before{
  background:linear-gradient(180deg,rgba(18,52,49,.99),rgba(6,22,22,.995))!important;
  border-color:#376c65!important;
}
body[data-chapter-theme="3"] .hud-character{
  border-color:#2d5b55!important;
  background:linear-gradient(135deg,rgba(27,74,68,.72),rgba(8,28,27,.88))!important;
}
body[data-chapter-theme="3"] .hud-resource{
  border-color:#2d5b55!important;
  background:#0d2826!important;
}
body[data-chapter-theme="3"] .hud-character-portrait{
  border-color:#478178!important;
  background:linear-gradient(145deg,#23534d,#0b2523)!important;
}

body[data-chapter-theme="3"] .quest-card-active{border-left-color:#4fc4aa!important}
body[data-chapter-theme="3"] .quest-next-location{
  background:#0c2624!important;
  border-color:#2d5b55!important;
}
body[data-chapter-theme="3"] .quest-next-location strong,
body[data-chapter-theme="3"] .crew-role,
body[data-chapter-theme="3"] .ability-path-level{color:#69d2b8!important}
body[data-chapter-theme="3"] .storage-boundary-divider{color:#6ac6b0!important}
body[data-chapter-theme="3"] .stored-items-zone{
  border-color:#315e57!important;
  border-top-color:#4b877c!important;
  background:radial-gradient(circle at 50% 0,rgba(57,135,119,.16),transparent 42%),linear-gradient(160deg,rgba(24,65,59,.86),rgba(10,31,29,.95))!important;
}
body[data-chapter-theme="3"] .toast{
  background:#12302e!important;
  border-color:#35655e!important;
}
body[data-chapter-theme="3"] .event-quest_accept .game-event-card,
body[data-chapter-theme="3"] .event-quest_story_update .game-event-card{
  border-color:#3e766d!important;
  background:radial-gradient(circle at 50% -5%,rgba(77,178,154,.14),transparent 44%),linear-gradient(160deg,#14312f,#081b1b)!important;
}

/* --------------------------------------------------------------------------
   CHAPTER 4 — OBSIDIAN & AMETHYST
   -------------------------------------------------------------------------- */
body[data-chapter-theme="4"]{
  --bg:#0d0914;
  --panel:#191124;
  --panel2:#241832;
  --line:#503b68;
  --text:#eee8f4;
  --muted:#a89cb0;
  --accent:#885ac7;

  --rw-chapter-name:"Obsidian & Amethyst";
  --rw-chapter-bg:#0d0914;
  --rw-chapter-panel:#191124;
  --rw-chapter-panel-2:#241832;
  --rw-chapter-line:#503b68;
  --rw-chapter-deep:#08060d;
  --rw-chapter-plum:#2c1a3d;
  --rw-chapter-amethyst:#885ac7;
  --rw-chapter-accent:#885ac7;
  --rw-chapter-accent-bright:#b97af1;
  --rw-chapter-cyan:#6fc6d0;
  --rw-chapter-pale:#e4d8ee;
  --rw-chapter-glow:rgba(151,91,211,.32);

  background:
    radial-gradient(circle at 50% -12%,rgba(135,75,188,.18),transparent 35rem),
    radial-gradient(circle at 8% 50%,rgba(76,44,105,.15),transparent 29rem),
    linear-gradient(180deg,#09060e 0%,#130b1c 50%,#07050b 100%)!important;
}

body[data-chapter-theme="4"] .app-header{
  background:linear-gradient(180deg,rgba(30,18,43,.98),rgba(15,9,23,.98))!important;
  border-bottom-color:#543b70!important;
  box-shadow:0 4px 18px rgba(0,0,0,.32),inset 0 -1px rgba(185,122,241,.07);
}
body[data-chapter-theme="4"] .main-nav{
  background:linear-gradient(180deg,rgba(35,21,49,.985),rgba(18,11,27,.985))!important;
  border-bottom-color:#5b4178!important;
  box-shadow:0 5px 18px rgba(0,0,0,.30)!important;
}
body[data-chapter-theme="4"] .main-nav a{color:#d2c5dc}
body[data-chapter-theme="4"] .main-nav a:hover,
body[data-chapter-theme="4"] .main-nav a.active,
body[data-chapter-theme="4"] .main-nav a.is-active,
body[data-chapter-theme="4"] .main-nav a[aria-current="page"]{
  color:#fff4ff!important;
  border-color:#8e60bc!important;
  background:linear-gradient(180deg,rgba(119,71,164,.44),rgba(63,38,88,.29))!important;
  box-shadow:inset 0 -2px var(--rw-chapter-cyan),0 0 15px rgba(143,82,199,.16);
}
body[data-chapter-theme="4"] .eyebrow{color:var(--rw-chapter-accent-bright)!important}

body[data-chapter-theme="4"] .panel{border-color:var(--rw-chapter-line)}
body[data-chapter-theme="4"] .quest-card,
body[data-chapter-theme="4"] .inventory-card,
body[data-chapter-theme="4"] .crew-profile-card,
body[data-chapter-theme="4"] .den-character-tile,
body[data-chapter-theme="4"] .travel-card,
body[data-chapter-theme="4"] .ability-card{
  border-color:#573d70!important;
  background:
    radial-gradient(circle at 100% 0,rgba(150,91,207,.08),transparent 36%),
    linear-gradient(155deg,#251832,#120c1b)!important;
}
body[data-chapter-theme="4"] .stat-strip>div,
body[data-chapter-theme="4"] .stat-grid>div{
  background:#21152d!important;
  border-color:#4e3964!important;
}
body[data-chapter-theme="4"] .tag{
  border-color:#70528c!important;
  color:#ddc7ec!important;
}

body[data-chapter-theme="4"] .location-hero-card::before{
  filter:saturate(.87) hue-rotate(-4deg) contrast(1.12) brightness(.82)!important;
}
body[data-chapter-theme="4"] .location-hero-scrim{
  background:
    linear-gradient(90deg,rgba(18,8,27,.95) 0%,rgba(37,17,52,.70) 48%,rgba(18,10,26,.32) 100%),
    linear-gradient(0deg,rgba(13,6,21,.92),transparent 64%)!important;
}
body[data-chapter-theme="4"] .location-travel-card::before{
  filter:saturate(.84) hue-rotate(-5deg) brightness(.67) contrast(1.14)!important;
}

body[data-chapter-theme="4"] .chapter-map-panel{
  background:linear-gradient(180deg,rgba(40,23,55,.99),rgba(20,12,29,.985))!important;
  border-color:#654582!important;
  box-shadow:0 8px 22px rgba(0,0,0,.44),0 0 20px rgba(143,82,199,.09)!important;
}
body[data-chapter-theme="4"] .chapter-map-grid{
  background:linear-gradient(145deg,#100a18,#261632)!important;
  border-color:#4d3762!important;
}
body[data-chapter-theme="4"] .chapter-map-tile{
  border-color:#443057!important;
  background:#160e20!important;
}
body[data-chapter-theme="4"] .chapter-map-tile.map-empty{
  background:linear-gradient(145deg,rgba(74,51,92,.26),rgba(24,14,35,.36))!important;
  border-color:#342440!important;
}
body[data-chapter-theme="4"] .map-tile-scrim{
  background:linear-gradient(to top,rgba(18,8,27,.96) 0 24%,rgba(35,17,48,.28) 66%,rgba(25,13,36,.08))!important;
}
body[data-chapter-theme="4"] .map-location-tile.is-reachable{
  border-color:#8156a7!important;
  box-shadow:inset 0 0 0 1px rgba(185,122,241,.13)!important;
}
body[data-chapter-theme="4"] .map-location-tile.is-reachable .map-tile-copy small{color:#c18bef!important}
body[data-chapter-theme="4"] .map-location-tile.is-current{
  border-color:#b46ee7!important;
  animation:currentMapTilePulseAmethyst 2.1s ease-in-out infinite!important;
}
body[data-chapter-theme="4"] .map-location-tile.is-current .map-tile-copy small{color:#83dbe2!important}
@keyframes currentMapTilePulseAmethyst{
  0%,100%{box-shadow:0 0 0 1px rgba(169,103,220,.32),0 0 11px rgba(145,82,199,.27),inset 0 0 20px rgba(127,71,174,.11)}
  50%{box-shadow:0 0 0 2px rgba(201,132,248,.66),0 0 27px rgba(156,89,215,.52),inset 0 0 30px rgba(136,75,190,.18)}
}

body[data-chapter-theme="4"] button:not(.save-delete-button):not(.warning-delete-button):not(.combat-flee-button):not(.turning-point-button){
  border-color:#6c4c89;
  background:linear-gradient(180deg,#4a2e63,#301d43);
  color:#f0e5f8;
}
body[data-chapter-theme="4"] button.secondary{
  background:linear-gradient(180deg,#352642,#24192e)!important;
  border-color:#5a466d!important;
}
body[data-chapter-theme="4"] .world-action-button,
body[data-chapter-theme="4"] .quest-offer-button,
body[data-chapter-theme="4"] .quest-action-row>button,
body[data-chapter-theme="4"] .fight-action-button{
  background:
    radial-gradient(circle at 50% 0,rgba(220,171,255,.17),transparent 58%),
    linear-gradient(180deg,#7b4bb0,#512d79)!important;
  border-color:#b178df!important;
  color:#fff1ff!important;
  box-shadow:0 0 18px rgba(145,80,203,.23),inset 0 1px rgba(241,215,255,.10)!important;
}
body[data-chapter-theme="4"] .rest-recover-button{
  background:linear-gradient(180deg,#3d3e62,#292c4a)!important;
  border-color:#6c70a0!important;
  color:#ececff!important;
}
body[data-chapter-theme="4"] .combat-action-stack>button:not(.combat-flee-button),
body[data-chapter-theme="4"] .combat-action-dropdown>summary{
  background:linear-gradient(90deg,#402854,#2a1939)!important;
  border-color:#65457d!important;
  color:#ebddf5!important;
}
body[data-chapter-theme="4"] .combat-action-stack>button::before,
body[data-chapter-theme="4"] .combat-action-dropdown>summary::before{background:#9c66cf!important}

body[data-chapter-theme="4"] .combat-section{
  border-color:#5b3f72!important;
  background:
    radial-gradient(circle at 50% -20%,rgba(142,78,197,.12),transparent 38%),
    linear-gradient(155deg,rgba(38,23,50,.99),rgba(14,9,21,.995))!important;
}
body[data-chapter-theme="4"] .combat-crew-card{
  background:linear-gradient(180deg,#261832,#140d1d)!important;
  border-color:#543a69!important;
}
body[data-chapter-theme="4"] .combat-chronicle-block{
  border-color:#503762!important;
  background:#130c1c!important;
}
body[data-chapter-theme="4"] .player-hud::before{
  background:linear-gradient(180deg,rgba(43,26,57,.99),rgba(16,10,24,.995))!important;
  border-color:#674982!important;
}
body[data-chapter-theme="4"] .hud-character{
  border-color:#543b69!important;
  background:linear-gradient(135deg,rgba(70,42,91,.74),rgba(21,13,30,.90))!important;
}
body[data-chapter-theme="4"] .hud-resource{
  border-color:#543b69!important;
  background:#1c1227!important;
}
body[data-chapter-theme="4"] .hud-character-portrait{
  border-color:#78569a!important;
  background:linear-gradient(145deg,#442a59,#1a1024)!important;
}

body[data-chapter-theme="4"] .quest-card-active{border-left-color:#a869dc!important}
body[data-chapter-theme="4"] .quest-next-location{
  background:#1a1024!important;
  border-color:#533969!important;
}
body[data-chapter-theme="4"] .quest-next-location strong,
body[data-chapter-theme="4"] .crew-role,
body[data-chapter-theme="4"] .ability-path-level{color:#c185eb!important}
body[data-chapter-theme="4"] .storage-boundary-divider{color:#bd83e2!important}
body[data-chapter-theme="4"] .stored-items-zone{
  border-color:#5b426e!important;
  border-top-color:#79558f!important;
  background:radial-gradient(circle at 50% 0,rgba(126,77,157,.17),transparent 42%),linear-gradient(160deg,rgba(55,34,69,.88),rgba(24,16,31,.96))!important;
}
body[data-chapter-theme="4"] .toast{
  background:#24162f!important;
  border-color:#62467a!important;
}
body[data-chapter-theme="4"] .event-quest_accept .game-event-card,
body[data-chapter-theme="4"] .event-quest_story_update .game-event-card{
  border-color:#684882!important;
  background:radial-gradient(circle at 50% -5%,rgba(148,86,199,.16),transparent 44%),linear-gradient(160deg,#281937,#120b1b)!important;
}

/* Small arcane-cyan accents are deliberately restrained so Chapter 4 remains
   predominantly obsidian/amethyst rather than becoming another blue theme. */
body[data-chapter-theme="4"] .chapter-map-heading .eyebrow,
body[data-chapter-theme="4"] .combat-chronicle-details>summary small,
body[data-chapter-theme="4"] .map-location-tile.is-current .map-tile-copy small{
  color:#82d7df!important;
}

/* --------------------------------------------------------------------------
   ACCOUNT SAVE CARDS — match the saved chapter before entering the game.
   -------------------------------------------------------------------------- */
.save-slot-card.has-save[data-save-chapter="3"]{
  --save-card-bg:#12302e;
  --save-card-deep:#061719;
  --save-card-line:#3e746b;
  --save-card-accent:#75e2c5;
  --save-card-accent-soft:#2b8a77;
  --save-card-text:#edf9f4;
  --save-card-muted:#a2beb5;
  --save-card-glow:rgba(66,184,159,.26);
}
.save-slot-card.has-save[data-save-chapter="3"]::after{
  background:
    linear-gradient(180deg,rgba(5,24,23,.18),rgba(6,31,29,.74) 67%,rgba(4,17,17,.95)),
    linear-gradient(90deg,rgba(8,32,30,.94),rgba(48,124,108,.18) 55%,rgba(6,27,26,.87));
}
.save-slot-card.has-save[data-save-chapter="3"] .save-slot-location-art img{
  opacity:.40;
  filter:saturate(.84) hue-rotate(5deg) contrast(1.08) brightness(.68);
}

.save-slot-card.has-save[data-save-chapter="4"]{
  --save-card-bg:#271733;
  --save-card-deep:#0d0713;
  --save-card-line:#6a4983;
  --save-card-accent:#c082ed;
  --save-card-accent-soft:#7542a1;
  --save-card-text:#f5edfa;
  --save-card-muted:#bdabc8;
  --save-card-glow:rgba(151,91,211,.29);
}
.save-slot-card.has-save[data-save-chapter="4"]::after{
  background:
    linear-gradient(180deg,rgba(21,9,29,.18),rgba(28,13,38,.75) 67%,rgba(13,6,19,.96)),
    linear-gradient(90deg,rgba(27,13,37,.95),rgba(116,67,151,.18) 55%,rgba(22,10,31,.88));
}
.save-slot-card.has-save[data-save-chapter="4"] .save-slot-location-art img{
  opacity:.40;
  filter:saturate(.82) hue-rotate(-5deg) contrast(1.1) brightness(.64);
}

@media(prefers-reduced-motion:reduce){
  body[data-chapter-theme="3"] .map-location-tile.is-current,
  body[data-chapter-theme="4"] .map-location-tile.is-current{animation:none!important}
}

/* === PATCH 025: definitive Chapter 3/4 Account Continue buttons ===
   The Account renderer already outputs data-save-chapter on the save card.
   These direct selectors intentionally bypass older generic green button rules
   and the variable-based fallback so Chapters 3 and 4 cannot inherit the wrong CTA. */

/* Chapter 3 — Verdant Moon */
body.account-saves-active
.save-slot-card.has-save[data-save-chapter="3"]
.save-continue-button{
  background:
    radial-gradient(circle at 50% 0,rgba(117,226,197,.28),transparent 58%),
    linear-gradient(180deg,#37a98f,#1e6f61)!important;
  border-color:#75e2c5!important;
  color:#f2fff9!important;
  box-shadow:
    0 0 0 1px rgba(117,226,197,.16),
    0 0 20px rgba(66,184,159,.34),
    inset 0 1px rgba(233,255,248,.14)!important;
  text-shadow:0 1px 5px rgba(0,0,0,.48)!important;
}
body.account-saves-active
.save-slot-card.has-save[data-save-chapter="3"]
.save-continue-button:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(151,244,219,.34),transparent 58%),
    linear-gradient(180deg,#46c1a4,#287f6e)!important;
  border-color:#9aefd8!important;
  box-shadow:
    0 0 0 1px rgba(154,239,216,.22),
    0 0 27px rgba(66,184,159,.48)!important;
}

/* Chapter 4 — Obsidian & Amethyst */
body.account-saves-active
.save-slot-card.has-save[data-save-chapter="4"]
.save-continue-button{
  background:
    radial-gradient(circle at 50% 0,rgba(192,130,237,.27),transparent 58%),
    linear-gradient(180deg,#8d55c4,#57307f)!important;
  border-color:#c082ed!important;
  color:#fff4ff!important;
  box-shadow:
    0 0 0 1px rgba(192,130,237,.16),
    0 0 21px rgba(151,91,211,.36),
    inset 0 1px rgba(248,229,255,.13)!important;
  text-shadow:0 1px 5px rgba(0,0,0,.5)!important;
}
body.account-saves-active
.save-slot-card.has-save[data-save-chapter="4"]
.save-continue-button:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(218,166,252,.33),transparent 58%),
    linear-gradient(180deg,#a96dd9,#663b91)!important;
  border-color:#dda9ff!important;
  box-shadow:
    0 0 0 1px rgba(221,169,255,.2),
    0 0 28px rgba(151,91,211,.5)!important;
}

/* Keep the recently requested toast notifications above the persistent HUD. */
#toast-stack{
  z-index:320!important;
  bottom:1rem!important;
  transition:bottom .28s ease!important;
}
body.hud-visible:not(.hud-minimized) #toast-stack{
  bottom:calc(76px + env(safe-area-inset-bottom))!important;
}
body.hud-visible.hud-minimized #toast-stack,
body.combat-active #toast-stack{
  bottom:calc(38px + env(safe-area-inset-bottom))!important;
}
@media(max-width:620px){
  body.hud-visible:not(.hud-minimized) #toast-stack{
    bottom:calc(74px + env(safe-area-inset-bottom))!important;
  }
  body.hud-visible.hud-minimized #toast-stack,
  body.combat-active #toast-stack{
    bottom:calc(36px + env(safe-area-inset-bottom))!important;
  }
  #toast-stack{
    right:.55rem!important;
    left:.55rem!important;
    max-width:none!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #toast-stack{transition:none!important}
}

/* === PATCH 026: complete Chapter 3/4 component theming ===
   Finishes the Verdant Moon / Obsidian & Amethyst repaint for older UI
   components that still carried the original Chapter 1 gold/olive styling.
   Semantic colors (HP, MP, KO, poison, danger, Stagger, Turning Point, etc.)
   intentionally remain unchanged. */

body[data-chapter-theme="3"]{
  --rw-ui-deep:#061617;
  --rw-ui-surface:#0d2524;
  --rw-ui-surface-2:#14332f;
  --rw-ui-surface-3:#1a403b;
  --rw-ui-line:#326860;
  --rw-ui-line-strong:#4a9587;
  --rw-ui-accent:#69d2b8;
  --rw-ui-accent-bright:#9aefd9;
  --rw-ui-text:#e8f6f0;
  --rw-ui-muted:#91aaa2;
  --rw-ui-faint:#708b83;
  --rw-ui-glow:rgba(66,184,159,.28);
  --rw-ui-glow-soft:rgba(66,184,159,.10);
}

body[data-chapter-theme="4"]{
  --rw-ui-deep:#0d0713;
  --rw-ui-surface:#1a1024;
  --rw-ui-surface-2:#271733;
  --rw-ui-surface-3:#342047;
  --rw-ui-line:#5c4270;
  --rw-ui-line-strong:#8058a0;
  --rw-ui-accent:#c185eb;
  --rw-ui-accent-bright:#dda9ff;
  --rw-ui-text:#f2eaf7;
  --rw-ui-muted:#aa9bb4;
  --rw-ui-faint:#80718a;
  --rw-ui-glow:rgba(151,91,211,.30);
  --rw-ui-glow-soft:rgba(151,91,211,.11);
}

/* ---------- Crew page shell ---------- */
body[data-chapter-theme="3"] .crew-roster-panel.panel,
body[data-chapter-theme="4"] .crew-roster-panel.panel{
  background:
    radial-gradient(circle at 16% 0,var(--rw-ui-glow-soft),transparent 36%),
    linear-gradient(145deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-roster-panel::before,
body[data-chapter-theme="4"] .crew-roster-panel::before{
  border-color:color-mix(in srgb,var(--rw-ui-accent) 18%,transparent)!important;
}
body[data-chapter-theme="3"] .crew-page-heading,
body[data-chapter-theme="4"] .crew-page-heading{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-page-heading p,
body[data-chapter-theme="4"] .crew-page-heading p{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .crew-profile-card,
body[data-chapter-theme="4"] .crew-profile-card{
  border-color:var(--rw-ui-line)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 38%),
    linear-gradient(165deg,var(--rw-ui-surface-2),var(--rw-ui-deep) 72%)!important;
}
body[data-chapter-theme="3"] .crew-card-ornament,
body[data-chapter-theme="4"] .crew-card-ornament{
  background:linear-gradient(90deg,var(--rw-ui-glow-soft),transparent 20%,transparent 80%,var(--rw-ui-glow-soft))!important;
  border-top-color:color-mix(in srgb,var(--rw-ui-accent) 48%,transparent)!important;
}
body[data-chapter-theme="3"] .crew-portrait-frame,
body[data-chapter-theme="4"] .crew-portrait-frame{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="3"] .crew-portrait-frame>span,
body[data-chapter-theme="4"] .crew-portrait-frame>span{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .crew-level-line,
body[data-chapter-theme="4"] .crew-level-line{
  color:var(--rw-ui-muted)!important;
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-vital>div:first-child span,
body[data-chapter-theme="4"] .crew-vital>div:first-child span{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Crew stat runes ---------- */
body[data-chapter-theme="3"] .crew-stat-rune-grid,
body[data-chapter-theme="4"] .crew-stat-rune-grid{
  background:var(--rw-ui-line)!important;
  border-top-color:var(--rw-ui-line)!important;
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-stat-rune-grid>div,
body[data-chapter-theme="4"] .crew-stat-rune-grid>div,
body[data-chapter-theme="3"] .crew-stat-rune,
body[data-chapter-theme="4"] .crew-stat-rune{
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
  border-color:color-mix(in srgb,var(--rw-ui-line-strong) 72%,transparent)!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .crew-stat-rune:hover,
body[data-chapter-theme="3"] .crew-stat-rune:focus-visible,
body[data-chapter-theme="4"] .crew-stat-rune:hover,
body[data-chapter-theme="4"] .crew-stat-rune:focus-visible{
  border-color:var(--rw-ui-accent)!important;
  box-shadow:0 0 15px var(--rw-ui-glow),inset 0 0 0 1px var(--rw-ui-glow-soft)!important;
}
body[data-chapter-theme="3"] .crew-stat-rune-grid span,
body[data-chapter-theme="4"] .crew-stat-rune-grid span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .crew-stat-rune-grid strong,
body[data-chapter-theme="4"] .crew-stat-rune-grid strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .crew-stat-rune-grid small,
body[data-chapter-theme="4"] .crew-stat-rune-grid small{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Crew equipment ---------- */
body[data-chapter-theme="3"] .crew-section-heading span,
body[data-chapter-theme="4"] .crew-section-heading span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .crew-section-heading i,
body[data-chapter-theme="4"] .crew-section-heading i{
  background:linear-gradient(90deg,var(--rw-ui-line-strong),transparent)!important;
}
body[data-chapter-theme="3"] .crew-equipment-slot,
body[data-chapter-theme="4"] .crew-equipment-slot{
  background:var(--rw-ui-deep)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-equipment-slot>span,
body[data-chapter-theme="4"] .crew-equipment-slot>span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .crew-equipment-slot>strong,
body[data-chapter-theme="4"] .crew-equipment-slot>strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .crew-equipment-slot.empty strong,
body[data-chapter-theme="4"] .crew-equipment-slot.empty strong{
  color:var(--rw-ui-faint)!important;
}
body[data-chapter-theme="3"] .crew-equipped-icon,
body[data-chapter-theme="4"] .crew-equipped-icon{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}

/* ---------- Crew abilities and help ---------- */
body[data-chapter-theme="3"] .crew-ability-chip,
body[data-chapter-theme="4"] .crew-ability-chip{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
}
body[data-chapter-theme="3"] .crew-ability-chip strong,
body[data-chapter-theme="4"] .crew-ability-chip strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .crew-ability-chip span,
body[data-chapter-theme="4"] .crew-ability-chip span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .crew-ability-button,
body[data-chapter-theme="4"] .crew-ability-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:linear-gradient(180deg,var(--rw-ui-surface-3),var(--rw-ui-surface))!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .crew-ability-button::after,
body[data-chapter-theme="4"] .crew-ability-button::after{
  border-color:var(--rw-ui-line-strong)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .crew-ability-tooltip,
body[data-chapter-theme="3"] .crew-ability-tooltip-portal,
body[data-chapter-theme="4"] .crew-ability-tooltip,
body[data-chapter-theme="4"] .crew-ability-tooltip-portal{
  border-color:var(--rw-ui-line-strong)!important;
  background:
    radial-gradient(circle at 20% 0,var(--rw-ui-glow-soft),transparent 38%),
    linear-gradient(160deg,var(--rw-ui-surface-2),var(--rw-ui-deep) 78%)!important;
  box-shadow:0 18px 48px rgba(0,0,0,.74),0 0 18px var(--rw-ui-glow-soft)!important;
}
body[data-chapter-theme="3"] .crew-ability-tooltip::after,
body[data-chapter-theme="3"] .crew-ability-tooltip-portal::after,
body[data-chapter-theme="4"] .crew-ability-tooltip::after,
body[data-chapter-theme="4"] .crew-ability-tooltip-portal::after{
  border-top-color:var(--rw-ui-line-strong)!important;
}
body[data-chapter-theme="3"] .crew-ability-tooltip.tooltip-below::after,
body[data-chapter-theme="3"] .crew-ability-tooltip-portal.tooltip-below::after,
body[data-chapter-theme="4"] .crew-ability-tooltip.tooltip-below::after,
body[data-chapter-theme="4"] .crew-ability-tooltip-portal.tooltip-below::after{
  border-top-color:transparent!important;
  border-bottom-color:var(--rw-ui-line-strong)!important;
}
body[data-chapter-theme="3"] .ability-tooltip-kicker,
body[data-chapter-theme="4"] .ability-tooltip-kicker{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .crew-ability-tooltip>strong,
body[data-chapter-theme="3"] .crew-ability-tooltip-portal>strong,
body[data-chapter-theme="4"] .crew-ability-tooltip>strong,
body[data-chapter-theme="4"] .crew-ability-tooltip-portal>strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .ability-tooltip-meta,
body[data-chapter-theme="4"] .ability-tooltip-meta{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .ability-tooltip-description,
body[data-chapter-theme="4"] .ability-tooltip-description{
  color:color-mix(in srgb,var(--rw-ui-text) 82%,var(--rw-ui-muted))!important;
}
body[data-chapter-theme="3"] .muted-copy,
body[data-chapter-theme="4"] .muted-copy{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Empty crew states ---------- */
body[data-chapter-theme="3"] .crew-empty-slot,
body[data-chapter-theme="4"] .crew-empty-slot{
  color:var(--rw-ui-faint)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .crew-empty-sigil,
body[data-chapter-theme="4"] .crew-empty-sigil{
  border-color:var(--rw-ui-line)!important;
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .crew-empty-slot>div:last-child>span,
body[data-chapter-theme="4"] .crew-empty-slot>div:last-child>span,
body[data-chapter-theme="3"] .crew-empty-slot p,
body[data-chapter-theme="4"] .crew-empty-slot p{
  color:var(--rw-ui-faint)!important;
}
body[data-chapter-theme="3"] .crew-empty-slot h3,
body[data-chapter-theme="4"] .crew-empty-slot h3{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Den shell / active crew cards ---------- */
body[data-chapter-theme="3"] .den-crew-panel.panel,
body[data-chapter-theme="3"] .storage-panel.panel,
body[data-chapter-theme="4"] .den-crew-panel.panel,
body[data-chapter-theme="4"] .storage-panel.panel{
  border-color:var(--rw-ui-line)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 40%),
    linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="3"] .den-character-tile,
body[data-chapter-theme="4"] .den-character-tile{
  border-color:var(--rw-ui-line)!important;
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="3"] .den-crew-card,
body[data-chapter-theme="4"] .den-crew-card{
  background:
    radial-gradient(circle at 0 0,var(--rw-ui-glow-soft),transparent 44%),
    linear-gradient(150deg,var(--rw-ui-surface-2),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="3"] .den-crew-portrait-frame,
body[data-chapter-theme="4"] .den-crew-portrait-frame{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="3"] .den-crew-name,
body[data-chapter-theme="4"] .den-crew-name{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .den-crew-name strong,
body[data-chapter-theme="4"] .den-crew-name strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .den-crew-name span,
body[data-chapter-theme="4"] .den-crew-name span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .den-crew-copy>p,
body[data-chapter-theme="4"] .den-crew-copy>p{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .den-xp-label,
body[data-chapter-theme="4"] .den-xp-label{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .den-xp-label strong,
body[data-chapter-theme="4"] .den-xp-label strong{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .den-xp-bar,
body[data-chapter-theme="4"] .den-xp-bar{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="3"] .den-xp-bar i{
  background:linear-gradient(90deg,#2a7f70,#75e2c5)!important;
}
body[data-chapter-theme="4"] .den-xp-bar i{
  background:linear-gradient(90deg,#70439a,#c185eb)!important;
}

/* ---------- Ability progression ---------- */
body[data-chapter-theme="3"] .ability-path-details,
body[data-chapter-theme="4"] .ability-path-details{
  border-top-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="3"] .ability-path-details>summary,
body[data-chapter-theme="4"] .ability-path-details>summary{
  color:var(--rw-ui-text)!important;
  background:linear-gradient(180deg,var(--rw-ui-glow-soft),transparent)!important;
}
body[data-chapter-theme="3"] .ability-path-details>summary small,
body[data-chapter-theme="4"] .ability-path-details>summary small{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .ability-path-chevron,
body[data-chapter-theme="4"] .ability-path-chevron{
  border-color:var(--rw-ui-line-strong)!important;
  background:
    radial-gradient(circle at 35% 30%,var(--rw-ui-surface-3),var(--rw-ui-deep) 72%)!important;
  color:var(--rw-ui-accent-bright)!important;
  text-shadow:0 0 8px var(--rw-ui-glow)!important;
  box-shadow:0 0 0 2px var(--rw-ui-glow-soft),0 0 15px var(--rw-ui-glow)!important;
}
body[data-chapter-theme="3"] .ability-path-details:hover .ability-path-chevron,
body[data-chapter-theme="4"] .ability-path-details:hover .ability-path-chevron{
  color:var(--rw-ui-text)!important;
  border-color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .ability-path-start,
body[data-chapter-theme="3"] .ability-path-milestone,
body[data-chapter-theme="4"] .ability-path-start,
body[data-chapter-theme="4"] .ability-path-milestone{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
}
body[data-chapter-theme="3"] .ability-path-learned,
body[data-chapter-theme="3"] .ability-path-pending,
body[data-chapter-theme="3"] .ability-path-option,
body[data-chapter-theme="4"] .ability-path-learned,
body[data-chapter-theme="4"] .ability-path-pending,
body[data-chapter-theme="4"] .ability-path-option{
  background:var(--rw-ui-deep)!important;
  border-color:color-mix(in srgb,var(--rw-ui-line) 78%,transparent)!important;
}
body[data-chapter-theme="3"] .ability-path-learned strong,
body[data-chapter-theme="3"] .ability-path-pending strong,
body[data-chapter-theme="3"] .ability-path-option strong,
body[data-chapter-theme="4"] .ability-path-learned strong,
body[data-chapter-theme="4"] .ability-path-pending strong,
body[data-chapter-theme="4"] .ability-path-option strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .ability-path-learned small,
body[data-chapter-theme="3"] .ability-path-pending small,
body[data-chapter-theme="3"] .ability-path-option small,
body[data-chapter-theme="4"] .ability-path-learned small,
body[data-chapter-theme="4"] .ability-path-pending small,
body[data-chapter-theme="4"] .ability-path-option small{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .ability-path-option.chosen,
body[data-chapter-theme="4"] .ability-path-option.chosen{
  border-color:var(--rw-ui-accent)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 52%),
    linear-gradient(145deg,var(--rw-ui-surface-3),var(--rw-ui-deep))!important;
  box-shadow:0 0 0 1px var(--rw-ui-glow-soft),0 0 18px var(--rw-ui-glow)!important;
}
body[data-chapter-theme="3"] .ability-path-option.chosen>span,
body[data-chapter-theme="4"] .ability-path-option.chosen>span{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .ability-type-help,
body[data-chapter-theme="4"] .ability-type-help{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}

/* ---------- Equipment preview / equipped item buttons ---------- */
body[data-chapter-theme="3"] .equipment-preview-trigger,
body[data-chapter-theme="3"] .equipped-item-tooltip-trigger,
body[data-chapter-theme="4"] .equipment-preview-trigger,
body[data-chapter-theme="4"] .equipped-item-tooltip-trigger{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .equipment-preview-details>summary,
body[data-chapter-theme="4"] .equipment-preview-details>summary{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="3"] .equipment-preview-details>summary::after,
body[data-chapter-theme="4"] .equipment-preview-details>summary::after{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .equipment-preview-popover,
body[data-chapter-theme="4"] .equipment-preview-popover{
  background:var(--rw-ui-deep)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .equipment-preview-replace,
body[data-chapter-theme="4"] .equipment-preview-replace{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="3"] .equipment-preview-replace>span,
body[data-chapter-theme="4"] .equipment-preview-replace>span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .equipment-preview-replace>small,
body[data-chapter-theme="3"] .equipment-preview-row small,
body[data-chapter-theme="3"] .equipment-preview-neutral,
body[data-chapter-theme="4"] .equipment-preview-replace>small,
body[data-chapter-theme="4"] .equipment-preview-row small,
body[data-chapter-theme="4"] .equipment-preview-neutral{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .equipment-preview-replace>strong,
body[data-chapter-theme="3"] .equipment-preview-row span,
body[data-chapter-theme="4"] .equipment-preview-replace>strong,
body[data-chapter-theme="4"] .equipment-preview-row span{
  color:var(--rw-ui-text)!important;
}

/* ---------- Inventory chrome that was still antique-gold ---------- */
body[data-chapter-theme="3"] .inventory-quantity,
body[data-chapter-theme="4"] .inventory-quantity{
  border-color:var(--rw-ui-line-strong)!important;
  color:var(--rw-ui-accent-bright)!important;
  background:color-mix(in srgb,var(--rw-ui-deep) 90%,transparent)!important;
}
body[data-chapter-theme="3"] .inventory-card-copy p,
body[data-chapter-theme="4"] .inventory-card-copy p{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Storage / GP storage ---------- */
body[data-chapter-theme="3"] .storage-boundary-divider,
body[data-chapter-theme="4"] .storage-boundary-divider{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .storage-boundary-divider::before,
body[data-chapter-theme="3"] .storage-boundary-divider::after,
body[data-chapter-theme="4"] .storage-boundary-divider::before,
body[data-chapter-theme="4"] .storage-boundary-divider::after{
  background:linear-gradient(90deg,transparent,var(--rw-ui-line-strong) 30%,var(--rw-ui-accent) 70%,transparent)!important;
}
body[data-chapter-theme="3"] .stored-heading,
body[data-chapter-theme="4"] .stored-heading{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .storage-info-button,
body[data-chapter-theme="4"] .storage-info-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .gp-storage-card,
body[data-chapter-theme="4"] .gp-storage-card{
  border-color:var(--rw-ui-line)!important;
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="3"] .gp-storage-readout,
body[data-chapter-theme="4"] .gp-storage-readout{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="3"] .gp-storage-readout span,
body[data-chapter-theme="4"] .gp-storage-readout span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .gp-storage-readout strong,
body[data-chapter-theme="4"] .gp-storage-readout strong{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .storage-stack-actions .storage-all-button,
body[data-chapter-theme="4"] .storage-stack-actions .storage-all-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:linear-gradient(180deg,var(--rw-ui-surface-3),var(--rw-ui-surface))!important;
  color:var(--rw-ui-text)!important;
}

/* ---------- Miscellaneous chapter-facing labels ---------- */
body[data-chapter-theme="3"] .chapter-map-heading p,
body[data-chapter-theme="3"] .quest-next-location span,
body[data-chapter-theme="3"] .quest-reward-summary>span,
body[data-chapter-theme="4"] .chapter-map-heading p,
body[data-chapter-theme="4"] .quest-next-location span,
body[data-chapter-theme="4"] .quest-reward-summary>span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .completed-count,
body[data-chapter-theme="4"] .completed-count{
  border-color:var(--rw-ui-line)!important;
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="3"] .completed-chevron,
body[data-chapter-theme="4"] .completed-chevron{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="3"] .player-hud-toggle,
body[data-chapter-theme="4"] .player-hud-toggle{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="3"] .player-hud-toggle:hover,
body[data-chapter-theme="4"] .player-hud-toggle:hover{
  background:var(--rw-ui-surface-3)!important;
  color:var(--rw-ui-text)!important;
}

/* Chapter 4 keeps a tiny restrained cyan signature in informational help,
   without allowing cyan to take over the overall amethyst palette. */
body[data-chapter-theme="4"] .ability-type-help,
body[data-chapter-theme="4"] .crew-ability-chip span{
  color:#82d7df!important;
}

/* === PATCH 027: complete Chapter 2 component theming ===
   Extends the Windblown Foothills rust / iron-red / earth palette across the
   same Crew, Den, equipment, progression, tooltip, storage and HUD components
   already completed for Chapters 3 and 4.
   Semantic gameplay colors remain unchanged. */

body[data-chapter-theme="2"]{
  --rw-ui-deep:#120b08;
  --rw-ui-surface:#21140f;
  --rw-ui-surface-2:#2c1b14;
  --rw-ui-surface-3:#3a241a;
  --rw-ui-line:#613d31;
  --rw-ui-line-strong:#8a5943;
  --rw-ui-accent:#e17d58;
  --rw-ui-accent-bright:#ffad7f;
  --rw-ui-text:#f3e4d8;
  --rw-ui-muted:#b9a092;
  --rw-ui-faint:#89746a;
  --rw-ui-glow:rgba(221,112,73,.30);
  --rw-ui-glow-soft:rgba(221,112,73,.10);
}

/* ---------- Crew page shell ---------- */
body[data-chapter-theme="2"] .crew-roster-panel.panel{
  background:
    radial-gradient(circle at 16% 0,var(--rw-ui-glow-soft),transparent 36%),
    linear-gradient(145deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-roster-panel::before{
  border-color:color-mix(in srgb,var(--rw-ui-accent) 18%,transparent)!important;
}
body[data-chapter-theme="2"] .crew-page-heading{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-page-heading p{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .crew-profile-card{
  border-color:var(--rw-ui-line)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 38%),
    linear-gradient(165deg,var(--rw-ui-surface-2),var(--rw-ui-deep) 72%)!important;
}
body[data-chapter-theme="2"] .crew-card-ornament{
  background:linear-gradient(90deg,var(--rw-ui-glow-soft),transparent 20%,transparent 80%,var(--rw-ui-glow-soft))!important;
  border-top-color:color-mix(in srgb,var(--rw-ui-accent) 48%,transparent)!important;
}
body[data-chapter-theme="2"] .crew-portrait-frame{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .crew-portrait-frame>span{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .crew-level-line{
  color:var(--rw-ui-muted)!important;
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-vital>div:first-child span{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Crew stat runes ---------- */
body[data-chapter-theme="2"] .crew-stat-rune-grid{
  background:var(--rw-ui-line)!important;
  border-top-color:var(--rw-ui-line)!important;
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-stat-rune-grid>div,
body[data-chapter-theme="2"] .crew-stat-rune{
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
  border-color:color-mix(in srgb,var(--rw-ui-line-strong) 72%,transparent)!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .crew-stat-rune:hover,
body[data-chapter-theme="2"] .crew-stat-rune:focus-visible{
  border-color:var(--rw-ui-accent)!important;
  box-shadow:0 0 15px var(--rw-ui-glow),inset 0 0 0 1px var(--rw-ui-glow-soft)!important;
}
body[data-chapter-theme="2"] .crew-stat-rune-grid span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .crew-stat-rune-grid strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .crew-stat-rune-grid small{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Crew equipment ---------- */
body[data-chapter-theme="2"] .crew-section-heading span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .crew-section-heading i{
  background:linear-gradient(90deg,var(--rw-ui-line-strong),transparent)!important;
}
body[data-chapter-theme="2"] .crew-equipment-slot{
  background:var(--rw-ui-deep)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-equipment-slot>span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .crew-equipment-slot>strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .crew-equipment-slot.empty strong{
  color:var(--rw-ui-faint)!important;
}
body[data-chapter-theme="2"] .crew-equipped-icon{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .unequip-button{
  background:linear-gradient(180deg,var(--rw-ui-surface-3),var(--rw-ui-surface))!important;
  border-color:var(--rw-ui-line-strong)!important;
  color:var(--rw-ui-text)!important;
}

/* ---------- Crew abilities and help ---------- */
body[data-chapter-theme="2"] .crew-ability-chip{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
}
body[data-chapter-theme="2"] .crew-ability-chip strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .crew-ability-chip span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .crew-ability-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:linear-gradient(180deg,var(--rw-ui-surface-3),var(--rw-ui-surface))!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .crew-ability-button::after{
  border-color:var(--rw-ui-line-strong)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .crew-ability-tooltip,
body[data-chapter-theme="2"] .crew-ability-tooltip-portal{
  border-color:var(--rw-ui-line-strong)!important;
  background:
    radial-gradient(circle at 20% 0,var(--rw-ui-glow-soft),transparent 38%),
    linear-gradient(160deg,var(--rw-ui-surface-2),var(--rw-ui-deep) 78%)!important;
  box-shadow:0 18px 48px rgba(0,0,0,.74),0 0 18px var(--rw-ui-glow-soft)!important;
}
body[data-chapter-theme="2"] .crew-ability-tooltip::after,
body[data-chapter-theme="2"] .crew-ability-tooltip-portal::after{
  border-top-color:var(--rw-ui-line-strong)!important;
}
body[data-chapter-theme="2"] .crew-ability-tooltip.tooltip-below::after,
body[data-chapter-theme="2"] .crew-ability-tooltip-portal.tooltip-below::after{
  border-top-color:transparent!important;
  border-bottom-color:var(--rw-ui-line-strong)!important;
}
body[data-chapter-theme="2"] .ability-tooltip-kicker{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .crew-ability-tooltip>strong,
body[data-chapter-theme="2"] .crew-ability-tooltip-portal>strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .ability-tooltip-meta{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .ability-tooltip-description{
  color:color-mix(in srgb,var(--rw-ui-text) 82%,var(--rw-ui-muted))!important;
}
body[data-chapter-theme="2"] .muted-copy{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Empty crew states ---------- */
body[data-chapter-theme="2"] .crew-empty-slot{
  color:var(--rw-ui-faint)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .crew-empty-sigil{
  border-color:var(--rw-ui-line)!important;
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .crew-empty-slot>div:last-child>span,
body[data-chapter-theme="2"] .crew-empty-slot p{
  color:var(--rw-ui-faint)!important;
}
body[data-chapter-theme="2"] .crew-empty-slot h3{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Den shell / active crew cards ---------- */
body[data-chapter-theme="2"] .den-crew-panel.panel,
body[data-chapter-theme="2"] .storage-panel.panel{
  border-color:var(--rw-ui-line)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 40%),
    linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="2"] .den-character-tile{
  border-color:var(--rw-ui-line)!important;
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="2"] .den-crew-card{
  background:
    radial-gradient(circle at 0 0,var(--rw-ui-glow-soft),transparent 44%),
    linear-gradient(150deg,var(--rw-ui-surface-2),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="2"] .den-crew-portrait-frame{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .den-crew-name{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .den-crew-name strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .den-crew-name span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .den-crew-copy>p{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .den-xp-label{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .den-xp-label strong{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .den-xp-bar{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .den-xp-bar i{
  background:linear-gradient(90deg,#8e3929,#e17d58)!important;
}

/* ---------- Ability progression ---------- */
body[data-chapter-theme="2"] .ability-path-details{
  border-top-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .ability-path-details>summary{
  color:var(--rw-ui-text)!important;
  background:linear-gradient(180deg,var(--rw-ui-glow-soft),transparent)!important;
}
body[data-chapter-theme="2"] .ability-path-details>summary small{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .ability-path-chevron{
  border-color:var(--rw-ui-line-strong)!important;
  background:
    radial-gradient(circle at 35% 30%,var(--rw-ui-surface-3),var(--rw-ui-deep) 72%)!important;
  color:var(--rw-ui-accent-bright)!important;
  text-shadow:0 0 8px var(--rw-ui-glow)!important;
  box-shadow:0 0 0 2px var(--rw-ui-glow-soft),0 0 15px var(--rw-ui-glow)!important;
}
body[data-chapter-theme="2"] .ability-path-details:hover .ability-path-chevron{
  color:var(--rw-ui-text)!important;
  border-color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .ability-path-start,
body[data-chapter-theme="2"] .ability-path-milestone{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
}
body[data-chapter-theme="2"] .ability-path-learned,
body[data-chapter-theme="2"] .ability-path-pending,
body[data-chapter-theme="2"] .ability-path-option{
  background:var(--rw-ui-deep)!important;
  border-color:color-mix(in srgb,var(--rw-ui-line) 78%,transparent)!important;
}
body[data-chapter-theme="2"] .ability-path-learned strong,
body[data-chapter-theme="2"] .ability-path-pending strong,
body[data-chapter-theme="2"] .ability-path-option strong{
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .ability-path-learned small,
body[data-chapter-theme="2"] .ability-path-pending small,
body[data-chapter-theme="2"] .ability-path-option small{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .ability-path-option.chosen{
  border-color:var(--rw-ui-accent)!important;
  background:
    radial-gradient(circle at 100% 0,var(--rw-ui-glow-soft),transparent 52%),
    linear-gradient(145deg,var(--rw-ui-surface-3),var(--rw-ui-deep))!important;
  box-shadow:0 0 0 1px var(--rw-ui-glow-soft),0 0 18px var(--rw-ui-glow)!important;
}
body[data-chapter-theme="2"] .ability-path-option.chosen>span{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .ability-type-help{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}

/* ---------- Equipment preview / equipped item buttons ---------- */
body[data-chapter-theme="2"] .equipment-preview-trigger,
body[data-chapter-theme="2"] .equipped-item-tooltip-trigger{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .equipment-preview-details>summary{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-text)!important;
}
body[data-chapter-theme="2"] .equipment-preview-details>summary::after{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .equipment-preview-popover{
  background:var(--rw-ui-deep)!important;
  border-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .equipment-preview-replace{
  border-bottom-color:var(--rw-ui-line)!important;
}
body[data-chapter-theme="2"] .equipment-preview-replace>span{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .equipment-preview-replace>small,
body[data-chapter-theme="2"] .equipment-preview-row small,
body[data-chapter-theme="2"] .equipment-preview-neutral{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .equipment-preview-replace>strong,
body[data-chapter-theme="2"] .equipment-preview-row span{
  color:var(--rw-ui-text)!important;
}

/* ---------- Inventory chrome ---------- */
body[data-chapter-theme="2"] .inventory-quantity{
  border-color:var(--rw-ui-line-strong)!important;
  color:var(--rw-ui-accent-bright)!important;
  background:color-mix(in srgb,var(--rw-ui-deep) 90%,transparent)!important;
}
body[data-chapter-theme="2"] .inventory-card-copy p{
  color:var(--rw-ui-muted)!important;
}

/* ---------- Storage / GP storage ---------- */
body[data-chapter-theme="2"] .storage-boundary-divider{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .storage-boundary-divider::before,
body[data-chapter-theme="2"] .storage-boundary-divider::after{
  background:linear-gradient(90deg,transparent,var(--rw-ui-line-strong) 30%,var(--rw-ui-accent) 70%,transparent)!important;
}
body[data-chapter-theme="2"] .stored-heading{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .stored-items-zone{
  border-color:var(--rw-ui-line)!important;
  border-top-color:var(--rw-ui-line-strong)!important;
  background:
    radial-gradient(circle at 50% 0,var(--rw-ui-glow-soft),transparent 42%),
    linear-gradient(160deg,var(--rw-ui-surface-2),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="2"] .storage-info-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .gp-storage-card{
  border-color:var(--rw-ui-line)!important;
  background:linear-gradient(155deg,var(--rw-ui-surface),var(--rw-ui-deep))!important;
}
body[data-chapter-theme="2"] .gp-storage-readout{
  border-color:var(--rw-ui-line)!important;
  background:var(--rw-ui-deep)!important;
}
body[data-chapter-theme="2"] .gp-storage-readout span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .gp-storage-readout strong{
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .storage-stack-actions .storage-all-button{
  border-color:var(--rw-ui-line-strong)!important;
  background:linear-gradient(180deg,var(--rw-ui-surface-3),var(--rw-ui-surface))!important;
  color:var(--rw-ui-text)!important;
}

/* ---------- Smaller chapter-facing labels ---------- */
body[data-chapter-theme="2"] .chapter-map-heading p,
body[data-chapter-theme="2"] .quest-next-location span,
body[data-chapter-theme="2"] .quest-reward-summary>span{
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .completed-count{
  border-color:var(--rw-ui-line)!important;
  color:var(--rw-ui-muted)!important;
}
body[data-chapter-theme="2"] .completed-chevron{
  color:var(--rw-ui-accent)!important;
}
body[data-chapter-theme="2"] .player-hud-toggle{
  border-color:var(--rw-ui-line-strong)!important;
  background:var(--rw-ui-surface)!important;
  color:var(--rw-ui-accent-bright)!important;
}
body[data-chapter-theme="2"] .player-hud-toggle:hover{
  background:var(--rw-ui-surface-3)!important;
  color:var(--rw-ui-text)!important;
}

/* === PATCH 028: chapter-themed ready recipe buttons ===
   Craftable recipes now belong visually to the active chapter instead of
   always using the old generic green ready-state. Locked recipes remain
   neutral/disabled for consistent gameplay readability. */

/* Chapter 1 — Black Swamp: moss, old bronze, tarnished gold */
body[data-chapter-theme="1"] .recipe-button.recipe-ready{
  background:
    radial-gradient(circle at 50% 0,rgba(220,199,119,.14),transparent 58%),
    linear-gradient(180deg,#4a4a2b,#2d321d)!important;
  border-color:#8e8650!important;
  color:#f3ebca!important;
  box-shadow:
    0 0 0 1px rgba(197,178,111,.09),
    0 0 14px rgba(197,178,111,.14),
    inset 0 1px rgba(255,244,192,.07)!important;
}
body[data-chapter-theme="1"] .recipe-button.recipe-ready:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(235,214,135,.19),transparent 58%),
    linear-gradient(180deg,#595830,#353a21)!important;
  border-color:#b4a660!important;
  box-shadow:
    0 0 0 1px rgba(218,199,121,.12),
    0 0 20px rgba(197,178,111,.23)!important;
}

/* Chapter 2 — Windblown Foothills: iron-red earth and ember */
body[data-chapter-theme="2"] .recipe-button.recipe-ready{
  background:
    radial-gradient(circle at 50% 0,rgba(255,162,107,.18),transparent 58%),
    linear-gradient(180deg,#783b2a,#49251c)!important;
  border-color:#d97550!important;
  color:#ffe8d9!important;
  box-shadow:
    0 0 0 1px rgba(225,125,88,.10),
    0 0 15px rgba(221,112,73,.18),
    inset 0 1px rgba(255,224,201,.08)!important;
}
body[data-chapter-theme="2"] .recipe-button.recipe-ready:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(255,181,130,.23),transparent 58%),
    linear-gradient(180deg,#914831,#562b20)!important;
  border-color:#f08e63!important;
  box-shadow:
    0 0 0 1px rgba(240,142,99,.13),
    0 0 21px rgba(221,112,73,.28)!important;
}

/* Chapter 3 — Verdant Moon: jade, teal and moonlit mint */
body[data-chapter-theme="3"] .recipe-button.recipe-ready{
  background:
    radial-gradient(circle at 50% 0,rgba(117,226,197,.19),transparent 58%),
    linear-gradient(180deg,#276f61,#16473f)!important;
  border-color:#69d2b8!important;
  color:#effff9!important;
  box-shadow:
    0 0 0 1px rgba(105,210,184,.10),
    0 0 16px rgba(66,184,159,.20),
    inset 0 1px rgba(225,255,247,.09)!important;
}
body[data-chapter-theme="3"] .recipe-button.recipe-ready:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(154,239,217,.25),transparent 58%),
    linear-gradient(180deg,#318876,#1a554a)!important;
  border-color:#91e7d0!important;
  box-shadow:
    0 0 0 1px rgba(145,231,208,.13),
    0 0 22px rgba(66,184,159,.31)!important;
}

/* Chapter 4 — Obsidian & Amethyst: violet with a restrained arcane edge */
body[data-chapter-theme="4"] .recipe-button.recipe-ready{
  background:
    radial-gradient(circle at 50% 0,rgba(193,133,235,.20),transparent 58%),
    linear-gradient(180deg,#68428a,#3d2853)!important;
  border-color:#b77ade!important;
  color:#fbf2ff!important;
  box-shadow:
    0 0 0 1px rgba(193,133,235,.10),
    0 0 16px rgba(151,91,211,.22),
    inset 0 1px rgba(235,210,255,.08)!important;
}
body[data-chapter-theme="4"] .recipe-button.recipe-ready:hover:not(:disabled){
  background:
    radial-gradient(circle at 50% 0,rgba(218,169,255,.25),transparent 58%),
    linear-gradient(180deg,#7c50a2,#493061)!important;
  border-color:#d29cf2!important;
  box-shadow:
    0 0 0 1px rgba(210,156,242,.13),
    0 0 22px rgba(151,91,211,.32),
    inset 0 -1px rgba(130,215,223,.10)!important;
}

/* === PATCH 029: final desktop polish + post-game free play === */

/* Desktop title: keep the full REALMWALKER wordmark inside the artwork column. */
@media(min-width:841px){
  .auth-screen .title-screen-content{
    min-width:0!important;
    padding-right:clamp(1.35rem,3vw,2.75rem)!important;
  }
  .auth-screen .realmwalker-title{
    width:auto!important;
    max-width:100%!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    font-size:clamp(2.45rem,4.8vw,4.9rem)!important;
    letter-spacing:-.035em!important;
  }

  /* Dante's portrait art is very top-heavy; center his eyes/face in the wide PC combat crop. */
  .combat-crew-card.dante .combat-crew-portrait{
    object-position:center 42%!important;
  }

  /* Desktop-only reminder beneath the install button. */
  .desktop-mobile-recommendation{
    display:block!important;
    margin:.8rem .2rem 0!important;
    color:#bfe8f4!important;
    font:800 .68rem/1.45 system-ui,sans-serif!important;
    letter-spacing:.035em;
    text-align:center;
    text-shadow:0 0 8px rgba(103,212,255,.42),0 0 18px rgba(103,212,255,.22);
    animation:desktopMobileRecommendationPulse 1.9s ease-in-out infinite;
  }
}
.desktop-mobile-recommendation{display:none}
@keyframes desktopMobileRecommendationPulse{
  0%,100%{opacity:.68;filter:brightness(.92)}
  50%{opacity:1;filter:brightness(1.18)}
}

/* Continue The Journey is now a dismissible reminder rather than a hard end-state. */
.event-ending_locked .game-event-card{
  position:relative;
}
.ending-popup-close{
  position:absolute!important;
  z-index:8!important;
  top:.5rem!important;
  right:.55rem!important;
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  padding:0!important;
  margin:0!important;
  display:grid!important;
  place-items:center!important;
  border-radius:50%!important;
  border:1px solid rgba(226,235,239,.42)!important;
  background:rgba(8,14,18,.78)!important;
  color:#eef8fb!important;
  font:900 1.22rem/1 system-ui,sans-serif!important;
  box-shadow:0 0 12px rgba(103,212,255,.14)!important;
  text-shadow:0 0 8px rgba(103,212,255,.24)!important;
}
.ending-popup-close:hover:not(:disabled){
  background:rgba(24,44,55,.95)!important;
  border-color:#8fdcf5!important;
  color:#fff!important;
  box-shadow:0 0 18px rgba(103,212,255,.28)!important;
}
.ending-popup-close[hidden]{display:none!important}

@media(max-width:560px){
  .ending-popup-close{
    top:.35rem!important;
    right:.38rem!important;
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .desktop-mobile-recommendation{animation:none!important}
}

