.battle-error{padding:12px 16px;background:#fff0ed;color:#a33b32;border-radius:12px}.battle-lobby{display:grid;grid-template-columns:1fr 440px;gap:60px;max-width:1100px;margin:40px auto}.battle-lobby-art{position:relative;text-align:center;padding:32px;background:linear-gradient(160deg,#e5f0ff,#f9f8ff);border-radius:28px;overflow:hidden}.battle-lobby-art h2{font-size:28px}.battle-lobby-art p{color:#61748b;line-height:1.8}.battle-lobby-cards{height:340px;position:relative}.battle-lobby-cards>div{position:absolute;left:calc(50% - 90px);top:50px;width:180px;transform:translateX(calc((var(--i) - 1)*90px)) rotate(calc((var(--i) - 1)*16deg));filter:drop-shadow(0 15px 15px #42619744)}.battle-lobby-cards img{width:100%;border-radius:9px}.battle-orbit{position:absolute;width:400px;height:400px;border:1px solid #afc6ef88;border-radius:50%;top:-50px;left:15%}.battle-start-form{display:flex;flex-direction:column;gap:16px;padding:20px 0}.battle-start-form label{display:flex;flex-direction:column;gap:10px;font-weight:600}.battle-start-form select{width:100%;padding:13px;border-radius:12px;border:1px solid #d3dfed;background:white;font:inherit;color:#203b57}.battle-deck-preview{display:flex;gap:6px;overflow:auto;min-height:70px;padding:4px}.battle-deck-preview button{flex:0 0 50px;border:0;padding:0;background:none;cursor:pointer}.battle-deck-preview img{width:100%;border-radius:3px}.battle-small{font-size:12px;color:#789;line-height:1.8}.battle-rules{max-width:1000px;margin:30px auto;color:#63768c;line-height:1.9}.battle-rules summary{cursor:pointer;font-weight:600;color:#284466}.battle-match-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.battle-match-head>div{display:flex;align-items:center;gap:14px}.battle-score{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0;color:#35536f}.battle-score>span:first-child,.battle-score>span:last-child{display:flex;gap:8px;align-items:baseline;white-space:nowrap}.battle-score b{font-size:32px;color:#347beb}.battle-score small{color:#8a9ab2}.battle-score #battle-effect-caption{font-size:13px;text-align:center}.battle-workspace{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px}.battle-arena{position:relative;background:radial-gradient(ellipse at center,#eff8ff,#dceaff);border-radius:24px;padding:22px 32px;overflow:hidden;border:1px solid #d2e0f5;box-shadow:inset 0 0 50px #c5d9f733;isolation:isolate}.battle-arena::before{content:'';position:absolute;width:300px;height:300px;border:2px solid #cadcf155;border-radius:50%;top:calc(50% - 150px);left:calc(50% - 150px);pointer-events:none}.battle-player-board{position:relative;z-index:1;display:flex;flex-direction:column;gap:16px;align-items:center}.opponent-board{margin-bottom:0}.your-board{flex-direction:column-reverse}.battle-bench{display:flex;gap:22px;justify-content:center;width:100%}.battle-active-row{display:flex;justify-content:center;align-items:center;gap:24px;width:100%}.battle-slot{position:relative;width:110px;aspect-ratio:367/512;flex:none;border:0;padding:0;border-radius:6px;cursor:pointer;box-shadow:0 4px 9px #4972a333;transition:transform .2s;background:#ffffff66;color:#7490b1}.battle-bench .battle-slot{width:85px}.battle-slot>img{width:100%;height:100%;object-fit:contain;border-radius:6px;display:block}.battle-slot.empty-slot{border:1px dashed #a5bcdb;background:#f8fbff5e;box-shadow:none;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px}.empty-slot span{font-size:22px}.empty-slot small{font-size:11px}.battle-slot:hover{transform:translateY(-3px)}.battle-slot:focus-visible,.battle-hand-card:focus-visible{outline:3px solid #468ded;outline-offset:3px}.battle-zone,.battle-pile{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:105px;color:#55718f;font-size:12px}.battle-zone>small{display:flex;align-items:center;gap:5px}.battle-zone>.energy{width:30px;height:30px;font-size:22px}.energy{display:inline-flex;align-items:center;justify-content:center;border:1px solid #ffffffb3;border-radius:50%;box-shadow:0 1px 3px #0003;width:17px;height:17px;font-size:12px;color:white;background:#8896a5;line-height:1;vertical-align:middle;flex:none;font-family:Arial,sans-serif}.energy-Grass{background:#54a154}.energy-Fire{background:#e47b47}.energy-Water{background:#48a8cd}.energy-Lightning{background:#efc544;color:#755f11}.energy-Psychic{background:#a575c0}.energy-Fighting{background:#b8764c}.energy-Darkness{background:#35505e}.energy-Metal{background:#7f929c}.energy-Colorless{background:#b5b3ae}.battle-hp{position:absolute;bottom:9px;right:3px;border-radius:4px;background:#fffffff0;color:#1f4d72;padding:1px 4px;font-size:12px}.battle-hp small{font-size:8px}.battle-hp-bar{position:absolute;bottom:3px;left:4px;right:4px;height:3px;background:linear-gradient(to right,#4ba987 calc(var(--hp)*100%),#d9e4e8 calc(var(--hp)*100%));border-radius:4px}.battle-attached{position:absolute;top:100%;left:0;display:flex;gap:1px;margin-top:4px;max-width:100%;flex-wrap:wrap;z-index:2}.battle-statuses{position:absolute;top:-8px;left:0;font-size:10px;background:#6e63bb;color:white;border-radius:4px;padding:2px 4px;white-space:nowrap}.battle-tool{position:absolute;top:3px;right:3px;background:#306285;color:white;font-size:9px;padding:3px;border-radius:3px}.battle-center{text-align:center;margin:28px 0;color:#8aa7c899;letter-spacing:5px;font-size:11px;display:flex;gap:12px;align-items:center;justify-content:center}.battle-center button{letter-spacing:0;border:0;border-radius:8px;background:#ffffffba;padding:6px;color:#4a719e}.battle-side{border-radius:20px;background:#fff;border:1px solid #dfE7f0;padding:18px;align-self:stretch;display:flex;flex-direction:column;max-height:690px}.battle-side h3{margin:0 0 10px}.battle-side .muted{font-size:12px;margin:0 0 10px;line-height:1.7}.battle-actions{overflow-y:auto;flex:1;min-height:90px;scrollbar-width:thin}.battle-action-group{margin-bottom:14px;display:flex;flex-direction:column;gap:6px}.battle-action-group>small{color:#89a0b9;font-size:10px;letter-spacing:1px}.battle-action{border:1px solid #dce6f3;background:#f5f9ff;border-radius:9px;padding:10px 12px;font:inherit;font-size:12px;cursor:pointer;color:#385777;text-align:left;line-height:1.65}.battle-action:hover{background:#e7f1ff;border-color:#9dc0f4}.battle-action.action-Attack{background:#ffece4;border-color:#f5c3a8;color:#a24f2a}.battle-action.action-EndTurn{background:#eaf2ff;color:#2e6ac5;font-weight:600}.battle-action.action-Attach{background:#ecf8f1;color:#437953;border-color:#cce7d7}.battle-log{margin-top:12px;font-size:12px;color:#68819f}.battle-log summary{cursor:pointer}.battle-log ol{max-height:180px;overflow:auto;padding-left:22px;line-height:1.9}.battle-hand-head{display:flex;align-items:center;justify-content:space-between;margin:22px 0 12px;color:#4b6683;font-size:13px}.battle-hand{display:flex;gap:10px;overflow-x:auto;padding:10px 4px 22px;align-items:flex-end;min-height:155px}.battle-hand-card{flex:0 0 95px;border:0;border-radius:6px;background:none;padding:0;cursor:pointer;color:#607993;transition:transform .2s,opacity .2s}.battle-hand-card img{width:100%;border-radius:5px;box-shadow:0 3px 8px #42628633}.battle-hand-card span{font-size:10px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:6px}.battle-hand-card.playable img{box-shadow:0 0 0 2px #73ae98,0 4px 10px #688aab33}.battle-hand-card.selected{transform:translateY(-10px)}.battle-hand-card.selected img{box-shadow:0 0 0 3px #4385e1,0 5px 12px #478be155}.battle-fx{position:absolute;inset:0;z-index:3;pointer-events:none}.damage-number{position:absolute;left:10%;top:30%;z-index:4;font-size:34px;font-weight:800;line-height:1;color:#f95547;text-shadow:0 2px 0 white,2px 0 0 white,-2px 0 0 white,0 -2px 0 white;animation:damage-rise .7s forwards}.heal-number{color:#40b68b}.battle-slot.hit{animation:battle-hit .35s}.battle-slot.healed{filter:drop-shadow(0 0 15px #5fe8b2)}.energy-flight{position:absolute;left:50%;top:50%;z-index:4;animation:energy-arrive .6s forwards}.energy-flight .energy{width:36px;height:36px;font-size:26px}.attack-player-0 .your-board .battle-active-row>.occupied-slot{animation:attack-up .3s}.attack-player-1 .opponent-board .battle-active-row>.occupied-slot{animation:attack-down .3s}.battle-result{text-align:center;padding:26px;margin:24px auto;background:#edf3fc;border-radius:24px;max-width:480px}.battle-result.won{background:linear-gradient(130deg,#e3f6ee,#fff5d7)}.battle-result h2{font-size:32px}.battle-result p{font-size:24px}.battle-deck-editor{width:min(1000px,94vw);max-height:92vh;padding:28px;border:0;border-radius:20px;overflow:auto;color:#294664}.battle-deck-editor h2{margin-top:0}.battle-deck-editor>p{font-size:12px;color:#6a819b;line-height:1.8}.editor-energies{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}.editor-energies label{font-size:12px;display:flex;gap:4px;align-items:center}.editor-selected{display:flex;gap:10px;overflow-x:auto;min-height:135px;background:#f0f5fb;padding:12px;border-radius:12px;margin-bottom:20px}.editor-selected>div{width:70px;flex:none;display:flex;flex-direction:column;gap:4px;align-items:center}.editor-selected>div>button,.editor-cards>button{border:0;padding:0;background:none;cursor:pointer}.editor-selected img{width:70px;border-radius:4px}.editor-selected small{font-size:9px;max-width:70px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.editor-selected span{display:flex;gap:8px;align-items:center}.editor-selected span button{border:0;border-radius:4px;padding:1px 6px;background:white;color:#3963a1;cursor:pointer}.battle-deck-editor input[type=search],.battle-deck-editor>select{padding:10px;border:1px solid #cfdbec;border-radius:10px;font:inherit;font-size:13px;margin:0 10px 12px 0}.editor-cards{display:grid;grid-template-columns:repeat(8,1fr);gap:12px;max-height:420px;overflow:auto;padding:4px;margin-bottom:18px}.editor-cards img{width:100%;border-radius:4px}.editor-cards small{font-size:9px;color:#58728f}.battle-discard-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.battle-discard-grid button{background:none;border:0;cursor:pointer}.battle-discard-grid img{width:100%;border-radius:6px}.battle-discard-grid small{display:block;margin:4px;color:#68829f}.battle-thinking{color:#6b8bb6;animation:thinking-pulse 1s infinite}
@keyframes attack-up{50%{transform:translateY(-45px) scale(1.06)}}@keyframes attack-down{50%{transform:translateY(45px) scale(1.06)}}@keyframes battle-hit{25%{transform:translateX(-5px);filter:brightness(1.6)}75%{transform:translateX(5px)}}@keyframes damage-rise{0%{opacity:0;transform:translateY(15px) scale(.8)}25%{opacity:1;transform:translateY(0) scale(1.1)}85%{opacity:1}100%{opacity:0;transform:translateY(-30px)}}@keyframes energy-arrive{0%{opacity:0;transform:translate(-100px,40px) scale(1.4)}50%{opacity:1}100%{opacity:0;transform:translate(0,-30px) scale(.5)}}@keyframes thinking-pulse{50%{opacity:.4}}
@media(max-width:900px){.battle-lobby{grid-template-columns:1fr 1fr;gap:24px}.battle-workspace{grid-template-columns:1fr 260px;gap:12px}.battle-arena{padding:20px 12px}.battle-bench{gap:12px}.battle-bench .battle-slot{width:65px}.battle-slot{width:90px}.battle-zone,.battle-pile{min-width:75px}.battle-side{padding:12px}.editor-cards{grid-template-columns:repeat(6,1fr)}}
@media(max-width:640px){.battle-lobby{display:flex;flex-direction:column;margin:16px auto;gap:14px}.battle-lobby-art{padding:14px}.battle-lobby-cards{height:170px}.battle-lobby-cards>div{width:95px;left:calc(50% - 47px);top:10px;transform:translateX(calc((var(--i) - 1)*60px)) rotate(calc((var(--i) - 1)*16deg))}.battle-lobby-art h2{font-size:20px;margin:8px}.battle-lobby-art p{font-size:12px;margin:8px}.battle-start-form{padding:6px}.battle-match-head{gap:6px;flex-wrap:wrap}.battle-match-head .secondary{font-size:11px;padding:8px}.battle-match-head>div{gap:7px;font-size:12px}.battle-match-head>button:last-child{font-size:10px}.battle-score{margin:12px 0}.battle-score b{font-size:25px}.battle-score #battle-effect-caption{font-size:10px;line-height:1.5}.battle-workspace{display:block}.battle-arena{padding:14px 10px;border-radius:16px}.battle-bench .battle-slot{width:58px}.battle-bench{gap:16px}.battle-slot{width:78px}.battle-active-row{gap:15px}.battle-zone,.battle-pile{min-width:72px;font-size:10px}.battle-zone small{font-size:9px}.battle-zone>.energy{width:24px;height:24px;font-size:18px}.battle-player-board{gap:12px}.battle-center{margin:21px 0;font-size:8px}.battle-hp{font-size:10px}.battle-hp small{font-size:7px}.battle-attached .energy{width:13px;height:13px;font-size:9px}.battle-side{margin-top:14px;max-height:none;border-radius:14px;padding:14px}.battle-side h3{font-size:14px}.battle-actions{max-height:290px;min-height:0}.battle-action-group{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin-bottom:10px}.battle-action-group>small{width:100%}.battle-action{font-size:11px;flex:1 1 140px;padding:9px}.battle-hand{gap:9px;min-height:122px}.battle-hand-card{flex-basis:72px}.battle-hand-head{margin-top:16px}.battle-hand-card span{font-size:9px}.battle-deck-editor{padding:22px 14px}.editor-cards{grid-template-columns:repeat(4,1fr);gap:10px}.editor-energies{gap:8px}.battle-deck-editor input[type=search]{width:100%}.battle-deck-editor>select{width:100%}.battle-result h2{font-size:26px}.damage-number{font-size:25px}}
@media(prefers-reduced-motion:reduce){.battle-slot,.battle-hand-card{transition:none}.damage-number,.battle-slot.hit,.energy-flight,.attack-player-0 .your-board .battle-active-row>.occupied-slot,.attack-player-1 .opponent-board .battle-active-row>.occupied-slot,.battle-thinking{animation:none}}

.energy svg{width:75%;height:75%;display:block}.battle-lobby-art{border:1px solid #e0ecef;background:radial-gradient(ellipse at 20% 20%,#e0f4f0,#eef5fa 60%,#f8fbff);box-shadow:0 15px 40px #344c7010}.battle-start-form{background:#ffffffb0;border:1px solid #e0eaf0;border-radius:24px;padding:28px;box-shadow:0 12px 30px #34516e08}.battle-start-form label{font-size:13px;color:#4e687d}.battle-start-form select{box-shadow:inset 0 1px 2px #2c516008}.battle-start-form #battle-start{background:linear-gradient(130deg,#479ca0,#287e8b);box-shadow:0 4px 12px #28758320}.battle-deck-preview{padding:9px;background:#eff6f8;border-radius:12px;scrollbar-width:thin}.battle-lobby-art h2{font-size:25px;color:#315665}.battle-lobby-art p{font-size:13px}.battle-lobby{gap:32px}.battle-deck-editor::backdrop,.battle-discard-dialog::backdrop{background:#213c5666;backdrop-filter:blur(4px)}@media(max-width:640px){.battle-start-form{padding:20px}.battle-lobby-art h2{font-size:19px}.battle-lobby-art p{font-size:12px}.battle-lobby{gap:16px}.battle-deck-editor{max-height:calc(100dvh - 24px)}.battle-discard-grid{grid-template-columns:repeat(3,1fr)}}
