/* All battle indicators live in reserved rows, rather than outside the arena. */
.battle-screen .arena,.battle-finale .arena{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(32px,15vw,200px);padding:14px clamp(16px,12vw,170px) 22px;height:auto;min-height:0;overflow:hidden;align-items:end;border-radius:0}
.battle-screen .combatant,.battle-finale .combatant{position:relative;inset:auto;width:100%;max-width:250px;justify-self:center;padding:0;display:grid;grid-template-rows:94px 150px 28px 22px;justify-items:center;align-items:end;z-index:2}
.battle-screen .combatant .overhead,.battle-finale .combatant .overhead{position:relative;inset:auto;transform:none;margin:0;align-self:start;min-width:92px;max-width:100%;padding:6px 10px;z-index:4}
.battle-screen .combatant .sprite.fighter,.battle-finale .combatant .sprite.fighter{width:145px;height:150px;max-width:100%;margin:0;align-self:end;z-index:2}
.battle-screen .combatant-label,.battle-finale .combatant-label{margin:2px 0 3px;line-height:1.2}
.battle-screen .arena,.battle-finale .arena{grid-template-columns:minmax(130px,1fr) minmax(0,1.8fr);gap:clamp(30px,7vw,110px);padding-left:clamp(18px,6vw,85px);padding-right:clamp(18px,6vw,85px);padding-bottom:35px}
.battle-screen .combatant,.battle-finale .combatant{grid-template-rows:94px auto}
.enemy-party{position:relative;display:grid;grid-template-columns:repeat(var(--foes),minmax(0,1fr));gap:16px;align-items:end;min-width:0}
.combatant-target{display:grid;grid-template-rows:150px 28px 22px;justify-items:center;align-items:end;position:relative;width:100%;min-width:0;padding:0;border:0;background:transparent;color:inherit;opacity:1!important;border-radius:12px}
.combatant-target:disabled{cursor:default}.combatant-target.target-ready{cursor:crosshair;outline:2px solid #b3faff;outline-offset:7px;background:linear-gradient(0deg,#53d4ee25,transparent);box-shadow:0 0 22px #66ddff3a}
.combatant-target.target-ready:hover,.combatant-target.target-ready:focus-visible{outline-color:#ffe399;background:#fff3a822;filter:brightness(1.1)}
.combatant-target.target-ready:before{content:'▼';position:absolute;top:2px;left:50%;transform:translateX(-50%);font-size:21px;color:#fff3aa;text-shadow:0 2px #144360;z-index:4}
.enemy-party .combatant-label{padding-left:4px;padding-right:4px;max-width:100%}.enemy-party .combatant-label b{font-size:12px;white-space:normal}
.all-target{position:absolute;inset:88px -8px -22px;background:#68dcf716;border:2px solid #a9faff;border-radius:10px;z-index:7;cursor:crosshair;box-shadow:0 0 22px #68dcf744}
.all-target:hover,.all-target:focus-visible{border-color:#ffe399;background:#fff3a825}.all-target>span{position:absolute;bottom:-13px;left:50%;transform:translateX(-50%);white-space:nowrap;background:#15455b;color:#fffbd9;border:1px solid #c6faff;padding:5px 12px;font-size:13px}
.is-defeated .combatant-target{opacity:.45!important;filter:grayscale(.6)}.is-defeated .overhead{opacity:.7}.battle-motion .is-defeated.fx-hit .combatant-target{opacity:1!important;filter:none}
.damage-preview{color:#ffe298!important}.enemy-count{color:#d0f2f5;font-size:13px;white-space:nowrap}.battle-heading{gap:16px;align-items:center}
.battle-controls .turn-bar .pile-button:first-of-type{margin-left:auto}.battle-controls .selection-bar{font-size:14px;min-height:48px;align-items:center;gap:12px}.selection-bar .quiet{padding:6px 12px;flex-shrink:0;font-size:12px}
.battle-screen .selection-bar.has-selection{display:flex}.battle-screen .arena:before,.battle-finale .arena:before{display:none}
.room-npc{display:flex;align-items:center;justify-content:center;gap:10px;color:#f0e7c4;font-size:13px;padding:8px}.room-npc .sprite{width:70px;height:74px}
.room-actions .room-npc{grid-column:1/-1}
.route-v2 .antique-map{height:1150px;min-height:1150px}.route-v2 .route-lane{top:80px}
.battle-screen .hp-track,.battle-finale .hp-track{width:100%;height:21px;margin:0}
.battle-screen .arena-center,.battle-finale .arena-center{position:absolute;top:15px;left:50%;transform:translateX(-50%);width:auto;max-width:100px;padding:0;z-index:1}
.battle-screen .overhead>small,.battle-finale .overhead>small{display:none}
.battle-screen .overhead>em,.battle-finale .overhead>em{font-size:11px;line-height:1.3}
.battle-screen .overhead>b,.battle-finale .overhead>b{line-height:1.1;font-size:27px}
.battle-screen .overhead>span,.battle-finale .overhead>span{font-size:10px}
.battle-finale{position:fixed;inset:0;z-index:85;display:grid;align-content:center;padding:20px;background:#0a1526e8}
.battle-finale .arena{width:min(1300px,100%);margin:auto}
.battle-fx{pointer-events:none;position:absolute;z-index:5}
.battle-motion .sprite.fighter{animation:none!important;transform-origin:center bottom}
.battle-motion.fx-attack .player .sprite{animation:pururuLunge 850ms ease-in-out!important}
.battle-motion.fx-enemy .opponent:not(.is-defeated) .sprite{animation:pururuEnemyLunge 850ms ease-in-out!important}
.battle-motion .fx-hit .sprite{animation:pururuHit 650ms 220ms ease-out both!important}
.battle-motion .fx-block .sprite{animation:pururuBrace 650ms 200ms ease-out both!important}
.battle-motion.fx-guard .player .sprite{animation:pururuGuard 850ms ease-out!important}
.battle-motion.fx-heal .player .sprite{animation:pururuHeal 900ms ease-in-out!important}
.fx-number{top:33%;left:50%;white-space:nowrap;font:900 28px/1.2 'M PLUS Rounded 1c',sans-serif;transform:translateX(-50%);text-shadow:2px 2px 0 #102039,-2px -1px 0 #102039,0 3px 10px #102039;animation:fxNumber 950ms ease-out both}
.damage-number{color:#fff2c2;font-size:40px;animation-delay:180ms}
.shield-number{color:#a7f5ff;top:66%;font-size:23px}
.heal-number{color:#baffac;top:57%;font-size:26px}
.focus-number{color:#ffe69e;top:60%;font-size:21px}
.fx-impact{top:36%;left:50%;color:#fff0a6;font-size:140px;line-height:1;text-shadow:0 0 15px #ffb02f;animation:fxImpact 480ms 180ms ease-out both}
.fx-shield{top:35%;left:50%;width:150px;height:150px;transform:translateX(-50%);display:grid;place-items:center;border-radius:50%;border:3px solid #b6fcff;background:radial-gradient(ellipse,#66d7ff12,#55cdff60);box-shadow:0 0 25px #65dcff;animation:fxShield 1000ms ease-out both}
.fx-shield .icon{width:58px;height:68px;color:#efffff;filter:drop-shadow(0 0 7px #58daff)}
.battle-fx.fx-heal{top:28%;left:50%;width:130px;height:160px;background:radial-gradient(ellipse,#baffaf8c,transparent 70%);display:grid;place-items:center;animation:fxHealing 950ms ease-out both}
.battle-fx.fx-heal .icon{width:54px;height:54px;fill:#c7ffb4;color:#ebffe4}
.fx-speed{top:56%;left:36%;width:30%;display:grid;gap:9px;animation:fxSpeed 600ms ease-out both}
.fx-speed i{height:3px;background:linear-gradient(90deg,transparent,#a8f4ff);box-shadow:0 0 4px #c6fbff;transform:rotate(-8deg)}
.fx-speed i:nth-child(2){width:75%;margin-left:25%}.fx-speed i:nth-child(3){width:85%;margin-left:15%}.speed-left{transform:scaleX(-1)}
@keyframes pururuLunge{0%{transform:scale(1)}15%{transform:translate(-8px,6px) scale(1.16,.82)}43%{transform:translate(clamp(32px,8vw,110px),-29px) rotate(13deg) scale(.95,1.08)}58%{transform:translate(clamp(28px,6vw,80px),-10px) rotate(8deg)}80%{transform:translate(0,4px) scale(1.08,.91)}100%{transform:none}}
@keyframes pururuEnemyLunge{0%{transform:none}15%{transform:translate(8px,6px) scale(1.16,.82)}43%{transform:translate(clamp(-110px,-8vw,-32px),-29px) rotate(-13deg) scale(.95,1.08)}58%{transform:translate(clamp(-80px,-6vw,-28px),-10px) rotate(-8deg)}80%{transform:translate(0,4px) scale(1.08,.91)}100%{transform:none}}
@keyframes pururuHit{0%,100%{transform:none;filter:none}20%{transform:translate(16px,-11px) rotate(10deg);filter:brightness(1.65)}40%{transform:translate(-10px,1px) rotate(-7deg)}65%{transform:translate(6px,-3px) rotate(3deg)}80%{transform:scale(1.1,.9)}}
@keyframes pururuBrace{0%,100%{transform:none}25%{transform:translateY(6px) scale(1.12,.85)}55%{transform:translateY(-7px) scale(.97,1.03)}}
@keyframes pururuGuard{0%,100%{transform:none}25%{transform:translateY(5px) scale(1.1,.85)}55%{transform:translateY(-13px) scale(.94,1.05)}}
@keyframes pururuHeal{0%,100%{transform:none}50%{transform:translateY(-15px) scale(1.03)}}
@keyframes fxNumber{0%{opacity:0;transform:translate(-50%,12px) scale(.6)}25%,70%{opacity:1;transform:translate(-50%,-15px) scale(1)}100%{opacity:0;transform:translate(-50%,-38px)}}
@keyframes fxImpact{0%{opacity:0;transform:translate(-50%,-20%) scale(.1) rotate(-20deg)}25%{opacity:1;transform:translate(-50%,-20%) scale(1) rotate(10deg)}100%{opacity:0;transform:translate(-50%,-20%) scale(1.3) rotate(25deg)}}
@keyframes fxShield{0%{opacity:0;transform:translateX(-50%) scale(.45)}30%,70%{opacity:1;transform:translateX(-50%) scale(1)}100%{opacity:0;transform:translateX(-50%) scale(1.15)}}
@keyframes fxHealing{0%{opacity:0;transform:translate(-50%,25px) scale(.7)}40%,70%{opacity:1}100%{opacity:0;transform:translate(-50%,-45px) scale(1.3)}}
@keyframes fxSpeed{0%,70%,100%{opacity:0}25%,45%{opacity:1}}

.upgrade-screen{max-width:1000px;margin:auto;padding:18px 24px 30px;text-align:center;font-family:'M PLUS Rounded 1c',sans-serif;overflow:hidden}
.upgrade-heading p{font-size:14px;letter-spacing:.08em;color:#c2e5ee;margin:4px 0}
.upgrade-heading h1{color:#ffe4a0;font-size:clamp(24px,3vw,36px);margin:6px 0 22px;text-shadow:0 3px #784d36}
.upgrade-star{color:#ffe18b;font-size:30px;display:inline-block;animation:upgradeStar 1.1s ease-out both}
.upgrade-showcase{display:grid;grid-template-columns:340px 1fr;align-items:center;gap:55px;max-width:850px;margin:auto}
.upgrade-card-display{position:relative;isolation:isolate;padding:20px;display:grid;justify-items:center}
.upgrade-card-display .card-wrap{width:285px;max-width:100%}
.upgrade-card-display .game-card{width:285px;max-width:100%;animation:upgradeReveal 850ms cubic-bezier(.16,.8,.2,1) both;box-shadow:0 0 35px #efc97777,0 12px 25px #060f2388}
.upgrade-rays{position:absolute;inset:-20px;z-index:-1;background:repeating-conic-gradient(from 0deg,#ffe59a18 0deg 10deg,transparent 10deg 25deg);mask-image:radial-gradient(ellipse,black,transparent 70%);animation:upgradeRays 18s linear infinite}
.upgrade-spark{position:absolute;left:calc(8% + mod(var(--i),4)*27%);top:calc(4% + mod(var(--i),3)*41%);color:#ffe39b;font-size:24px;font-style:normal;z-index:2;animation:upgradeSpark 1.5s calc(var(--i)*.05s) ease-out both;pointer-events:none}
.upgrade-seal{position:relative;margin-top:12px;background:#ffe09a;color:#472e26;border:2px solid #fff5d0;padding:7px 25px;box-shadow:0 4px #805630;font-size:17px}
.upgrade-report{text-align:left;align-self:center}
.upgrade-report h2{font-size:25px;margin:0 0 15px;color:#fff5d2}.upgrade-report h2>b{color:#ffd879;margin-left:6px}
.upgrade-message{font-size:14px;color:#c3e3ee}.upgrade-stat-list{display:grid;gap:12px;margin:24px 0 16px}
.upgrade-stat{border:2px solid #8badba;background:#10243d;padding:12px 16px;animation:upgradeReveal 600ms 350ms ease-out both}
.upgrade-stat>span{display:flex;align-items:center;gap:7px;font-size:14px;color:#bfe8ef}.upgrade-stat>div{display:flex;gap:17px;align-items:center;margin-top:4px}
.upgrade-stat s{font-size:28px;text-decoration:none;color:#a6bccb}.upgrade-stat i{color:#c2d8e2;font-size:24px;font-style:normal}.upgrade-stat strong{font-size:43px;line-height:1.2;color:#ffe397}.upgrade-stat b{margin-left:auto;color:#163529;background:#bdf2b7;border:1px solid #d9ffd6;font-size:17px;padding:3px 8px}
.upgrade-cost{display:flex;align-items:center;gap:8px;font-size:13px;color:#d7eef3}.upgrade-cost strong{font-size:23px;color:#a7ecf1}.upgrade-cost span{margin-left:auto;color:#a7ecf1;font-size:12px}
.upgrade-saved{font-size:12px;color:#c0d9e1;margin:18px 0}.upgrade-saved .icon{width:16px}.upgrade-continue{width:100%;font-size:15px;min-height:55px;margin-top:8px}
@keyframes upgradeReveal{from{opacity:0;transform:translateY(20px) scale(.85);filter:brightness(1.8)}to{opacity:1;transform:none;filter:none}}
@keyframes upgradeStar{from{transform:scale(.2) rotate(-120deg)}to{transform:none}}
@keyframes upgradeRays{to{transform:rotate(360deg)}}
@keyframes upgradeSpark{0%{opacity:0;transform:translateY(15px) scale(.1)}30%{opacity:1;transform:translateY(0) scale(1.3)}100%{opacity:.25;transform:translateY(-16px) scale(.65)}}
@media(max-width:760px){
 .battle-screen .arena,.battle-finale .arena{grid-template-columns:minmax(76px,.8fr) minmax(0,1.8fr);gap:20px;padding:12px 10px 30px}
 .battle-screen .combatant,.battle-finale .combatant{grid-template-rows:92px auto;max-width:150px}
 .combatant-target{grid-template-rows:118px 34px 22px}.enemy-party{gap:9px}
 .battle-screen .combatant .sprite.fighter,.battle-finale .combatant .sprite.fighter{width:112px;height:118px}
 .battle-screen .party-size-3 .enemy-party .sprite.fighter,.battle-finale .party-size-3 .enemy-party .sprite.fighter{width:100%;height:102px}
 .battle-screen .party-size-3 .enemy-party .overhead,.battle-finale .party-size-3 .enemy-party .overhead{min-width:0;width:100%;padding:5px 2px;grid-template-columns:14px auto;gap:0}
 .battle-screen .party-size-3 .enemy-party .overhead>b{font-size:22px}.battle-screen .party-size-3 .enemy-party .overhead>span,.battle-screen .party-size-3 .enemy-party .overhead>em{font-size:9px}
 .enemy-party .combatant-label{border:0;background:#10233bdc;padding:2px}.battle-screen .enemy-party .combatant-label b{font-size:9px;line-height:1.3}.enemy-party .hp-track span{font-size:10px}.enemy-party .hp-track .icon{display:none}
 .enemy-count{font-size:10px;white-space:normal;max-width:115px;text-align:right}.battle-heading h1{font-size:16px}
 .combatant-target.target-ready{outline-offset:3px}.all-target{inset:87px -4px -21px}.all-target>span{font-size:11px}
 .battle-controls .selection-bar{font-size:12px}.battle-controls .selection-bar strong{display:block}.route-v2 .antique-map{height:1180px;min-height:1180px}
 .battle-screen .combatant .overhead,.battle-finale .combatant .overhead{min-width:76px;padding:5px 8px}
 .battle-screen .arena-center,.battle-finale .arena-center{top:104px;max-width:62px}.battle-screen .round-badge,.battle-finale .round-badge{font-size:10px;padding:5px}.battle-screen .round-badge small,.battle-finale .round-badge small{font-size:7px}
 .battle-screen .overhead>em,.battle-finale .overhead>em{font-size:10px}.battle-screen .combatant-label b,.battle-finale .combatant-label b{font-size:10px}
 .fx-shield{width:115px;height:120px}.shield-number{font-size:19px}.damage-number{font-size:33px}
 .upgrade-screen{padding:18px 18px 30px}.upgrade-heading h1{font-size:24px;margin-bottom:2px}.upgrade-heading p{font-size:12px}.upgrade-star{font-size:25px}
 .upgrade-showcase{grid-template-columns:1fr;gap:18px}.upgrade-card-display{padding:15px 28px 4px}.upgrade-card-display .game-card{width:240px}.upgrade-card-display .card-art{height:140px}.upgrade-card-display .card-fact{font-size:12px}.upgrade-card-display .card-title{min-height:46px}
 .upgrade-card-display .card-wrap{width:240px}
 .upgrade-card-display .game-card.large{min-height:0;padding:9px}.upgrade-card-display .card-fact{display:none}.upgrade-card-display .card-region{font-size:15px;min-height:28px}.upgrade-card-display .card-place{font-size:10px;min-height:20px}.upgrade-card-display .card-title{padding:7px 0;min-height:42px}.upgrade-card-display .card-title strong{font-size:18px}.upgrade-card-display .card-stats{min-height:60px}.upgrade-card-display .card-stats b{font-size:30px}.upgrade-card-display .card-edition{font-size:10px}.upgrade-card-display .card-effect{font-size:10px;padding:3px 0}
 .upgrade-report h2,.upgrade-message{display:none}.upgrade-stat-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}.upgrade-stat:only-child{grid-column:1/-1}.upgrade-stat{padding:9px 10px}.upgrade-stat>div{gap:8px;flex-wrap:wrap}.upgrade-stat strong{font-size:32px}.upgrade-stat s{font-size:22px}.upgrade-stat i{font-size:18px}.upgrade-stat b{font-size:13px;padding:1px 5px}.upgrade-stat>span{font-size:12px}
 .upgrade-cost,.upgrade-saved{margin:12px 0}.upgrade-continue{min-height:52px;margin-top:0;font-size:14px}
}
.battle-screen .arena-center,.battle-finale .arena-center{display:none}
@media(max-width:760px){.enemy-party .combatant-target{grid-template-rows:90px 34px 22px}.battle-screen .enemy-party .combatant-label b,.battle-finale .enemy-party .combatant-label b{font-size:11px}.enemy-party .health-bar{font-size:11px}.enemy-party .overhead small{font-size:10px}}
.result-screen{margin:28px auto;padding:30px 30px 36px;background:#142b45;border:2px solid #779aaf;box-shadow:0 8px 0 #08172b,0 0 0 6px #1d3953;max-width:820px;font-family:'M PLUS Rounded 1c',sans-serif}
.result-screen .eyebrow{color:#c4e8ef;letter-spacing:.1em;font-size:12px}
.result-screen .result-avatar{width:200px;height:210px;display:inline-block;filter:drop-shadow(0 8px 16px #050f22);background:radial-gradient(ellipse,#34667755,transparent 70%)}
.result-screen h1{font-size:32px;line-height:1.5;color:#ffe59b;text-shadow:0 2px #5e4128;margin:6px 0 14px}
.result-screen>p:not(.eyebrow){color:#f0f6fa;font-size:16px;line-height:1.9}
.result-screen .result-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:26px 0}
.result-stats>div{padding:16px 10px;background:#0d2037;border:1px solid #587a93;border-radius:5px}
.result-screen .result-stats small{font-size:12px;color:#cfdeea;line-height:1.5}.result-screen .result-stats b{font-size:38px;color:#fff4c8;line-height:1.2}.result-screen .result-stats em{font-size:19px;color:#cce6ee}
.result-screen .result-actions{gap:14px}.result-screen .result-actions .btn{font-size:16px;min-height:54px}
@media(max-width:760px){.result-screen{margin:20px 14px;padding:22px 16px}.result-screen h1{font-size:24px}.result-screen>p:not(.eyebrow){font-size:14px}.result-screen .result-stats{gap:7px}.result-stats>div{padding:12px 4px}.result-screen .result-stats small{font-size:10px}.result-screen .result-stats b{font-size:28px}.result-screen .result-stats em{font-size:14px}.result-screen .result-avatar{width:165px;height:173px}}
@media(prefers-reduced-motion:reduce){.battle-motion .sprite.fighter{animation:none!important}.battle-fx,.upgrade-card-display .game-card,.upgrade-stat,.upgrade-star,.upgrade-rays,.upgrade-spark{animation:none!important}.fx-impact,.fx-speed{display:none}.fx-number{opacity:1}.battle-fx.fx-heal{transform:translateX(-50%)}}
@media(min-width:761px) and (max-height:800px){
 .battle-screen .arena,.battle-finale .arena{padding-top:8px;padding-bottom:20px}
 .battle-screen .combatant,.battle-finale .combatant{grid-template-rows:90px auto}
 .combatant-target{grid-template-rows:90px 26px 22px}
 .battle-screen .combatant .sprite.fighter,.battle-finale .combatant .sprite.fighter{height:96px;width:92px}
 .battle-screen .selection-bar.has-selection{min-height:35px;padding:4px 10px;margin:2px 0 0}.battle-screen .selection-bar strong{font-size:13px}
 .upgrade-heading h1{font-size:28px;margin-bottom:6px}.upgrade-heading p{font-size:12px}.upgrade-star{font-size:22px}.upgrade-showcase{gap:40px}.upgrade-card-display{padding:10px 20px}.upgrade-card-display .card-wrap{width:270px}
 .upgrade-card-display .game-card.large{min-height:0;padding:9px}.upgrade-card-display .card-art{height:155px}.upgrade-card-display .card-region{min-height:30px;font-size:16px}.upgrade-card-display .card-place{font-size:10px;min-height:22px}.upgrade-card-display .card-title{min-height:44px;font-size:20px;padding:7px 0}.upgrade-card-display .card-fact{font-size:12px;line-height:1.7;min-height:0;margin:7px 0;padding:4px 0}.upgrade-card-display .card-stats{min-height:60px}.upgrade-card-display .card-stats b{font-size:30px}.upgrade-card-display .card-edition{font-size:11px}.upgrade-card-display .card-effect{font-size:11px;padding:4px 0}
 .upgrade-stat{padding:8px 14px}.upgrade-stat strong{font-size:35px}.upgrade-report h2{font-size:23px}.upgrade-stat-list{margin-top:16px}.upgrade-seal{font-size:14px;padding:5px 20px}
}
