
:root{
  --bg:#100d18;--bg2:#171324;--panel:#1d1830;--panel2:#251e39;--line:#3b3153;
  --text:#f7f2ff;--muted:#aea5bf;--gold:#f5cc6a;--violet:#bda4ff;--pink:#ff91bd;
  --good:#93e6a1;--bad:#ff9d9d;--shadow:0 20px 60px rgba(0,0,0,.28);
}
*{box-sizing:border-box}
html{background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{margin:0;min-height:100vh;background:
 radial-gradient(circle at 20% -10%,rgba(137,98,255,.16),transparent 35rem),
 radial-gradient(circle at 100% 10%,rgba(245,204,106,.08),transparent 30rem),
 linear-gradient(180deg,#120f1d,#0e0b15 80%)}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.48}
#app{max-width:1480px;margin:auto;min-height:100vh}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:22px 30px;border-bottom:1px solid rgba(255,255,255,.07);position:sticky;top:0;background:rgba(16,13,24,.9);backdrop-filter:blur(18px);z-index:20}
.brand{display:flex;gap:12px;align-items:center}.brand-mark{width:46px;height:46px;display:grid;place-items:center;border:1px solid var(--line);border-radius:14px;background:linear-gradient(145deg,var(--panel2),#161124);font-size:24px}
.brand h1{font-size:18px;margin:0;letter-spacing:.02em}.brand p{margin:2px 0 0;color:var(--muted);font-size:12px;letter-spacing:.16em;text-transform:uppercase}
.status-strip{display:flex;gap:8px}.stat-pill{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:12px;padding:7px 12px;min-width:100px;text-align:left}.stat-pill span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.1em}.stat-pill strong{font-size:14px}
.tabs{display:flex;padding:10px 30px;gap:6px;border-bottom:1px solid rgba(255,255,255,.06);position:sticky;top:91px;z-index:19;background:rgba(16,13,24,.88);backdrop-filter:blur(18px)}
.tab{border:0;background:transparent;color:var(--muted);padding:10px 15px;border-radius:10px}.tab:hover{background:rgba(255,255,255,.05);color:var(--text)}.tab.active{background:var(--panel2);color:var(--text);box-shadow:inset 0 0 0 1px var(--line)}
main{padding:26px 30px 60px}.view{display:none}.view.active{display:block}
.hero-card{display:flex;justify-content:space-between;gap:30px;align-items:center;padding:28px;border:1px solid var(--line);background:linear-gradient(120deg,rgba(189,164,255,.1),rgba(245,204,106,.06));border-radius:20px;margin-bottom:18px;overflow:hidden;position:relative}
.hero-card h2,.section-heading h2{font-size:clamp(24px,3vw,38px);margin:4px 0 8px;letter-spacing:-.035em}.hero-card p,.section-heading p{color:var(--muted);max-width:760px;margin:0;line-height:1.55}.eyebrow{font-size:10px;letter-spacing:.2em;text-transform:uppercase;color:var(--gold);font-weight:800}
.progress-ring-wrap{text-align:center}.progress-ring{--p:5%;width:92px;height:92px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--gold) var(--p),rgba(255,255,255,.08) 0);position:relative}.progress-ring:after{content:"";position:absolute;inset:8px;border-radius:50%;background:var(--bg2)}.progress-ring span{z-index:1;font-weight:800}.progress-ring-wrap small{color:var(--muted);display:block;margin-top:7px}
.lab-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,.65fr);gap:18px}.panel{border:1px solid var(--line);background:rgba(29,24,48,.84);border-radius:18px;padding:20px;box-shadow:var(--shadow)}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}.panel h3{margin:4px 0 12px;font-size:20px}.panel h4{margin:0 0 10px}
.crucible-panel{min-height:470px;position:relative;overflow:hidden}.slots-row{display:grid;grid-template-columns:1fr 48px 1fr;align-items:center;gap:10px;margin:24px auto 18px;max-width:700px}
.monster-slot{min-height:165px;border:1px dashed #665684;border-radius:18px;background:rgba(255,255,255,.025);color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:15px;transition:.2s}
.monster-slot:hover,.monster-slot.dragover{border-color:var(--gold);background:rgba(245,204,106,.06)}.monster-slot.filled{border-style:solid;background:linear-gradient(145deg,rgba(189,164,255,.1),rgba(255,255,255,.025));color:var(--text)}
.slot-plus{font-size:34px}.slot-label{font-size:13px}.slot-glyph{font-size:42px}.slot-name{font-weight:800;font-size:17px}.reaction-symbol{text-align:center;color:#6b6078;font-size:24px}
.catalyst-control{max-width:700px;margin:0 auto 14px;display:flex;justify-content:space-between;align-items:center;gap:15px;color:var(--muted);font-size:13px}.catalyst-control select,.codex-tools select,.search-wrap input,.codex-tools input{border:1px solid var(--line);background:#171222;color:var(--text);padding:10px 12px;border-radius:10px;outline:none}
.catalyst-control select{min-width:220px}.catalyst-control select:focus,input:focus,select:focus{border-color:#76629f}
.combine-btn{display:flex;align-items:center;justify-content:center;gap:9px;max-width:700px;width:100%;margin:auto;border:1px solid #7c683b;background:linear-gradient(180deg,#f3d37c,#d6aa4f);color:#211706;padding:14px;border-radius:12px;font-weight:900;box-shadow:0 10px 30px rgba(245,204,106,.1)}.combine-btn:not(:disabled):hover{filter:brightness(1.06);transform:translateY(-1px)}
.lab-message{text-align:center;color:var(--muted);font-size:13px;margin-top:12px;min-height:20px}.lab-message.success{color:var(--good)}.lab-message.fail{color:var(--bad)}
#particleCanvas{position:absolute;left:0;right:0;bottom:0;width:100%;height:160px;pointer-events:none;opacity:.85}
.objective{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid rgba(255,255,255,.06)}.objective:last-child{border-bottom:0}.objective-icon{width:28px;height:28px;border-radius:8px;background:var(--panel2);display:grid;place-items:center}.objective strong{display:block;font-size:13px}.objective span{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.mini-divider{height:1px;background:rgba(255,255,255,.07);margin:15px 0}.badge-wrap{display:flex;flex-wrap:wrap;gap:7px}.badge-wrap.center{justify-content:center}.badge{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);background:rgba(255,255,255,.035);padding:5px 8px;border-radius:999px;font-size:11px}.badge.locked{opacity:.45;filter:grayscale(1)}
.collection-panel{margin-top:18px}.collection-heading{align-items:end}.search-wrap input{width:min(320px,40vw)}.microcopy{color:var(--muted);font-size:12px;margin:4px 0 14px}
.monster-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.monster-grid.compact{grid-template-columns:repeat(auto-fill,minmax(138px,1fr));max-height:440px;overflow:auto;padding-right:5px}
.monster-card{position:relative;min-height:164px;border:1px solid var(--line);background:linear-gradient(145deg,#241d38,#171321);border-radius:14px;padding:13px;text-align:left;color:var(--text);overflow:hidden;transition:.16s}
.monster-card:hover{transform:translateY(-2px);border-color:#6c5a91}.monster-card .num{font-size:10px;color:var(--muted);letter-spacing:.1em}.monster-card .glyph{font-size:33px;margin:12px 0 9px;filter:drop-shadow(0 5px 8px rgba(0,0,0,.25))}.monster-card .name{font-weight:800;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.monster-card .meta{font-size:10px;color:var(--muted);margin-top:3px}.monster-card .rarity{position:absolute;right:8px;top:8px;width:7px;height:7px;border-radius:50%;background:#827794}.monster-card[data-rarity="Uncommon"] .rarity{background:#76c996}.monster-card[data-rarity="Rare"] .rarity{background:#75aef5}.monster-card[data-rarity="Epic"] .rarity{background:#c087ff}.monster-card[data-rarity="Mythic"] .rarity{background:#f5cc6a;box-shadow:0 0 12px rgba(245,204,106,.6)}
.monster-card.unknown{display:grid;place-items:center;text-align:center;background:#15111e;color:#5e5669}.unknown-shape{font-size:48px;filter:grayscale(1) blur(1px);opacity:.26}.unknown .num{position:absolute;top:10px;left:10px}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:24px;margin:0 0 18px}.codex-tools{display:flex;gap:8px}.codex-tools input{width:240px}
.codex-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
.research-bank{border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:10px 16px}.research-bank span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase}.research-bank strong{font-size:24px}
.research-layout{display:grid;grid-template-columns:1.1fr 1.2fr .9fr;gap:18px}.research-layout .panel>p{color:var(--muted);line-height:1.5}
.primary-btn,.ghost-btn{border-radius:10px;padding:10px 13px;font-weight:750}.primary-btn{border:1px solid #7c683b;background:var(--gold);color:#211706}.ghost-btn{border:1px solid var(--line);background:rgba(255,255,255,.03);color:var(--text)}.ghost-btn:hover{background:rgba(255,255,255,.07)}
.hint-card{margin-top:15px;border:1px solid #665684;border-radius:14px;padding:16px;background:rgba(189,164,255,.06);line-height:1.5}.hint-card.empty{color:var(--muted);border-style:dashed;background:transparent}.hint-card strong{color:var(--gold)}
.research-log{max-height:360px;overflow:auto}.log-entry{padding:10px 0;border-bottom:1px solid rgba(255,255,255,.06)}.log-entry strong{font-size:12px}.log-entry span{color:var(--muted);font-size:11px;display:block;margin-top:2px}
.catalyst-row{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.06)}.catalyst-row .cat-icon{font-size:21px}.catalyst-row strong{font-size:13px}.catalyst-row p{margin:2px 0;color:var(--muted);font-size:11px}.catalyst-row.locked{opacity:.45}
.battle-layout{display:grid;grid-template-columns:.72fr 1.5fr .72fr;gap:18px}.team-card{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:12px;margin-bottom:8px}.team-card .glyph{font-size:26px}.team-card strong{display:block;font-size:13px}.team-card span{font-size:10px;color:var(--muted)}
.battle-arena-panel{min-height:570px}.battle-empty{min-height:500px;display:grid;place-content:center;text-align:center;color:var(--muted)}.battle-empty h3{color:var(--text);margin:8px}.big-icon{font-size:54px}.hidden{display:none!important}
.rival-line{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:12px}
.fighter{border:1px solid var(--line);border-radius:15px;padding:14px;background:rgba(255,255,255,.025)}.fighter.enemy{background:rgba(255,145,189,.035)}.fighter-head{display:flex;justify-content:space-between;gap:15px}.fighter .glyph{font-size:40px}.fighter .name{font-weight:900}.fighter .aff{font-size:11px;color:var(--muted)}.hpbar{height:8px;border-radius:999px;background:#332b40;margin-top:10px;overflow:hidden}.hpbar>div{height:100%;background:linear-gradient(90deg,#7fcd92,#b9ec8f);transition:width .35s}.hptext{font-size:10px;color:var(--muted);text-align:right;margin-top:4px}
.battle-vs{text-align:center;color:#6f647b;font-weight:900;font-size:12px;padding:9px}.move-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.move-btn{border:1px solid var(--line);background:var(--panel2);color:var(--text);padding:10px;border-radius:10px}.move-btn span{display:block;font-size:10px;color:var(--muted);margin-top:2px}.swap-buttons{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}.swap-btn{border:1px solid var(--line);background:transparent;color:var(--muted);font-size:11px;padding:6px 8px;border-radius:8px}
.battle-log{height:105px;overflow:auto;background:#110e18;border-radius:10px;margin-top:10px;padding:9px;font-size:11px;color:var(--muted);line-height:1.5}.battle-log b{color:var(--text)}
.affinity-chart{display:grid;gap:7px}.affinity-row{font-size:11px;color:var(--muted);padding:8px;border:1px solid rgba(255,255,255,.06);border-radius:9px}.affinity-row strong{color:var(--text)}
footer{border-top:1px solid rgba(255,255,255,.07);padding:20px 30px 35px;display:flex;justify-content:space-between;color:var(--muted);font-size:11px}.link-btn{border:0;background:transparent;color:var(--violet);padding:4px 8px}.link-btn.danger{color:#e99999}.file-label{cursor:pointer}.file-label input{display:none}
.modal-backdrop{position:fixed;inset:0;background:rgba(6,4,10,.82);backdrop-filter:blur(12px);z-index:300;display:grid;place-items:center;padding:20px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.discovery-card,.detail-card{position:relative;width:min(600px,96vw);max-height:90vh;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;border:1px solid #725f96;background:linear-gradient(160deg,#2b2244,#171222 70%);border-radius:24px;padding:30px;text-align:center;box-shadow:0 35px 100px rgba(0,0,0,.5)}.discovery-number{color:var(--muted);font-size:12px;margin-top:9px}.discovery-glyph{font-size:78px;margin:14px 0;animation:pop .45s cubic-bezier(.2,.9,.3,1.3)}.discovery-card h2{font-size:36px;margin:0 0 10px}.discovery-card p{color:var(--muted);line-height:1.6}.modal-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:18px}
.detail-card{text-align:left}.modal-close{position:absolute;right:14px;top:12px;width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:var(--panel);color:var(--text);font-size:22px}.detail-hero{text-align:center}.detail-glyph{font-size:66px}.detail-card h2{font-size:30px;margin:5px 0}.detail-card .flavor{color:var(--muted);line-height:1.6}.stat-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin:16px 0}.stat-box{border:1px solid var(--line);border-radius:10px;padding:8px;text-align:center}.stat-box span{display:block;color:var(--muted);font-size:9px;text-transform:uppercase}.stat-box strong{font-size:14px}.formula-list{display:grid;gap:8px}.formula{border:1px solid var(--line);border-radius:10px;padding:10px;font-size:12px}.formula.unknown{color:var(--muted);filter:none;opacity:.55}
.great-symbol{font-size:82px;color:var(--gold);text-shadow:0 0 30px rgba(245,204,106,.35)}.great-work{border-color:var(--gold)}
.toast{position:fixed;right:22px;bottom:22px;z-index:200;background:#282037;border:1px solid #65537f;color:var(--text);padding:11px 14px;border-radius:11px;box-shadow:var(--shadow);font-size:12px;max-width:340px}
@keyframes pop{0%{transform:scale(.4) rotate(-8deg);opacity:0}100%{transform:scale(1);opacity:1}}
@media(max-width:1000px){
 .lab-grid,.battle-layout,.research-layout{grid-template-columns:1fr}.objectives-panel{order:-1}.battle-layout>section:first-child{order:2}.battle-layout>section:nth-child(2){order:1}.battle-layout>section:last-child{order:3}
}
@media(max-width:700px){
 .topbar{padding:14px 16px;position:relative}.status-strip{display:none}.tabs{top:0;padding:8px 12px;overflow:auto}.tab{white-space:nowrap}.brand-mark{width:40px;height:40px}.brand h1{font-size:16px}
 main{padding:18px 14px 45px}.hero-card,.section-heading{align-items:flex-start;flex-direction:column}.progress-ring-wrap{display:none}.slots-row{grid-template-columns:1fr 30px 1fr}.monster-slot{min-height:132px}.reaction-symbol{font-size:18px}
 .collection-heading{align-items:flex-start;flex-direction:column}.search-wrap,.search-wrap input,.codex-tools,.codex-tools input{width:100%}.codex-tools{flex-direction:column}.section-heading{gap:12px}.monster-grid,.monster-grid.compact,.codex-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .stat-grid{grid-template-columns:repeat(3,1fr)}.move-buttons{grid-template-columns:1fr}.catalyst-control{align-items:stretch;flex-direction:column}.catalyst-control select{width:100%}
 footer{padding:18px 14px;gap:10px;flex-direction:column}.discovery-card{padding:25px 18px}.discovery-card h2{font-size:29px}
}

/* Battle clarity + cooldown */
.battle-start-controls{display:flex;flex-direction:column;align-items:flex-end;gap:6px;min-width:250px}
.cooldown-text{color:var(--muted);font-size:10px;max-width:290px;text-align:right;line-height:1.35}
.combatant-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 11px;margin:9px 0 7px;border-radius:9px;font-size:11px;letter-spacing:.04em}
.combatant-banner strong{font-size:13px;letter-spacing:.14em}
.combatant-banner span{color:var(--muted);font-size:10px;letter-spacing:0}
.rival-banner{border:1px solid rgba(255,145,189,.34);background:rgba(255,145,189,.075)}
.rival-banner strong{color:var(--pink)}
.player-banner{border:1px solid rgba(245,204,106,.5);background:rgba(245,204,106,.09);box-shadow:0 0 0 1px rgba(245,204,106,.05) inset}
.player-banner strong{color:var(--gold)}
.fighter{position:relative}
.fighter.player{border-color:rgba(245,204,106,.55);background:linear-gradient(145deg,rgba(245,204,106,.10),rgba(255,255,255,.025));box-shadow:0 0 0 1px rgba(245,204,106,.05) inset}
.fighter.enemy{border-color:rgba(255,145,189,.28)}
.fighter-owner{position:absolute;right:10px;top:-9px;padding:2px 8px;border-radius:999px;background:var(--bg2);border:1px solid var(--line);font-size:9px;font-weight:900;letter-spacing:.12em}
.fighter.player .fighter-owner{color:var(--gold);border-color:rgba(245,204,106,.45)}
.fighter.enemy .fighter-owner{color:var(--pink);border-color:rgba(255,145,189,.35)}
.battle-status{text-align:center;color:var(--gold);font-weight:900;font-size:10px;letter-spacing:.14em;margin:12px 0 -3px}
@media(max-width:700px){.battle-start-controls{align-items:stretch;width:100%}.cooldown-text{text-align:left;max-width:none}.combatant-banner{align-items:flex-start;flex-direction:column;gap:2px}}
.move-btn.effective{border-color:rgba(147,230,161,.55);background:linear-gradient(180deg,rgba(147,230,161,.12),var(--panel2))}
.move-btn.effective span{color:var(--good);font-weight:800}

/* Mastery + secret variants */
.mastery-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.75fr);gap:18px}
.mastery-summary{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;max-width:460px}
.mastery-summary .badge{font-size:10px}
#masterySearch{border:1px solid var(--line);background:#171222;color:var(--text);padding:10px 12px;border-radius:10px;outline:none;width:250px}
.mastery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;max-height:690px;overflow:auto;padding-right:4px}
.mastery-card{border:1px solid var(--line);background:linear-gradient(145deg,#241d38,#171321);border-radius:14px;padding:13px;color:var(--text);text-align:left}
.mastery-card:hover{border-color:#6c5a91;transform:translateY(-1px)}
.mastery-card-head{display:flex;gap:10px;align-items:center}.mastery-card .glyph{font-size:30px}.mastery-card strong{display:block;font-size:13px}.mastery-card small{color:var(--muted);font-size:10px}
.mastery-rank{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;padding:3px 7px;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.09em;margin-top:7px}
.mastery-rank.Common{color:#d7d0df}.mastery-rank.Uncommon{color:#93e6a1;border-color:rgba(147,230,161,.35)}.mastery-rank.Rare{color:#86bdff;border-color:rgba(134,189,255,.4)}.mastery-rank.Epic{color:#c8a0ff;border-color:rgba(200,160,255,.4)}.mastery-rank.Mythic{color:var(--gold);border-color:rgba(245,204,106,.5);box-shadow:0 0 14px rgba(245,204,106,.08)}
.mastery-bar{height:7px;background:#332b40;border-radius:999px;overflow:hidden;margin:9px 0 5px}.mastery-bar>div{height:100%;background:linear-gradient(90deg,var(--violet),var(--gold));transition:width .25s}
.mastery-card-progress{display:flex;justify-content:space-between;color:var(--muted);font-size:9px}
.mastery-panel{border:1px solid var(--line);border-radius:14px;padding:14px;margin:14px 0;background:rgba(255,255,255,.025)}
.mastery-panel h3{margin:0 0 8px}.mastery-progress-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.mastery-progress-head strong{font-size:14px}.challenge-list{display:grid;gap:7px;margin-top:10px}.challenge{display:flex;justify-content:space-between;gap:12px;border:1px solid rgba(255,255,255,.06);padding:8px 9px;border-radius:9px;font-size:11px;color:var(--muted)}.challenge.complete{color:var(--good);border-color:rgba(147,230,161,.18)}.challenge b{color:inherit;white-space:nowrap}
.move-loadout{display:grid;gap:7px}.move-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;border:1px solid var(--line);padding:9px;border-radius:10px}.move-row.locked{opacity:.45}.move-row.equipped{border-color:rgba(245,204,106,.45);background:rgba(245,204,106,.04)}.move-row strong{display:block;font-size:12px}.move-row small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.move-row button{border:1px solid var(--line);background:transparent;color:var(--text);padding:6px 8px;border-radius:8px;font-size:10px}.move-row.equipped button{color:var(--gold)}
.variant-panel{min-height:390px}.variant-seal{display:grid;place-items:center;text-align:center;min-height:300px;color:var(--muted);border:1px dashed var(--line);border-radius:14px;padding:20px}.variant-seal .seal{font-size:44px;margin-bottom:8px}.variant-list{display:grid;gap:8px}.variant-row{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:11px;padding:10px}.variant-row .glyph{font-size:26px}.variant-row strong{font-size:12px;display:block}.variant-row span{font-size:10px;color:var(--muted)}
.variant-clue{border:1px dashed #665684;background:rgba(189,164,255,.04);padding:10px;border-radius:10px;font-size:11px;color:var(--muted);margin-top:9px;line-height:1.45}
.variant-form-grid{display:grid;gap:7px;margin-top:8px}.variant-form{border:1px solid var(--line);border-radius:10px;padding:9px;display:flex;justify-content:space-between;gap:12px;align-items:center}.variant-form strong{font-size:12px}.variant-form span{font-size:10px;color:var(--muted);display:block}.variant-form button{border:1px solid var(--line);background:transparent;color:var(--text);padding:6px 8px;border-radius:8px;font-size:10px}
.mastery-rank-display{font-size:28px;font-weight:950;color:var(--gold);letter-spacing:.08em;text-transform:uppercase;margin:5px 0 10px}.mastery-ascension-card{border-color:rgba(245,204,106,.6)}.variant-discovery-card{border-color:rgba(189,164,255,.7)}
.essence-meter{display:flex;gap:5px;align-items:center;margin-top:8px}.essence-meter span{width:16px;height:16px;border-radius:50%;border:1px solid #6f6480;background:#1b1625;display:grid;place-items:center;font-size:8px}.essence-meter span.filled{background:var(--gold);color:#211706;border-color:var(--gold);box-shadow:0 0 8px rgba(245,204,106,.2)}.essence-label{font-size:9px;color:var(--muted);margin-right:3px}
.move-btn.unaffordable{opacity:.42}.move-btn .move-cost{color:var(--gold)}
.monster-card .mastery-mini{margin-top:6px;font-size:9px;color:var(--violet);font-weight:800}
.slot-mastery{font-size:10px;color:var(--violet);font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.variant-equipped{color:var(--violet)!important}

@media(max-width:1000px){.mastery-layout{grid-template-columns:1fr}.variant-panel{order:-1}}
@media(max-width:700px){#masterySearch{width:100%}.mastery-grid{grid-template-columns:1fr}.mastery-summary{justify-content:flex-start}.move-row{grid-template-columns:1fr}.move-row button{width:100%}}

/* --- Team management + mobile polish --- */
.team-panel{display:grid;gap:8px}
.team-card{width:100%;min-height:64px;justify-content:flex-start;text-align:left;overflow:hidden}
.team-card>span:last-child{min-width:0;flex:1}
.team-card strong,.team-card>span:last-child>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fighter{width:100%;min-height:116px;display:flex;flex-direction:column;justify-content:center}
.fighter-head>div:first-child{min-width:0;flex:1}
.fighter .name,.fighter .aff{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-swap-card{width:min(520px,96vw)}
.team-swap-incoming{display:flex;align-items:center;gap:12px;border:1px solid rgba(245,204,106,.35);background:rgba(245,204,106,.06);border-radius:14px;padding:13px;margin:14px 0}
.team-swap-incoming .glyph,.team-swap-choice .glyph{font-size:30px;flex:0 0 auto}
.team-swap-incoming strong,.team-swap-choice strong{display:block}
.team-swap-incoming small,.team-swap-choice small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.team-swap-choices{display:grid;gap:8px}
.team-swap-choice{width:100%;min-height:64px;display:flex;align-items:center;gap:12px;text-align:left;border:1px solid var(--line);background:var(--panel2);color:var(--text);border-radius:12px;padding:11px 12px}
.team-swap-choice:hover{border-color:var(--gold);background:rgba(245,204,106,.07)}
.team-swap-choice>span:last-child{min-width:0}
.team-swap-choice strong,.team-swap-choice small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media(max-width:700px){
  body{overflow-x:hidden}
  main{padding:14px 10px 38px}
  .topbar{padding:12px 12px}
  .tabs{padding:7px 8px;gap:4px;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tab{padding:9px 11px;font-size:12px}
  .hero-card,.panel{border-radius:15px;padding:14px}
  .hero-card h2,.section-heading h2{font-size:24px}
  .hero-card p,.section-heading p{font-size:13px}
  .section-heading{margin-bottom:12px}
  .slots-row{gap:6px;margin:16px auto 12px}
  .monster-slot{min-height:118px;padding:10px}
  .slot-glyph{font-size:34px}.slot-name{font-size:14px}.slot-label{font-size:10px}.slot-mastery{font-size:8px}
  .monster-grid,.monster-grid.compact,.codex-grid{gap:7px}
  .monster-card{min-height:148px;padding:10px}
  .monster-card .glyph{font-size:29px;margin:10px 0 8px}
  .mastery-grid{max-height:none}
  .battle-arena-panel{padding:11px;min-height:0}
  .battle-empty{min-height:330px}
  .combatant-banner{padding:8px 10px;margin:6px 0}
  .fighter{min-height:112px;padding:13px 11px}
  .fighter .name{font-size:14px;padding-right:42px}
  .fighter .aff{font-size:9.5px}
  .fighter-owner{right:8px;top:-8px}
  .move-buttons{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .move-btn{min-height:68px;padding:9px 8px;font-size:12px;text-align:left}
  .move-btn span{font-size:9px;line-height:1.35}
  .swap-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .swap-btn{width:100%;padding:7px 4px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .battle-log{height:92px}
  .team-card{min-height:60px}
  .modal-backdrop{align-items:end;padding:max(8px,env(safe-area-inset-top)) 0 0;overflow-y:auto}
  .detail-card,.discovery-card{width:100%;max-width:none;max-height:calc(100dvh - max(8px,env(safe-area-inset-top)));min-height:0;overflow-y:auto;border-radius:20px 20px 0 0;padding:22px 15px calc(24px + env(safe-area-inset-bottom));scrollbar-gutter:stable}
  .detail-card h2{font-size:26px}
  .detail-glyph{font-size:56px}
  .modal-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .modal-actions>*{width:100%}
  .modal-actions>*:last-child:nth-child(odd){grid-column:1/-1}
  .stat-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .stat-box{padding:7px 4px}
  .mastery-panel{padding:11px;margin:11px 0}
  .mastery-progress-head{align-items:flex-start;flex-direction:column;gap:4px}
  .challenge{align-items:flex-start;flex-direction:column;gap:3px}
  .challenge b{white-space:normal}
  .move-row{padding:9px}
  .move-row small{line-height:1.4}
  .team-swap-card{width:100%}
  .team-swap-choice,.team-swap-incoming{min-height:60px}
}

@media(max-width:390px){
  .brand p{display:none}
  .brand h1{font-size:15px}
  .brand-mark{width:36px;height:36px}
  .tab{padding:8px 9px;font-size:11px}
  .monster-grid,.monster-grid.compact,.codex-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .monster-card .name{font-size:12px}
  .move-buttons{grid-template-columns:1fr 1fr}
}


/* --- Daily Discovery + sharing --- */
.daily-date-card{border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:10px 14px;min-width:170px}.daily-date-card span,.daily-date-card small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.daily-date-card strong{display:block;font-size:18px;margin:2px 0}.daily-date-card small.solved{color:var(--good);font-weight:900}
.daily-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(330px,.9fr);gap:18px}.daily-clue-panel,.daily-lab-panel{min-height:320px}.daily-clue{border:1px dashed #665684;background:rgba(189,164,255,.045);border-radius:14px;padding:18px;font-size:15px;line-height:1.65;margin:14px 0;color:#e6deef}.daily-meta{display:flex;gap:18px;flex-wrap:wrap;color:var(--muted);font-size:11px}.daily-meta small{color:#7e748b}.daily-result{border:1px solid rgba(147,230,161,.28);background:rgba(147,230,161,.055);border-radius:13px;padding:13px;margin:14px 0}.daily-result strong{display:block;font-size:16px;color:var(--good)}.daily-result span{display:block;color:var(--muted);font-size:11px;margin-top:3px}.daily-select-grid{display:grid;grid-template-columns:1fr 32px 1fr;align-items:end;gap:9px;margin:24px 0 14px}.daily-select-grid label{display:grid;gap:6px;color:var(--muted);font-size:11px}.daily-select-grid select{width:100%;border:1px solid var(--line);background:#171222;color:var(--text);padding:11px;border-radius:10px}.daily-submit{width:100%}.daily-notes-panel{margin-top:18px}.daily-rules{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.daily-rules>div{border:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.02);border-radius:11px;padding:12px}.daily-rules strong{display:block;font-size:12px;margin-bottom:4px}.daily-rules span{display:block;color:var(--muted);font-size:10.5px;line-height:1.45}
.share-modal-card{width:min(650px,96vw)}.share-card-preview{position:relative;overflow:hidden;aspect-ratio:1200/630;border-radius:18px;border:1px solid #6a588c;background:radial-gradient(circle at 18% 20%,rgba(189,164,255,.24),transparent 34%),radial-gradient(circle at 86% 12%,rgba(245,204,106,.15),transparent 30%),linear-gradient(145deg,#2b2244,#120e1c 72%);padding:28px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 18px 50px rgba(0,0,0,.28);margin:15px 0}.share-card-preview .share-brand{font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--gold);font-weight:900}.share-card-preview .share-main{display:flex;align-items:center;gap:18px;min-width:0}.share-card-preview .share-glyph{font-size:70px;line-height:1}.share-card-preview .share-copy{min-width:0}.share-card-preview .share-eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.12em;color:var(--violet);font-weight:900}.share-card-preview h3{margin:4px 0;font-size:clamp(22px,4vw,34px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.share-card-preview p{margin:0;color:var(--muted);font-size:12px;line-height:1.4}.share-card-preview .share-footer{display:flex;justify-content:space-between;gap:14px;color:#d5ccdf;font-size:10px}.share-card-preview .spoiler-line{margin-top:7px;color:var(--pink);font-weight:800}.spoiler-toggle{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:12px;margin:8px 0}.spoiler-toggle input{accent-color:var(--gold)}.share-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:12px}
@media(max-width:1000px){.daily-layout{grid-template-columns:1fr}.daily-rules{grid-template-columns:1fr}}@media(max-width:700px){.daily-date-card{width:100%}.daily-clue-panel,.daily-lab-panel{min-height:0}.daily-clue{font-size:13px;padding:14px}.daily-select-grid{grid-template-columns:1fr 24px 1fr}.daily-select-grid select{font-size:12px;padding:10px 7px}.share-card-preview{padding:17px}.share-card-preview .share-glyph{font-size:48px}.share-card-preview h3{font-size:22px}.share-actions{grid-template-columns:1fr}}

.status-strip{flex-wrap:wrap;justify-content:flex-end}
.detail-share-btn{margin-top:10px}

/* --- Creature sprite artwork integration --- */
.creature-visual{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;overflow:visible}
.creature-sprite{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 8px 12px rgba(0,0,0,.28));user-select:none;-webkit-user-drag:none}
.monster-card .glyph.creature-visual{width:100%;height:82px;margin:5px 0 7px}
.monster-card .glyph.creature-visual .creature-sprite{max-width:104px;margin:auto}
.monster-card:has(.creature-sprite){min-height:188px}
.slot-glyph.creature-visual{width:104px;height:104px;margin-bottom:3px}
.detail-glyph.creature-visual{width:170px;height:170px;margin:2px auto 7px}
.discovery-glyph.has-sprite{width:190px;height:190px;margin:8px auto 12px;display:flex;align-items:center;justify-content:center}
.discovery-glyph.has-sprite .creature-sprite{filter:drop-shadow(0 14px 22px rgba(0,0,0,.35));animation:pop .45s cubic-bezier(.2,.9,.3,1.3)}
.mastery-card .glyph.creature-visual{width:60px;height:60px}
.mastery-card-head>div:last-child{min-width:0}
.team-card .glyph.creature-visual,.team-swap-choice .glyph.creature-visual,#teamSwapIncoming .glyph.creature-visual{width:58px;height:58px}
.fighter-identity{display:flex;align-items:center;gap:12px;min-width:0}
.fighter-glyph{font-size:40px;display:inline-grid;place-items:center;flex:0 0 auto}
.fighter-glyph.creature-visual{width:82px;height:82px}
.fighter-identity>div:last-child{min-width:0}
.fighter .name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:280px}
.daily-result-creature{display:flex!important;align-items:center;gap:9px}
.daily-result-glyph.creature-visual{width:54px;height:54px}
.share-card-preview .share-glyph.creature-visual{width:132px;height:132px;flex:0 0 132px}

@media(max-width:700px){
  .monster-card .glyph.creature-visual{height:68px}
  .monster-card .glyph.creature-visual .creature-sprite{max-width:88px}
  .monster-card:has(.creature-sprite){min-height:166px}
  .slot-glyph.creature-visual{width:76px;height:76px}
  .detail-glyph.creature-visual{width:140px;height:140px}
  .discovery-glyph.has-sprite{width:150px;height:150px}
  .fighter-glyph.creature-visual{width:68px;height:68px}
  .fighter-identity{gap:9px}
  .fighter .name{max-width:180px}
  .share-card-preview .share-glyph.creature-visual{width:88px;height:88px;flex-basis:88px}
}

/* --- Sprite polish pass: scaling, hover animation, battle idle, and variant treatments --- */
.creature-visual{position:relative;isolation:isolate}
.creature-sprite{object-position:center bottom;transform-origin:center bottom;transition:transform .22s ease,filter .22s ease,opacity .22s ease}

.monster-card .glyph.creature-visual{height:88px}
.monster-card .glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:112px;max-height:100%;object-position:center 82%}
.slot-glyph.creature-visual{width:112px;height:112px}
.slot-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;transform:translateY(3px) scale(1.08)}
.detail-glyph.creature-visual{width:184px;height:184px}
.detail-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 84%;transform:translateY(5px) scale(1.05)}
.discovery-glyph.has-sprite{width:200px;height:200px}
.discovery-glyph.has-sprite .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 84%;transform:translateY(5px) scale(1.06)}
.mastery-card .glyph.creature-visual{width:64px;height:64px}
.mastery-card .glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;transform:translateY(2px) scale(1.04)}
.team-card .glyph.creature-visual,.team-swap-choice .glyph.creature-visual,#teamSwapIncoming .glyph.creature-visual{width:62px;height:62px}
.team-card .glyph.creature-visual .creature-sprite,.team-swap-choice .glyph.creature-visual .creature-sprite,#teamSwapIncoming .glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;transform:translateY(2px) scale(1.04)}
.fighter-glyph.creature-visual{width:90px;height:90px}
.fighter-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 86%}
.daily-result-glyph.creature-visual{width:60px;height:60px}
.daily-result-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;transform:translateY(2px) scale(1.04)}
.share-card-preview .share-glyph.creature-visual{width:142px;height:142px;flex:0 0 142px}
.share-card-preview .share-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 84%;transform:translateY(4px) scale(1.05)}

@keyframes sprite-hover-float{0%{transform:translateY(2px) scale(1.03)}50%{transform:translateY(-3px) scale(1.08)}100%{transform:translateY(0) scale(1.05)}}
@keyframes battle-idle-player{0%{transform:translateY(1px) scale(1)}5%{transform:translateY(-1px) scale(1.01)}25%{transform:translateY(-4px) scale(1.03)}50%{transform:translateY(0) scale(1)}75%{transform:translateY(-2px) scale(1.02)}100%{transform:translateY(1px) scale(1)}}
@keyframes battle-idle-rival{0%{transform:translateY(0) scale(1)}20%{transform:translateY(-3px) scale(1.02)}40%{transform:translateY(1px) scale(1)}60%{transform:translateY(-2px) scale(1.025)}100%{transform:translateY(0) scale(1)}}

.monster-card:hover .creature-sprite,
.mastery-card:hover .creature-sprite,
.team-card:hover .creature-sprite,
.team-swap-choice:hover .creature-sprite,
.variant-row:hover .creature-sprite,
.variant-form:hover .creature-sprite,
.daily-result:hover .creature-sprite{
  animation:sprite-hover-float 1.1s ease-in-out infinite;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.28)) brightness(1.06);
}

.fighter.player .fighter-glyph.creature-visual .creature-sprite{animation:battle-idle-player 1.9s ease-in-out infinite;filter:drop-shadow(0 14px 18px rgba(245,204,106,.12)) drop-shadow(0 8px 12px rgba(0,0,0,.25))}
.fighter.enemy .fighter-glyph.creature-visual .creature-sprite{animation:battle-idle-rival 2.15s ease-in-out infinite;filter:drop-shadow(0 14px 18px rgba(255,145,189,.11)) drop-shadow(0 8px 12px rgba(0,0,0,.25))}

.creature-visual.variant-treated::after{content:"";position:absolute;inset:12% 10% 14%;border-radius:999px;opacity:.4;filter:blur(12px);pointer-events:none;z-index:0;background:var(--variant-glow,rgba(189,164,255,.22))}
.creature-visual.variant-treated .creature-sprite{position:relative;z-index:1}
.creature-visual.variant-treated[data-treatment="azure"]{--variant-glow:rgba(86,194,255,.30)}
.creature-visual.variant-treated[data-treatment="azure"] .creature-sprite{filter:hue-rotate(145deg) saturate(1.38) brightness(1.08) drop-shadow(0 10px 18px rgba(86,194,255,.26))}
.creature-visual.variant-treated[data-treatment="mirror"]{--variant-glow:rgba(220,236,255,.26)}
.creature-visual.variant-treated[data-treatment="mirror"] .creature-sprite{filter:grayscale(.18) contrast(1.18) brightness(1.15) drop-shadow(0 10px 18px rgba(210,228,255,.22))}
.creature-visual.variant-treated[data-treatment="gilded"]{--variant-glow:rgba(245,204,106,.34)}
.creature-visual.variant-treated[data-treatment="gilded"] .creature-sprite{filter:sepia(.6) saturate(1.48) hue-rotate(-12deg) brightness(1.08) drop-shadow(0 10px 18px rgba(245,204,106,.28))}
.creature-visual.variant-treated[data-treatment="obsidian"]{--variant-glow:rgba(112,90,132,.25)}
.creature-visual.variant-treated[data-treatment="obsidian"] .creature-sprite{filter:grayscale(.78) contrast(1.34) brightness(.82) drop-shadow(0 10px 18px rgba(90,76,110,.28))}
.creature-visual.variant-treated[data-treatment="tempest"]{--variant-glow:rgba(124,228,255,.28)}
.creature-visual.variant-treated[data-treatment="tempest"] .creature-sprite{filter:hue-rotate(168deg) saturate(1.42) brightness(1.05) drop-shadow(0 10px 18px rgba(124,228,255,.24))}
.creature-visual.variant-treated[data-treatment="neon"]{--variant-glow:rgba(145,255,198,.30)}
.creature-visual.variant-treated[data-treatment="neon"] .creature-sprite{filter:saturate(1.75) brightness(1.15) hue-rotate(18deg) drop-shadow(0 10px 18px rgba(145,255,198,.24))}
.creature-visual.variant-treated[data-treatment="hollow"]{--variant-glow:rgba(222,231,255,.18)}
.creature-visual.variant-treated[data-treatment="hollow"] .creature-sprite{filter:grayscale(.34) brightness(.92) contrast(1.18) drop-shadow(0 10px 18px rgba(206,218,255,.18))}
.creature-visual.variant-treated[data-treatment="eclipse"]{--variant-glow:rgba(177,115,255,.28)}
.creature-visual.variant-treated[data-treatment="eclipse"] .creature-sprite{filter:hue-rotate(295deg) brightness(.86) saturate(1.2) drop-shadow(0 10px 18px rgba(177,115,255,.24))}
.creature-visual.variant-treated[data-treatment="prismatic"]{--variant-glow:rgba(255,175,238,.28)}
.creature-visual.variant-treated[data-treatment="prismatic"] .creature-sprite{filter:hue-rotate(28deg) saturate(1.55) brightness(1.08) drop-shadow(0 10px 18px rgba(255,175,238,.22))}
.creature-visual.variant-treated[data-treatment="ancient"]{--variant-glow:rgba(202,165,116,.26)}
.creature-visual.variant-treated[data-treatment="ancient"] .creature-sprite{filter:sepia(.42) contrast(1.08) brightness(.98) drop-shadow(0 10px 18px rgba(202,165,116,.20))}
.creature-visual.variant-treated[data-treatment="velvet"]{--variant-glow:rgba(245,132,194,.22)}
.creature-visual.variant-treated[data-treatment="velvet"] .creature-sprite{filter:hue-rotate(320deg) saturate(1.18) brightness(.98) drop-shadow(0 10px 18px rgba(245,132,194,.18))}
.creature-visual.variant-treated[data-treatment="runic"]{--variant-glow:rgba(146,190,255,.26)}
.creature-visual.variant-treated[data-treatment="runic"] .creature-sprite{filter:hue-rotate(220deg) saturate(1.25) brightness(1.08) drop-shadow(0 10px 18px rgba(146,190,255,.22))}
.creature-visual.variant-treated[data-treatment="ghostlight"]{--variant-glow:rgba(175,242,255,.24)}
.creature-visual.variant-treated[data-treatment="ghostlight"] .creature-sprite{filter:hue-rotate(190deg) saturate(1.12) brightness(1.18) drop-shadow(0 10px 18px rgba(175,242,255,.22))}
.creature-visual.variant-treated[data-treatment="celestial"]{--variant-glow:rgba(151,226,255,.28)}
.creature-visual.variant-treated[data-treatment="celestial"] .creature-sprite{filter:hue-rotate(185deg) saturate(1.24) brightness(1.16) drop-shadow(0 10px 18px rgba(151,226,255,.24))}
.creature-visual.variant-treated[data-treatment="clockwork"]{--variant-glow:rgba(215,174,112,.26)}
.creature-visual.variant-treated[data-treatment="clockwork"] .creature-sprite{filter:sepia(.5) saturate(1.3) contrast(1.08) drop-shadow(0 10px 18px rgba(215,174,112,.22))}
.creature-visual.variant-treated[data-treatment="frosted"]{--variant-glow:rgba(197,240,255,.30)}
.creature-visual.variant-treated[data-treatment="frosted"] .creature-sprite{filter:hue-rotate(170deg) saturate(.96) brightness(1.18) drop-shadow(0 10px 18px rgba(197,240,255,.24))}
.creature-visual.variant-treated[data-treatment="solar"]{--variant-glow:rgba(255,212,116,.34)}
.creature-visual.variant-treated[data-treatment="solar"] .creature-sprite{filter:sepia(.72) saturate(1.62) brightness(1.12) drop-shadow(0 10px 18px rgba(255,212,116,.28))}
.creature-visual.variant-treated[data-treatment="umbral"]{--variant-glow:rgba(156,122,222,.26)}
.creature-visual.variant-treated[data-treatment="umbral"] .creature-sprite{filter:hue-rotate(292deg) saturate(1.25) brightness(.84) drop-shadow(0 10px 18px rgba(156,122,222,.22))}
.creature-visual.variant-treated[data-treatment="glass"]{--variant-glow:rgba(209,244,255,.26)}
.creature-visual.variant-treated[data-treatment="glass"] .creature-sprite{filter:contrast(1.12) brightness(1.14) saturate(.92) drop-shadow(0 10px 18px rgba(209,244,255,.20))}
.creature-visual.variant-treated[data-treatment="meteoric"]{--variant-glow:rgba(255,170,118,.24)}
.creature-visual.variant-treated[data-treatment="meteoric"] .creature-sprite{filter:hue-rotate(10deg) saturate(1.3) brightness(1.05) drop-shadow(0 10px 18px rgba(255,170,118,.22))}
.creature-visual.variant-treated[data-treatment="wild"]{--variant-glow:rgba(161,245,146,.24)}
.creature-visual.variant-treated[data-treatment="wild"] .creature-sprite{filter:saturate(1.35) contrast(1.15) drop-shadow(0 10px 18px rgba(161,245,146,.18))}
.creature-visual.variant-treated[data-treatment="voidtouched"]{--variant-glow:rgba(153,108,230,.26)}
.creature-visual.variant-treated[data-treatment="voidtouched"] .creature-sprite{filter:hue-rotate(270deg) saturate(1.42) brightness(.8) drop-shadow(0 10px 18px rgba(153,108,230,.22))}
.creature-visual.variant-treated[data-treatment="dreaming"]{--variant-glow:rgba(197,148,255,.28)}
.creature-visual.variant-treated[data-treatment="dreaming"] .creature-sprite{filter:hue-rotate(245deg) saturate(1.22) brightness(1.12) drop-shadow(0 10px 18px rgba(197,148,255,.22))}
.creature-visual.variant-treated[data-treatment="perfected"]{--variant-glow:rgba(255,230,162,.32)}
.creature-visual.variant-treated[data-treatment="perfected"] .creature-sprite{filter:saturate(1.25) brightness(1.12) contrast(1.08) drop-shadow(0 10px 18px rgba(255,230,162,.26))}
.creature-visual.variant-treated[data-treatment="secret"]{--variant-glow:rgba(189,164,255,.24)}
.creature-visual.variant-treated[data-treatment="secret"] .creature-sprite{filter:saturate(1.15) brightness(1.06) drop-shadow(0 10px 18px rgba(189,164,255,.18))}

@media(max-width:700px){
  .monster-card .glyph.creature-visual{height:72px}
  .monster-card .glyph.creature-visual .creature-sprite{max-width:92px}
  .slot-glyph.creature-visual{width:82px;height:82px}
  .detail-glyph.creature-visual{width:150px;height:150px}
  .discovery-glyph.has-sprite{width:160px;height:160px}
  .fighter-glyph.creature-visual{width:72px;height:72px}
  .share-card-preview .share-glyph.creature-visual{width:94px;height:94px;flex-basis:94px}
}

/* --- Creature Lab pixel-art branding --- */
.brand{min-width:205px}
.brand-logo{display:block;width:176px;height:auto;max-height:70px;object-fit:contain;object-position:left center;image-rendering:auto;filter:drop-shadow(0 8px 16px rgba(0,0,0,.3));transition:transform .2s ease,filter .2s ease}
.brand:hover .brand-logo{transform:translateY(-1px) scale(1.015);filter:drop-shadow(0 11px 18px rgba(0,0,0,.35)) brightness(1.03)}
.brand-tagline{font-size:9px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:800;margin-left:4px;margin-top:-2px;white-space:nowrap}
@media(max-width:900px){.brand-logo{width:154px;max-height:62px}.brand{min-width:180px}}
@media(max-width:700px){.brand{min-width:0}.brand-logo{width:126px;max-height:54px}.brand-tagline{font-size:7px;letter-spacing:.11em;margin-top:-1px}}

/* --- Mastery page hierarchy + spacing polish --- */
.mastery-controls{display:flex;flex-direction:column;align-items:stretch;width:min(440px,42vw)}
#masterySearch{width:100%;border:1px solid var(--line);background:#171222;color:var(--text);padding:11px 13px;border-radius:10px;outline:none}
#masterySearch:focus{border-color:#76629f}
.mastery-controls .mastery-summary{margin-top:14px;padding-top:2px;justify-content:flex-start;gap:8px;max-width:none}
.mastery-controls .mastery-summary .badge{padding:6px 9px;background:rgba(255,255,255,.03)}

.mastery-card{display:flex;flex-direction:column;min-height:205px}
.mastery-card-head{padding-bottom:10px;border-bottom:1px solid rgba(255,255,255,.065)}
.mastery-card-identity{min-width:0}
.mastery-card-identity strong{font-size:14px}
.mastery-card-identity small{display:block;margin-top:3px;letter-spacing:.08em}
.mastery-card-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:end;padding:11px 0 3px}
.mastery-meta-group{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.mastery-rank-group{align-items:flex-end}
.mastery-meta-label{font-size:8px;font-weight:900;letter-spacing:.16em;text-transform:uppercase;color:#817890}
.affinity-chips{display:flex;flex-wrap:wrap;gap:5px}
.affinity-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:999px;padding:4px 7px;font-size:9px;font-weight:800;line-height:1;background:rgba(255,255,255,.025)}
.affinity-ember{color:#ff9a70;border-color:rgba(255,122,69,.32);background:rgba(255,122,69,.07)}
.affinity-tide{color:#7cc8ff;border-color:rgba(88,185,255,.32);background:rgba(88,185,255,.07)}
.affinity-bloom{color:#9ae58e;border-color:rgba(121,213,111,.32);background:rgba(121,213,111,.07)}
.affinity-stone{color:#c0b2a8;border-color:rgba(169,154,143,.34);background:rgba(169,154,143,.07)}
.affinity-gale{color:#b9f4ef;border-color:rgba(158,232,227,.30);background:rgba(158,232,227,.065)}
.affinity-spark{color:#ffe27c;border-color:rgba(255,217,90,.30);background:rgba(255,217,90,.07)}
.affinity-gloom{color:#bba4ef;border-color:rgba(159,130,223,.34);background:rgba(159,130,223,.08)}
.affinity-gleam{color:#fff0b5;border-color:rgba(255,233,160,.30);background:rgba(255,233,160,.07)}
.mastery-card .mastery-rank{margin-top:0;padding:4px 8px}
.mastery-card .mastery-bar{margin-top:auto}

@media(max-width:1000px){
  .mastery-controls{width:100%;max-width:540px}
  .mastery-controls .mastery-summary{justify-content:flex-start}
}
@media(max-width:700px){
  .mastery-controls{width:100%;max-width:none}
  .mastery-controls .mastery-summary{margin-top:16px;gap:7px}
  .mastery-controls .mastery-summary .badge{padding:6px 8px}
  .mastery-card{min-height:198px}
  .mastery-card-meta{grid-template-columns:1fr;gap:10px;align-items:start}
  .mastery-rank-group{align-items:flex-start}
}

/* --- Rival team scouting --- */
.rival-roster-wrap{margin:8px 0 12px;padding:10px;border:1px solid rgba(255,145,189,.18);background:rgba(255,145,189,.035);border-radius:12px}
.rival-roster-label{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:8px}
.rival-roster-label strong{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:var(--pink)}
.rival-roster-label span{font-size:9px;color:var(--muted)}
.rival-team-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.rival-roster-card{position:relative;min-width:0;min-height:88px;padding:8px 7px 7px;border:1px solid var(--line);border-radius:10px;background:rgba(16,13,24,.62);display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:2px 7px;align-items:center;overflow:hidden;transition:border-color .18s ease,background .18s ease,transform .18s ease}
.rival-roster-card.active{border-color:rgba(255,145,189,.58);background:linear-gradient(145deg,rgba(255,145,189,.11),rgba(16,13,24,.72));box-shadow:0 0 0 1px rgba(255,145,189,.04) inset}
.rival-roster-card.fainted{opacity:.45;filter:grayscale(.65)}
.rival-roster-status{grid-column:1/-1;font-size:8px;font-weight:950;letter-spacing:.12em;color:var(--muted)}
.rival-roster-card.active .rival-roster-status{color:var(--pink)}
.rival-roster-card.fainted .rival-roster-status{color:#a69cac}
.rival-roster-glyph.creature-visual{width:46px;height:46px;grid-row:2;grid-column:1}
.rival-roster-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 86%}
.rival-roster-copy{grid-row:2;grid-column:2;min-width:0}
.rival-roster-copy strong,.rival-roster-copy span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rival-roster-copy strong{font-size:10px;color:var(--text)}
.rival-roster-copy span{font-size:8px;color:var(--muted);margin-top:2px}
.rival-roster-hp{grid-column:1/-1;height:4px;border-radius:999px;background:#332b40;overflow:hidden;margin-top:2px}
.rival-roster-hp span{display:block;height:100%;background:linear-gradient(90deg,#7fcd92,#b9ec8f);transition:width .3s ease}
.rival-roster-card.active .creature-sprite{animation:battle-idle-rival 2.15s ease-in-out infinite}

@media(max-width:700px){
  .rival-roster-wrap{padding:8px;margin:6px 0 9px}
  .rival-roster-label{align-items:flex-start;flex-direction:column;gap:2px;margin-bottom:7px}
  .rival-team-panel{gap:5px}
  .rival-roster-card{min-height:98px;grid-template-columns:1fr;grid-template-rows:auto 48px auto 4px;text-align:center;padding:7px 4px 6px;gap:2px}
  .rival-roster-status{grid-row:1;grid-column:1;font-size:7px}
  .rival-roster-glyph.creature-visual{grid-row:2;grid-column:1;width:100%;height:48px}
  .rival-roster-copy{grid-row:3;grid-column:1;min-width:0}
  .rival-roster-copy strong{font-size:9px}
  .rival-roster-copy span{font-size:7px}
  .rival-roster-hp{grid-row:4;grid-column:1}
}

/* --- Player team battle scouting + team edit lock --- */
.team-locked-hint{color:var(--gold)!important;font-weight:850;letter-spacing:.04em}
.player-roster-wrap{margin:8px 0 12px;padding:10px;border:1px solid rgba(245,204,106,.20);background:rgba(245,204,106,.04);border-radius:12px}
.player-roster-label{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:8px}
.player-roster-label strong{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:var(--gold)}
.player-roster-label span{font-size:9px;color:var(--muted)}
.player-team-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.player-roster-card{position:relative;min-width:0;min-height:88px;padding:8px 7px 7px;border:1px solid var(--line);border-radius:10px;background:rgba(16,13,24,.62);display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:2px 7px;align-items:center;overflow:hidden;transition:border-color .18s ease,background .18s ease,transform .18s ease}
.player-roster-card.active{border-color:rgba(245,204,106,.62);background:linear-gradient(145deg,rgba(245,204,106,.12),rgba(16,13,24,.72));box-shadow:0 0 0 1px rgba(245,204,106,.05) inset}
.player-roster-card.fainted{opacity:.45;filter:grayscale(.65)}
.player-roster-status{grid-column:1/-1;font-size:8px;font-weight:950;letter-spacing:.12em;color:var(--muted)}
.player-roster-card.active .player-roster-status{color:var(--gold)}
.player-roster-card.fainted .player-roster-status{color:#a69cac}
.player-roster-glyph.creature-visual{width:46px;height:46px;grid-row:2;grid-column:1}
.player-roster-glyph.creature-visual .creature-sprite{width:auto;height:100%;max-width:100%;object-position:center 86%}
.player-roster-copy{grid-row:2;grid-column:2;min-width:0}
.player-roster-copy strong,.player-roster-copy span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-roster-copy strong{font-size:10px;color:var(--text)}
.player-roster-copy span{font-size:8px;color:var(--muted);margin-top:2px}
.player-roster-hp{grid-column:1/-1;height:4px;border-radius:999px;background:#332b40;overflow:hidden;margin-top:2px}
.player-roster-hp span{display:block;height:100%;background:linear-gradient(90deg,#7fcd92,#b9ec8f);transition:width .3s ease}
.player-roster-card.active .creature-sprite{animation:battle-idle-player 1.9s ease-in-out infinite}

@media(max-width:700px){
  .player-roster-wrap{padding:8px;margin:6px 0 9px}
  .player-roster-label{align-items:flex-start;flex-direction:column;gap:2px;margin-bottom:7px}
  .player-team-panel{gap:5px}
  .player-roster-card{min-height:98px;grid-template-columns:1fr;grid-template-rows:auto 48px auto 4px;text-align:center;padding:7px 4px 6px;gap:2px}
  .player-roster-status{grid-row:1;grid-column:1;font-size:7px}
  .player-roster-glyph.creature-visual{grid-row:2;grid-column:1;width:100%;height:48px}
  .player-roster-copy{grid-row:3;grid-column:1;min-width:0}
  .player-roster-copy strong{font-size:9px}
  .player-roster-copy span{font-size:7px}
  .player-roster-hp{grid-row:4;grid-column:1}
}

/* --- Strategic battle statuses --- */
.status-chips{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px;min-height:20px}
.status-chips.compact{gap:3px;margin-top:4px;min-height:0}
.status-chip{display:inline-flex;align-items:center;gap:3px;border:1px solid var(--line);background:rgba(255,255,255,.045);border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850;letter-spacing:.02em;white-space:nowrap}
.status-chips.compact .status-chip{padding:2px 5px;font-size:9px}
.status-burn{color:#ffab7c;border-color:rgba(255,122,69,.38)!important;background:rgba(255,122,69,.08)!important}
.status-soak{color:#88d1ff;border-color:rgba(88,185,255,.38)!important;background:rgba(88,185,255,.08)!important}
.status-root{color:#9de392;border-color:rgba(121,213,111,.38)!important;background:rgba(121,213,111,.08)!important}
.status-guard{color:#d8c9bf;border-color:rgba(169,154,143,.44)!important;background:rgba(169,154,143,.09)!important}
.status-haste{color:#bff4ef;border-color:rgba(158,232,227,.4)!important;background:rgba(158,232,227,.08)!important}
.status-charge{color:#ffe383;border-color:rgba(255,217,90,.42)!important;background:rgba(255,217,90,.08)!important}
.status-hex{color:#c8afff;border-color:rgba(159,130,223,.42)!important;background:rgba(159,130,223,.09)!important}
.move-btn{min-height:78px;text-align:left;display:flex;flex-direction:column;justify-content:center;gap:3px}
.move-btn>strong{font-size:12px}
.move-btn>span{display:block}
.move-btn .move-tactics{font-size:9px;color:#cfc6dd;line-height:1.25}
.move-btn.unaffordable .move-tactics{opacity:.6}
.affinity-row{display:flex;flex-direction:column;gap:2px}
.affinity-row>span{color:#d8d0e4;font-size:10px}
.affinity-row>small{color:#82788f;font-size:9px}

/* --- Battle impact feedback --- */
#enemyFighter,#playerFighter{position:relative;overflow:visible}
@keyframes hit-jolt{0%,100%{transform:translateX(0)}22%{transform:translateX(-6px)}45%{transform:translateX(5px)}65%{transform:translateX(-2px)}}
@keyframes crit-jolt{0%,100%{transform:scale(1) rotate(0)}20%{transform:scale(1.025) rotate(-1deg)}45%{transform:scale(.985) rotate(1deg)}70%{transform:scale(1.01)}}
@keyframes evade-slide{0%,100%{transform:translateX(0);opacity:1}45%{transform:translateX(18px);opacity:.35}}
.fighter.battle-hit{animation:hit-jolt .34s ease}
.fighter.battle-critical{animation:crit-jolt .42s ease;box-shadow:0 0 0 2px rgba(255,217,90,.32),0 0 35px rgba(255,217,90,.18)}
.fighter.battle-effective-hit{background-image:radial-gradient(circle at 50% 30%,rgba(147,230,161,.13),transparent 55%)}
.fighter.battle-evade{animation:evade-slide .38s ease}
.damage-pop,.status-pop{position:absolute;z-index:25;pointer-events:none;font-weight:950;text-shadow:0 2px 8px rgba(0,0,0,.85)}
.damage-pop{right:18px;top:38%;font-size:24px;color:#ffb1b1;animation:damage-rise .85s ease-out forwards}
.damage-pop.critical{font-size:30px;color:#ffe383}
.damage-pop.effective{color:#aef0b7}
.status-pop{left:50%;top:12%;font-size:12px;transform:translateX(-50%);animation:status-rise 1.05s ease-out forwards;border:1px solid currentColor;border-radius:999px;padding:4px 8px;background:#171222}
@keyframes damage-rise{0%{transform:translateY(8px) scale(.75);opacity:0}20%{transform:translateY(0) scale(1.15);opacity:1}100%{transform:translateY(-36px) scale(.96);opacity:0}}
@keyframes status-rise{0%{transform:translate(-50%,7px) scale(.86);opacity:0}20%{transform:translate(-50%,0) scale(1);opacity:1}100%{transform:translate(-50%,-22px);opacity:0}}

/* --- Milestone celebration feedback --- */
.celebration-layer{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:350}
.celebration-layer i{position:absolute;left:var(--x);top:18%;width:7px;height:13px;border-radius:2px;background:var(--c);box-shadow:0 0 8px color-mix(in srgb,var(--c) 65%,transparent);animation:celebration-fall var(--dur) cubic-bezier(.15,.75,.4,1) var(--delay) forwards;opacity:0}
.celebration-variant i:nth-child(3n){border-radius:50%;width:8px;height:8px}
.celebration-great i{width:9px;height:16px}
@keyframes celebration-fall{0%{transform:translate(0,-20px) rotate(0);opacity:0}15%{opacity:1}100%{transform:translate(var(--dx),72vh) rotate(var(--r));opacity:0}}

@media(max-width:700px){
  .move-btn{min-height:72px;padding:8px}
  .move-btn>strong{font-size:11px}
  .move-btn>span{font-size:9px}
  .damage-pop{font-size:20px}
  .status-chip{font-size:8px;padding:2px 5px}
}
@media(prefers-reduced-motion:reduce){
  .celebration-layer{display:none}
  .fighter.battle-hit,.fighter.battle-critical,.fighter.battle-evade{animation:none!important}
  .damage-pop,.status-pop{animation:none!important}
}
.move-description{display:block;color:#c7bed3;font-size:9px;line-height:1.35;margin-top:4px;max-width:620px}

/* --- PWA install + update UI --- */
.footer-save-copy{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.pwa-version{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:#71677e;border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:3px 6px}.pwa-update-banner{position:fixed;left:50%;bottom:18px;z-index:220;width:min(680px,calc(100vw - 28px));transform:translateX(-50%);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 15px;border:1px solid rgba(245,204,106,.48);border-radius:14px;background:rgba(23,19,36,.96);backdrop-filter:blur(18px);box-shadow:0 20px 65px rgba(0,0,0,.48)}.pwa-update-banner[hidden]{display:none}.pwa-update-banner strong{display:block;color:var(--gold);font-size:13px}.pwa-update-banner span{display:block;color:var(--muted);font-size:10.5px;line-height:1.4;margin-top:3px}.pwa-update-actions{display:flex;gap:7px;flex:0 0 auto}.pwa-update-actions button{white-space:nowrap}.pwa-standalone body{overscroll-behavior-y:none}
@media(max-width:700px){.pwa-update-banner{align-items:stretch;flex-direction:column;bottom:10px}.pwa-update-actions{display:grid;grid-template-columns:1fr 1fr}.pwa-update-actions button{width:100%}}

/* --- Playtest export + stronger install CTA --- */
.playtest-export-btn{border:1px solid rgba(189,164,255,.28)!important;background:rgba(189,164,255,.055)!important;color:#d9caff!important}
.playtest-export-btn:hover{border-color:rgba(189,164,255,.55)!important;background:rgba(189,164,255,.11)!important}

.pwa-install-cta{position:fixed;right:18px;bottom:18px;z-index:205;display:flex;align-items:center;gap:10px;border:1px solid rgba(245,204,106,.72);border-radius:15px;padding:10px 14px 10px 11px;background:linear-gradient(145deg,#f5d67c,#d9a840);color:#241706;box-shadow:0 14px 42px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.18) inset,0 0 30px rgba(245,204,106,.16);font-weight:900;text-align:left;transition:transform .18s ease,filter .18s ease,box-shadow .18s ease;animation:install-cta-pulse 2.8s ease-in-out infinite}
.pwa-install-cta[hidden]{display:none!important}
.pwa-install-cta:hover{transform:translateY(-3px) scale(1.02);filter:brightness(1.05);box-shadow:0 18px 52px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.24) inset,0 0 42px rgba(245,204,106,.25)}
.pwa-install-cta:active{transform:translateY(-1px) scale(.99)}
.pwa-install-cta .install-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:rgba(34,23,6,.12);font-size:20px;line-height:1;box-shadow:inset 0 0 0 1px rgba(34,23,6,.10)}
.pwa-install-cta strong{display:block;font-size:13px;line-height:1.15;letter-spacing:.01em}
.pwa-install-cta small{display:block;font-size:9px;line-height:1.25;margin-top:3px;opacity:.7;font-weight:750;white-space:nowrap}
@keyframes install-cta-pulse{0%,100%{box-shadow:0 14px 42px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.18) inset,0 0 22px rgba(245,204,106,.11)}50%{box-shadow:0 14px 42px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.18) inset,0 0 40px rgba(245,204,106,.24)}}
@media(max-width:700px){
  .pwa-install-cta{left:12px;right:12px;bottom:12px;justify-content:center;padding:10px 13px}
  .pwa-install-cta small{white-space:normal}
}
@media(prefers-reduced-motion:reduce){.pwa-install-cta{animation:none}}

/* --- Challenger collection loop --- */
.pending-challenges-panel{margin:18px 0;border-color:rgba(255,145,189,.26);background:linear-gradient(135deg,rgba(255,145,189,.07),rgba(88,185,255,.04))}
.pending-challenges-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:10px;margin-top:14px}
.pending-challenge-card,.challenge-choice{border:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:14px;padding:11px;display:flex;align-items:center;gap:11px;text-align:left;color:var(--text);cursor:pointer;transition:transform .18s ease,border-color .18s ease,background .18s ease}
.pending-challenge-card:hover,.challenge-choice:hover{transform:translateY(-2px);border-color:rgba(245,204,106,.55);background:rgba(245,204,106,.06)}
.pending-challenge-card>span:nth-child(2),.challenge-choice>span:nth-child(2){display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.pending-challenge-card small,.challenge-choice small{color:var(--muted);line-height:1.35}
.pending-challenge-card>b,.challenge-choice>b{font-size:.68rem;letter-spacing:.08em;color:var(--gold);white-space:nowrap}
.pending-challenge-glyph,.challenge-choice-glyph{width:62px;height:62px;flex:0 0 62px;display:flex;align-items:center;justify-content:center}
.pending-challenge-glyph .creature-sprite,.challenge-choice-glyph .creature-sprite{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.challenge-status-badge{position:absolute;top:8px;left:8px;z-index:2;border:1px solid rgba(255,145,189,.48);background:rgba(34,18,34,.9);color:#ffb1cf;border-radius:999px;padding:4px 7px;font-size:.57rem;font-weight:900;letter-spacing:.08em}
.monster-card.pending-unlock{border-color:rgba(255,145,189,.28);background:linear-gradient(180deg,rgba(255,145,189,.055),rgba(255,255,255,.015))}
.monster-card.pending-unlock .creature-sprite{filter:saturate(.78) brightness(.88)}
.discovery-challenge-callout,.pending-explainer{border:1px solid rgba(245,204,106,.28);background:rgba(245,204,106,.055);border-radius:12px;padding:11px 13px;margin:12px 0;display:flex;flex-direction:column;gap:4px;text-align:left}
.discovery-challenge-callout strong,.pending-explainer strong{color:var(--gold)}
.discovery-challenge-callout span,.pending-explainer span{color:var(--muted);font-size:.9rem;line-height:1.45}
.challenge-picker-card{max-width:820px}
.challenge-target-row{display:flex;align-items:center;gap:16px;margin:10px 0 14px;padding:12px;border:1px solid rgba(255,145,189,.24);border-radius:14px;background:rgba(255,145,189,.04)}
.challenge-target-glyph{width:112px;height:112px;flex:0 0 112px;display:flex;align-items:center;justify-content:center}
.challenge-target-glyph .creature-sprite{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.challenge-target-row h2{margin:0 0 5px}.challenge-target-row p{margin:0;color:var(--muted)}
.challenge-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:48vh;overflow:auto;padding:2px}
.challenge-choice.recommended{border-color:rgba(147,230,161,.46);background:rgba(147,230,161,.055)}
.challenge-choice.recommended>b{color:#93e6a1}
.pending-detail .challenge-detail-btn{margin-top:10px}
.unlock-card{border-color:rgba(147,230,161,.36)}
.challenge-roster{opacity:.92}
.challenge-retry-btn{width:100%;margin-top:5px}

@media(max-width:700px){
  .pending-challenges-list,.challenge-choice-grid{grid-template-columns:1fr}
  .challenge-choice-grid{max-height:none;overflow:visible}
  .challenge-target-row{align-items:flex-start}.challenge-target-glyph{width:86px;height:86px;flex-basis:86px}
  .pending-challenge-card>b,.challenge-choice>b{font-size:.62rem}
}

/* --- Playtest feedback pass: mobile nav, Mastery sorting, Challenger variety --- */
.mobile-research-btn{display:none;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:11px;padding:7px 10px;align-items:center;gap:6px}.mobile-research-btn span{font-size:15px}.mobile-research-btn strong{font-size:12px;color:var(--gold)}
.mastery-controls{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.mastery-filter-row{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}.mastery-sort-control{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.mastery-sort-control select{border:1px solid var(--line);background:#171222;color:var(--text);padding:10px 12px;border-radius:10px;outline:none;min-width:172px;text-transform:none;letter-spacing:0;font-size:12px}
.mastery-card-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:10px 0 8px}.mastery-stat{border:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.025);border-radius:8px;padding:5px 4px;text-align:center}.mastery-stat span{display:block;color:var(--muted);font-size:8px;text-transform:uppercase;letter-spacing:.06em}.mastery-stat strong{font-size:11px;margin-top:1px}.mastery-ready-note{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:7px;font-size:9px;color:var(--muted)}.mastery-ready-note strong{font-size:9px;color:var(--gold)}
.challenge-team-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0 9px}.challenge-team-heading strong{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}.challenge-team-heading .ghost-btn{padding:7px 9px;font-size:10px}.challenge-trait-callout{border:1px solid rgba(189,164,255,.36);background:rgba(189,164,255,.07);border-radius:12px;padding:10px 12px;margin:10px 0 4px}.challenge-trait-callout strong{display:block;color:var(--violet);font-size:11px;text-transform:uppercase;letter-spacing:.08em}.challenge-trait-callout span{display:block;color:#d9d0e5;font-size:11px;line-height:1.45;margin-top:3px}.challenge-choice-grid.empty-team{border:1px dashed var(--line);border-radius:12px;padding:16px;color:var(--muted);font-size:12px;text-align:center}.challenge-battle-trait{color:var(--violet);font-weight:800}.challenge-advice{color:var(--gold)}

@media(max-width:700px){
  body{padding-bottom:76px}
  main{padding-bottom:94px}
  footer{padding-bottom:104px}
  .topbar{position:sticky;top:0;z-index:35}
  .mobile-research-btn{display:flex;margin-left:auto}
  .tabs{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:210;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:7px max(6px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));border-top:1px solid rgba(255,255,255,.1);border-bottom:0;background:rgba(16,13,24,.96);box-shadow:0 -10px 30px rgba(0,0,0,.36);overflow:visible;backdrop-filter:blur(20px)}
  .tab{min-width:0;padding:8px 3px 7px;font-size:10px;line-height:1.15;white-space:normal;text-align:center;border-radius:9px}
  .tab[data-view="lab"]{order:1}.tab[data-view="codex"]{order:2}.tab[data-view="battle"]{order:3}.tab[data-view="mastery"]{order:4}.tab[data-view="daily"]{order:5}.tab[data-view="research"]{display:none}
  .pwa-install-cta{bottom:82px}
  .pwa-update-banner{bottom:82px}
  .mastery-controls{width:100%;align-items:stretch}.mastery-filter-row{display:grid;grid-template-columns:1fr;gap:7px}.mastery-sort-control{display:grid;grid-template-columns:auto 1fr}.mastery-sort-control select{min-width:0;width:100%}.mastery-summary{justify-content:flex-start}.mastery-card-stats{gap:4px}.mastery-stat{padding:5px 2px}
  .challenge-team-heading{align-items:stretch;flex-direction:column}.challenge-team-heading .ghost-btn{width:100%}
}

/* --- Cinematic 2D battle presentation (pwa8) --- */
.battle-speed-control{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:3px}
.battle-speed-control>span{font-size:9px;text-transform:uppercase;letter-spacing:.11em;color:var(--muted);font-weight:850}
.battle-speed-toggle{display:inline-grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:999px;padding:2px;background:rgba(0,0,0,.18)}
.battle-speed-btn{border:0;border-radius:999px;background:transparent;color:var(--muted);padding:5px 9px;font-size:9px;font-weight:850;letter-spacing:.04em}
.battle-speed-btn.active{background:var(--gold);color:#211706;box-shadow:0 2px 10px rgba(245,204,106,.18)}

.battle-stage{position:relative;isolation:isolate;display:grid;grid-template-rows:1fr auto 1fr;gap:8px;min-height:500px;margin:10px 0 12px;padding:18px;border:1px solid rgba(189,164,255,.22);border-radius:18px;overflow:hidden;background:
  radial-gradient(ellipse at 75% 25%,rgba(255,145,189,.13),transparent 27%),
  radial-gradient(ellipse at 24% 77%,rgba(245,204,106,.13),transparent 29%),
  linear-gradient(180deg,#171226 0%,#211a32 48%,#171421 49%,#100d18 100%)}
.battle-stage:before,.battle-stage:after{content:"";position:absolute;z-index:-1;width:48%;height:13%;border-radius:50%;filter:blur(.2px);transform:skewX(-9deg);border:1px solid rgba(255,255,255,.07)}
.battle-stage:before{right:5%;top:39%;background:radial-gradient(ellipse,rgba(255,145,189,.12),rgba(0,0,0,.08) 62%,transparent 68%)}
.battle-stage:after{left:4%;bottom:5%;background:radial-gradient(ellipse,rgba(245,204,106,.13),rgba(0,0,0,.09) 62%,transparent 68%)}
.battle-stage-grid{position:absolute;inset:49% 0 0;z-index:-2;opacity:.16;background-image:linear-gradient(rgba(189,164,255,.16) 1px,transparent 1px),linear-gradient(90deg,rgba(189,164,255,.16) 1px,transparent 1px);background-size:26px 18px;transform:perspective(260px) rotateX(56deg) scale(1.25);transform-origin:top}
.battle-stage-glow{position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(112deg,transparent 47%,rgba(255,255,255,.025) 50%,transparent 53%)}
.battle-zone{position:relative;z-index:3;width:min(76%,560px)}
.enemy-zone{justify-self:end;align-self:start}.player-zone{justify-self:start;align-self:end}
.battle-stage .combatant-banner{margin:0 0 5px;padding:5px 9px;background:rgba(16,13,24,.7);backdrop-filter:blur(8px)}
.battle-stage .fighter{min-height:190px;background:rgba(16,13,24,.64);backdrop-filter:blur(8px);box-shadow:0 12px 28px rgba(0,0,0,.22)}
.battle-stage .fighter.enemy{background:linear-gradient(145deg,rgba(255,145,189,.09),rgba(16,13,24,.7))}
.battle-stage .fighter.player{background:linear-gradient(145deg,rgba(245,204,106,.10),rgba(16,13,24,.72))}
.battle-stage .fighter-glyph.creature-visual{width:144px;height:144px}
.battle-stage .fighter-glyph.creature-visual .creature-sprite{image-rendering:pixelated;object-position:center 82%;filter:drop-shadow(0 16px 18px rgba(0,0,0,.34))}
.battle-stage .fighter-head{align-items:center}.battle-stage .fighter-identity{gap:16px}
.battle-stage .fighter .name{font-size:17px}.battle-stage .fighter .aff{font-size:10px;line-height:1.4}
.battle-stage .hpbar{height:10px;background:#241e2d;box-shadow:inset 0 1px 4px rgba(0,0,0,.4)}
.battle-stage .hpbar>div{transition:width .48s cubic-bezier(.2,.75,.25,1)}
.battle-stage .battle-vs{align-self:center;justify-self:center;z-index:4;width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid rgba(255,255,255,.09);border-radius:50%;background:rgba(16,13,24,.84);color:#91859f;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.battle-action-banner{position:absolute;left:50%;top:48%;z-index:20;min-width:180px;max-width:70%;transform:translate(-50%,-50%) scale(.94);opacity:0;pointer-events:none;text-align:center;border:1px solid rgba(245,204,106,.42);border-radius:999px;padding:8px 13px;background:rgba(16,13,24,.92);box-shadow:0 10px 32px rgba(0,0,0,.4);transition:opacity .14s ease,transform .14s ease}
.battle-action-banner.show{opacity:1;transform:translate(-50%,-50%) scale(1)}
.battle-action-banner strong{color:var(--gold);font-size:10px}.battle-action-banner span{margin-left:7px;color:var(--text);font-size:11px;font-weight:850}
.battle-effect-layer{position:absolute;inset:0;z-index:18;pointer-events:none;overflow:hidden}
.battle-projectile{position:absolute;width:52px;height:52px;display:grid;place-items:center;border-radius:50%;font-size:25px;opacity:0;filter:drop-shadow(0 0 12px rgba(255,255,255,.5));background:radial-gradient(circle,rgba(255,255,255,.46),rgba(189,164,255,.24) 48%,transparent 72%)}
.battle-projectile.from-player{left:25%;top:70%}.battle-projectile.from-enemy{left:72%;top:24%}
.battle-projectile.from-player.fly{animation:battle-projectile-player .62s cubic-bezier(.2,.7,.3,1) forwards}.battle-projectile.from-enemy.fly{animation:battle-projectile-enemy .62s cubic-bezier(.2,.7,.3,1) forwards}
.battle-projectile.effect-ember{background:radial-gradient(circle,#fff4bc,#ff9d62 45%,rgba(255,87,32,.05) 72%);text-shadow:0 0 12px #ff7338}
.battle-projectile.effect-tide{background:radial-gradient(circle,#e6fbff,#68c9ff 45%,rgba(64,152,255,.05) 72%)}
.battle-projectile.effect-bloom{background:radial-gradient(circle,#f1ffe9,#7dde87 45%,rgba(77,190,97,.05) 72%)}
.battle-projectile.effect-stone{background:radial-gradient(circle,#fff7ed,#c1ad9c 45%,rgba(129,104,86,.05) 72%)}
.battle-projectile.effect-gale{background:radial-gradient(circle,#fff,#b7f1ed 43%,rgba(132,222,217,.04) 72%)}
.battle-projectile.effect-spark{background:radial-gradient(circle,#fffce5,#ffe36c 43%,rgba(255,208,48,.04) 72%)}
.battle-projectile.effect-gloom{background:radial-gradient(circle,#f4edff,#aa87ef 43%,rgba(90,54,154,.04) 72%)}
.battle-projectile.effect-gleam{background:radial-gradient(circle,#fff,#fff0a7 43%,rgba(255,244,196,.04) 72%)}
@keyframes battle-projectile-player{0%{opacity:0;transform:translate(0,0) scale(.5) rotate(-15deg)}18%{opacity:1}72%{opacity:1}100%{opacity:0;left:72%;top:25%;transform:scale(1.35) rotate(35deg)}}
@keyframes battle-projectile-enemy{0%{opacity:0;transform:translate(0,0) scale(.5) rotate(15deg)}18%{opacity:1}72%{opacity:1}100%{opacity:0;left:24%;top:69%;transform:scale(1.35) rotate(-35deg)}}
@keyframes battle-lunge-player{0%,100%{transform:translate(0,0)}35%{transform:translate(24px,-10px) scale(1.015)}65%{transform:translate(18px,-7px)}}
@keyframes battle-lunge-enemy{0%,100%{transform:translate(0,0)}35%{transform:translate(-24px,10px) scale(1.015)}65%{transform:translate(-18px,7px)}}
.battle-stage .fighter.player.battle-attack{animation:battle-lunge-player .58s cubic-bezier(.2,.75,.3,1)}
.battle-stage .fighter.enemy.battle-attack{animation:battle-lunge-enemy .58s cubic-bezier(.2,.75,.3,1)}
.battle-stage.stage-impact{animation:stage-impact .34s ease}.battle-stage.stage-crit{animation:stage-crit .42s ease}
@keyframes stage-impact{0%,100%{transform:translate(0)}35%{transform:translate(-2px,1px)}55%{transform:translate(2px,-1px)}}
@keyframes stage-crit{0%,100%{transform:translate(0);filter:brightness(1)}25%{transform:translate(-4px,2px);filter:brightness(1.24)}50%{transform:translate(4px,-2px)}72%{transform:translate(-2px,1px)}}
.battle-impact-callout{position:absolute;z-index:30;left:50%;top:7%;transform:translateX(-50%);color:var(--good);font-size:12px;font-weight:950;letter-spacing:.1em;text-shadow:0 2px 10px rgba(0,0,0,.85);animation:battle-callout .9s ease-out forwards;white-space:nowrap}.battle-impact-callout.critical{color:#ffe383;font-size:14px}
@keyframes battle-callout{0%{opacity:0;transform:translate(-50%,8px) scale(.82)}20%{opacity:1;transform:translate(-50%,0) scale(1.08)}70%{opacity:1}100%{opacity:0;transform:translate(-50%,-16px) scale(.98)}}

@media(max-width:700px){
  body{padding-bottom:calc(92px + env(safe-area-inset-bottom))}
  main{padding-bottom:calc(108px + env(safe-area-inset-bottom))}
  footer{padding-bottom:calc(116px + env(safe-area-inset-bottom))}
  .tabs{padding-top:8px;padding-bottom:calc(13px + env(safe-area-inset-bottom));min-height:calc(70px + env(safe-area-inset-bottom))}
  .tab{padding-top:9px;padding-bottom:9px}
  .pwa-install-cta,.pwa-update-banner{bottom:calc(90px + env(safe-area-inset-bottom))}
  .battle-speed-control{justify-content:flex-start;flex-wrap:wrap}.battle-speed-toggle{flex:1;max-width:220px}.battle-speed-btn{width:100%}
  .battle-stage{min-height:430px;padding:10px;margin-left:-3px;margin-right:-3px}
  .battle-zone{width:91%}.battle-stage .fighter{min-height:145px;padding:9px}
  .battle-stage .fighter-glyph.creature-visual{width:94px;height:94px}.battle-stage .fighter-identity{gap:8px}
  .battle-stage .fighter .name{font-size:13px;max-width:150px}.battle-stage .fighter .aff{font-size:8px;max-width:160px;white-space:normal}
  .battle-stage .fighter-owner{font-size:7px}.battle-stage .status-chips{margin-top:5px}
  .battle-stage .battle-vs{width:34px;height:34px;font-size:9px}
  .battle-action-banner{top:49%;max-width:86%;padding:6px 10px}.battle-action-banner strong,.battle-action-banner span{font-size:9px}
  .battle-projectile{width:42px;height:42px;font-size:20px}
}
@media(prefers-reduced-motion:reduce){
  .battle-projectile{display:none!important}.battle-stage .fighter.battle-attack,.battle-stage.stage-impact,.battle-stage.stage-crit,.battle-impact-callout{animation:none!important}
  .battle-action-banner{transition:none}
}


/* --- Lab Tier + Affinity filtering (pwa9) --- */
.lab-collection-tools{display:flex;align-items:flex-end;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-width:0}
.lab-collection-tools .search-wrap{min-width:min(250px,100%)}
.lab-collection-tools .search-wrap input{width:250px;max-width:100%}
.lab-filter-control{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:8px;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.lab-filter-control select{min-width:128px;border:1px solid var(--line);background:#171222;color:var(--text);padding:10px 12px;border-radius:10px;outline:none;font-size:12px;text-transform:none;letter-spacing:0}
.lab-filter-count{margin-left:5px;color:#a99fba;font-weight:750}
.lab-filter-empty{grid-column:1/-1;display:flex;min-height:132px;align-items:center;justify-content:center;flex-direction:column;gap:6px;border:1px dashed rgba(189,164,255,.2);border-radius:14px;background:rgba(255,255,255,.018);text-align:center;padding:20px;color:var(--muted)}
.lab-filter-empty strong{color:var(--text);font-size:12px}.lab-filter-empty span{font-size:10px}
@media(max-width:700px){
  .lab-collection-tools{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:7px;align-items:end}
  .lab-collection-tools .search-wrap{grid-column:1/-1;width:100%;min-width:0}
  .lab-collection-tools .search-wrap input{width:100%}
  .lab-filter-control{min-width:0}.lab-filter-control select{width:100%;min-width:0;padding:9px 8px}
  .lab-filter-count{display:block;margin:5px 0 0}
}

/* v0.10 endgame systems: Research sinks, Dojo, Trials, support roles, sprite cleanup */
.research-layout{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.variant-research-panel{grid-column:1/-1}
.research-training-panel .panel-heading p,.variant-research-panel>p,.dojo-panel>p,.trials-panel>p{color:var(--muted);line-height:1.5;margin:.35rem 0 1rem}
.research-price{font-weight:800;color:var(--gold,#f5cc6a);font-size:.82rem;white-space:nowrap}
.research-select{display:grid;gap:6px;margin:12px 0}.research-select span,.dojo-selects label>span{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.research-select select,.dojo-selects select{width:100%;min-width:0;background:rgba(255,255,255,.04);border:1px solid var(--line);color:var(--text);border-radius:10px;padding:10px}
.variant-research-list{display:grid;gap:8px;margin-top:12px;max-height:560px;overflow:auto;padding-right:4px}
.variant-research-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.025)}
.variant-research-row>div{display:grid;gap:4px}.variant-research-row strong{font-size:13px}.variant-research-row span{font-size:11px;color:var(--muted);line-height:1.45}.variant-research-row>b{font-size:10px;letter-spacing:.08em;color:var(--muted)}
.variant-research-row.complete{border-color:rgba(147,230,161,.32);background:rgba(147,230,161,.05)}.variant-research-row.complete>b{color:#93e6a1}.variant-research-row.locked{opacity:.68}
.variant-research-sealed{display:flex;justify-content:space-between;gap:12px;padding:16px;border:1px dashed var(--line);border-radius:12px;color:var(--muted)}
.research-affinity-guide{display:grid;gap:7px}.research-affinity-row{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:10px;font-size:11px}.research-affinity-row>b{color:var(--gold,#f5cc6a)}
.dojo-panel,.trials-panel{align-self:start}.dojo-selects{display:grid;gap:8px;margin:12px 0}.dojo-selects label{display:grid;gap:5px}
.lab-trials-list{display:grid;gap:8px}.lab-trial-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.025)}.lab-trial-row>div{display:grid;gap:4px}.lab-trial-row strong{font-size:12px}.lab-trial-row span{font-size:10px;line-height:1.4;color:var(--muted)}.lab-trial-row>b{font-size:9px;letter-spacing:.1em;color:var(--muted)}.lab-trial-row.available{border-color:rgba(245,204,106,.32)}.lab-trial-row.complete{border-color:rgba(147,230,161,.3);background:rgba(147,230,161,.04)}.lab-trial-row.complete>b{color:#93e6a1}

/* Sprite art has been normalized and caption cleanup is handled in the assets themselves. */

.battle-heal{filter:drop-shadow(0 0 16px rgba(147,230,161,.55))!important}.healing-pop{position:absolute;z-index:9;left:50%;top:22%;transform:translateX(-50%);font-weight:900;color:#93e6a1;text-shadow:0 2px 8px #000;animation:damage-rise .9s ease forwards;pointer-events:none}

@media (max-width:900px){
  .research-layout{grid-template-columns:1fr}.variant-research-panel{grid-column:auto}
  .battle-layout>.battle-arena-panel{order:1!important}.battle-layout>section:first-child{order:2!important}.battle-layout>.dojo-panel{order:3!important}.battle-layout>.trials-panel{order:4!important}.battle-layout>section:last-child{order:5!important}
}
@media (max-width:560px){
  .variant-research-row,.lab-trial-row{grid-template-columns:1fr}.variant-research-row button,.lab-trial-row button{width:100%}.research-affinity-row{grid-template-columns:1fr auto 1fr;font-size:10px}.variant-research-sealed{flex-direction:column}.dojo-selects{grid-template-columns:1fr}
}

/* Daily formula solved before its tier has been certified. */
.daily-trial-gate{display:block;margin-top:10px;padding:10px 12px;border:1px solid rgba(255,208,91,.32);border-radius:12px;background:rgba(255,208,91,.07);color:var(--text);font-size:.9rem;line-height:1.45}

/* Secret Archive creatures beyond the numbered 150-species Codex */
.secret-creature-list{display:grid;gap:8px;margin-top:12px}
.secret-creature-row{width:100%;display:grid;grid-template-columns:58px minmax(0,1fr) auto;gap:10px;align-items:center;text-align:left;border:1px solid var(--line);border-radius:12px;padding:10px;background:rgba(255,255,255,.025)}
.secret-creature-row .glyph.creature-visual{width:54px;height:54px;display:grid;place-items:center}
.secret-creature-row>span:nth-child(2){display:grid;gap:4px}.secret-creature-row>span:nth-child(2)>strong{font-size:12px;color:var(--text)}.secret-creature-row>span:nth-child(2)>span{font-size:10px;color:var(--muted);line-height:1.4}
.secret-creature-row>b{font-size:9px;letter-spacing:.08em;color:var(--muted)}
.secret-creature-row.found{border-color:rgba(245,204,106,.35);background:rgba(245,204,106,.045)}.secret-creature-row.found>b{color:var(--gold)}
.secret-creature-row.pending{border-color:rgba(255,145,189,.34);background:rgba(255,145,189,.045)}.secret-creature-row.pending>b{color:#ff91bd}
.secret-creature-row.unknown-secret{opacity:.88;border-style:dashed}.secret-unknown-glyph{width:52px;height:52px;border:1px dashed var(--line);border-radius:11px;display:grid;place-items:center;font-size:25px;color:var(--muted);background:rgba(255,255,255,.02)}
.secret-archive-seal{min-height:210px;margin-top:10px}
.secret-research-panel{grid-column:1/-1}
.secret-research-row{border-color:rgba(245,204,106,.18)}
.secret-creature-visual .creature-sprite{clip-path:none}

@media(max-width:620px){
  .secret-creature-row{grid-template-columns:50px minmax(0,1fr);padding:9px}.secret-creature-row>b{grid-column:2}.secret-creature-row .glyph.creature-visual,.secret-unknown-glyph{width:46px;height:46px}
  .secret-research-panel{grid-column:auto}
}

/* Reactive audio controls */
.audio-controls{display:inline-flex;align-items:center;gap:6px;vertical-align:middle}.audio-toggle{border:1px solid rgba(189,164,255,.18);border-radius:999px;background:rgba(189,164,255,.055);padding:6px 9px!important;white-space:nowrap;transition:border-color .18s ease,background .18s ease,color .18s ease,opacity .18s ease}.audio-toggle:hover{border-color:rgba(245,204,106,.38);background:rgba(245,204,106,.06)}.audio-toggle[aria-pressed="false"]{color:#756d80;opacity:.72}.audio-toggle[aria-pressed="true"]{color:var(--violet)}
footer>div:last-child{display:flex;align-items:center;justify-content:flex-end;gap:4px;flex-wrap:wrap}
@media(max-width:700px){.audio-controls{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:3px}.audio-toggle{width:100%;text-align:center;padding:8px 7px!important}footer>div:last-child{justify-content:flex-start;width:100%}}


/* --- Mobile density + one-screen decisions (pwa18) --- */
.mobile-lab-dock{display:none}
@media(max-width:700px){
  /* Reduce decorative vertical space while preserving hierarchy. */
  main{padding-top:10px}
  .hero-card{padding:10px 12px;margin-bottom:10px;gap:8px}
  .hero-card .eyebrow{font-size:8px}
  .hero-card h2,.section-heading h2{font-size:20px;line-height:1.12;margin:2px 0 4px}
  .hero-card p,.section-heading p{font-size:11px;line-height:1.38;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .section-heading{gap:7px;margin-bottom:9px}
  .panel{padding:11px;border-radius:13px}
  .panel h3{font-size:17px;margin:2px 0 8px}
  .panel h4{font-size:13px;margin-bottom:7px}
  .microcopy{font-size:10px;line-height:1.35;margin:3px 0 8px}
  .mini-divider{margin:10px 0}

  /* Lab: the Crucible itself is shorter, and collection browsing gets a fixed mini-Crucible. */
  #view-lab{padding-bottom:104px}
  #view-lab .lab-grid{display:flex;flex-direction:column;gap:10px}
  #view-lab .crucible-panel{order:1;min-height:0;padding-bottom:8px}
  #view-lab .objectives-panel{order:2}
  #view-lab .collection-panel{margin-top:10px}
  .slots-row{margin:8px auto 7px;grid-template-columns:1fr 22px 1fr;gap:5px}
  .monster-slot{min-height:88px;padding:6px;gap:3px;border-radius:12px}
  .slot-glyph.creature-visual{width:58px;height:58px;margin:0}
  .slot-name{font-size:11px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .slot-label{font-size:8px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .slot-mastery{display:none}
  .slot-plus{font-size:23px}.reaction-symbol{font-size:14px}
  .catalyst-control{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;margin:0 auto 7px;font-size:10px}
  .catalyst-control select{min-width:0;width:100%;padding:7px 8px;font-size:11px}
  .combine-btn{padding:10px;font-size:12px;border-radius:10px}
  .lab-message{font-size:10px;margin-top:6px;min-height:14px}
  #particleCanvas{display:none}
  #objectives .objective{padding:7px 0;gap:7px}
  #objectives .objective-icon{width:23px;height:23px;font-size:11px}
  #objectives .objective strong{font-size:11px}
  #objectives .objective span{font-size:9px}
  .badge{font-size:9px;padding:4px 6px}

  .lab-collection-tools{gap:5px}
  .lab-collection-tools .search-wrap input,.lab-filter-control select{padding:7px 8px;font-size:11px}
  .lab-filter-control{font-size:7px;gap:2px}
  .monster-grid,.monster-grid.compact,.codex-grid{gap:5px}
  .monster-card{min-height:112px;padding:7px;border-radius:11px}
  .monster-card .num{font-size:8px}
  .monster-card .glyph.creature-visual{height:62px;margin:1px 0 3px}
  .monster-card .glyph.creature-visual .creature-sprite{max-width:74px}
  .monster-card .name{font-size:11px}
  .monster-card .meta{font-size:8px;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .monster-card .mastery-mini{font-size:7px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .monster-card:has(.creature-sprite){min-height:112px}

  .mobile-lab-dock{position:fixed;z-index:205;left:7px;right:7px;bottom:calc(72px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:6px;padding:6px;border:1px solid rgba(245,204,106,.42);border-radius:13px;background:rgba(20,16,31,.96);backdrop-filter:blur(18px);box-shadow:0 12px 34px rgba(0,0,0,.42)}
  .mobile-lab-dock-slots{display:grid;grid-template-columns:minmax(0,1fr) 12px minmax(0,1fr) 58px;gap:4px;align-items:center;min-width:0}
  .mobile-lab-slot{min-width:0;height:38px;border:1px solid var(--line);background:var(--panel2);color:var(--text);border-radius:9px;padding:4px 5px;text-align:left;display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px;align-items:center}
  .mobile-lab-slot>span{display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:rgba(189,164,255,.14);font-size:8px;color:var(--violet);font-weight:900}
  .mobile-lab-slot strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-lab-plus{text-align:center;color:var(--muted);font-size:10px}
  .mobile-catalyst{height:38px;display:grid;grid-template-columns:15px minmax(0,1fr);align-items:center;border:1px solid var(--line);border-radius:9px;background:#171222;padding:0 3px;overflow:hidden}
  .mobile-catalyst>span{font-size:10px;text-align:center}
  .mobile-catalyst select{width:100%;min-width:0;border:0;background:transparent;color:var(--text);font-size:8px;padding:0;outline:0;text-overflow:ellipsis}
  .mobile-combine-btn{border:1px solid #7c683b;background:linear-gradient(180deg,#f3d37c,#d6aa4f);color:#211706;border-radius:9px;font-size:10px;font-weight:950;padding:0 5px}
  .mobile-combine-btn:disabled{opacity:.4}

  /* Mastery: two compact roster cards rather than one tall card per row. */
  .mastery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  .mastery-card{min-height:0!important;padding:7px;border-radius:11px}
  .mastery-card-head{gap:5px;padding-bottom:5px}
  .mastery-card .glyph.creature-visual{width:42px;height:42px}
  .mastery-card-identity strong{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mastery-card-identity small{font-size:7px;margin-top:1px}
  .mastery-card-meta{display:flex;justify-content:space-between;gap:4px;padding:5px 0 2px;align-items:center}
  .mastery-meta-label{display:none}
  .mastery-meta-group{gap:2px;min-width:0}
  .mastery-rank-group{align-items:flex-end}
  .affinity-chips{gap:2px;flex-wrap:nowrap}
  .affinity-chip{font-size:7px;padding:2px 3px;white-space:nowrap}
  .mastery-card .mastery-rank{font-size:7px;padding:2px 4px}
  .mastery-card-stats{gap:2px;margin:5px 0 4px}
  .mastery-stat{padding:3px 1px;border-radius:6px}
  .mastery-stat span{font-size:6px}.mastery-stat strong{font-size:9px}
  .mastery-card .mastery-bar{height:5px;margin:4px 0 3px}
  .mastery-card-progress{font-size:6.5px;gap:2px}.mastery-card-progress span:last-child{display:none}
  .mastery-ready-note{margin-top:3px;font-size:7px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mastery-ready-note strong{font-size:7px;margin-right:3px}.mastery-ready-note span{font-size:7px}
  .mastery-controls .mastery-summary{display:none}
  .mastery-filter-row{gap:5px}.mastery-sort-control select,#masterySearch{padding:7px 8px;font-size:11px}

  /* Battle: preserve cinematic readibility but remove unnecessary dead height. */
  .battle-stage{min-height:350px;padding:6px;margin:0 -3px 6px}
  .battle-stage .fighter{min-height:112px;padding:6px}
  .battle-stage .fighter-glyph.creature-visual{width:76px;height:76px}
  .battle-stage .fighter .name{font-size:11px;max-width:130px}
  .battle-stage .fighter .aff{font-size:7px;max-width:135px}
  .battle-stage .battle-vs{width:28px;height:28px;font-size:8px}
  .move-buttons{gap:5px;margin-top:7px}
  .move-btn{min-height:54px;padding:7px 6px;font-size:11px}
  .move-btn span{font-size:8px;line-height:1.22}
  .battle-log{height:62px;margin-top:6px;padding:6px;font-size:9px;line-height:1.35}
  .combatant-banner{padding:5px 7px;margin:4px 0;font-size:9px}
  .combatant-banner strong{font-size:10px}.combatant-banner span{font-size:8px}
  .battle-speed-control{gap:4px}.battle-speed-toggle{max-width:none}.battle-speed-btn{padding:6px 8px;font-size:9px}

  /* General list density. */
  .pending-challenges-panel{padding:10px;margin-bottom:9px}
  .pending-challenges-panel .microcopy{display:none}
  .team-card{min-height:48px;padding:6px;margin-bottom:5px}
  .research-layout{gap:10px}
  .variant-research-list{max-height:none}
  footer{padding-top:11px;font-size:9px}
}

@media(max-width:360px){
  .mobile-lab-dock{grid-template-columns:minmax(0,1fr) 72px;left:4px;right:4px}
  .mobile-lab-dock-slots{grid-template-columns:minmax(0,1fr) 9px minmax(0,1fr) 48px}
  .mobile-lab-slot strong{font-size:8px}
  .mastery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* --- Mobile screen-based navigation + no-scroll battle (pwa19) --- */
.mobile-pager,.mobile-battle-hub-tabs{display:none}
@media(max-width:700px){
  .mobile-pager{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px;margin:7px 0 0}
  .mobile-pager button{height:34px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--text);font-size:21px;font-weight:900}
  .mobile-pager button:disabled{opacity:.28}
  .mobile-pager strong{text-align:center;font-size:10px;letter-spacing:.08em;color:var(--muted)}
  .monster-grid.compact{max-height:none;overflow:visible;padding-right:0}

  /* Core collection screens use page-sized grids instead of continuous lists. */
  #view-lab .collection-panel,#view-codex,#view-mastery{scroll-margin-top:0}
  #view-lab .collection-panel .monster-grid,#view-codex .codex-grid,#view-mastery .mastery-grid{overflow:visible}
  #view-lab .collection-panel{padding-bottom:7px}
  #view-codex .codex-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

  /* Battle setup is mode-based on phones so Dojo/Trials/type reference are not stacked. */
  .mobile-battle-hub-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0 0 8px}
  .mobile-battle-hub-tabs button{border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--muted);padding:8px 3px;font-size:9px;font-weight:900}
  .mobile-battle-hub-tabs button.active{border-color:rgba(245,204,106,.48);color:var(--gold);background:rgba(245,204,106,.07)}
  #view-battle .battle-layout>[data-battle-hub-panel]{display:none}
  #view-battle .battle-layout>[data-battle-hub-panel].mobile-hub-active{display:block}
  #view-battle .battle-layout>.battle-arena-panel{display:block!important}

  /* Once a fight begins, Battle becomes a true fixed-height game screen. */
  body.mobile-battle-active{overflow:hidden}
  body.mobile-battle-active .topbar{display:none}
  body.mobile-battle-active main{padding:0!important;margin:0!important;max-width:none!important}
  body.mobile-battle-active #view-battle.active{position:fixed;z-index:190;inset:0 0 calc(70px + env(safe-area-inset-bottom)) 0;display:block!important;padding:4px!important;margin:0!important;background:var(--bg);overflow:hidden}
  body.mobile-battle-active #view-battle>.section-heading,
  body.mobile-battle-active #view-battle>.mobile-battle-hub-tabs,
  body.mobile-battle-active #view-battle .battle-layout>[data-battle-hub-panel],
  body.mobile-battle-active #view-battle .battle-empty{display:none!important}
  body.mobile-battle-active #view-battle .battle-layout{display:block;height:100%;margin:0;padding:0}
  body.mobile-battle-active #view-battle .battle-arena-panel{display:block!important;height:100%;padding:5px;border-radius:10px;overflow:hidden}
  body.mobile-battle-active #view-battle .battle-arena{display:flex!important;flex-direction:column;height:100%;min-height:0;gap:3px}
  body.mobile-battle-active #view-battle .rival-line{flex:0 0 20px;margin:0;padding:0 3px;font-size:8px;min-height:0}
  body.mobile-battle-active #view-battle .rival-line span:last-child{font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:58%}
  body.mobile-battle-active #view-battle .rival-roster-wrap,
  body.mobile-battle-active #view-battle .player-roster-wrap{display:none!important}
  body.mobile-battle-active #view-battle .battle-stage{flex:1 1 auto;min-height:0!important;height:auto;margin:0!important;padding:3px 5px;display:grid;grid-template-rows:minmax(0,1fr) 18px minmax(0,1fr);gap:1px;border-radius:10px}
  body.mobile-battle-active #view-battle .battle-zone{width:96%;min-height:0;align-self:stretch}
  body.mobile-battle-active #view-battle .battle-zone.enemy-zone{justify-self:end}
  body.mobile-battle-active #view-battle .battle-zone.player-zone{justify-self:start}
  body.mobile-battle-active #view-battle .combatant-banner{display:none}
  body.mobile-battle-active #view-battle .battle-stage .fighter{height:100%;min-height:0;padding:4px 6px;border-radius:9px;overflow:hidden}
  body.mobile-battle-active #view-battle .battle-stage .fighter-head{height:100%;display:flex;align-items:center}
  body.mobile-battle-active #view-battle .battle-stage .fighter-identity{gap:5px;min-width:0;align-items:center}
  body.mobile-battle-active #view-battle .battle-stage .fighter-glyph.creature-visual{width:clamp(58px,11vh,82px);height:clamp(58px,11vh,82px);flex:0 0 auto}
  body.mobile-battle-active #view-battle .battle-stage .fighter .name{font-size:11px;max-width:120px}
  body.mobile-battle-active #view-battle .battle-stage .fighter .aff{font-size:7px;line-height:1.2;max-width:125px}
  body.mobile-battle-active #view-battle .fighter-owner{font-size:6px}
  body.mobile-battle-active #view-battle .fighter-stats{font-size:7px;gap:3px}
  body.mobile-battle-active #view-battle .hpbar{height:8px;margin-top:3px}
  body.mobile-battle-active #view-battle .status-chips{margin-top:3px;gap:2px}
  body.mobile-battle-active #view-battle .status-chip{font-size:6px;padding:1px 3px}
  body.mobile-battle-active #view-battle .battle-stage .battle-vs{width:18px;height:18px;font-size:6px;margin:0}
  body.mobile-battle-active #view-battle .battle-action-banner{font-size:8px;padding:3px 6px;max-width:75%}

  body.mobile-battle-active #view-battle .battle-status{order:3;flex:0 0 16px;min-height:0;margin:0;padding:2px 4px;font-size:7px;text-align:center;line-height:12px}
  body.mobile-battle-active #view-battle .battle-log{order:4;flex:0 0 42px;height:42px!important;margin:0;padding:4px 6px;overflow:hidden;font-size:8px;line-height:1.25;border-radius:8px}
  body.mobile-battle-active #view-battle .battle-log div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.mobile-battle-active #view-battle .move-buttons{order:5;flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:0}
  body.mobile-battle-active #view-battle .move-btn{min-height:45px;max-height:50px;padding:5px 6px;border-radius:8px;text-align:left;overflow:hidden}
  body.mobile-battle-active #view-battle .move-btn strong{font-size:9px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  body.mobile-battle-active #view-battle .move-btn>span{font-size:6.5px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  body.mobile-battle-active #view-battle .move-tactics{margin-top:2px!important}
  body.mobile-battle-active #view-battle .swap-buttons{order:6;flex:0 0 30px;display:flex;gap:3px;margin:0;overflow:hidden}
  body.mobile-battle-active #view-battle .swap-btn,
  body.mobile-battle-active #view-battle .challenge-retry-btn{min-width:0;flex:1;height:29px;padding:3px 4px;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* Keep the bottom navigation above the fixed combat screen. */
  body.mobile-battle-active .tabs{z-index:210}
}

@media(max-width:390px) and (max-height:700px){
  body.mobile-battle-active #view-battle .battle-stage .fighter-glyph.creature-visual{width:54px;height:54px}
  body.mobile-battle-active #view-battle .move-btn{min-height:40px;max-height:44px;padding:4px}
  body.mobile-battle-active #view-battle .battle-log{flex-basis:34px;height:34px!important}
  body.mobile-battle-active #view-battle .battle-status{display:none}
}

.mobile-lab-notes-toggle,.mobile-mastery-tabs{display:none}
@media(max-width:700px){
  /* Lab's dock is the mobile Crucible; remove the duplicate full Crucible from the normal flow. */
  #view-lab .lab-grid{display:none!important}
  .mobile-lab-notes-toggle{display:block;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--violet);padding:7px 9px;font-size:9px;font-weight:900}
  body.mobile-lab-notes-open #view-lab .lab-grid{display:block!important;position:fixed;z-index:225;left:8px;right:8px;bottom:calc(78px + env(safe-area-inset-bottom));max-height:62dvh;overflow:auto;background:rgba(16,13,24,.98);border:1px solid rgba(189,164,255,.3);border-radius:14px;padding:8px;box-shadow:0 18px 50px rgba(0,0,0,.55)}
  body.mobile-lab-notes-open #view-lab .crucible-panel{display:none!important}
  body.mobile-lab-notes-open #view-lab .objectives-panel{display:block!important;margin:0}
  body.mobile-lab-notes-open:after{content:"Tap Notes again to close";position:fixed;z-index:226;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translateX(-50%);font-size:8px;color:var(--muted);pointer-events:none}
  .lab-collection-tools{grid-template-columns:auto 1fr 1fr!important}
  .lab-collection-tools .search-wrap{grid-column:1/-1}

  /* Slightly smaller paged cards so a complete page fits typical phone heights. */
  #view-lab .monster-card,#view-codex .monster-card{min-height:92px!important;padding:5px}
  #view-lab .monster-card .glyph.creature-visual,#view-codex .monster-card .glyph.creature-visual{height:48px;margin:0 0 2px}
  #view-lab .monster-card .glyph.creature-visual .creature-sprite,#view-codex .monster-card .glyph.creature-visual .creature-sprite{max-width:58px}
  #view-lab .monster-card .mastery-mini,#view-codex .monster-card .mastery-mini{display:none}
  #view-lab .monster-card:has(.creature-sprite),#view-codex .monster-card:has(.creature-sprite){min-height:92px!important}

  /* Mastery gets a screen switch instead of stacking roster + archives. */
  .mobile-mastery-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 0 7px}
  .mobile-mastery-tabs button{border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--muted);padding:8px;font-size:9px;font-weight:900}
  .mobile-mastery-tabs button.active{color:var(--gold);border-color:rgba(245,204,106,.4);background:rgba(245,204,106,.06)}
  #view-mastery .mastery-layout[data-mobile-tab="creatures"]>.variant-panel{display:none}
  #view-mastery .mastery-layout[data-mobile-tab="archives"]>section:first-child{display:none}
  #view-mastery .mastery-layout[data-mobile-tab="archives"]>.variant-panel{display:block;max-height:calc(100dvh - 220px - env(safe-area-inset-bottom));overflow:auto}

  /* Daily's rules are reference copy, not part of the daily decision loop. */
  #view-daily .daily-notes-panel{display:none}
  #view-daily .daily-layout{gap:7px}
  #view-daily .daily-clue-panel,#view-daily .daily-lab-panel{padding:9px}
  #view-daily .daily-clue{padding:8px;font-size:11px;line-height:1.35}
  #view-daily .daily-meta{font-size:8px;margin-top:5px}
}

/* --- Desktop landscape battle + horizontal Affinity Notes (pwa20) --- */
@keyframes battle-projectile-player-landscape{0%{opacity:0;left:27%;top:49%;transform:scale(.5) rotate(-12deg)}18%{opacity:1}72%{opacity:1}100%{opacity:0;left:70%;top:49%;transform:scale(1.35) rotate(25deg)}}
@keyframes battle-projectile-enemy-landscape{0%{opacity:0;left:70%;top:49%;transform:scale(.5) rotate(12deg)}18%{opacity:1}72%{opacity:1}100%{opacity:0;left:27%;top:49%;transform:scale(1.35) rotate(-25deg)}}
@keyframes battle-lunge-player-landscape{0%,100%{transform:translate(0,0)}35%{transform:translate(24px,0) scale(1.015)}65%{transform:translate(17px,0)}}
@keyframes battle-lunge-enemy-landscape{0%,100%{transform:translate(0,0)}35%{transform:translate(-24px,0) scale(1.015)}65%{transform:translate(-17px,0)}}

@media(min-width:1001px){
  /* Battle modes form a compact left rail; the actual fight owns the wide canvas. */
  #view-battle .battle-layout{
    grid-template-columns:minmax(250px,.52fr) minmax(0,1.9fr);
    grid-template-areas:
      "team arena"
      "dojo arena"
      "trials arena"
      "affinity affinity";
    gap:14px 18px;
    align-items:start;
  }
  #view-battle .team-setup-panel{grid-area:team}
  #view-battle .dojo-panel{grid-area:dojo}
  #view-battle .trials-panel{grid-area:trials}
  #view-battle .battle-arena-panel{grid-area:arena;min-height:0;padding:16px}
  #view-battle .affinity-notes-panel{grid-area:affinity;padding:16px 18px}
  #view-battle .battle-empty{min-height:560px}

  #view-battle .team-setup-panel,
  #view-battle .dojo-panel,
  #view-battle .trials-panel{padding:14px}
  #view-battle .team-setup-panel h3,
  #view-battle .dojo-panel h3,
  #view-battle .trials-panel h3{font-size:16px;margin-bottom:8px}
  #view-battle .team-card{min-height:56px;padding:7px 8px;margin-bottom:6px;gap:8px}
  #view-battle .team-card .glyph.creature-visual{width:48px;height:48px}
  #view-battle .team-card strong{font-size:11px}
  #view-battle .team-card span{font-size:9px}
  #view-battle .team-setup-panel .microcopy,
  #view-battle .dojo-panel>p,
  #view-battle .trials-panel>p{font-size:10px;line-height:1.4;margin-bottom:9px}
  #view-battle .dojo-selects{gap:6px;margin:8px 0}
  #view-battle .dojo-selects select{padding:8px;font-size:10px}
  #view-battle .lab-trials-list{gap:6px}
  #view-battle .lab-trial-row{padding:8px}

  /* Roster scouting, arena, actions and log are arranged as one compact game board. */
  #view-battle #battleArena.battle-arena:not(.hidden){
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:
      "line line"
      "player-roster rival-roster"
      "stage stage"
      "status status"
      "moves moves"
      "swap swap"
      "log log";
    gap:8px 10px;
    align-items:start;
  }
  #view-battle .rival-line{grid-area:line;margin:0;padding:0 2px;font-size:10px}
  #view-battle .rival-roster-wrap{grid-area:rival-roster;margin:0;padding:8px}
  #view-battle .player-roster-wrap{grid-area:player-roster;margin:0;padding:8px}
  #view-battle .rival-roster-label,
  #view-battle .player-roster-label{margin-bottom:6px}
  #view-battle .rival-roster-label span,
  #view-battle .player-roster-label span{display:none}
  #view-battle .rival-roster-card,
  #view-battle .player-roster-card{min-height:72px;grid-template-columns:38px minmax(0,1fr);padding:6px;gap:1px 5px}
  #view-battle .rival-roster-glyph.creature-visual,
  #view-battle .player-roster-glyph.creature-visual{width:36px;height:36px}

  /* Desktop combat is genuinely landscape: player left, rival right. */
  #view-battle .battle-stage{
    grid-area:stage;
    grid-template-columns:minmax(0,1fr) 46px minmax(0,1fr);
    grid-template-rows:1fr;
    gap:12px;
    min-height:300px;
    margin:0;
    padding:14px 16px;
  }
  #view-battle .battle-stage .player-zone{
    grid-column:1;
    grid-row:1;
    width:100%;
    justify-self:stretch;
    align-self:stretch;
  }
  #view-battle .battle-stage .enemy-zone{
    grid-column:3;
    grid-row:1;
    width:100%;
    justify-self:stretch;
    align-self:stretch;
  }
  #view-battle .battle-stage .battle-vs{grid-column:2;grid-row:1;align-self:center;justify-self:center}
  #view-battle .battle-stage .fighter{height:100%;min-height:228px;padding:13px}
  #view-battle .battle-stage .fighter-glyph.creature-visual{width:124px;height:124px}
  #view-battle .battle-stage .fighter-identity{gap:11px}
  #view-battle .battle-stage .fighter .name{font-size:15px;max-width:190px}
  #view-battle .battle-stage .fighter .aff{font-size:9px;max-width:210px;white-space:normal}
  #view-battle .battle-projectile.from-player{left:27%;top:49%}
  #view-battle .battle-projectile.from-enemy{left:70%;top:49%}
  #view-battle .battle-projectile.from-player.fly{animation-name:battle-projectile-player-landscape}
  #view-battle .battle-projectile.from-enemy.fly{animation-name:battle-projectile-enemy-landscape}
  #view-battle .battle-stage .fighter.player.battle-attack{animation-name:battle-lunge-player-landscape}
  #view-battle .battle-stage .fighter.enemy.battle-attack{animation-name:battle-lunge-enemy-landscape}

  #view-battle #battleStatus{grid-area:status;margin:0;min-height:28px;padding:6px 9px}
  #view-battle #moveButtons{grid-area:moves;margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  #view-battle .move-btn{min-height:68px;padding:9px 8px;text-align:left}
  #view-battle #swapButtons{grid-area:swap;margin:0}
  #view-battle #battleLog{grid-area:log;height:74px;margin:0;padding:7px 9px}

  /* Eight affinities become a two-row landscape reference underneath battle. */
  #view-battle .affinity-notes-panel h3{margin:0 0 10px;font-size:17px}
  #view-battle .affinity-chart{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  #view-battle .affinity-row{min-height:64px;padding:9px 10px;justify-content:center}
  #view-battle .affinity-row strong{font-size:11px}
  #view-battle .affinity-row>span{font-size:9px}
  #view-battle .affinity-row>small{font-size:8px}
}

/* --- PWA21 onboarding, help, and Lab history polish --- */
.title-help-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.title-help-row h2{margin-right:0}.help-btn{position:relative;display:inline-grid;place-items:center;flex:0 0 auto;width:25px;height:25px;padding:0;border:1px solid rgba(189,164,255,.42);border-radius:50%;background:rgba(189,164,255,.08);color:var(--violet);font-size:13px;font-weight:950;line-height:1;cursor:help;vertical-align:middle}.help-btn:hover,.help-btn:focus-visible{border-color:rgba(245,204,106,.68);color:var(--gold);background:rgba(245,204,106,.08);outline:none}.help-btn-small{width:20px;height:20px;font-size:10px;margin-left:4px;transform:translateY(-1px)}
@media (hover:hover){.help-btn:after{content:attr(data-help-summary);position:absolute;z-index:380;left:50%;top:calc(100% + 9px);width:min(290px,70vw);padding:9px 10px;border:1px solid #695888;border-radius:9px;background:#171321;color:var(--text);box-shadow:0 12px 32px rgba(0,0,0,.42);font-size:10px;font-weight:600;line-height:1.45;text-align:left;text-transform:none;letter-spacing:0;opacity:0;pointer-events:none;transform:translate(-50%,-4px);transition:.14s}.help-btn:hover:after,.help-btn:focus-visible:after{opacity:1;transform:translate(-50%,0)}}
.help-modal-card{width:min(560px,96vw)}.help-modal-body{display:grid;gap:12px;color:var(--muted);line-height:1.6}.help-modal-body p{margin:0}.help-modal-body ul{margin:0;padding-left:19px;display:grid;gap:7px}.help-modal-body strong{color:var(--text)}
.welcome-card{width:min(640px,96vw);text-align:left}.welcome-card>p{color:var(--muted);line-height:1.6}.welcome-steps{display:grid;gap:8px;margin:18px 0}.welcome-steps>div{display:grid;gap:3px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.025)}.welcome-steps strong{font-size:12px}.welcome-steps span{color:var(--muted);font-size:11px;line-height:1.5}.welcome-card .modal-actions{justify-content:flex-start}
.monster-card.lab-combo-known,.monster-card.lab-combo-tried,.monster-card.lab-combo-blocked{opacity:.48;filter:saturate(.45);cursor:not-allowed}.monster-card.lab-combo-known:hover,.monster-card.lab-combo-tried:hover,.monster-card.lab-combo-blocked:hover{transform:none;border-color:var(--line)}.lab-combo-badge{position:absolute;z-index:3;right:6px;top:6px;max-width:calc(100% - 12px);padding:3px 6px;border:1px solid rgba(255,255,255,.14);border-radius:999px;background:rgba(12,10,18,.88);color:#d9d1e4;font-size:7px;font-weight:950;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lab-combo-known .lab-combo-badge{color:#93e6a1;border-color:rgba(147,230,161,.34)}.lab-combo-tried .lab-combo-badge{color:#aea5bf}.lab-combo-blocked .lab-combo-badge{color:#f5cc6a;border-color:rgba(245,204,106,.34)}
@media(max-width:700px){.title-help-row{gap:6px}.help-btn{width:21px;height:21px;font-size:10px}.help-btn-small{width:18px;height:18px;font-size:9px}.welcome-card,.help-modal-card{width:100%;border-radius:18px 18px 0 0;padding:20px 16px max(20px,env(safe-area-inset-bottom))}.welcome-steps{gap:6px;margin:13px 0}.welcome-steps>div{padding:9px}.welcome-steps strong{font-size:11px}.welcome-steps span{font-size:10px}.lab-combo-badge{right:3px;top:3px;font-size:6px;padding:2px 4px}}


/* --- PWA22 roaming bosses, Relics, and hard-pinned mobile navigation --- */
.relic-chip{display:inline-flex;align-items:center;gap:5px;width:max-content;max-width:100%;margin-top:5px;padding:3px 7px;border:1px solid rgba(245,204,106,.28);border-radius:999px;background:rgba(245,204,106,.06);color:var(--gold);font-size:8px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.relic-loadout{display:grid;gap:7px;margin-bottom:16px}.relic-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.02)}.relic-row.equipped{border-color:rgba(245,204,106,.42);background:rgba(245,204,106,.045)}.relic-row .relic-icon{display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:var(--panel2);font-size:23px}.relic-row strong,.relic-row span,.relic-row small{display:block}.relic-row strong{font-size:11px;color:var(--text)}.relic-row span{margin-top:2px;color:var(--muted);font-size:9px;line-height:1.35}.relic-row small{margin-top:3px;color:#817890;font-size:8px}.relic-row button{padding:7px 8px}
.boss-hunt-panel{border-color:rgba(245,204,106,.22)}.boss-sighting{display:grid;gap:10px}.boss-sighting-head{display:flex;align-items:center;gap:10px}.boss-sighting-glyph.creature-visual{width:68px;height:68px;flex:0 0 auto}.boss-sighting-head strong,.boss-sighting-head span{display:block}.boss-sighting-head strong{font-size:13px}.boss-sighting-head span{margin-top:3px;color:var(--muted);font-size:9px}.boss-traits{display:grid;gap:5px}.boss-traits span{display:block;padding:6px 7px;border:1px solid rgba(255,145,189,.18);border-radius:8px;background:rgba(255,145,189,.035);font-size:9px;line-height:1.35}.boss-challenger-grid{display:grid;gap:6px}.boss-challenger-grid button{display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;text-align:left;gap:7px}.boss-choice-glyph.creature-visual{width:42px;height:42px}.boss-challenger-grid b,.boss-challenger-grid small{display:block}.boss-challenger-grid small{margin-top:2px;color:var(--muted);font-size:8px}
.relic-drop-card{width:min(520px,94vw);text-align:center}.relic-drop-icon{display:grid;place-items:center;width:90px;height:90px;margin:10px auto 12px;border:1px solid rgba(245,204,106,.42);border-radius:18px;background:radial-gradient(circle at 50% 35%,rgba(245,204,106,.15),rgba(23,19,36,.8));box-shadow:0 0 30px rgba(245,204,106,.08);font-size:48px}.relic-drop-card>p{color:var(--muted);line-height:1.55}.relic-drop-card .modal-actions{justify-content:center}




/* --- PWA24 branch merge: original ingredient locks + Relic Vault --- */
.monster-slot-wrap{position:relative;min-width:0}.monster-slot-wrap .monster-slot{width:100%;height:100%}.ingredient-lock-btn{position:absolute;right:9px;top:9px;z-index:3;width:30px;height:30px;border:1px solid var(--line);border-radius:9px;background:rgba(16,13,24,.9);color:var(--muted);font-size:14px;display:grid;place-items:center;padding:0}.ingredient-lock-btn:hover{border-color:var(--gold);color:var(--gold)}.ingredient-lock-btn.locked{border-color:rgba(245,204,106,.65);background:rgba(245,204,106,.12);color:var(--gold)}.ingredient-lock-btn:disabled{opacity:.3;cursor:not-allowed}
.relics-panel{grid-column:1/-1}
.relic-boss-card{border:1px solid rgba(245,204,106,.34);background:linear-gradient(145deg,rgba(245,204,106,.08),rgba(189,164,255,.06));border-radius:16px;padding:14px;margin-bottom:14px}
.relic-boss-card.dormant{border-color:var(--line);background:rgba(255,255,255,.018)}
.relic-boss-main{display:flex;align-items:center;gap:14px;margin:9px 0 12px}.relic-boss-main h3{margin:0 0 4px}.relic-boss-main p{margin:5px 0;color:var(--muted)}
.relic-boss-glyph{width:92px;height:92px;flex:0 0 92px}.relic-boss-card>small{display:block;color:var(--muted);margin-top:8px}.relic-vault-heading{margin-top:12px}
.relic-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px}.relic-row{display:grid;grid-template-columns:42px 1fr auto;gap:9px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:9px;background:rgba(255,255,255,.018)}
.relic-row.locked{opacity:.48}.relic-icon{font-size:24px;text-align:center}.relic-row strong{display:block}.relic-row strong small{color:var(--gold);font-size:9px;text-transform:uppercase;margin-left:5px}.relic-row span:not(.relic-icon){display:block;color:var(--muted);font-size:11px;line-height:1.35}.relic-row>b{font-size:10px;color:var(--muted);text-align:right;max-width:86px}
.relic-equip-panel{border:1px solid rgba(245,204,106,.22);border-radius:14px;padding:12px;margin:12px 0;background:rgba(245,204,106,.035)}.relic-equip-select{display:grid;gap:5px;text-align:left}.relic-equip-select>span{font-size:10px;color:var(--muted);text-transform:uppercase;font-weight:900}.relic-equip-select select{width:100%;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);padding:10px}
.relic-drop-card{text-align:center}.relic-drop-icon{font-size:72px;margin:14px 0 4px;filter:drop-shadow(0 0 18px rgba(245,204,106,.3))}.relic-rarity{display:inline-block;border:1px solid rgba(245,204,106,.35);border-radius:999px;padding:4px 10px;color:var(--gold);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.stat-box small{display:block;margin-top:2px;color:var(--muted);font-size:8px}

@media(min-width:1001px){
  #view-battle .battle-layout{grid-template-areas:"team arena" "dojo arena" "trials arena" "relics arena" "affinity affinity"}
  #view-battle .relics-panel{grid-area:relics;grid-column:auto;padding:14px;max-height:420px;overflow:auto}
  #view-battle .relics-panel .relic-list{grid-template-columns:1fr}
  #view-battle .relics-panel .relic-boss-glyph{width:58px;height:58px;flex-basis:58px}
  #view-battle .relics-panel .relic-row{grid-template-columns:32px 1fr auto;padding:7px}.relics-panel .relic-icon{font-size:18px}
}

@media(max-width:700px){
  /* Historical mobile chrome from the working mobile-no-scroll / relic-boss builds. */
  body{padding-bottom:calc(92px + env(safe-area-inset-bottom))}
  main{padding-bottom:calc(108px + env(safe-area-inset-bottom))}
  footer{padding-bottom:calc(116px + env(safe-area-inset-bottom))}
  .tabs{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:210;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:8px max(6px,env(safe-area-inset-right)) calc(13px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));min-height:calc(70px + env(safe-area-inset-bottom));border-top:1px solid rgba(255,255,255,.1);border-bottom:0;background:rgba(16,13,24,.96);box-shadow:0 -10px 30px rgba(0,0,0,.36);overflow:visible;backdrop-filter:blur(20px)}
  .mobile-lab-dock{position:fixed;z-index:205;left:7px;right:7px;bottom:calc(72px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:6px;padding:6px;border:1px solid rgba(245,204,106,.42);border-radius:13px;background:rgba(20,16,31,.96);backdrop-filter:blur(18px);box-shadow:0 12px 34px rgba(0,0,0,.42)}
  .mobile-lab-dock-slots{display:grid;grid-template-columns:minmax(0,1fr) 12px minmax(0,1fr) 58px;gap:4px;align-items:center;min-width:0}
  .mobile-lab-slot-wrap{display:grid;grid-template-columns:minmax(0,1fr) 27px;gap:3px;align-items:center;min-width:0}.mobile-ingredient-lock{height:38px;width:27px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--muted);padding:0;font-size:11px}.mobile-ingredient-lock.locked{border-color:rgba(245,204,106,.65);background:rgba(245,204,106,.12);color:var(--gold)}.mobile-ingredient-lock:disabled{opacity:.3}
  .mobile-battle-hub-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}.mobile-battle-hub-tabs button{font-size:8px;padding-inline:2px}
  .relics-panel{padding:10px}.relic-boss-main{gap:9px}.relic-boss-glyph{width:70px;height:70px;flex-basis:70px}.relic-list{grid-template-columns:1fr;max-height:44dvh;overflow:auto;overscroll-behavior:contain}.relic-row{grid-template-columns:36px 1fr auto;padding:7px}.relic-icon{font-size:20px}
}


/* --- PWA25 Android launch scale + historical compact mobile chrome --- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:700px){
  /* Match the compact mobile chrome from the working pwa18/pwa19 builds. */
  body{padding-bottom:76px}
  main{padding-bottom:94px}
  footer{padding-bottom:104px}
  .tabs{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:210;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:7px max(6px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));min-height:0;border-top:1px solid rgba(255,255,255,.1);border-bottom:0;background:rgba(16,13,24,.96);box-shadow:0 -10px 30px rgba(0,0,0,.36);overflow:visible;backdrop-filter:blur(20px)}
  .mobile-lab-dock{bottom:calc(72px + env(safe-area-inset-bottom))}
}


/* --- PWA27 Beyond the Codex + Tentaguin --- */
.beyond-codex-panel{margin-top:22px;overflow:hidden}
.beyond-codex-intro{margin:-2px 0 14px;color:var(--muted);line-height:1.55}
.beyond-teaser-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.beyond-teaser-card,.beyond-live-card,.secret-dossier-card{border:1px solid var(--line);border-radius:15px;background:rgba(255,255,255,.02)}
.beyond-teaser-card{display:grid;grid-template-rows:118px 1fr;overflow:hidden}
.beyond-teaser-card.locked{border-color:rgba(189,164,255,.22)}
.beyond-blurred-preview{position:relative;display:flex;align-items:center;justify-content:center;gap:22px;overflow:hidden;background:
  radial-gradient(circle at 24% 35%,rgba(88,185,255,.17),transparent 35%),
  radial-gradient(circle at 72% 58%,rgba(189,164,255,.18),transparent 38%),
  linear-gradient(135deg,rgba(245,204,106,.04),rgba(50,36,76,.3))}
.beyond-blurred-preview::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,8,16,.08),rgba(10,8,16,.42));backdrop-filter:blur(5px)}
.beyond-blurred-preview span{position:relative;z-index:0;display:grid;place-items:center;width:58px;height:58px;border:1px solid rgba(255,255,255,.18);border-radius:18px;background:rgba(255,255,255,.07);color:#f0eaff;font-size:28px;filter:blur(7px);transform:scale(1.12)}
.beyond-blurred-preview.secret span{border-radius:50%;font-weight:950}
.beyond-card-copy{display:grid;align-content:start;gap:8px;padding:14px}
.beyond-card-copy h4,.beyond-live-card h4,.secret-dossier-card h4{margin:0;color:var(--text)}
.beyond-card-copy h4{font-size:16px;line-height:1.35}
.beyond-card-copy p,.beyond-live-card>p,.secret-dossier-card>p{margin:0;color:var(--muted);font-size:10px;line-height:1.55}
.beyond-lock,.beyond-progress,.secret-dossier-status{display:block;width:max-content;max-width:100%;font-size:9px;line-height:1.4}
.beyond-lock{margin-top:2px;color:var(--gold)}
.beyond-unlocked-stack{display:grid;gap:14px}
.beyond-live-card{padding:15px}
.beyond-live-card>h4{font-size:18px;margin:4px 0 7px}
.beyond-live-card>p+p{margin-top:5px}
.beyond-progress{margin:12px 0;color:var(--gold)}
.beyond-requirement{display:grid;gap:4px;margin:10px 0 13px;padding:9px 10px;border:1px solid rgba(245,204,106,.25);border-radius:10px;background:rgba(245,204,106,.035)}.beyond-requirement.ready{border-color:rgba(147,230,161,.25);background:rgba(147,230,161,.03)}.beyond-requirement strong{font-size:9px;color:var(--gold)}.beyond-requirement.ready strong{color:#93e6a1}.beyond-requirement span{font-size:8px;color:var(--muted);line-height:1.45}
.beyond-knowledge{margin:12px 0;padding:11px 12px;border:1px solid rgba(189,164,255,.18);border-radius:11px;background:rgba(189,164,255,.035)}
.beyond-knowledge>strong{display:block;margin-bottom:6px;font-size:10px}
.beyond-knowledge ul{margin:0;padding-left:18px;display:grid;gap:5px;color:var(--muted);font-size:9px;line-height:1.45}
.beyond-empty{display:grid;gap:3px;margin:10px 0;padding:10px 11px;border:1px dashed rgba(255,255,255,.13);border-radius:10px;color:var(--muted)}
.beyond-empty strong{color:var(--text);font-size:10px}.beyond-empty span{font-size:9px}
.secret-dossier-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:13px}
.secret-dossier-card{display:grid;align-content:start;gap:9px;padding:11px;min-width:0}
.secret-dossier-card.locked{background:linear-gradient(145deg,rgba(32,26,46,.72),rgba(17,14,25,.96));border-color:rgba(189,164,255,.2)}
.secret-dossier-card.revealed{border-color:rgba(245,204,106,.28);background:linear-gradient(145deg,rgba(245,204,106,.035),rgba(189,164,255,.035))}
.secret-dossier-card.pending{border-color:rgba(255,145,189,.34)}
.secret-dossier-id{color:var(--gold);font-size:8px;font-weight:950;letter-spacing:.09em}
.secret-dossier-unknown{display:flex;align-items:center;gap:9px;padding:8px;border:1px solid rgba(255,255,255,.07);border-radius:10px;background:rgba(255,255,255,.02)}
.secret-dossier-unknown>span{display:grid;place-items:center;width:44px;height:44px;flex:0 0 auto;border:1px solid rgba(189,164,255,.22);border-radius:50%;background:rgba(189,164,255,.05);color:rgba(229,220,243,.52);font-size:22px;filter:blur(2px)}
.secret-dossier-unknown h4{font-size:12px}.secret-dossier-unknown small{display:block;margin-top:3px;color:var(--muted);font-size:7px;letter-spacing:.1em}
.secret-dossier-status{margin-top:auto;color:var(--muted)}
.secret-dossier-analysis{display:grid;gap:4px;padding:8px;border:1px solid rgba(88,185,255,.18);border-radius:9px;background:rgba(88,185,255,.03)}.secret-dossier-analysis strong{font-size:8px;color:#8bd2ff}.secret-dossier-analysis span{font-size:8px;color:var(--muted);line-height:1.45}
.secret-dossier-reveal{display:grid;grid-template-columns:70px minmax(0,1fr);gap:9px;align-items:center}
.secret-dossier-sprite.creature-visual{width:70px;height:70px}
.secret-dossier-reveal h4{font-size:13px}.secret-dossier-reveal p{margin:4px 0 0;color:var(--muted);font-size:8px;line-height:1.45}
.secret-dossier-actions{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:auto}
.secret-dossier-actions>strong{color:var(--muted);font-size:8px;line-height:1.35}
.secret-dossier-actions .ghost-btn{padding:6px 7px;font-size:8px}
.secret-detail-dossier{display:grid;gap:8px;margin:11px 0;padding:11px;border:1px solid rgba(245,204,106,.22);border-radius:11px;background:rgba(245,204,106,.025)}
.secret-detail-dossier .secret-detail-id{color:var(--gold);font-size:8px;font-weight:950;letter-spacing:.09em}
.secret-detail-dossier p{margin:0;color:var(--muted);font-size:9px;line-height:1.5}
.status-disorient{border-color:rgba(88,185,255,.42)!important;color:#8bd2ff!important;background:rgba(88,185,255,.08)!important}
.status-weakness{border-color:rgba(255,145,189,.42)!important;color:#ff9fc7!important;background:rgba(255,145,189,.08)!important}

@media(max-width:900px){
  .secret-dossier-grid{grid-template-columns:1fr}
}
@media(max-width:700px){
  .beyond-codex-panel{margin-top:13px;padding:11px}
  .beyond-teaser-grid{grid-template-columns:1fr;gap:9px}
  .beyond-teaser-card{grid-template-columns:92px minmax(0,1fr);grid-template-rows:auto;min-height:118px}
  .beyond-blurred-preview{min-height:100%;gap:5px}.beyond-blurred-preview span{width:34px;height:34px;border-radius:10px;font-size:17px}
  .beyond-card-copy{padding:11px;gap:6px}.beyond-card-copy h4{font-size:13px}.beyond-card-copy p{font-size:9px}
  .beyond-live-card{padding:11px}.beyond-live-card>h4{font-size:15px}.beyond-live-card>p{font-size:9px}
  .secret-dossier-card{padding:9px}.secret-dossier-grid{gap:7px}
  .secret-dossier-reveal{grid-template-columns:58px minmax(0,1fr)}.secret-dossier-sprite.creature-visual{width:58px;height:58px}
}


/* PWA29 spoiler-safe changelog */
.changelog-card{width:min(620px,96vw);max-height:min(82vh,760px);overflow:auto}.changelog-intro{color:var(--muted);margin:-3px 0 15px;line-height:1.55}.changelog-list{display:grid;gap:10px}.changelog-entry{border:1px solid rgba(255,255,255,.08);border-radius:14px;background:rgba(255,255,255,.025);padding:13px 14px}.changelog-entry>div{display:flex;align-items:center;gap:8px;margin-bottom:3px}.changelog-entry>div strong{font-size:11px;color:var(--gold)}.changelog-entry>div span{font-size:8px;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:2px 6px}.changelog-entry h3{font-size:14px;margin:0 0 7px}.changelog-entry ul{margin:0;padding-left:18px;color:var(--muted);display:grid;gap:4px;font-size:11px;line-height:1.45}.changelog-note{margin-top:14px}.changelog-card .modal-close{position:sticky;top:0;float:right;z-index:2}
@media(max-width:700px){.changelog-card{width:100%;max-height:86dvh;border-radius:18px 18px 0 0;padding:20px 16px max(20px,env(safe-area-inset-bottom))}.changelog-entry{padding:11px 12px}.changelog-entry h3{font-size:13px}.changelog-entry ul{font-size:10px}}
