﻿/* v0.65: one center axis for the board and both hero portraits. */
.arena { --hero-scale:1; --hand-scale:1; height:100dvh; background:linear-gradient(90deg,#21150e,#412a19 50%,#21150e); }
.arena .board-surface { inset:2% 1.5%; filter:brightness(.77) drop-shadow(0 3px 3px #150b08b3); }
.arena .board-half {height:50%;background:linear-gradient(90deg,#25180e44,transparent 34%,transparent 66%,#25180e44),radial-gradient(ellipse at 50% 15%,#d8b07c26,transparent 65%),linear-gradient(#98774f,#ac875b 50%,#8d6a44);}
.arena .board-half-player {transform:scaleY(-1);border-radius:0 0 var(--board-bend) var(--board-bend);}
.arena .board-center-line,.arena .board-center-jewel {top:50%;}
.arena .board-center-line {transform:translateY(-50%);}
.arena .hero-zone {left:50%;transform:translate(-50%,-50%) scale(var(--hero-scale));transform-origin:center;}
.arena .hero-zone.enemy {top:19%;}
.arena .hero-zone.player {top:81%;}
.arena .battle-row {left:10%;right:10%;height:20%;}
.arena .battle-row.enemy {top:29%;}
.arena .battle-row.player {top:51%;}
.arena .deck.enemy {top:19%;bottom:auto;transform:translateY(-50%);}
.arena .deck.player {top:81%;bottom:auto;transform:translateY(-50%);}
.arena .turn-control {top:50%;right:3%;width:147px;height:74px;transform:translateY(-50%) scale(var(--turn-scale,1));transform-origin:right center;}
.arena .log-toggle {top:50%;left:3%;transform:translateY(-50%);}
.arena .log-toggle:active {transform:translateY(-50%);}
.arena .enemy-hand,.arena .action-guide {left:50%;}
/* Each card center is calculated from the usable viewport and hand size.
   Leave a full half-card at both ends, including a raised/selected card. */
.arena .hand-area {left:0;right:0;bottom:0;height:112px;display:block;}
.arena .hand-card {position:absolute;left:calc(50% + var(--hand-offset) * min(64px,(100vw - 186px) / var(--hand-gaps)));bottom:-96px;margin:0;width:150px;height:216px;transform-origin:center;transform:translateX(-50%) translateY(var(--rise)) rotate(var(--angle)) scale(var(--hand-scale));}
.arena .hand-card:hover,.arena .hand-card.selected {transform:translateX(-50%) translateY(-68px) scale(var(--hand-scale));}
.arena .hand-card:active:not(:disabled) {transform:translateX(-50%) translateY(-68px) scale(var(--hand-scale));}
.hero.ice-block-active .hero-frame {box-shadow:0 0 8px 4px #8ee5ff,0 0 30px #50bcf399;}
.ice-block-shell {position:absolute;inset:-10px -8px 9px;pointer-events:none;z-index:6;border:3px solid #adf2ff;border-radius:42% 42% 30% 30%;background:linear-gradient(130deg,#d7fbff77,transparent 30%,#79d9fa33 52%,transparent 65%,#d7fbff88);box-shadow:inset 0 0 18px #9eeaff88,0 0 22px #66caff99;clip-path:polygon(21% 0,77% 0,100% 24%,94% 87%,75% 100%,20% 100%,3% 81%,0 24%);}
.ice-block-shell i {position:absolute;inset:8%;border:1px solid #d4f7ffaa;transform:skewY(24deg);}
.ice-block-shell i+i {transform:skewY(-24deg);}
.ice-block-shell b {position:absolute;bottom:8px;left:0;right:0;color:#e3fcff;text-shadow:0 1px 4px #12364c;font-size:13px;letter-spacing:3px;}
@media(max-height:800px){.arena{--hero-scale:.83;--hand-scale:.88;--turn-scale:.88;}}
@media(max-width:800px){.arena{--hero-scale:.75;--hand-scale:.76;--turn-scale:.64;}.arena .battle-row{left:5%;right:5%;}.arena .hand-card{left:calc(50% + var(--hand-offset) * min(48px,(100vw - 145px) / var(--hand-gaps)));bottom:-90px;}.arena .hand-area{height:100px;}}
@media(max-width:540px){.arena{--hero-scale:.66;--hand-scale:.66;--turn-scale:.52;}.arena .hand-card{left:calc(50% + var(--hand-offset) * min(37px,(100vw - 144px) / var(--hand-gaps)));bottom:-78px;}.arena .hand-card:hover,.arena .hand-card.selected,.arena .hand-card:active:not(:disabled){transform:translateX(-50%) translateY(-58px) scale(.72);}}
@media(max-height:500px) and (min-width:541px){.arena{--hero-scale:.57;--hand-scale:.58;--turn-scale:.58;}.arena .unit{transform:scale(.72);margin:0 -8px;}.arena .hand-card{bottom:-100px;}.arena .hand-card:hover,.arena .hand-card.selected,.arena .hand-card:active:not(:disabled){transform:translateX(-50%) translateY(-50px) scale(.65);}}



/* Resource counters must not intercept touches on overlapping hand cards. */
.arena .mana-area {pointer-events:none;}
/* Touch presses keep the card under the finger until it is selected. */
@media(hover:none){.arena .hand-card:not(.selected):hover,.arena .hand-card:not(.selected):active:not(:disabled){transform:translateX(-50%) translateY(var(--rise)) rotate(var(--angle)) scale(var(--hand-scale));}}
/* v0.66: use the extra room on desktop while retaining the narrow-screen fan. */
@media(min-width:801px) and (min-height:501px){.arena .hand-card{bottom:-124px;left:calc(50% + var(--hand-offset) * min(clamp(64px,8vw,112px),(100vw - 186px) / var(--hand-gaps)));}}
@media(max-width:540px){.arena .unit{width:min(52px,calc(90vw / 7));}}
@media(max-width:540px) and (max-height:650px){.arena .hand-card{bottom:-120px;}}
@media(max-height:500px) and (min-width:541px){.arena .hero-zone.enemy{top:23%;}.arena .hero-zone.player{top:77%;}.arena .hand-card{bottom:-128px;}}
