:root{
  --ink:#17202b;--ink2:#334155;--paper:#fff9ea;--white:#fffef8;
  --sky:#61c9ff;--blue:#208cff;--pink:#ff5e9f;--yellow:#ffd83d;--lime:#9be44b;
  --orange:#ff8a32;--purple:#8f6dff;--red:#f04c4c;--green:#43a86b;--muted:#667085;
  --line:#17202b;--shadow:6px 7px 0 #17202b;--soft:0 18px 45px rgba(23,32,43,.14)
}
*{box-sizing:border-box}html{background:#bfe8ff}body{margin:0;color:var(--ink);font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif;background:
  radial-gradient(circle at 8% 3%,rgba(255,255,255,.85),transparent 22%),
  linear-gradient(180deg,#bdeaff 0 270px,#f4efd9 270px 100%);min-height:100vh;overflow-x:hidden}
button,input,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}.hidden{display:none!important}
.dot-bg{position:fixed;inset:0;pointer-events:none;z-index:-1;opacity:.22;background-image:radial-gradient(#23506a 1px,transparent 1px);background-size:13px 13px;mask-image:linear-gradient(#000,transparent 70%)}
.app-shell{width:min(1180px,calc(100% - 26px));margin:0 auto;padding-bottom:54px}.site-header{height:82px;display:flex;align-items:center;justify-content:space-between;gap:16px}.portal-brand{display:flex;align-items:center;gap:9px;color:var(--ink);text-decoration:none}.portal-mark{width:42px;height:42px;display:grid;place-items:center;background:var(--ink);color:var(--yellow);font-weight:1000;font-size:23px;border-radius:8px;transform:rotate(-4deg);box-shadow:3px 3px 0 var(--pink)}.portal-brand span:last-child{display:flex;flex-direction:column;line-height:1}.portal-brand b{font-size:16px;letter-spacing:.03em}.portal-brand small{font-size:9px;font-weight:1000;color:var(--muted);margin-top:5px;letter-spacing:.14em}
.header-status{display:flex;gap:8px}.status-ticket{min-width:102px;background:var(--white);border:2px solid var(--ink);border-radius:12px;padding:9px 12px;box-shadow:2px 3px 0 var(--ink);transform:rotate(.3deg)}.status-ticket:nth-child(2){transform:rotate(-.5deg)}.status-ticket small{display:block;font-size:8px;font-weight:1000;color:var(--muted)}.status-ticket strong{display:block;font-size:17px;margin-top:3px}.energy-ticket{background:var(--yellow)}.scanner-ticket{background:#e8fbff}
.hero-pop{min-height:320px;display:grid;grid-template-columns:1.25fr .75fr;border:3px solid var(--ink);border-radius:22px;background:linear-gradient(105deg,var(--white) 0 59%,var(--yellow) 59.3%);box-shadow:var(--shadow);overflow:hidden;position:relative}.hero-pop:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(10deg,transparent 0 28px,rgba(23,32,43,.03) 29px 30px);pointer-events:none}.hero-copy{padding:34px 38px;position:relative;z-index:2}.tape{display:inline-block;background:var(--pink);color:#fff;border:2px solid var(--ink);padding:6px 11px;border-radius:5px;font-size:10px;font-weight:1000;transform:rotate(-1.3deg);box-shadow:3px 3px 0 var(--ink)}.hero-pop h1{margin:22px 0 13px;line-height:.88;font-size:clamp(60px,9vw,104px);font-weight:1000;letter-spacing:-.09em}.hero-pop h1 span{color:var(--blue);text-shadow:3px 3px 0 var(--ink);-webkit-text-stroke:2px var(--ink)}.hero-pop h1 b{display:inline-block;margin-left:12px;color:var(--ink)}.hero-copy>p{font-weight:900;line-height:1.75;margin:0;font-size:14px;color:var(--ink2)}.hero-stickers{display:flex;gap:7px;flex-wrap:wrap;margin-top:20px}.hero-stickers span{border:2px solid var(--ink);background:#fff;padding:5px 8px;border-radius:6px;font-size:9px;font-weight:1000;box-shadow:2px 2px 0 var(--ink)}.hero-stickers span:nth-child(2){background:var(--lime)}.hero-stickers span:nth-child(3){background:var(--sky)}.hero-stickers span:nth-child(4){background:var(--yellow)}
.hero-burst{position:relative;display:grid;place-items:center;min-height:320px}.burst-ring{width:240px;height:240px;border:4px solid var(--ink);border-radius:50%;background:var(--blue);display:grid;grid-template-columns:1fr auto 1fr;place-items:center;transform:rotate(5deg);box-shadow:10px 12px 0 rgba(23,32,43,.2)}.burst-ring span{font-size:31px;font-weight:1000;color:#fff;writing-mode:vertical-rl}.burst-ring b{font-size:52px;color:var(--yellow);text-shadow:3px 3px 0 var(--ink);transform:rotate(-6deg)}.hero-burst>p{position:absolute;right:12px;top:12px;background:var(--pink);color:#fff;border:3px solid var(--ink);padding:14px 12px;border-radius:50%;font-size:17px;font-weight:1000;text-align:center;line-height:1.05;transform:rotate(10deg);box-shadow:4px 4px 0 var(--ink)}
.alert{margin:20px 0 0;padding:13px 15px;background:#fff6bd;border:2px solid var(--ink);border-radius:12px;box-shadow:3px 3px 0 var(--ink);font-weight:900;font-size:12px}.alert.error{background:#ffe0e4;color:#9a2135}.alert.success{background:#dcffd1;color:#1f6d35}
.tabs{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin:24px 0 0}.tab{border:2px solid var(--ink);background:var(--white);padding:12px 9px;border-radius:11px;box-shadow:3px 4px 0 var(--ink);font-size:12px;font-weight:1000;transition:.12s}.tab span{color:var(--pink);margin-right:5px;font-size:9px}.tab:hover{transform:translateY(-2px)}.tab.active{background:var(--sky);transform:translateY(-3px);box-shadow:5px 6px 0 var(--ink)}
.view{display:none;padding:20px 0 40px}.view.active{display:block;animation:screenIn .2s ease}@keyframes screenIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.hero-grid{display:grid;grid-template-columns:1.02fr .98fr;gap:17px}.panel{background:var(--paper);border:3px solid var(--ink);border-radius:18px;box-shadow:var(--shadow);padding:21px}.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}.kicker{margin:0;color:var(--pink);font-size:9px;font-weight:1000;letter-spacing:.15em}.panel h2{font-size:27px;margin:3px 0 0;letter-spacing:-.04em}.pill{display:inline-block;border:2px solid var(--ink);background:var(--yellow);padding:6px 9px;border-radius:999px;font-size:9px;font-weight:1000;white-space:nowrap;box-shadow:2px 2px 0 var(--ink)}.pill.success{background:var(--lime)}.small-note{font-size:10px;font-weight:1000;color:var(--muted)}
.field-label{display:block;font-size:11px;font-weight:1000;margin:0 0 7px}.url-row{display:grid;grid-template-columns:1fr auto;gap:8px}.url-input,select{width:100%;min-width:0;border:2px solid var(--ink);background:#fff;color:var(--ink);border-radius:10px;padding:12px 13px;outline:none;font-weight:800}.url-input:focus,select:focus{box-shadow:0 0 0 4px rgba(32,140,255,.18);border-color:var(--blue)}.primary,.secondary,.danger{border:2px solid var(--ink);border-radius:10px;font-weight:1000;padding:10px 13px;box-shadow:3px 3px 0 var(--ink);transition:.1s}.primary{background:var(--pink);color:#fff}.secondary{background:#fff}.danger{background:#ffd9df;color:#9a2135}.ghost{box-shadow:none}.big-button{font-size:16px;padding-inline:20px}.primary:hover,.secondary:hover{transform:translateY(-2px);box-shadow:5px 5px 0 var(--ink)}.primary:active,.secondary:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}.hint,.muted{font-size:10px;color:var(--muted);font-weight:700;line-height:1.65}.settings-row,.battle-actions,.rush-controls{display:flex;gap:13px;align-items:flex-end;flex-wrap:wrap;margin-top:17px}.select-label{font-size:10px;font-weight:1000;display:flex;flex-direction:column;gap:6px;min-width:150px}.checkbox-line{display:flex;align-items:center;gap:8px;font-size:10px;font-weight:900;padding-bottom:10px}.checkbox-line input{width:19px;height:19px;accent-color:var(--pink)}.checkbox-line b{color:var(--pink)}
.energy-panel{margin-top:17px;padding:14px;border:2px solid var(--ink);border-radius:13px;background:#fff;display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center}.energy-title small{display:block;font-size:9px;font-weight:1000;color:var(--blue)}.energy-title strong{font-size:28px}.energy-title em{font-style:normal;font-size:15px;color:var(--muted)}.energy-title p{font-size:9px;margin:3px 0 0;color:var(--muted);font-weight:800}.energy-orbs{display:flex;gap:7px;justify-content:center}.energy-orb{width:24px;height:24px;border:3px solid var(--ink);border-radius:50%;background:#fff;box-shadow:2px 2px 0 var(--ink)}.energy-orb.on{background:var(--yellow)}.energy-rules{display:grid;gap:4px;font-size:9px;font-weight:900}.energy-rules b{display:inline-block;background:var(--ink);color:#fff;padding:2px 4px;border-radius:3px;min-width:35px;text-align:center}.progress{display:flex;gap:12px;align-items:center;margin-top:17px;border:2px solid var(--ink);background:#dff6ff;border-radius:12px;padding:12px}.spinner{width:27px;height:27px;border:4px solid #fff;border-top-color:var(--blue);border-right-color:var(--pink);border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.progress p{margin:3px 0 0;font-size:9px;color:var(--muted)}.safety-note{margin-top:16px;border-top:2px dashed rgba(23,32,43,.25);padding-top:11px}.safety-note summary{cursor:pointer;font-size:10px;font-weight:1000;color:var(--muted)}.safety-note p{font-size:9px;line-height:1.65;color:var(--muted)}
.card-stage{background:linear-gradient(145deg,#e9f9ff,#fff4c9);min-height:500px;display:grid;place-items:center;position:relative;overflow:hidden}.card-stage:before{content:"";position:absolute;inset:0;background:radial-gradient(var(--blue) 1px,transparent 1px);background-size:17px 17px;opacity:.09}.empty-card{text-align:center;position:relative}.empty-card span{width:104px;height:136px;border:3px dashed var(--ink);background:rgba(255,255,255,.65);border-radius:14px;display:grid;place-items:center;margin:0 auto 15px;font-size:55px;font-weight:1000;color:var(--blue);transform:rotate(-4deg)}.empty-card b{display:block;font-size:18px}.empty-card p{font-size:11px;color:var(--muted)}
.ability-guide{margin-top:17px}.stat-guide{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.stat-guide>div{border:2px solid var(--ink);background:#fff;border-radius:10px;padding:12px;box-shadow:2px 3px 0 var(--ink)}.stat-guide b{display:block;font-size:19px}.stat-guide span{display:block;font-size:9px;color:var(--muted);font-weight:800;line-height:1.45;margin-top:5px}.guide-hp{border-top:8px solid var(--orange)!important}.guide-atk{border-top:8px solid var(--pink)!important}.guide-def{border-top:8px solid var(--blue)!important}.guide-spd{border-top:8px solid var(--yellow)!important}.guide-tec{border-top:8px solid var(--purple)!important}.balance-copy{margin:14px 0 0;padding:10px 12px;border-left:5px solid var(--pink);background:#fff;font-size:10px;font-weight:800;line-height:1.6}
.site-card{width:min(100%,430px);position:relative;overflow:hidden;border:3px solid var(--ink);border-radius:18px;background:linear-gradient(145deg,#fff 0 66%,var(--cardA,#dff6ff));box-shadow:6px 7px 0 var(--ink);padding:16px;transform:rotate(-.25deg)}.site-card:after{content:"";position:absolute;right:-38px;top:-45px;width:150px;height:150px;border-radius:50%;background:var(--cardB,var(--sky));opacity:.2}.card-top{display:flex;justify-content:space-between;gap:12px;position:relative;z-index:1}.card-name{font-size:19px;font-weight:1000;line-height:1.15}.card-domain{font-size:9px;font-weight:1000;color:var(--blue);margin-top:4px;word-break:break-all}.card-path{font-size:8px;color:var(--muted);margin-top:3px;word-break:break-all;max-height:24px;overflow:hidden}.class-badge{height:max-content;border:2px solid var(--ink);background:var(--yellow);border-radius:999px;padding:5px 7px;font-size:9px;font-weight:1000;box-shadow:2px 2px 0 var(--ink);white-space:nowrap}.card-bp{display:flex;align-items:baseline;gap:8px;margin:17px 0 12px;position:relative;z-index:1}.card-bp small{font-size:9px;font-weight:1000;color:var(--muted)}.card-bp strong{font-size:42px;line-height:1;letter-spacing:-.05em;color:var(--pink);text-shadow:1px 1px 0 #fff}.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;position:relative;z-index:1}.statbox{border:2px solid var(--ink);background:#fff;border-radius:8px;padding:7px 4px;text-align:center}.statbox small{display:block;font-size:8px;font-weight:1000;color:var(--muted)}.statbox strong{display:block;font-size:16px;margin-top:2px}.statbox:nth-child(1){background:#fff0df}.statbox:nth-child(2){background:#ffe2ef}.statbox:nth-child(3){background:#e0f3ff}.statbox:nth-child(4){background:#fff6bd}.statbox:nth-child(5){background:#eee8ff}.skills{display:grid;gap:5px;margin-top:11px;position:relative;z-index:1}.skill{display:flex;justify-content:space-between;gap:10px;align-items:center;border:2px solid var(--ink);background:#fff;border-radius:8px;padding:7px 9px}.skill strong{font-size:10px}.skill span{font-size:8px;color:var(--muted);font-weight:800;text-align:right}.card-meta{display:flex;justify-content:space-between;font-size:7px;font-weight:900;color:var(--muted);margin-top:9px}.card-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.card-actions button{font-size:9px;flex:1;min-width:80px}.discovery-banner{border:2px solid var(--ink);border-radius:9px;background:var(--sky);padding:8px 10px;font-size:9px;font-weight:1000;margin-top:12px;box-shadow:2px 2px 0 var(--ink)}.discovery-banner.new{background:var(--lime)}.scan-details{margin-top:11px}.scan-details summary{font-size:9px;font-weight:1000;color:var(--muted);cursor:pointer}.scan-details p{font-size:8px;color:var(--muted);line-height:1.6}.share-note{font-size:8px;color:var(--muted);font-weight:800;margin-top:8px}.card-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.card-wrap .site-card{width:100%}
.versus-inputs{display:grid;grid-template-columns:1fr auto 1fr;gap:13px;align-items:end}.vs-mark{font-size:32px;font-weight:1000;color:var(--pink);text-shadow:2px 2px 0 var(--ink);-webkit-text-stroke:1px var(--ink);padding-bottom:5px}.streak{border:2px solid var(--ink);background:var(--yellow);border-radius:10px;padding:10px 13px;font-size:10px;font-weight:1000;box-shadow:2px 2px 0 var(--ink)}.streak strong{font-size:24px;color:var(--pink)}
/* Battle */
.battle-shell{margin-top:18px;border:3px solid var(--ink);border-radius:20px;background:#fff7dc;box-shadow:var(--shadow);overflow:hidden}.battle-top{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:3px solid var(--ink);background:var(--sky)}.battle-top b{font-size:12px}.battle-top span{font-size:9px;font-weight:1000}.battle-stage{position:relative;min-height:450px;display:grid;grid-template-columns:1fr 130px 1fr;gap:14px;align-items:center;padding:24px;background:
  radial-gradient(circle at center,rgba(255,216,61,.45),transparent 27%),
  repeating-linear-gradient(0deg,transparent 0 31px,rgba(23,32,43,.045) 31px 32px),#f7efd2;overflow:hidden}.battle-stage:before{content:"";position:absolute;inset:13px;border:2px dashed rgba(23,32,43,.18);border-radius:14px}.battle-fighter{position:relative;z-index:2;border:3px solid var(--ink);background:#fff;border-radius:16px;padding:14px;box-shadow:5px 6px 0 var(--ink);transition:transform .18s,filter .18s}.battle-fighter.right{transform:rotate(1deg)}.battle-fighter.left{transform:rotate(-1deg)}.fighter-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.fighter-head small{display:block;font-size:8px;color:var(--muted);font-weight:1000}.fighter-head strong{display:block;font-size:16px;line-height:1.2;margin-top:2px}.fighter-sigil{width:58px;height:58px;border:3px solid var(--ink);border-radius:50%;display:grid;place-items:center;background:var(--yellow);font-size:25px;font-weight:1000;box-shadow:3px 3px 0 var(--ink)}.hp-line{margin-top:13px}.hp-label{display:flex;justify-content:space-between;font-size:9px;font-weight:1000}.hp-track{height:17px;background:#fff;border:2px solid var(--ink);border-radius:999px;overflow:hidden;margin-top:4px}.hp-fill{height:100%;width:100%;background:linear-gradient(90deg,var(--green),var(--lime));transition:width .28s ease}.fighter-mini-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:10px}.fighter-mini-stats span{border:1px solid var(--ink);border-radius:6px;background:#f8f8f2;padding:5px;text-align:center;font-size:8px;font-weight:1000}.battle-center{z-index:4;text-align:center}.turn-chip{display:inline-block;border:2px solid var(--ink);background:#fff;padding:5px 8px;border-radius:999px;box-shadow:2px 2px 0 var(--ink);font-size:9px;font-weight:1000}.battle-message{margin-top:12px;border:3px solid var(--ink);background:var(--ink);color:#fff;border-radius:12px;padding:13px 8px;font-size:12px;font-weight:1000;line-height:1.45;min-height:72px;display:grid;place-items:center}.battle-skip{margin-top:10px;border:0;background:transparent;font-size:9px;font-weight:1000;text-decoration:underline}.battle-fx{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%) scale(.7) rotate(-6deg);z-index:9;font-size:38px;font-weight:1000;color:var(--pink);text-shadow:3px 3px 0 #fff,5px 5px 0 var(--ink);opacity:0;pointer-events:none}.battle-fx.show{animation:fxPop .5s ease}@keyframes fxPop{0%{opacity:0;transform:translate(-50%,-50%) scale(.3) rotate(-12deg)}35%{opacity:1;transform:translate(-50%,-50%) scale(1.25) rotate(4deg)}100%{opacity:0;transform:translate(-50%,-58%) scale(.92)}}.battle-fighter.lunge-left{animation:lungeLeft .35s ease}.battle-fighter.lunge-right{animation:lungeRight .35s ease}.battle-fighter.hit{animation:hitShake .36s ease;filter:saturate(1.7)}@keyframes lungeLeft{50%{transform:translateX(28px) rotate(-2deg)}}@keyframes lungeRight{50%{transform:translateX(-28px) rotate(2deg)}}@keyframes hitShake{20%{transform:translateX(-8px)}40%{transform:translateX(7px)}60%{transform:translateX(-5px)}80%{transform:translateX(3px)}}.damage-pop{position:absolute;z-index:10;font-size:30px;font-weight:1000;color:var(--red);text-shadow:2px 2px 0 #fff;animation:damageFly .7s ease forwards;pointer-events:none}@keyframes damageFly{0%{opacity:0;transform:translateY(12px) scale(.6)}25%{opacity:1;transform:translateY(0) scale(1.15)}100%{opacity:0;transform:translateY(-34px) scale(.92)}}.skill-flash{position:absolute;inset:0;z-index:8;background:rgba(255,216,61,.55);opacity:0;pointer-events:none}.skill-flash.on{animation:flash .45s ease}@keyframes flash{0%,100%{opacity:0}35%{opacity:1}}
.battle-result{border-top:3px solid var(--ink);padding:18px;background:#fff}.winner-strip{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center}.winner-strip small{font-size:9px;font-weight:1000;color:var(--pink)}.winner-strip h3{font-size:30px;margin:3px 0 0}.winner-badge{background:var(--yellow);border:3px solid var(--ink);border-radius:50%;width:90px;height:90px;display:grid;place-items:center;text-align:center;font-size:12px;font-weight:1000;transform:rotate(5deg);box-shadow:4px 4px 0 var(--ink)}.reason-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}.reason-card{border:2px solid var(--ink);border-radius:9px;background:#f7f7f2;padding:9px}.reason-card b{display:block;font-size:11px}.reason-card span{display:block;font-size:8px;color:var(--muted);font-weight:800;line-height:1.45;margin-top:3px}.result-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:14px}.battle-log{margin-top:12px;border-top:2px dashed rgba(23,32,43,.2);padding-top:9px}.battle-log summary{font-size:9px;font-weight:1000;cursor:pointer}.log-line{font-size:8px;color:var(--muted);font-weight:700;line-height:1.5;padding:3px 0;border-bottom:1px dotted rgba(23,32,43,.12)}
.history-list{display:grid;gap:7px}.history-item{display:grid;grid-template-columns:130px 1fr auto;gap:12px;align-items:center;border-bottom:2px dashed rgba(23,32,43,.18);padding:10px 2px}.history-item time{font-size:9px;color:var(--muted);font-weight:800}.history-item strong{font-size:11px}.history-item span{font-size:10px;font-weight:1000;color:var(--pink)}
dialog{color:var(--ink);background:var(--paper);border:3px solid var(--ink);border-radius:18px;box-shadow:var(--shadow)}dialog::backdrop{background:rgba(23,32,43,.68);backdrop-filter:blur(2px)}.battle-dialog{width:min(1080px,calc(100% - 22px));max-height:calc(100vh - 24px);overflow:auto;padding:16px}.dialog-close{position:sticky;float:right;top:0;z-index:20;width:38px;height:38px;border:2px solid var(--ink);border-radius:50%;background:var(--pink);color:#fff;font-size:22px;font-weight:1000;box-shadow:2px 2px 0 var(--ink)}.external-dialog{width:min(530px,calc(100% - 22px));padding:22px}.external-dialog h3{font-size:25px;margin:10px 0}.external-dialog p{font-size:10px;color:var(--muted);font-weight:800;line-height:1.6}.external-dialog code{display:block;border:2px solid var(--ink);background:#fff;padding:10px;border-radius:9px;word-break:break-all;font-size:9px}.dialog-sticker{display:inline-block;border:2px solid var(--ink);background:var(--sky);padding:4px 7px;border-radius:5px;font-size:8px;font-weight:1000;transform:rotate(-2deg)}.dialog-sticker.warning{background:var(--yellow)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
footer{margin-top:16px;padding:20px 4px 0;display:flex;justify-content:space-between;gap:18px;border-top:2px solid rgba(23,32,43,.18)}footer a{color:var(--ink);font-weight:1000;font-size:10px}footer p{margin:0;max-width:760px;font-size:8px;color:var(--muted);font-weight:700;line-height:1.6;text-align:right}
@media(max-width:900px){.hero-pop{grid-template-columns:1fr}.hero-burst{display:none}.hero-grid,.card-grid{grid-template-columns:1fr}.stat-guide{grid-template-columns:repeat(3,1fr)}.battle-stage{grid-template-columns:1fr 90px 1fr;padding:18px 10px}.reason-grid{grid-template-columns:1fr}.header-status{gap:5px}.status-ticket{min-width:86px;padding:8px}}
@media(max-width:650px){.app-shell{width:min(100% - 16px,1180px)}.site-header{height:auto;padding:14px 0;align-items:flex-start}.header-status{display:grid;grid-template-columns:repeat(3,1fr);width:100%}.site-header{flex-direction:column}.hero-copy{padding:28px 20px}.hero-pop h1{font-size:57px}.hero-pop h1 b{display:block;margin:3px 0 0}.tabs{grid-template-columns:repeat(6,auto);overflow-x:auto;padding-bottom:5px}.tab{min-width:105px}.hero-grid{gap:12px}.panel{padding:15px}.url-row{grid-template-columns:1fr}.energy-panel{grid-template-columns:1fr}.energy-orbs{justify-content:flex-start}.stat-guide{grid-template-columns:1fr 1fr}.versus-inputs{grid-template-columns:1fr}.vs-mark{text-align:center}.battle-stage{grid-template-columns:1fr;gap:10px;padding:17px}.battle-center{order:2}.battle-fighter.right{order:3}.battle-fighter.left{order:1}.fighter-sigil{width:48px;height:48px}.history-item{grid-template-columns:1fr;gap:3px}.winner-strip{grid-template-columns:1fr auto}footer{flex-direction:column}footer p{text-align:left}.stats{gap:3px}.statbox strong{font-size:14px}.site-card{padding:13px}.card-name{font-size:17px}}


/* v0.6: monster card / click-safe layers */
.card-stage::before,
.card-stage:before,
.battle-stage::before,
.battle-stage:before {
  pointer-events: none;
}
.card-stage > * {
  position: relative;
  z-index: 1;
}
.header-status { grid-template-columns: repeat(3, minmax(112px,1fr)); }

.site-card {
  width: min(100%, 500px);
}
.card-core {
  display:grid;
  grid-template-columns: 92px 1fr;
  gap:10px;
  align-items:center;
  margin:14px 0 12px;
  position:relative;
  z-index:1;
}
.card-core .card-bp {
  display:block;
  margin:0;
  text-align:left;
}
.card-core .card-bp small { display:block; margin-bottom:3px; }
.card-core .card-bp strong { font-size:44px; }
.monster-panel {
  min-height:118px;
  display:grid;
  grid-template-columns:118px 1fr;
  align-items:center;
  border:2px solid var(--ink);
  border-radius:13px;
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(255,246,198,.95));
  overflow:hidden;
  box-shadow:3px 3px 0 rgba(23,32,43,.18);
}
.monster-art {
  height:116px;
  display:grid;
  place-items:center;
  background:radial-gradient(circle at 50% 58%,rgba(97,201,255,.24),transparent 63%);
}
.monster-art img {
  width:108px;
  height:108px;
  object-fit:contain;
  image-rendering:auto;
  filter:drop-shadow(0 5px 3px rgba(23,32,43,.18));
}
.monster-info { padding:9px 9px 9px 2px; min-width:0; }
.monster-info small {
  display:block;
  font-size:7px;
  font-weight:1000;
  color:var(--pink);
  margin-bottom:2px;
}
.monster-info strong {
  display:block;
  font-size:13px;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.monster-info span {
  display:block;
  font-size:7px;
  color:var(--muted);
  font-weight:900;
  margin-top:5px;
}
.statbox { position:relative; padding-top:6px; }
.stat-icon {
  display:block;
  width:24px;
  height:24px;
  object-fit:contain;
  margin:0 auto 2px;
  filter:drop-shadow(1px 2px 0 rgba(23,32,43,.16));
}
.skill {
  display:grid;
  grid-template-columns:28px auto 1fr;
  align-items:center;
}
.skill-icon {
  width:25px;
  height:25px;
  object-fit:contain;
  filter:drop-shadow(1px 2px 0 rgba(23,32,43,.12));
}
.skill span { justify-self:end; }

.fighter-monster {
  margin-top:10px;
  min-height:145px;
  position:relative;
  display:grid;
  place-items:center;
  border:2px solid var(--ink);
  border-radius:12px;
  background:linear-gradient(180deg,#eaf8ff,#fff6c8);
  overflow:hidden;
}
.fighter-monster::after {
  content:"";
  position:absolute;
  width:150px;height:28px;
  left:50%;bottom:29px;transform:translateX(-50%);
  background:rgba(23,32,43,.10);
  border-radius:50%;
  filter:blur(4px);
}
.fighter-monster img {
  position:relative;
  z-index:2;
  width:138px;
  height:118px;
  object-fit:contain;
  margin-top:-10px;
  filter:drop-shadow(0 6px 3px rgba(23,32,43,.20));
}
.battle-fighter.right .fighter-monster img { transform:scaleX(-1); }
.fighter-monster > div {
  position:absolute;
  z-index:3;
  left:7px;right:7px;bottom:5px;
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:5px;
  padding:5px 7px;
  background:rgba(255,255,255,.88);
  border:1px solid var(--ink);
  border-radius:7px;
}
.fighter-monster b { font-size:8px; }
.fighter-monster span { font-size:7px; color:var(--muted); font-weight:900; text-align:right; }

.battle-effect-art {
  position:absolute;
  left:50%;
  top:47%;
  width:270px;
  height:270px;
  transform:translate(-50%,-50%);
  z-index:7;
  pointer-events:none;
  opacity:0;
}
.battle-effect-art img {
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 0 12px rgba(255,255,255,.85));
}
.battle-effect-art.show { animation:effectArtPop .58s ease; }
@keyframes effectArtPop {
  0% { opacity:0; transform:translate(-50%,-50%) scale(.35) rotate(-8deg); }
  24% { opacity:1; transform:translate(-50%,-50%) scale(1.12) rotate(2deg); }
  70% { opacity:.95; transform:translate(-50%,-50%) scale(.98); }
  100% { opacity:0; transform:translate(-50%,-55%) scale(1.08); }
}
.battle-fx { z-index:10; }

.winner-strip {
  grid-template-columns:1fr 110px 86px;
  align-items:center;
}
.winner-monster {
  width:105px;
  height:95px;
  object-fit:contain;
  filter:drop-shadow(0 5px 3px rgba(23,32,43,.18));
}
.winner-monster-name {
  margin:5px 0 0;
  font-size:9px;
  font-weight:900;
  color:var(--muted);
}

@media(max-width:650px) {
  .header-status { grid-template-columns:repeat(3,1fr); }
  .card-core { grid-template-columns:76px 1fr; }
  .monster-panel { grid-template-columns:92px 1fr; min-height:98px; }
  .monster-art { height:96px; }
  .monster-art img { width:88px; height:88px; }
  .card-core .card-bp strong { font-size:37px; }
  .stat-icon { width:20px; height:20px; }
  .skill { grid-template-columns:24px auto 1fr; }
  .skill-icon { width:21px; height:21px; }
  .winner-strip { grid-template-columns:1fr 80px 70px; }
  .winner-monster { width:76px; height:70px; }
}


/* v0.7: player-facing polish / buddy bonuses / battle feel */
.class-badge {
  display:flex;
  align-items:center;
  gap:5px;
}
.class-badge b {
  display:inline-grid;
  place-items:center;
  min-width:27px;
  height:21px;
  padding:0 5px;
  border:1px solid var(--ink);
  border-radius:999px;
  background:var(--pink);
  color:#fff;
  font-size:8px;
  line-height:1;
}
.class-badge span { font-size:8px; }

.monster-info em {
  display:inline-block;
  margin-top:6px;
  padding:3px 6px;
  border:1px solid var(--ink);
  border-radius:999px;
  background:#fff;
  color:var(--pink);
  font-size:7px;
  font-style:normal;
  font-weight:1000;
}

.trait-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;
  margin-top:8px;
}
.trait-grid span {
  display:flex;
  flex-direction:column;
  gap:2px;
  border:1px solid rgba(23,32,43,.25);
  border-radius:7px;
  padding:7px 8px;
  background:rgba(255,255,255,.72);
  font-size:8px;
  font-weight:900;
  color:var(--ink);
}
.trait-grid b {
  font-size:7px;
  color:var(--muted);
}

.battle-fighter.lunge-left .fighter-monster img,
.battle-fighter.lunge-right .fighter-monster img {
  animation:buddyPounce .36s ease;
}
@keyframes buddyPounce {
  0% { transform:translateY(0) scale(1); }
  45% { transform:translateY(-10px) scale(1.12) rotate(-3deg); }
  100% { transform:translateY(0) scale(1); }
}
.battle-fighter.right.lunge-left .fighter-monster img,
.battle-fighter.right.lunge-right .fighter-monster img {
  animation:buddyPounceRight .36s ease;
}
@keyframes buddyPounceRight {
  0% { transform:scaleX(-1) translateY(0) scale(1); }
  45% { transform:scaleX(-1) translateY(-10px) scale(1.12) rotate(-3deg); }
  100% { transform:scaleX(-1) translateY(0) scale(1); }
}

.battle-effect-art.show img {
  animation:effectPulse .58s ease;
}
@keyframes effectPulse {
  0% { filter:drop-shadow(0 0 0 rgba(255,255,255,0)); }
  35% { filter:drop-shadow(0 0 20px rgba(255,255,255,1)) saturate(1.5); }
  100% { filter:drop-shadow(0 0 8px rgba(255,255,255,.4)); }
}

@media(max-width:650px) {
  .trait-grid { grid-template-columns:1fr 1fr; }
  .class-badge { flex-direction:column; align-items:flex-end; gap:2px; }
}


/* v0.8 GAMEPLAY: radar / tower / target FX / transparent-padding correction */
.monster-sprite{display:block;position:relative;width:100%;height:100%;overflow:visible;pointer-events:none}
.monster-sprite img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:contain!important;margin:0!important;transform:translate(calc(var(--monster-x,0) * 1%),calc(var(--monster-y,0) * 1%)) scale(var(--monster-scale,1));transform-origin:50% 50%;filter:drop-shadow(0 5px 3px rgba(23,32,43,.18))}
.monster-art{overflow:hidden;padding:5px}.card-monster-sprite{width:100%;height:100%}
.fighter-monster{overflow:hidden}.fighter-monster .monster-sprite{position:absolute;left:12%;right:12%;top:2%;bottom:24%;width:auto;height:auto}
.battle-fighter.right .fighter-monster .monster-sprite{transform:scaleX(-1)}
.battle-fighter.right .fighter-monster img{transform:translate(calc(var(--monster-x,0) * 1%),calc(var(--monster-y,0) * 1%)) scale(var(--monster-scale,1))}
.battle-fighter.lunge-left .fighter-monster img,.battle-fighter.lunge-right .fighter-monster img{animation:none!important}
.battle-fighter.lunge-left .fighter-monster .monster-sprite,.battle-fighter.lunge-right .fighter-monster .monster-sprite{animation:buddyPounce .36s ease}
.battle-fighter.right.lunge-left .fighter-monster .monster-sprite,.battle-fighter.right.lunge-right .fighter-monster .monster-sprite{animation:buddyPounceRightWrap .36s ease}
@keyframes buddyPounceRightWrap{0%{transform:scaleX(-1) translateY(0) scale(1)}45%{transform:scaleX(-1) translateY(-10px) scale(1.10)}100%{transform:scaleX(-1) translateY(0) scale(1)}}

.stats-and-radar{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:8px;align-items:stretch;position:relative;z-index:1}
.stats-and-radar .stats{grid-template-columns:repeat(3,1fr);align-content:center}
.stat-radar{border:2px solid var(--ink);border-radius:10px;background:rgba(255,255,255,.88);display:grid;place-items:center;padding:3px}
.stat-radar-svg{width:100%;height:auto;display:block;overflow:visible}
.stat-radar-svg .radar-grid polygon,.stat-radar-svg .radar-grid line{fill:none;stroke:rgba(23,32,43,.25);stroke-width:1}
.stat-radar-svg .radar-value{fill:rgba(32,140,255,.28);stroke:var(--blue);stroke-width:2;stroke-linejoin:round}
.stat-radar-svg text{font-size:8px;font-weight:1000;text-anchor:middle;fill:var(--muted)}
.fighter-stat-zone{display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:6px;align-items:center;margin-top:9px}
.fighter-stat-zone .fighter-mini-stats{grid-template-columns:repeat(2,1fr);margin-top:0}
.fighter-stat-zone .fighter-mini-stats span:last-child{grid-column:1/-1}
.fighter-radar{width:88px;height:88px;border:1px solid rgba(23,32,43,.25);border-radius:9px;background:#fff;display:grid;place-items:center}

.battle-playback-controls{display:flex;align-items:center;justify-content:center;gap:4px;flex-wrap:wrap;margin-top:8px;font-size:8px;font-weight:1000}
.battle-playback-controls button{border:1px solid var(--ink);background:#fff;border-radius:999px;padding:4px 7px;font-size:8px;font-weight:1000;cursor:pointer}
.battle-playback-controls button.active{background:var(--yellow);box-shadow:1px 1px 0 var(--ink)}
.battle-skip{display:inline-block;border:1px dashed rgba(23,32,43,.55);border-radius:999px;padding:5px 8px;background:rgba(255,255,255,.7);text-decoration:none}
.battle-effect-art{left:50%;top:47%;transform:translate(-50%,-50%);width:220px;height:220px;transition:left .08s,top .08s,width .08s,height .08s}

.winner-monster{position:relative;width:105px;height:95px;overflow:hidden}.winner-monster .monster-sprite{width:100%;height:100%}

.tower-panel{background:linear-gradient(145deg,#fff9ea,#eef0ff)}
.tower-dashboard{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}
.tower-floor-card,.tower-next-enemy{border:2px solid var(--ink);border-radius:12px;background:#fff;padding:12px;box-shadow:3px 3px 0 var(--ink)}
.tower-floor-card.best{background:#fff4bc}.tower-floor-card.run{background:#eefaff}.tower-floor-card.score{background:#fff0f7}.tower-floor-card small,.tower-next-enemy small{display:block;font-size:8px;font-weight:1000;color:var(--muted)}
.tower-floor-card strong{display:block;font-size:31px;line-height:1;color:var(--pink);margin:5px 0}.tower-floor-card em{font-size:9px;font-style:normal;font-weight:1000}
.tower-next-enemy{background:#e9f7ff;min-width:0;grid-column:1/-1}.tower-next-enemy strong{display:block;font-size:18px;margin-top:4px}.tower-next-enemy span{display:block;font-size:8px;color:var(--muted);font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px}.tower-next-enemy b{display:inline-block;margin-top:8px;font-size:10px;color:var(--blue)}
.tower-note{display:flex;gap:10px;align-items:center;margin-top:13px;border:2px dashed rgba(23,32,43,.35);border-radius:10px;padding:9px 11px;font-size:9px;font-weight:900}.tower-note b{color:var(--pink)}

@media(max-width:900px){.tower-dashboard{grid-template-columns:1fr 1fr}.tower-next-enemy{grid-column:1/-1}}
@media(max-width:650px){.stats-and-radar{grid-template-columns:1fr 96px}.stats-and-radar .stats{grid-template-columns:repeat(2,1fr)}.stats-and-radar .stats .statbox:last-child{grid-column:1/-1}.fighter-stat-zone{grid-template-columns:1fr 76px}.fighter-radar{width:76px;height:76px}.tower-dashboard{grid-template-columns:1fr 1fr}.tower-floor-card{padding:9px}.tower-floor-card strong{font-size:25px}.battle-stage{overflow:visible}.battle-effect-art{max-width:55vw;max-height:55vw}}

/* v0.9: full-screen battle modal / compact mobile battlefield / settings */
.tabs{grid-template-columns:repeat(7,1fr)}
.battle-dialog{
  width:100vw;
  height:100dvh;
  max-width:none;
  max-height:none;
  margin:0;
  padding:10px;
  border-radius:0;
  overflow:auto;
  box-shadow:none;
}
.battle-dialog .dialog-close{position:fixed;right:16px;top:12px;z-index:100}
#battleDialogContent{width:min(1120px,100%);margin:0 auto;padding:0 2px 28px}
.battle-dialog .battle-shell{margin:0;box-shadow:none;min-height:calc(100dvh - 20px)}
.battle-toolbar{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:7px 56px 7px 12px;border-bottom:2px solid var(--ink);background:#fff}
.battle-toolbar .battle-playback-controls{margin:0}
.battle-stage{
  min-height:540px;
  height:min(58dvh,620px);
  display:grid;
  grid-template-columns:minmax(260px,1fr) 120px minmax(260px,1fr);
  grid-template-rows:1fr 1fr;
  gap:10px 16px;
  align-items:stretch;
  padding:14px;
}
.battle-stage .battle-fighter.right{grid-column:3;grid-row:1;align-self:start}
.battle-stage .battle-fighter.left{grid-column:1;grid-row:2;align-self:end}
.battle-stage .battle-center{grid-column:2;grid-row:1 / 3;align-self:center;z-index:5}
.battle-fighter{min-width:0;padding:9px}
.battle-fighter .fighter-head strong{font-size:clamp(12px,1.8vw,18px);max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.battle-fighter .fighter-monster{min-height:120px;height:clamp(120px,18dvh,180px);margin-top:5px}
.battle-fighter .fighter-stat-zone{margin-top:5px}
.battle-log-panel{border-top:3px solid var(--ink);background:#fff;padding:10px 14px 12px}
.battle-log-title{font-size:10px;font-weight:1000;color:var(--pink);margin-bottom:5px}
.battle-log-live{max-height:150px;overflow:auto;border:2px solid rgba(23,32,43,.2);border-radius:9px;padding:5px 8px;background:#fffdf6}
.battle-log-live:empty::before{content:"戦闘開始後、ここにログが並びます。";font-size:8px;color:var(--muted);font-weight:800}
.settings-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.settings-card{border:2px solid var(--ink);border-radius:12px;background:#fff;padding:16px;box-shadow:3px 3px 0 rgba(23,32,43,.16)}
.settings-card h3{margin:0 0 6px;font-size:17px}.settings-card p{margin:0;font-size:10px;line-height:1.7;color:var(--muted);font-weight:800}
.footer-links{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-start}

@media(max-width:900px){
  .tabs{grid-template-columns:repeat(7,auto);overflow-x:auto}
  .settings-cards{grid-template-columns:1fr}
  .battle-stage{grid-template-columns:minmax(210px,1fr) 88px minmax(210px,1fr)}
}
@media(max-width:650px){
  .battle-dialog{padding:6px}
  .battle-dialog .dialog-close{right:8px;top:7px;width:34px;height:34px;font-size:19px}
  .battle-dialog .battle-top{padding-right:46px}
  .battle-toolbar{padding:5px 44px 5px 6px;justify-content:flex-start;gap:5px}
  .battle-playback-controls{justify-content:flex-start}
  .battle-stage{
    min-height:0;
    height:52dvh;
    max-height:500px;
    grid-template-columns:1fr 58px 1fr;
    grid-template-rows:1fr 1fr;
    gap:5px;
    padding:6px;
    overflow:hidden;
  }
  .battle-stage .battle-fighter.right{grid-column:2 / 4;grid-row:1;width:82%;justify-self:end}
  .battle-stage .battle-fighter.left{grid-column:1 / 3;grid-row:2;width:82%;justify-self:start}
  .battle-stage .battle-center{grid-column:2;grid-row:1 / 3;align-self:center;pointer-events:none}
  .battle-center .battle-message{font-size:7px;padding:5px;max-width:74px}
  .turn-chip{font-size:7px;padding:4px 5px}
  .battle-fighter{padding:5px;border-width:2px}
  .battle-fighter .fighter-head{gap:4px}.fighter-sigil{width:32px;height:32px;font-size:11px}
  .battle-fighter .fighter-head small{font-size:6px}.battle-fighter .fighter-head strong{font-size:10px;max-width:130px}
  .battle-fighter .fighter-monster{height:13dvh;min-height:76px;max-height:112px;border-width:1px;margin-top:3px}
  .fighter-monster > div{padding:2px 4px;bottom:2px}.fighter-monster b{font-size:6px}.fighter-monster span{font-size:5px}
  .hp-line{margin-top:3px}.hp-label{font-size:6px}.hp-track{height:8px}
  .fighter-stat-zone{grid-template-columns:1fr 48px;gap:3px}.fighter-radar{width:48px;height:48px}.fighter-mini-stats{gap:2px}.fighter-mini-stats span{font-size:5.5px;padding:2px}
  .battle-effect-art{max-width:34vw;max-height:34vw}
  .battle-log-panel{padding:6px}.battle-log-live{max-height:105px}.log-line{font-size:7px}
  .battle-result{padding:10px}.winner-strip h3{font-size:20px}.winner-badge{width:62px;height:62px}.reason-grid{margin-top:8px}.result-actions{margin-top:8px}
  .footer-links{gap:8px 12px}
}

/* v1.0: battle-card fit / clearer information hierarchy */
.battle-stage{
  min-height:520px;
  height:auto;
  grid-template-rows:minmax(235px,1fr) minmax(235px,1fr);
  overflow:visible;
}
.battle-stage .battle-fighter.right{justify-self:end}
.battle-stage .battle-fighter.left{justify-self:start}
.battle-fighter{
  width:min(100%,430px);
  max-width:430px;
  padding:8px 9px;
}
.fighter-head{align-items:center;gap:7px}
.fighter-title{min-width:0;flex:1}
.battle-fighter .fighter-head strong{
  max-width:none;
  font-size:clamp(12px,1.55vw,17px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fighter-sigil{
  flex:0 0 auto;
  width:44px;
  height:44px;
  border-width:2px;
  font-size:19px;
  box-shadow:2px 2px 0 var(--ink);
}
.fighter-body{
  display:grid;
  grid-template-columns:minmax(112px,.9fr) minmax(150px,1.1fr);
  gap:8px;
  align-items:stretch;
  margin-top:6px;
}
.battle-fighter .fighter-monster{
  min-height:0;
  height:136px;
  margin:0;
  border-width:2px;
}
.fighter-monster .monster-sprite{
  left:6%;
  right:6%;
  top:5%;
  bottom:5%;
}
.fighter-monster::after{bottom:12px;width:72%;height:22px}
.fighter-no-monster{
  font-size:8px;
  font-weight:1000;
  color:var(--muted);
  letter-spacing:.08em;
}
.battle-fighter .fighter-stat-zone{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) 76px;
  gap:5px;
  align-items:center;
  margin:0;
}
.battle-fighter .fighter-mini-stats{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  margin:0;
}
.battle-fighter .fighter-mini-stats span{
  padding:5px 3px;
  font-size:7px;
  line-height:1.15;
  white-space:nowrap;
}
.battle-fighter .fighter-mini-stats span:last-child{grid-column:1/-1}
.battle-fighter .fighter-radar{
  width:76px;
  height:76px;
}
.battle-fighter .hp-line{margin:7px 1px 0}
.battle-fighter .hp-track{height:13px;margin-top:3px}

@media(max-width:900px){
  .battle-stage{
    min-height:500px;
    grid-template-columns:minmax(210px,1fr) 76px minmax(210px,1fr);
    grid-template-rows:minmax(225px,1fr) minmax(225px,1fr);
    gap:8px 10px;
    padding:10px;
  }
  .battle-fighter{max-width:390px}
  .fighter-body{grid-template-columns:minmax(104px,.88fr) minmax(142px,1.12fr);gap:6px}
  .battle-fighter .fighter-monster{height:126px}
  .battle-fighter .fighter-stat-zone{grid-template-columns:minmax(0,1fr) 68px;gap:4px}
  .battle-fighter .fighter-radar{width:68px;height:68px}
  .battle-fighter .fighter-mini-stats span{font-size:6.5px;padding:4px 2px}
}

@media(max-width:650px){
  .battle-stage{
    min-height:0;
    height:auto;
    max-height:none;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto;
    gap:7px;
    padding:7px;
    overflow:visible;
  }
  .battle-stage .battle-fighter.right{
    grid-column:1;
    grid-row:1;
    width:100%;
    max-width:none;
    justify-self:stretch;
  }
  .battle-stage .battle-center{
    grid-column:1;
    grid-row:2;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    pointer-events:none;
  }
  .battle-stage .battle-fighter.left{
    grid-column:1;
    grid-row:3;
    width:100%;
    max-width:none;
    justify-self:stretch;
  }
  .battle-center .battle-message{margin:0;min-height:0;max-width:210px;padding:5px 8px}
  .battle-fighter{padding:5px 6px}
  .fighter-sigil{width:30px;height:30px;font-size:11px;border-width:2px;box-shadow:1px 1px 0 var(--ink)}
  .battle-fighter .fighter-head small{font-size:6px}
  .battle-fighter .fighter-head strong{font-size:10px;max-width:none}
  .fighter-body{grid-template-columns:minmax(96px,.8fr) minmax(150px,1.2fr);gap:5px;margin-top:4px}
  .battle-fighter .fighter-monster{height:98px;min-height:0;max-height:none;margin:0}
  .fighter-monster .monster-sprite{left:4%;right:4%;top:3%;bottom:3%}
  .battle-fighter .fighter-stat-zone{grid-template-columns:minmax(0,1fr) 52px;gap:3px}
  .battle-fighter .fighter-radar{width:52px;height:52px}
  .battle-fighter .fighter-mini-stats{gap:2px}
  .battle-fighter .fighter-mini-stats span{font-size:5.8px;padding:2px 1px}
  .battle-fighter .hp-line{margin-top:4px}
  .battle-fighter .hp-label{font-size:6px}
  .battle-fighter .hp-track{height:8px;margin-top:2px}
}

/* v1.1: URL-first battle/results, tower progression, mobile arena expansion */
.fighter-title small{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--blue);
  font-size:7.5px;
  line-height:1.25;
}
.battle-fighter.defeated{
  filter:grayscale(1);
  opacity:.48;
  box-shadow:3px 4px 0 rgba(23,32,43,.45);
}
.battle-fighter.victorious{
  outline:3px solid rgba(255,216,61,.9);
  outline-offset:2px;
}
.winner-strip{
  grid-template-columns:minmax(0,1fr) 108px 86px;
  gap:14px;
  align-items:center;
}
.winner-copy{min-width:0}
.winner-strip .winner-copy > small{
  display:block;
  color:var(--pink);
  font-size:10px;
  font-weight:1000;
  letter-spacing:.08em;
}
.winner-strip .winner-copy h3{
  margin:3px 0 0;
  font-size:clamp(22px,3vw,34px);
  line-height:1.1;
  overflow-wrap:anywhere;
}
.winner-url{
  margin:6px 0 0;
  color:var(--blue);
  font-size:10px;
  line-height:1.35;
  font-weight:1000;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.winner-meta{
  margin:5px 0 0;
  color:var(--muted);
  font-size:8px;
  line-height:1.35;
  font-weight:900;
}
.result-actions .result-next:not(.hidden){order:-2}
.result-actions .result-rematch{order:-1}

.history-list{gap:0}
.history-item{
  grid-template-columns:128px minmax(0,1fr) minmax(190px,300px);
  gap:14px;
  align-items:start;
  padding:12px 2px;
}
.history-match{min-width:0;display:grid;gap:3px}
.history-match b{
  color:var(--ink);
  font-size:10px;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.history-match em{
  color:var(--muted);
  font-size:8px;
  font-style:normal;
  font-weight:1000;
}
.history-outcome{min-width:0;text-align:right}
.history-outcome strong{
  display:block;
  color:var(--pink);
  font-size:9px;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.history-outcome span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:8px;
}

@media(max-width:650px){
  .battle-dialog{padding:0}
  #battleDialogContent{width:100%;padding:0 0 20px}
  .battle-dialog .battle-shell{
    min-height:100dvh;
    border-left:0;
    border-right:0;
    border-radius:0;
  }
  .battle-dialog .battle-top{padding:9px 48px 9px 10px}
  .battle-toolbar{padding:6px 44px 6px 8px}
  .battle-stage{
    width:100%;
    min-height:0;
    height:auto;
    max-height:none;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto;
    gap:10px;
    padding:10px 4px 14px;
    overflow:visible;
  }
  .battle-stage:before{inset:5px 2px}
  .battle-stage .battle-fighter.right,
  .battle-stage .battle-fighter.left{
    grid-column:1;
    width:calc(100% - 8px);
    max-width:none;
  }
  .battle-stage .battle-fighter.right{grid-row:1;justify-self:end}
  .battle-stage .battle-fighter.left{grid-row:3;justify-self:start}
  .battle-stage .battle-center{
    grid-column:1;
    grid-row:2;
    min-height:42px;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
  }
  .battle-center .battle-message{
    max-width:min(72vw,270px);
    padding:6px 9px;
    font-size:8px;
  }
  .battle-fighter{padding:7px 8px}
  .fighter-head{gap:6px}
  .fighter-title small{font-size:7.5px}
  .battle-fighter .fighter-head strong{font-size:11px;line-height:1.15}
  .fighter-sigil{width:34px;height:34px;font-size:13px}
  .fighter-body{
    grid-template-columns:minmax(118px,.86fr) minmax(0,1.14fr);
    gap:7px;
    margin-top:6px;
  }
  .battle-fighter .fighter-monster{height:116px}
  .battle-fighter .fighter-stat-zone{grid-template-columns:minmax(0,1fr) 58px;gap:4px}
  .battle-fighter .fighter-radar{width:58px;height:58px}
  .battle-fighter .fighter-mini-stats span{font-size:6.2px;padding:3px 2px}
  .battle-fighter .hp-line{margin-top:6px}
  .battle-fighter .hp-label{font-size:7px}
  .battle-fighter .hp-track{height:10px}
  .battle-effect-art{max-width:46vw;max-height:46vw}
  .winner-strip{grid-template-columns:minmax(0,1fr) 64px;gap:8px}
  .winner-strip .winner-monster{display:none}
  .winner-strip .winner-badge{width:58px;height:58px;font-size:9px;box-shadow:2px 2px 0 var(--ink)}
  .winner-strip .winner-copy h3{font-size:22px}
  .winner-url{font-size:9px}
  .winner-meta{font-size:7px}
  .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .result-actions button{width:100%}
  .history-item{grid-template-columns:1fr;gap:6px;padding:12px 0}
  .history-outcome{text-align:left}
}
.battle-message.winner-message{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:96px;
  padding:9px 8px;
}
.battle-message.winner-message > span{
  color:var(--yellow);
  font-size:8px;
  font-weight:1000;
  letter-spacing:.12em;
}
.battle-message.winner-message > strong{
  max-width:100%;
  font-size:13px;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.battle-message.winner-message > small{
  max-width:100%;
  color:#d8e7f7;
  font-size:7px;
  line-height:1.25;
  font-weight:900;
  overflow-wrap:anywhere;
  word-break:break-word;
}
@media(max-width:650px){
  .battle-message.winner-message{
    min-height:64px;
    max-width:min(82vw,310px);
    padding:6px 8px;
  }
  .battle-message.winner-message > strong{font-size:11px}
  .battle-message.winner-message > small{font-size:6.5px}
}

/* v1.2: 50F tower bands / clear turn score */
.tower-result-summary{
  margin:12px 0;
  padding:11px 14px;
  border:2px solid var(--ink);
  border-radius:12px;
  background:#eefaff;
  box-shadow:3px 3px 0 var(--ink);
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
}
.tower-result-summary small{font-size:9px;font-weight:1000;color:var(--blue);letter-spacing:.08em}
.tower-result-summary strong{font-size:18px;line-height:1.2;text-align:center}
.tower-result-summary span{font-size:9px;font-weight:900;color:var(--muted);text-align:right}
.tower-result-summary.clear{background:#fff4bc}
.tower-result-summary.clear strong{color:var(--pink);font-size:22px}
.tower-result-summary.failed{background:#f2f2f2}
.tower-result-summary.failed small,.tower-result-summary.failed strong{color:#626b75}
@media(max-width:650px){
  .tower-result-summary{grid-template-columns:1fr;gap:4px;text-align:center}
  .tower-result-summary strong,.tower-result-summary span{text-align:center}
  .tower-floor-card.score strong{font-size:22px}
}
