:root{--panel:#151025e8;--panel2:#100b1b;--line:#4c3763;--text:#f6f0ff;--muted:#aa9db9;--gold:#f7b731;--green:#30d67a;--blue:#4d9cff;--red:#ff5578;--violet:#a78bfa;--orange:#fb8a3c}*{box-sizing:border-box}body{margin:0;min-height:100vh;color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;background:radial-gradient(circle at 15% 8%,#34205d 0,transparent 30%),radial-gradient(circle at 86% 22%,#76361766 0,transparent 33%),linear-gradient(180deg,#0c0715,#120b1d 50%,#08050e)}button,select,input{font:inherit}.shell{width:min(1540px,calc(100% - 26px));margin:auto;padding:76px 0 64px}.top-center-nav{position:absolute;top:18px;left:50%;transform:translateX(-50%);display:flex;gap:10px;z-index:20}.nav-pill{display:flex;align-items:center;gap:7px;text-decoration:none;color:#f3ecff;background:#160e25e8;border:1px solid #654b7d;border-radius:999px;padding:10px 17px;font-weight:850;box-shadow:0 10px 30px #0005;transition:.2s}.nav-pill:hover{transform:translateY(-2px);border-color:#dca629;box-shadow:0 0 24px #f7b73126}.event-hero{height:min(390px,42vw);min-height:265px;position:relative;overflow:hidden;border-radius:26px;border:1px solid #6c4a79;box-shadow:0 30px 85px #0008}.event-hero img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.event-hero:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#090512f2 0,#10091dba 45%,#23101d33 78%),linear-gradient(0deg,#090512c9,transparent 58%)}.event-copy{position:absolute;z-index:2;left:clamp(22px,4vw,58px);top:50%;transform:translateY(-50%);max-width:720px}.event-kicker{display:inline-flex;border:1px solid #d79a4788;background:#7139163d;color:#ffd4a4;border-radius:999px;padding:7px 11px;font-size:.75rem;font-weight:950;letter-spacing:.08em}.event-copy h1{font-size:clamp(2.6rem,5vw,5.3rem);line-height:.9;margin:12px 0}.event-copy p{margin:0;max-width:690px;color:#d5c8dd;line-height:1.55}.main-tabs{display:flex;justify-content:center;gap:10px;margin:18px auto 0}.tab-btn{border:1px solid #55406b;color:#aa9abb;background:#130c20;border-radius:15px;padding:12px 23px;font-weight:900;cursor:pointer;transition:.2s}.tab-btn:hover{color:#fff;border-color:#8a6ca3;transform:translateY(-1px)}.tab-btn.active{color:#1b1004;border-color:#ffd66c;background:linear-gradient(135deg,#ffd66c,#e99718);box-shadow:0 0 28px #f7b7313d}.panel{margin-top:15px;border:1px solid var(--line);background:var(--panel);backdrop-filter:blur(12px);border-radius:23px;padding:19px;box-shadow:0 20px 55px #0004}.section-title{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:13px}.section-title h2,.section-title h3{margin:0}.section-title p{margin:0;color:var(--muted);font-size:.8rem}.setup-top{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:11px}.field{display:flex;flex-direction:column;gap:5px}.field>span{color:#b2a5c0;font-size:.72rem;font-weight:750}.field input,.field select,.gear-field input,.gear-field select,.config-hero-select select{width:100%;min-height:39px;background:#0d0917;color:#fff;border:1px solid #4b385f;border-radius:10px;padding:8px 10px;outline:0;transition:.18s}.field input:focus,.field select:focus,.gear-field input:focus,.gear-field select:focus,.config-hero-select select:focus{border-color:#e8b23d;box-shadow:0 0 0 3px #f7b73116,0 0 16px #f7b7311a}.troop-input-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.troop-card{position:relative;overflow:hidden;border:1px solid #49365f;background:linear-gradient(155deg,#130c20,#0d0917);border-radius:17px;padding:12px}.troop-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px}.troop-card.inf:before{background:var(--green);box-shadow:0 0 18px var(--green)}.troop-card.lancer:before{background:var(--blue);box-shadow:0 0 18px var(--blue)}.troop-card.marksman:before{background:var(--red);box-shadow:0 0 18px var(--red)}.troop-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;padding-left:3px}.troop-title h3{margin:0;font-size:1rem}.troop-title small{color:#8d7f9a}.mini-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.equipment-wrap{margin-top:12px}.gear-panel{border:1px solid #49365e;border-radius:16px;background:#100b1b;margin-top:10px;overflow:hidden}.gear-panel-head{display:flex;justify-content:space-between;align-items:end;gap:20px;padding:12px 14px;background:linear-gradient(90deg,#1b102b,#130c20)}.gear-panel-head h4{margin:2px 0 0;font-size:1rem}.gear-panel-head small{color:#9e8dab;font-size:.7rem}.gear-kicker{font-size:.64rem;letter-spacing:.14em;color:#f7c750;font-weight:950}.gear-troop-row{display:grid;grid-template-columns:130px 1fr;gap:12px;padding:10px 13px;border-top:1px solid #392a49}.gear-troop-name{display:flex;gap:8px;align-items:center;font-weight:900}.troop-dot{width:8px;height:8px;border-radius:50%}.gear-troop-row.inf .troop-dot{background:var(--green);box-shadow:0 0 12px var(--green)}.gear-troop-row.lancer .troop-dot{background:var(--blue);box-shadow:0 0 12px var(--blue)}.gear-troop-row.marksman .troop-dot{background:var(--red);box-shadow:0 0 12px var(--red)}.gear-row-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.gear-field{display:flex;flex-direction:column;gap:4px}.gear-field>span{color:#9889a5;font-size:.64rem}.charm-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}.hero-gear-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.hero-gear-piece{border:1px solid #3a2a4a;background:#120c1d;border-radius:10px;padding:7px}.hero-gear-piece>b{display:block;color:#eee5f6;font-size:.74rem;margin-bottom:5px}.optimize-zone{text-align:center;padding:20px 0 4px}.optimize-btn{position:relative;min-width:280px;border:1px solid #ffdf72;border-radius:17px;padding:16px 34px;color:#1a1003;background:linear-gradient(115deg,#cb8210,#ffd867,#e79b13);font-weight:1000;font-size:1.12rem;cursor:pointer;box-shadow:0 0 0 4px #f7b73112,0 15px 38px #d88d163c;overflow:hidden;animation:goldPulse 2.4s ease-in-out infinite}.optimize-btn:before{content:"";position:absolute;top:-30%;bottom:-30%;width:55px;left:-90px;transform:rotate(20deg);background:linear-gradient(90deg,transparent,#fff9,transparent);animation:shine 2.5s linear infinite}.optimize-btn:hover{transform:translateY(-2px) scale(1.015)}.optimize-btn:disabled{filter:grayscale(.7);opacity:.7}.secondary{border:1px solid #69527f;border-radius:12px;background:#241730;color:white;font-weight:850;padding:11px 18px;cursor:pointer}.progress-wrap{max-width:720px;margin:13px auto 0}.progress-track{height:10px;background:#2a2037;border-radius:99px;overflow:hidden}.progress{height:100%;width:0;background:linear-gradient(90deg,#ad8cff,#ffac5c);box-shadow:0 0 12px #ffac5c88;transition:width .18s}.progress-text{color:#a394af;font-size:.72rem;margin-top:6px}.result{margin-top:16px;border:1px solid #5b4370;background:linear-gradient(145deg,#170f27,#0d0916);border-radius:20px;padding:17px}.result-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.result-head h2{margin:3px 0;font-size:2.2rem}.eyebrow{font-size:.67rem;letter-spacing:.14em;color:#f7c750;font-weight:950}.result-head small,.result-head p{color:var(--muted)}.pve-heroes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}.pve-hero-card{min-width:0;border:1px solid #49375e;border-radius:16px;background:#100b1b;padding:11px;position:relative;overflow:hidden}.pve-hero-card.inf{box-shadow:inset 0 2px 0 #30d67a66}.pve-hero-card.lancer{box-shadow:inset 0 2px 0 #4d9cff66}.pve-hero-card.marksman{box-shadow:inset 0 2px 0 #ff557866}.pve-hero-top{display:flex;gap:10px;align-items:center}.pve-hero-top img,.hero-initials{width:66px;height:66px;border-radius:13px;object-fit:cover;background:#2a1a38}.hero-initials{display:grid;place-items:center;font-weight:950}.pve-hero-top h3{margin:0;font-size:1.05rem}.hero-sub{font-size:.7rem;color:#aa9bb5}.hero-stars{color:#ffd45e;letter-spacing:2px;text-shadow:0 0 9px #f6bd34;margin-top:2px;font-size:.82rem}.pve-skills{display:grid;gap:5px;margin-top:9px}.pve-skill{display:flex;gap:7px;padding:6px;border:1px solid #3b2c4c;background:#120c1e;border-radius:9px}.skill-num{flex:0 0 22px;width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:#34224d;color:#d4b8ff;font-size:.66rem;font-weight:950}.pve-skill b{display:block;font-size:.7rem}.pve-skill small{display:block;color:#91839d;font-size:.6rem;line-height:1.25;margin-top:2px}.pve-widget{margin-top:8px;padding:8px;border:1px solid #5f491d;background:linear-gradient(135deg,#2c230d55,#151020);border-radius:10px}.pve-widget span{display:block;color:#f5c95c;font-size:.58rem;font-weight:950;letter-spacing:.08em}.pve-widget b{font-size:.76rem}.pve-widget small{display:block;color:#aaa0ad;font-size:.61rem;margin-top:3px}.pve-widget em{display:inline-block;margin-top:5px;font-style:normal;font-size:.58rem;border-radius:999px;padding:3px 6px}.pve-widget em.active{background:#14532d77;color:#86efac}.pve-widget em.inactive{background:#4c3b5c;color:#c0b3ca}.pve-ratio-bar{display:flex;height:42px;border-radius:13px;overflow:hidden;margin-top:14px;background:#23182f;border:1px solid #56416c;box-shadow:inset 0 0 14px #0006}.ratio-part{display:grid;place-items:center;min-width:0}.ratio-part span{font-weight:1000;text-shadow:0 1px 5px #000}.ratio-part.inf{background:linear-gradient(90deg,#10a64f,#4ee88c);box-shadow:inset 0 0 18px #9cffc455}.ratio-part.lancer{background:linear-gradient(90deg,#276bdc,#65adff);box-shadow:inset 0 0 18px #b5d9ff55}.ratio-part.marksman{background:linear-gradient(90deg,#d9365c,#ff6c89);box-shadow:inset 0 0 18px #ffc2d055}.ratio-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:7px}.ratio-counts div{display:flex;justify-content:space-between;border:1px solid #423252;background:#100b1b;border-radius:9px;padding:7px 9px}.ratio-counts span{color:#9e91a8;font-size:.7rem}.configure-cta{display:block;margin:16px auto 2px;border:1px solid #ffd66c;background:#241806;color:#ffe7a6;border-radius:14px;padding:13px 28px;font-weight:950;cursor:pointer;box-shadow:0 0 22px #f7b73125}.configure-cta:hover{background:#3b2709;transform:translateY(-1px)}.alternatives{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:13px}.alternatives section{border:1px solid #443553;background:#100b1a;border-radius:13px;padding:10px}.alternatives h3{margin:0 0 6px}.alt-row{display:flex;justify-content:space-between;gap:8px;padding:7px 0;border-top:1px solid #31263c}.alt-row small{display:block;color:#9587a1;font-size:.68rem}.alt-row strong{color:#ff9cac}.config-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.config-hero-select{border:1px solid #49375e;background:#100b1b;border-radius:13px;padding:10px}.config-hero-select h4{margin:0 0 7px}.ratio-editor{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.ratio-editor .field input{text-align:center;font-size:1.05rem;font-weight:900}.calc-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}.calc-summary div{border:1px solid #47365a;background:#100b1b;border-radius:11px;padding:9px}.calc-summary span{display:block;color:#93869e;font-size:.65rem}.calc-summary b{font-size:.95rem}.model-note{margin-top:12px;border-left:3px solid #fb8a3c;background:#6b2f172a;color:#d9b79f;border-radius:0 10px 10px 0;padding:9px 12px;font-size:.75rem}.error{color:#fecaca;background:#7f1d1d55;border:1px solid #b91c1c77;padding:12px;border-radius:10px}@keyframes goldPulse{50%{box-shadow:0 0 0 6px #f7b7310d,0 18px 42px #d88d1650,0 0 28px #f7b73124}}@keyframes shine{0%{left:-90px}60%,100%{left:120%}}@media(max-width:1000px){.troop-input-grid,.pve-heroes,.alternatives,.config-grid{grid-template-columns:1fr}.charm-strip{grid-template-columns:repeat(3,1fr)}.hero-gear-strip{grid-template-columns:repeat(2,1fr)}.gear-troop-row{grid-template-columns:1fr}.calc-summary{grid-template-columns:1fr 1fr}}@media(max-width:650px){.shell{width:calc(100% - 14px);padding-top:72px}.event-hero{height:390px}.event-hero:after{background:linear-gradient(0deg,#090512f2,#12091d66)}.event-copy{left:18px;right:18px;top:auto;bottom:18px;transform:none}.setup-top,.mini-grid,.ratio-editor{grid-template-columns:1fr}.gear-row-content{grid-template-columns:1fr}.top-center-nav{top:13px}.nav-pill{padding:8px 12px}.main-tabs{display:grid;grid-template-columns:1fr 1fr}.ratio-counts,.calc-summary{grid-template-columns:1fr}.hero-gear-strip{grid-template-columns:1fr}.charm-strip{grid-template-columns:repeat(2,1fr)}}

.setup-compact{display:grid;gap:10px;align-items:end;margin:0 auto 12px}.endless-controls{grid-template-columns:170px 220px;width:min(100%,420px)}
.gen-control{display:flex;flex-direction:column;gap:5px;position:relative}.gen-control>span{color:#a99bb4;font-size:.72rem;font-weight:750}.gen-gold{min-height:42px;border:1px solid #ffdb6b;border-radius:11px;background:linear-gradient(135deg,#ffd86b,#d98d13);color:#201305;font-weight:1000;letter-spacing:.04em;cursor:pointer;box-shadow:0 0 18px #f7b7312b}.gen-gold strong{font-size:1.05rem}
.gen-menu{position:absolute;top:68px;left:0;z-index:50;display:grid;grid-template-columns:repeat(4,58px);gap:6px;padding:8px;border:1px solid #6f5520;border-radius:12px;background:#120c1e;box-shadow:0 18px 45px #0009}.gen-menu[hidden]{display:none}.gen-menu button{border:1px solid #5f4a1d;border-radius:9px;background:#241730;color:#ffe08b;padding:8px;font-weight:900;cursor:pointer}.gen-menu button.active,.gen-menu button:hover{background:#f3b62c;color:#211405;border-color:#ffe08b}
.stat-source-tabs{display:flex;justify-content:center;gap:8px;width:min(100%,620px);margin:4px auto 13px}.stat-source-tab{flex:1;border:1px solid #49375e;border-radius:12px;background:#100b1b;color:#b5a7c0;padding:10px 15px;font-weight:900;cursor:pointer}.stat-source-tab.active{background:linear-gradient(135deg,#ffd66c,#e99718);color:#1b1104;border-color:#ffde79;box-shadow:0 0 20px #f7b7312b}
.manual-stat input[readonly]{background:#17121f;color:#c4b5fd;border-color:#4b3b59;cursor:not-allowed}.manual-stat.calculated{opacity:.92}
.result-head{justify-content:center!important;text-align:center}.result-head>div{width:100%;text-align:center}.damage-line{display:flex;align-items:baseline;justify-content:center;gap:9px;flex-wrap:wrap}.damage-line strong{font-size:2.25rem;line-height:1}.damage-line span{color:var(--muted);font-size:.95rem;font-weight:750}.result-head .eyebrow{display:block;margin-bottom:6px}
@media(max-width:620px){.endless-controls{grid-template-columns:1fr;width:100%}.stat-source-tabs{display:grid;grid-template-columns:1fr}}


/* VNEXT PVE FLOW */
.main-tabs .tab-btn,.stat-source-tab{
  box-shadow:none!important;background:#171021!important;color:#ad9db9!important;border-color:#503b65!important;
}
.main-tabs .tab-btn.active[data-tab="optimize"]{
  background:linear-gradient(135deg,#49316f,#6d48a1)!important;
  color:#f7efff!important;border-color:#b99aff!important;
}
.main-tabs .tab-btn.active[data-tab="configure"]{
  background:linear-gradient(135deg,#143f4f,#1d677a)!important;
  color:#effcff!important;border-color:#65d1e8!important;
}
.stat-source-tab.active{
  background:linear-gradient(135deg,#382452,#553576)!important;
  color:#f7efff!important;border-color:#b998e9!important;
  box-shadow:0 0 18px rgba(167,139,250,.14)!important;
}
.configure-cta{
  border-color:#a78bfa!important;background:#25183a!important;color:#ede5ff!important;
  box-shadow:0 0 20px rgba(167,139,250,.14)!important;
}
.configure-cta:hover{background:#35214e!important}
#endConfigHeroEditor{margin-top:8px}


/* Endless Trials: keep long skill descriptions inside their cards */
.pve-skill-box{min-width:0!important;height:auto!important;align-items:start!important}
.pve-skill-box>div{min-width:0!important;max-width:100%!important}
.pve-skill-box small{
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  white-space:normal!important;
  line-height:1.22!important;
}
.pve-skill-box b,.pve-skill-box em{
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}


/* Shared Dark / Light event theme controls */
body{color-scheme:dark}
.theme-toggle{
  display:flex;align-items:center;justify-content:center;gap:7px;
  border:1px solid #4c6a80;border-radius:999px;
  background:#091827e8;color:#edf8ff;
  min-height:42px;padding:9px 15px;font-weight:900;cursor:pointer;
  box-shadow:0 10px 30px #0004;transition:.18s;
}
.theme-toggle:hover{transform:translateY(-2px);border-color:#f0bc45}
.theme-toggle-icon{font-size:1rem;line-height:1}
.theme-toggle-text{font-size:.76rem;white-space:nowrap}
body.light-theme{color-scheme:light}
body.light-theme .theme-toggle{
  background:#ffffffed;color:#173247;border-color:#8eb3c9;
  box-shadow:0 8px 24px #345a711e
}
body.light-theme .nav-pill{
  background:#ffffffed!important;color:#153247!important;
  border-color:#9bbbcf!important;box-shadow:0 8px 24px #345a711e!important
}
body.light-theme .section-title h2,
body.light-theme .section-title h3,
body.light-theme .troop-title h3,
body.light-theme .gear-panel-head h4,
body.light-theme .gear-troop-name,
body.light-theme .alternatives h3,
body.light-theme .config-hero-select h4,
body.light-theme .pve-hero-top h3{
  color:#10283a!important
}
body.light-theme .section-title p,
body.light-theme .troop-title small,
body.light-theme .gear-panel-head small,
body.light-theme .gear-field>span,
body.light-theme .hero-sub,
body.light-theme .alt-row small,
body.light-theme .calc-summary span,
body.light-theme .progress-text{
  color:#587084!important
}
body.light-theme .field>span,
body.light-theme .field label,
body.light-theme .gen-control>span,
body.light-theme .cyrille-control>span{
  color:#425d71!important
}
body.light-theme .field input,
body.light-theme .field select,
body.light-theme .gear-field input,
body.light-theme .gear-field select,
body.light-theme .config-hero-select select,
body.light-theme .manual-stat input[readonly]{
  background:#fff!important;color:#10263a!important;border-color:#9cb9cb!important;
  box-shadow:none!important
}
body.light-theme .field input:focus,
body.light-theme .field select:focus,
body.light-theme .gear-field input:focus,
body.light-theme .gear-field select:focus,
body.light-theme .config-hero-select select:focus{
  border-color:#b88410!important;
  box-shadow:0 0 0 3px #e7b83c28!important
}
body.light-theme .troop-card,
body.light-theme .gear-panel,
body.light-theme .hero-gear-piece,
body.light-theme .result,
body.light-theme .pve-hero-card,
body.light-theme .pve-skill,
body.light-theme .ratio-counts div,
body.light-theme .alternatives section,
body.light-theme .config-hero-select,
body.light-theme .calc-summary div{
  background:#f8fcff!important;color:#10283a!important;
  border-color:#a9c5d6!important;box-shadow:none!important
}
body.light-theme .gear-panel-head{
  background:linear-gradient(90deg,#eaf5fb,#f8fcff)!important;
  border-color:#a9c5d6!important
}
body.light-theme .gear-troop-row{border-color:#c6d9e5!important}
body.light-theme .pve-skill small,
body.light-theme .pve-widget small{color:#536d80!important}
body.light-theme .pve-widget{
  background:#fff7df!important;border-color:#d8b85c!important;color:#2d2818!important
}
body.light-theme .pve-widget em.inactive{background:#e4eaf0!important;color:#4a6071!important}
body.light-theme .progress-track{background:#d7e3eb!important}
body.light-theme .secondary{
  background:#e8f2f8!important;color:#173247!important;border-color:#9ab7c9!important
}
body.light-theme .error{
  color:#7f1d1d!important;background:#fee2e2!important;border-color:#fca5a5!important
}

/* Shared PvE editor / shared engine content inserted after page load */
body.light-theme .pve-battle-hero,
body.light-theme .pve-hero-editor-row,
body.light-theme .pve-hero-dialog,
body.light-theme .pve-hero-modal,
body.light-theme .pve-choice,
body.light-theme .pve-skill-box,
body.light-theme .widget-box-v4,
body.light-theme .v61-base-panel,
body.light-theme .v61-base-stat-card,
body.light-theme .v61-base-field,
body.light-theme .v61-resolved-wrap,
body.light-theme .v61-resolved-card,
body.light-theme .hero-gear-piece,
body.light-theme .hero-gear-center,
body.light-theme .v61-base-editor{
  background:#f7fbfe!important;color:#10283a!important;border-color:#a9c5d6!important
}
body.light-theme .pve-skill-box b,
body.light-theme .pve-skill-box small,
body.light-theme .pve-skill-box em,
body.light-theme .pve-battle-hero b,
body.light-theme .pve-battle-hero small,
body.light-theme .v61-base-panel h3,
body.light-theme .v61-base-panel h4,
body.light-theme .v61-base-field>span{
  color:#173247!important
}
body.light-theme .pve-star-step{filter:drop-shadow(0 0 4px #139bc955)}
body.light-theme .hero-gear-mastery-btn,
body.light-theme .piece-controls>.field>select{
  background:#fff!important;color:#10283a!important;border-color:#9cb9cb!important
}
body.light-theme .hero-gear-mastery-menu,
body.light-theme .gen-menu,
body.light-theme .cyrille-menu{
  background:#f8fcff!important;border-color:#8eacbf!important;box-shadow:0 18px 42px #2c52652d!important
}
body.light-theme .hero-gear-mastery-menu button,
body.light-theme .gen-menu button,
body.light-theme .cyrille-menu button{
  background:#eaf3f8!important;color:#173247!important;border-color:#b3cad8!important
}
body.light-theme .hero-gear-mastery-menu button.active,
body.light-theme .gen-menu button.active,
body.light-theme .cyrille-menu button.active{
  background:#f5bd37!important;color:#201405!important;border-color:#d89b15!important
}

/* Endless Trials light theme: pale frost/lavender with dark readable panels */
body.light-theme{
  background:
    radial-gradient(circle at 14% 8%,#f4f0ff 0,transparent 32%),
    radial-gradient(circle at 87% 18%,#ffe9d7 0,transparent 31%),
    linear-gradient(180deg,#eef5fb,#e6edf8 52%,#f7f9fc)!important;
  color:#1a2433!important
}
body.light-theme .panel{
  background:rgba(250,251,255,.96)!important;border-color:#b3bfd2!important;
  color:#172337!important;box-shadow:0 18px 52px #34415720!important
}
body.light-theme .main-tabs .tab-btn,
body.light-theme .stat-source-tab{
  background:#f0edf7!important;color:#594d68!important;border-color:#b6a8c5!important
}
body.light-theme .main-tabs .tab-btn.active[data-tab="optimize"]{
  background:#e5daf5!important;color:#513475!important;border-color:#9a7abc!important
}
body.light-theme .main-tabs .tab-btn.active[data-tab="configure"]{
  background:#dceff4!important;color:#174d5b!important;border-color:#65a5b5!important
}
body.light-theme .stat-source-tab.active{
  background:#e6dcf2!important;color:#513968!important;border-color:#9d82b7!important
}
body.light-theme .gen-control>span{color:#48586b!important}
body.light-theme .gen-menu{background:#fff!important}
body.light-theme .manual-stat input[readonly]{background:#eef3f8!important;color:#33465a!important}
body.light-theme .event-copy{color:#fff!important}
body.light-theme .event-copy p{color:#f1eafa!important}


/* Floating theme button: stays visible while scrolling */
.theme-toggle{
  position:fixed!important;
  right:22px!important;
  top:50%!important;
  z-index:9999!important;
  transform:translateY(-50%)!important;
  min-width:128px!important;
  min-height:46px!important;
  padding:10px 16px!important;
  border-radius:999px!important;
  backdrop-filter:blur(12px)!important;
}
.theme-toggle:hover{
  transform:translateY(-50%) translateX(-3px)!important;
}
.theme-toggle:active{
  transform:translateY(-50%) translateX(-1px)!important;
}
@media(max-width:700px){
  .theme-toggle{
    right:10px!important;
    top:auto!important;
    bottom:16px!important;
    transform:none!important;
    min-width:112px!important;
    min-height:42px!important;
    padding:8px 12px!important;
  }
  .theme-toggle:hover,
  .theme-toggle:active{
    transform:none!important;
  }
}


/* TRUE viewport-fixed theme control.
   Kept outside .top-center-nav because that nav is transformed. */
.floating-theme-toggle{
  position:fixed!important;
  right:20px!important;
  left:auto!important;
  top:50vh!important;
  bottom:auto!important;
  z-index:100000!important;
  transform:translateY(-50%)!important;
  margin:0!important;
}
.floating-theme-toggle:hover{
  transform:translateY(-50%) translateX(-4px)!important;
}
.floating-theme-toggle:active{
  transform:translateY(-50%) translateX(-2px)!important;
}
@media(max-width:700px){
  .floating-theme-toggle{
    right:10px!important;
    top:auto!important;
    bottom:14px!important;
    transform:none!important;
  }
  .floating-theme-toggle:hover,
  .floating-theme-toggle:active{
    transform:none!important;
  }
}


/* =========================================================
   CLEAN PvE LIGHT THEME
   Bear Hunt + Endless Trials
   White surfaces, dark navy text, colored accents only.
   ========================================================= */

/* Event artwork text must remain readable even in Light mode */
body.light-theme .event-copy,
body.light-theme .event-copy h1,
body.light-theme .event-copy p{
  color:#ffffff!important;
}
body.light-theme .event-copy h1{
  text-shadow:0 3px 18px rgba(0,0,0,.92),0 1px 3px rgba(0,0,0,.95)!important;
}
body.light-theme .event-copy p{
  text-shadow:0 2px 10px rgba(0,0,0,.92)!important;
}
body.light-theme .event-kicker{
  color:#fff3c7!important;
  background:rgba(89,50,7,.72)!important;
  border-color:#f0b43f!important;
  box-shadow:0 3px 14px rgba(0,0,0,.25)!important;
}

/* ---------- Hero editor ---------- */
body.light-theme .pve-battle-hero,
body.light-theme .hero-progression,
body.light-theme .hero-photo-select,
body.light-theme .pve-skill-box,
body.light-theme .widget-box-v4{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#a8c5d7!important;
  box-shadow:none!important;
}

body.light-theme .pve-battle-hero.inf{border-top-color:#20b96b!important}
body.light-theme .pve-battle-hero.lancer{border-top-color:#3188e8!important}
body.light-theme .pve-battle-hero.marksman{border-top-color:#ef476f!important}

body.light-theme .hero-photo-select{
  color:#163047!important;
}
body.light-theme .hero-photo-select:hover{
  border-color:#1599d3!important;
  background:#ffffff!important;
}
body.light-theme .hero-photo-name,
body.light-theme .pve-skill-box b,
body.light-theme .widget-line b,
body.light-theme .widget-line span,
body.light-theme .widget-box-v4>div,
body.light-theme .widget-current-stats{
  color:#142a3b!important;
}

body.light-theme .star-readout{
  color:#0875a6!important;
  text-shadow:none!important;
}
body.light-theme .skill-level-readout{
  color:#6742a3!important;
  text-shadow:none!important;
}
body.light-theme .hero-stat-strip{
  color:#4d6680!important;
}
body.light-theme .hero-stat-strip b,
body.light-theme .widget-current-stats b{
  color:#087f88!important;
  text-shadow:none!important;
}
body.light-theme .pve-skill-box small,
body.light-theme .small.muted,
body.light-theme .widget-box-v4 .small.muted{
  color:#5c7183!important;
}
body.light-theme .pve-skill-box em{
  color:#0878a5!important;
}
body.light-theme .skill-active-value{
  color:#128b4d!important;
  text-shadow:none!important;
}

body.light-theme .star-up-btn,
body.light-theme .star-max-btn{
  background:#ffffff!important;
  color:#17324a!important;
  border-color:#8fb6ce!important;
  box-shadow:none!important;
}
body.light-theme .star-up-btn:hover,
body.light-theme .star-max-btn:hover{
  background:#eef8fd!important;
  border-color:#2c98cc!important;
}
body.light-theme .hero-widget-corner label{
  color:#506b80!important;
}
body.light-theme .hero-widget-corner select,
body.light-theme .pve-widget-readout{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
  box-shadow:none!important;
}

body.light-theme .widget-img{
  background:#ffffff!important;
}
body.light-theme .widget-status.inactive{
  background:#edf2f6!important;
  color:#536879!important;
  border:1px solid #c7d5df!important;
}
body.light-theme .widget-status.active{
  background:#e3f7ea!important;
  color:#17683c!important;
  border-color:#75c798!important;
}

/* ---------- Ratio bar readability ---------- */
body.light-theme .pve-ratio-bar{
  border-color:#9eb9ca!important;
  background:#ffffff!important;
  box-shadow:none!important;
}
body.light-theme .ratio-part span{
  color:#ffffff!important;
  font-weight:1000!important;
  text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 7px rgba(0,0,0,.65)!important;
  background:rgba(8,24,40,.26)!important;
  border-radius:999px!important;
  padding:3px 8px!important;
  line-height:1!important;
}
body.light-theme .ratio-counts div{
  background:#ffffff!important;
  color:#173148!important;
  border-color:#adc6d5!important;
}
body.light-theme .ratio-counts span{color:#597186!important}
body.light-theme .ratio-counts b{color:#142a3b!important}

/* ---------- Dynamic Loadouts shell ---------- */
body.light-theme .dynamic-loadout,
body.light-theme .dynamic-toolbar,
body.light-theme .dynamic-tabs,
body.light-theme .dynamic-content{
  background:#ffffff!important;
  color:#142a3b!important;
}
body.light-theme .dynamic-loadout{
  border-color:#9dbdd0!important;
  box-shadow:0 12px 32px rgba(47,83,105,.10)!important;
}
body.light-theme .dynamic-toolbar{
  border-bottom-color:#c3d6e1!important;
}
body.light-theme .dynamic-toolbar>b{
  color:#142a3b!important;
}
body.light-theme .dynamic-tabs{
  border-bottom-color:#c3d6e1!important;
}
body.light-theme .dynamic-tool-btn{
  background:#ffffff!important;
  color:#17324a!important;
  border-color:#9eb9cb!important;
  box-shadow:none!important;
}
body.light-theme .dynamic-tool-btn:hover{
  background:#eef8fd!important;
  border-color:#2f98ca!important;
}
body.light-theme .dynamic-tool-btn.max{
  background:#fff8dc!important;
  color:#76510b!important;
  border-color:#d7b54b!important;
}
body.light-theme .dynamic-tab{
  background:#ffffff!important;
  color:#314f65!important;
  border-color:#aabfcd!important;
  box-shadow:none!important;
}
body.light-theme .dynamic-tab:hover{
  background:#f1f9fd!important;
  border-color:#57a9cf!important;
}
body.light-theme .dynamic-tab.active{
  background:#e1f4fd!important;
  color:#075b82!important;
  border-color:#2ba0d3!important;
  box-shadow:0 0 0 1px rgba(43,160,211,.14)!important;
}

/* ---------- Base Stats ---------- */
body.light-theme .v61-base-panel,
body.light-theme .v61-base-editor{
  background:#ffffff!important;
  color:#142a3b!important;
}
body.light-theme .v60-panel-head h3{
  color:#142a3b!important;
}
body.light-theme .v60-panel-head p{
  color:#60778a!important;
}

body.light-theme .v61-base-mode{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
  box-shadow:none!important;
}
body.light-theme .v61-base-mode:hover{
  background:#f2f9fd!important;
  border-color:#4fa6cc!important;
}
body.light-theme .v61-base-mode.active{
  background:#e5f6fd!important;
  color:#12384d!important;
  border-color:#2b9fd0!important;
  box-shadow:0 0 0 1px rgba(43,159,208,.14)!important;
}
body.light-theme .v61-base-mode b{color:#142a3b!important}
body.light-theme .v61-base-mode small{color:#657d90!important}

body.light-theme .v62-base-import{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#6fb4d3!important;
  box-shadow:0 10px 28px rgba(44,98,126,.11)!important;
}
body.light-theme .v62-base-import-copy b{
  color:#142a3b!important;
}
body.light-theme .v62-base-import-copy small{
  color:#536d80!important;
}
body.light-theme .v62-base-import-copy small b{
  color:#8a5a00!important;
}
body.light-theme .v62-base-import-status{
  color:#087da5!important;
}

body.light-theme .v61-base-stat-card,
body.light-theme .v61-base-field,
body.light-theme .v61-resolved-wrap,
body.light-theme .v61-resolved-card{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#b2c9d7!important;
  box-shadow:none!important;
}
body.light-theme .v61-base-stat-card h4,
body.light-theme .v61-base-field>span,
body.light-theme .v61-resolved-card b,
body.light-theme .v61-resolved-wrap>div:first-child b{
  color:#142a3b!important;
}
body.light-theme .v61-base-field input,
body.light-theme .v61-base-field input[readonly]{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
}
body.light-theme .v61-base-live{
  color:#087ba5!important;
}
body.light-theme .v61-base-field.calculated .v61-base-live{
  color:#60788c!important;
}
body.light-theme .v61-resolved-wrap>div:first-child small{
  color:#60778a!important;
}
body.light-theme .v61-resolved-card span{
  color:#276b92!important;
}
body.light-theme .v61-base-section-head b{
  color:#142a3b!important;
}
body.light-theme .v61-base-section-head small{
  color:#667d8f!important;
}

/* Base Stats inner subtabs: all white, active uses pale-blue accent */
body.light-theme .v61-base-subtabs{
  border-top-color:#c5d7e1!important;
}
body.light-theme .v61-base-subtabs button{
  background:#ffffff!important;
  color:#36546a!important;
  border-color:#a8bfce!important;
  box-shadow:none!important;
}
body.light-theme .v61-base-subtabs button:hover{
  background:#f0f8fc!important;
  color:#164c68!important;
  border-color:#5aa5c8!important;
}
body.light-theme .v61-base-subtabs button.active{
  background:#e4f5fc!important;
  color:#075c82!important;
  border-color:#2d9bca!important;
  box-shadow:0 0 0 1px rgba(45,155,202,.12)!important;
}

/* ---------- Equipment / Hero Gear / loadout cards ---------- */
body.light-theme .gear-slot-card,
body.light-theme .gear-system-center,
body.light-theme .hero-gear-piece,
body.light-theme .hero-gear-center,
body.light-theme .gear-choice,
body.light-theme .charm-node{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#aac2d1!important;
  box-shadow:none!important;
}
body.light-theme .gear-slot-title,
body.light-theme .gear-choice b,
body.light-theme .charm-node b,
body.light-theme .hero-gear-piece .piece-title,
body.light-theme .hero-gear-center b{
  color:#142a3b!important;
}
body.light-theme .gear-tier{
  color:#176a98!important;
}
body.light-theme .gear-stat,
body.light-theme .gear-choice small,
body.light-theme .gear-system-center span{
  color:#5e7487!important;
}
body.light-theme .gear-system-center strong{
  color:#087d85!important;
}
body.light-theme .gear-slot-icon,
body.light-theme .gear-choice-photo{
  background:#ffffff!important;
}
body.light-theme .piece-reset-btn{
  background:#ffffff!important;
  color:#38546a!important;
  border-color:#abc1cf!important;
}
body.light-theme .hero-gear-quick-row>span{
  color:#526d82!important;
}
body.light-theme .piece-controls>.field>select,
body.light-theme .hero-gear-mastery-btn{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
}
body.light-theme .hero-gear-mastery-btn .mastery-chevron{
  color:#36566e!important;
}
body.light-theme .hero-gear-mastery-menu{
  background:#ffffff!important;
  border-color:#b29a56!important;
  box-shadow:0 16px 38px rgba(51,72,88,.18)!important;
}
body.light-theme .hero-gear-mastery-menu button{
  background:#ffffff!important;
  color:#173148!important;
  border-color:#b6c9d5!important;
}
body.light-theme .hero-gear-mastery-menu button:hover{
  background:#eef8fd!important;
  border-color:#5ca4c6!important;
}
body.light-theme .hero-gear-mastery-menu button.active{
  background:#ffe4a0!important;
  color:#563900!important;
  border-color:#d6a732!important;
}

/* ---------- v60 equipment editors ---------- */
body.light-theme .v60-photo-panel,
body.light-theme .v60-island-grid section,
body.light-theme .v60-special-summary{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#afc7d6!important;
  box-shadow:none!important;
}
body.light-theme .v60-stat-row,
body.light-theme .v60-stat-row:nth-child(4n+1),
body.light-theme .v60-stat-row:nth-child(4n+2){
  background:#ffffff!important;
  color:#142a3b!important;
  border-bottom-color:#d5e1e8!important;
}
body.light-theme .v60-stat-row span{
  color:#173148!important;
}
body.light-theme .v60-stat-row input{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
}
body.light-theme .v60-stat-row b{
  color:#087ba5!important;
}
body.light-theme .v60-source-note{
  background:#ffffff!important;
  color:#60778a!important;
  border:1px solid #c3d5df!important;
}
body.light-theme .v60-expert-gareth{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9ccfc7!important;
}
body.light-theme .v60-expert-gareth b,
body.light-theme .v60-island-grid section h4{
  color:#142a3b!important;
}
body.light-theme .v60-special-summary>div{
  background:#ffffff!important;
  border:1px solid #c5d7e1!important;
}
body.light-theme .v60-special-summary span{
  color:#60778a!important;
}
body.light-theme .v60-special-summary b{
  color:#142a3b!important;
}

/* ---------- Specials modal + ALL loadout popups ---------- */
body.light-theme .loadout-modal,
body.light-theme .pve-hero-modal{
  background:rgba(202,226,239,.62)!important;
  backdrop-filter:blur(8px)!important;
}
body.light-theme .loadout-dialog,
body.light-theme .pve-hero-dialog{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#8fb6cc!important;
  box-shadow:0 24px 70px rgba(40,70,90,.24)!important;
}
body.light-theme .loadout-dialog-head,
body.light-theme .pve-hero-dialog-head{
  background:#ffffff!important;
}
body.light-theme .loadout-dialog-head h3,
body.light-theme .pve-hero-dialog-head h3{
  color:#125e84!important;
}
body.light-theme .modal-close,
body.light-theme .pve-hero-dialog-head button{
  background:#ffffff!important;
  color:#8b2635!important;
  border-color:#d6a9b1!important;
}
body.light-theme #loadoutModalBody{
  background:#ffffff!important;
  color:#142a3b!important;
}

body.light-theme .v60-special-modal{
  background:#ffffff!important;
  color:#142a3b!important;
}
body.light-theme .v60-special-section,
body.light-theme .v60-event-choice,
body.light-theme .v60-special-card{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#afc5d3!important;
  box-shadow:none!important;
}
body.light-theme .v60-special-section h3,
body.light-theme .v60-event-choice b,
body.light-theme .v60-special-card b{
  color:#142a3b!important;
}
body.light-theme .v60-special-section>p,
body.light-theme .v60-event-choice small,
body.light-theme .v60-special-card small{
  color:#60778a!important;
}
body.light-theme .v60-event-choice.selected{
  background:#fff8df!important;
  border-color:#d4a72c!important;
  box-shadow:0 0 0 2px rgba(212,167,44,.12)!important;
}
body.light-theme .v60-none-icon{
  background:#ffffff!important;
  color:#526b7d!important;
  border:1px solid #c0d1dc!important;
}
body.light-theme .v60-special-card strong{
  color:#087ba5!important;
}
body.light-theme .v60-special-card select{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
}

/* Hero picker modal */
body.light-theme .hero-picker-choice{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#adc4d2!important;
  box-shadow:none!important;
}
body.light-theme .hero-picker-choice:hover{
  background:#f0f9fd!important;
  border-color:#3a9dcc!important;
}
body.light-theme .hero-picker-choice.selected{
  background:#e5f6fd!important;
  color:#12384d!important;
  border-color:#2599ca!important;
}
body.light-theme .hero-picker-choice b{
  color:#142a3b!important;
}
body.light-theme .hero-picker-choice small{
  color:#61788a!important;
}
body.light-theme .none-choice-icon{
  background:#ffffff!important;
  color:#36566e!important;
  border-color:#b8cbd6!important;
}

/* Keep normal form controls white anywhere in shared loadout content */
body.light-theme .dynamic-content input,
body.light-theme .dynamic-content select,
body.light-theme .loadout-dialog input,
body.light-theme .loadout-dialog select{
  background:#ffffff!important;
  color:#142a3b!important;
  border-color:#9db9cb!important;
}

/* Avoid light mode inheriting any generic gray card surfaces */
body.light-theme .dynamic-content .muted,
body.light-theme .loadout-dialog .muted{
  color:#63798b!important;
}


/* ===== Endless Trials fixed deployment rules ===== */
.endless-rule-card{
  margin:12px 0 0;
  border:1px solid #6f5b82;
  border-radius:15px;
  padding:12px 14px;
  background:linear-gradient(145deg,rgba(22,15,38,.86),rgba(10,8,18,.86));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.endless-rule-card b{color:#f7c750}
.endless-rule-card span{color:#b8a9c5;font-size:.76rem}
.endless-rule-card strong{color:#f6f0ff}
.endless-pet-btn{
  border:1px solid #8b70a5;
  border-radius:12px;
  background:linear-gradient(135deg,#2e1d48,#191025);
  color:#f4edff;
  min-height:42px;
  padding:9px 14px;
  font-weight:900;
  cursor:pointer;
}
.endless-pet-btn:hover{border-color:#f7c750;box-shadow:0 0 18px #f7b73122}
#endConfigRule{
  margin-top:13px;
  border:1px solid #58446c;
  border-radius:13px;
  background:#100b1b;
  color:#b9abc4;
  padding:11px 13px;
  text-align:center;
}
#endConfigRule b{color:#f7c750}
body.light-theme .endless-rule-card,
body.light-theme #endConfigRule{
  background:#ffffff!important;
  color:#526b7d!important;
  border-color:#abc3d2!important;
}
body.light-theme .endless-rule-card b,
body.light-theme #endConfigRule b{color:#8b6100!important}
body.light-theme .endless-rule-card span{color:#5e7487!important}
body.light-theme .endless-rule-card strong{color:#142a3b!important}
body.light-theme .endless-pet-btn{
  background:#ffffff!important;
  color:#17324a!important;
  border-color:#a3bdcc!important;
}

/* Extracted from endless_trials.html style block 2: id="endless-profile-mode-v7" */

.stat-source-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}.stat-source-tab{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:2px!important;text-align:left!important}.stat-source-tab b{font-size:.75rem}.stat-source-tab small{font-size:.61rem;color:#9d8fab}.stat-source-tab.profile-source.active{border-color:#9ef1dc!important;background:linear-gradient(135deg,#b9ffe8,#58d5b4)!important;color:#0a3e35!important}.stat-source-tab.profile-source.active small{color:#286a5d!important}.end-profile-note{margin:9px 0 12px;padding:9px 11px;border-left:3px solid #a78bfa;background:#a78bfa10;color:#b7a9c5;font-size:.69rem;line-height:1.45}body.light-theme .end-profile-note{color:#5d5268;background:#7c3aed0b}@media(max-width:780px){.stat-source-tabs{grid-template-columns:1fr!important}}
