[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.heart-defs{position:absolute;width:0;height:0;overflow:hidden}
.hearts{display:inline-flex;gap:4px;align-items:center;justify-content:center;flex-wrap:nowrap}
.hp-heart{display:block;width:19px;height:17px;shape-rendering:crispEdges;flex:none}
.hp-heart.filled{fill:#dc9191;stroke:#f3c4aa;stroke-width:.8}
.hp-heart.empty{fill:transparent;stroke:#b5a397;stroke-width:1.2}
.unit-marker.hearts{gap:1px;bottom:0;height:auto}
.unit-marker .hp-heart{width:9px;height:8px;filter:drop-shadow(0 1px 0 #061820)}
.unit-affinity{pointer-events:none}
.unit-affinity>.relic{width:100%;height:100%}
.inspect-hearts{display:flex;margin-top:16px}
.stats-line{margin:16px 0}

.battle-toolbar{position:sticky;top:8px;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;background:#173239f7;border:1px solid #8c9b7b;box-shadow:0 4px 0 #071d24;margin-bottom:12px}
.toolbar-mage{display:grid;grid-template-columns:auto auto;align-items:center;gap:3px 9px}
.toolbar-mage .eyebrow{grid-column:1/-1}
.toolbar-mage strong{font-size:13px;color:#dfd5b5;letter-spacing:.5px}
.toolbar-mage .hp-heart{width:14px;height:13px}
.battle-toolbar .action-buttons{display:flex;gap:9px}
.battle-toolbar .action-button{min-width:106px;padding:10px 16px;font-size:15px;border:2px solid #839b89;box-shadow:inset 0 -3px 0 #091c23;background:#234953}
.battle-toolbar .action-button small{font-size:9px;color:#afc4b9}
.battle-toolbar .action-button.active{background:#a18554;border-color:#f2d69a;color:#fff4cf;box-shadow:inset 0 -3px 0 #665131}
.battle-toolbar .action-button.active small{color:#f8e5b4}
.battle-toolbar .action-button:disabled{opacity:.35}

.toolbar-instruction{display:flex;flex-direction:column;align-items:flex-end;gap:4px;text-align:right}
.toolbar-instruction strong{font-size:12px;color:#dcc58e}
.toolbar-instruction small{font-size:9px;color:#a9c4b7}
.unit-actions{position:fixed;inset:auto;margin:0;padding:3px;gap:3px;overflow:visible;width:102.5px;max-width:calc(100vw - 16px);background:#112e35f7;border:1px solid #d4bc81;border-radius:3px;box-shadow:0 2px 0 #061b23,0 4px 8px #06172070;color:#fff0c5}
.unit-actions:popover-open{display:flex}
.unit-actions:after{content:'';position:absolute;left:var(--pointer-left,50%);bottom:-5px;width:6px;height:6px;background:#14343b;border-right:1px solid #d4bc81;border-bottom:1px solid #d4bc81;transform:translateX(-50%) rotate(45deg);pointer-events:none}
.unit-actions .action-button{position:relative;z-index:1;flex:1;min-width:0;height:27.25px;min-height:27.25px;align-items:center;justify-content:center;gap:0;padding:3px 2px;font-size:11px;line-height:1.1;font-weight:600;border:1px solid #719c8b;background:#24544f;color:#e3f2d7;border-radius:2px}
.unit-actions #attack-button{border-color:#b58c94;background:#613d4a;color:#ffe3d6}
.unit-actions .action-button:hover:enabled,.unit-actions .action-button:focus-visible{background:#997c46!important;border-color:#ffdf9a!important;color:#fff3ce;outline:2px solid #fff0bc;outline-offset:1px}
.unit-actions .action-button small{display:none}
.unit-actions .action-button:disabled{opacity:.38;cursor:default}
body.dimensional-board .unit-figure .mage-sprite{pointer-events:auto}
@media(max-width:650px){.toolbar-instruction strong{font-size:10px}.toolbar-instruction small{font-size:8px;max-width:170px}.unit-actions{width:93.5px}.unit-actions .action-button{height:24.75px;min-height:24.75px;font-size:10px}}

.preparation-panel{padding:16px;background:linear-gradient(130deg,#254942f0,#132c36f5);border:1px solid #baa46f;margin:0 0 14px;box-shadow:inset 0 3px 0 #bea97025}
.preparation-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.preparation-heading h2{margin:4px 0;font-size:16px;color:#f1deb0}
.prepare-teams{display:flex;gap:5px;flex:none}
.prepare-teams button{background:#19383b;border:1px solid #657f70;padding:6px 9px;color:#aabdb0;font-size:10px}
.prepare-teams button.active{border-color:#d4c08e;background:#526653;color:#fff0c5}
.preparation-panel>p{font-size:10px;line-height:1.8;color:#b4c6b8;margin:5px 0 11px}
.preparation-roster{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.preparation-card{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:5px;padding:4px 7px;background:#102d34;border:1px solid #5e7c6a68;min-height:47px}
.preparation-card.selected{border-color:#d7bd84;background:#384e40}
.prepare-select-unit{display:flex;align-items:center;gap:4px;background:none;text-align:left;padding:0;min-width:0}
.prepare-select-unit .mage-sprite{width:34px;height:34px}
.prepare-select-unit strong{display:block;font-size:9px;font-family:monospace}
.prepare-select-unit small{display:block;font-size:8px;color:#99b4a5;white-space:nowrap}
.preparation-card select{width:67px;flex:none;color:#f0dba6;background:#244542;border:1px solid #9ca987;font:inherit;font-size:11px;padding:6px 4px}
.prepare-runes{display:flex;flex-wrap:wrap;justify-content:end;gap:3px;font-size:8px}
.prepare-runes .rune-badge{gap:2px;padding:2px 3px;font-size:8px}
.prepare-runes .relic{width:17px;height:17px}
.preparation-footer{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-top:12px}
.preparation-footer>span{font-size:9px;color:#c8d5bd}
.preparation-footer .gold-button{margin:0;width:auto;padding:9px 13px;flex:none;font-size:11px}

.matchup-panel{padding:15px;margin:0 0 16px}
.matchup-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:11px}
.matchup-heading h2{font-size:15px;margin-top:3px}
.matchup-heading>span{font-size:9px;color:#a5b9ac}
.matchup-table table{table-layout:fixed;width:100%;border-collapse:collapse;font-size:11px;text-align:center}
.matchup-table th,.matchup-table td{border:1px solid #5470676b;padding:5px 1px;height:30px}
.matchup-table th{background:#1c393c;font-size:8px;font-weight:500;color:#c9d0b7}
.matchup-table td{font-size:13px;background:#153137;color:#82978b}
.table-element{display:flex;align-items:center;justify-content:center;gap:3px;cursor:help;outline-offset:1px}
.table-element .relic{width:19px;height:19px}
.matchup-table .advantage{background:#28584b;color:#ace0aa}
.matchup-table .disadvantage{background:#563741;color:#efabb1}
.matchup-table .equal{background:#4c493b;color:#e2c790}
.matchup-table .special{background:#4b3d5c;color:#d4b6f0}
.advantage{color:#a3d8a3}.disadvantage{color:#e89faa}.special{color:#ccacec}
.matchup-legend{display:flex;flex-wrap:wrap;gap:6px 15px;font-size:9px;margin:11px 0 8px;color:#bac9b5}
.matchup-legend b{font-size:12px;margin-right:4px}
.matchup-special{padding:8px 10px;background:#29323f;border-left:2px solid #b3a2c4;font-size:9px;line-height:1.8;color:#c2bacd}
.rune-badge{display:inline-flex;align-items:center;gap:3px;background:#243c3e;border:1px solid #75866b7a;padding:3px 6px;font-size:10px;cursor:help}
.rune-badge .relic{width:21px;height:21px}
[data-rune]{outline-offset:3px}
.rune-tooltip{position:fixed;inset:auto;margin:0;padding:14px;background:#102c34;border:1px solid #d6c28f;box-shadow:4px 5px 0 #06151bc7;max-width:calc(100vw - 16px);color:#e9dfb9;font-size:11px;pointer-events:none;z-index:100}
.rune-tooltip>strong{display:flex;align-items:center;gap:7px;font-size:14px;margin-bottom:11px}
.rune-tooltip .relic{display:inline-block;width:20px;height:20px;vertical-align:middle}
.tip-line{display:flex;align-items:start;gap:10px;margin:7px 0}
.tip-line b{white-space:nowrap;font-size:10px;padding-top:3px}
.tip-line span{font-size:10px;line-height:1.9}
.rune-tooltip p{border-top:1px solid #5e7c715c;padding-top:9px;margin-top:10px;font-size:10px;color:#b9c8b7;line-height:1.7}

.duel-dialog{max-width:760px;width:96vw;max-height:94dvh;overflow:auto;padding:23px}
.duel-dialog h2{font-size:21px;margin:12px 0}
.duel-dialog>p,.duel-dialog form>p{font-size:11px;margin:13px 0;line-height:1.7}
.duel-stage{display:grid;grid-template-columns:minmax(0,1fr)38px minmax(0,1fr);gap:4px;align-items:center;position:relative;padding:15px 10px;background:linear-gradient(180deg,#2b4440,#183238);border:1px solid #648276;isolation:isolate}
.duel-stage:before{content:'';position:absolute;left:6%;right:6%;height:105px;bottom:68px;background:conic-gradient(#718275 25%,#354b4b 0 50%,#718275 0 75%,#354b4b 0) 0 0/48px 48px;transform:perspective(500px) rotateX(45deg);border:2px solid #91a48a;box-shadow:0 8px 0 #263f3c;pointer-events:none}
.duel-mage{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;z-index:1;min-width:0}
.duel-mage.crimson>.eyebrow{color:#daa3b6}
.duel-figure{width:clamp(110px,28vw,200px);aspect-ratio:1;position:relative}
.duel-figure .mage-sprite{width:100%;height:100%;filter:drop-shadow(3px 3px 0 #0c292955)}
.duel-mage>strong{font-size:14px;letter-spacing:1px}
.duel-mage .hearts{margin:3px 0}
.duel-versus{position:relative;color:#d7c8a2;font-family:Georgia,serif;font-size:21px;z-index:1}
.duel-runes{display:flex;justify-content:center;flex-wrap:wrap;gap:4px;min-height:33px;align-items:center}
.concealed-runes{font-size:10px;color:#9fb5ac}
.defeated-duelist .duel-figure{opacity:.65;filter:saturate(.6)}
.combat-stage>div{position:relative;min-width:0}
.combat-stage{overflow:hidden}.combat-stage canvas{position:absolute;left:0;top:0;width:220px;height:220px;pointer-events:none;image-rendering:pixelated;z-index:4;transform:translate(-50%,-50%);opacity:0}#combat-bolt{width:156px;height:156px;z-index:5}

.combat-targets{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:9px}
.combat-targets:empty{display:none}
.combat-targets button{background:#213d42;border:1px solid #617d70;padding:6px 10px;font-size:10px}
.combat-targets button.active{background:#776643;border-color:#d9bf84}
#combat-summary{color:#ded7b9;font-size:12px}
.defense-row .hearts{margin-top:5px;justify-content:start}
.defense-row .hp-heart{width:14px;height:13px}

@media(max-width:980px){.battle-toolbar{padding:9px;gap:7px}.battle-toolbar .action-button{min-width:81px;padding:8px 10px;font-size:13px}.toolbar-mage strong{font-size:11px}.toolbar-mage .eyebrow{font-size:7px}.toolbar-mage .hp-heart{width:11px;height:10px}.preparation-panel{padding:11px}.prepare-select-unit .mage-sprite{width:24px;height:24px}.preparation-card{padding:4px;gap:3px}.preparation-card select{width:52px;font-size:10px}.prepare-select-unit small{font-size:7px}.prepare-select-unit strong{font-size:8px}.preparation-heading h2{font-size:13px}.prepare-teams button{font-size:8px;padding:5px}.matchup-heading>span{font-size:8px}.table-element{flex-direction:column;gap:0}.table-element .relic{width:17px;height:17px}.matchup-table th,.matchup-table td{padding:3px 0}.matchup-table th{font-size:7px}}
@media(max-width:650px){.battle-toolbar{top:4px;margin-bottom:9px;padding:8px}.battle-toolbar .action-button{min-width:83px;padding:7px 10px;font-size:13px}.battle-toolbar .action-button small{font-size:8px}.toolbar-mage{gap:2px 5px}.toolbar-mage strong{font-size:10px}.toolbar-mage .eyebrow{font-size:6px}.toolbar-mage .hearts{gap:2px}.preparation-panel{padding:10px}.preparation-heading{gap:5px}.preparation-heading h2{font-size:12px}.prepare-teams button{font-size:8px;padding:5px 6px}.preparation-panel>p{font-size:9px}.preparation-roster{gap:4px}.preparation-card{padding:3px;gap:2px;min-height:40px}.prepare-select-unit{gap:2px}.prepare-select-unit .mage-sprite{width:22px;height:22px}.prepare-select-unit small{display:none}.preparation-card select{width:43px;font-size:9px;padding:5px 1px}.preparation-footer{gap:5px}.preparation-footer>span{font-size:8px}.preparation-footer .gold-button{font-size:9px;padding:8px}.matchup-panel{padding:10px}.matchup-heading{gap:6px}.matchup-heading h2{font-size:13px}.matchup-heading>span{font-size:7px}.matchup-legend{font-size:8px;gap:5px 8px}.matchup-special{font-size:8px;padding:7px 8px}.table-element .relic{width:16px;height:16px}.matchup-table td{font-size:11px}.unit-marker .hp-heart{width:6px;height:6px}.selected-panel .stats-line .hp-heart{width:16px;height:14px}.duel-dialog{padding:14px}.duel-dialog h2{font-size:17px}.duel-stage{grid-template-columns:minmax(0,1fr)26px minmax(0,1fr);padding:10px 3px;gap:2px}.duel-mage>.eyebrow{font-size:8px;letter-spacing:1px}.duel-mage>strong{font-size:12px}.duel-figure{width:clamp(100px,32vw,160px)}.duel-versus{font-size:17px}.duel-runes .rune-badge{font-size:9px;padding:2px 3px}.concealed-runes{font-size:8px}.duel-stage:before{height:75px;bottom:66px;background-size:32px 32px}.combat-stage canvas{width:150px;height:150px}#combat-bolt{width:108px;height:108px}.duel-dialog>p,.duel-dialog form>p{font-size:10px}.prepare-runes .rune-badge .relic{width:15px;height:15px}.prepare-runes .rune-badge span{font-size:7px}}
.result-dialog h2{font-size:26px}.result-dialog.victory h2{color:#f1d497}.result-dialog.defeat h2{color:#cf8ea8}.result-dialog .result-tally{font-size:11px;color:var(--muted);margin:-8px 0 0}.result-actions{display:flex;gap:8px;margin-top:9px}.result-actions .quiet-button{flex:1}

.duel-figure .motion-sprite.scripted{animation:none!important;will-change:transform}.combat-stage>.combat-fx{position:absolute;inset:0;pointer-events:none;z-index:5}.combat-charge,.combat-orb{position:absolute;left:0;top:0;width:22px;height:22px;margin:-11px 0 0 -11px;background:var(--fx-color);box-shadow:0 0 0 3px #ffffff55,0 0 18px 6px var(--fx-color);opacity:0;transform:rotate(45deg)}.combat-orb{width:14px;height:14px;margin:-7px 0 0 -7px}.combat-shield{position:absolute;left:0;top:0;width:118px;height:118px;margin:-59px 0 0 -59px;border:4px solid var(--fx-color);border-radius:50%;box-shadow:0 0 18px var(--fx-color),inset 0 0 18px var(--fx-color);opacity:0}.combat-dmg{position:absolute;left:0;top:0;transform:translate(-50%,-100%);font:700 24px Georgia,serif;color:#ffe3a3;text-shadow:2px 2px 0 #4a1d26,-1px -1px 0 #4a1d26,1px -1px 0 #4a1d26,-1px 1px 0 #4a1d26;opacity:0;white-space:nowrap}.combat-dmg.note{font-size:15px;color:#dff3f7;text-shadow:2px 2px 0 #163038}.combat-replay{position:absolute;right:8px;top:8px;z-index:6;background:#183238d9;border:1px solid #648276;color:#d7c8a2;font-size:10px;padding:4px 8px}.combat-replay:hover{border-color:var(--gold)}.hp-heart.heart-broken{animation:heartBreak .55s steps(6,end)}@keyframes heartBreak{0%{transform:scale(1.7);filter:brightness(2.6)}45%{transform:scale(.75) rotate(-8deg)}70%{transform:scale(1.1) rotate(5deg)}100%{transform:none}}@media(max-width:650px){.combat-dmg{font-size:18px}.combat-shield{width:84px;height:84px;margin:-42px 0 0 -42px}}@media(prefers-reduced-motion:reduce){.hp-heart.heart-broken{animation:none}.unit-figure[data-motion]{animation:none!important}}
