/* One viewport: field, decision controls and hand stay together. */
:root{--hand-height:188px;--gold:#dfc393;--line:#cbb58a44}
body{height:100dvh;min-height:0;overflow:hidden;background:#101a18;font-size:13px}
body>header{height:54px;max-width:none;padding:8px 24px;background:#121e1c;gap:16px}
.brand{font-size:8px}.brand strong{font-family:serif;font-size:18px}.top-nav{display:flex;align-items:center;gap:12px}.top-nav a{color:var(--gold);font-size:12px;text-decoration:none}.top-nav button{font-size:12px;padding:6px 12px}
main{max-width:none;height:calc(100dvh - 54px);padding:0;margin:0;position:relative}.layout{height:100%;display:block}
.battle{height:100%;padding:0;border:0;border-radius:0;background:none;display:flex;flex-direction:column;position:relative;isolation:isolate;overflow:hidden}
.battle::before{content:'';position:absolute;inset:0;z-index:-2;background:linear-gradient(#09150f45,#0c1a1520 48%,#0b171dcc 83%),url('assets/backgrounds/stone-clearing-v1.jpg') center 44%/cover no-repeat}
.battle::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;box-shadow:inset 0 0 100px #07141088}
.duel-hud{position:relative;top:auto;z-index:2;flex-shrink:0;max-width:960px;width:calc(100% - 48px);margin:12px auto 0;padding:10px 16px;border:1px solid #d6c49b66;background:linear-gradient(105deg,#14231ef2,#15231bd9);backdrop-filter:blur(10px);grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr);gap:22px;box-shadow:0 6px 24px #07110c66}
.fighter strong{font-size:23px}.fighter small{font-size:9px}.fighter progress{margin:3px 0;height:6px}.fighter .mp{height:4px}.fighter .ailment{min-height:12px;font-size:9px}.fighter>span{font-size:11px}.turn-marker b{font-size:22px}.turn-marker span{font-size:10px}
.arena{flex:1;min-height:0;padding:12px 20px 6px;gap:clamp(24px,7vw,130px);align-items:center;position:relative}
.field-side{width:auto;max-width:none;flex:0 1 190px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0}
.field-label{font-size:10px;letter-spacing:.15em;text-shadow:0 1px 5px #000;background:#14241bd9;padding:3px 12px;border:1px solid #bea67566;border-radius:20px}
.slot{min-height:0;height:clamp(130px,28vh,310px);height:clamp(130px,28dvh,310px);width:auto;aspect-ratio:3/4;margin-top:7px;padding:5px;flex-shrink:1;background:linear-gradient(140deg,#324033,#14271f);border:2px solid #bca577;box-shadow:0 10px 25px #0009,0 0 0 3px #15221da6;overflow:hidden;font-size:30px;border-radius:7px;justify-content:center}
.slot:has(.painted-art){justify-content:flex-start}.slot .art.painted-art{width:100%;height:calc(100% - 43px);aspect-ratio:auto;min-height:0;margin:0 0 3px}.slot .painted-art img{object-fit:cover;object-position:center 43%}.slot .card-name{font-family:serif;font-size:15px;line-height:1.4}.slot .stats{font-size:10px;gap:9px;line-height:1.5}.slot .effect{display:none}.slot .card-back{min-height:0;height:100%;border-width:4px}.slot:has(.card-back){padding:0}.back-emblem{font-size:46px}.back-orbit{font-size:120px}.back-title{font-size:7px}.slot .card-back small{font-size:8px}.prepared-summary{min-height:20px;font-size:10px;background:#102219d9;max-width:240px;padding:3px 9px;border-radius:3px;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}
.versus{align-self:center;background:#14241bd9;border:1px solid #c8b07c66;padding:10px 12px;border-radius:50%;width:76px;height:76px;display:flex;align-items:center;justify-content:center;color:#e5d5b4;line-height:1.65;font-size:8px;text-shadow:0 1px 3px #000}
.command-bar{position:relative;flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:18px;padding:7px 24px;background:#11231ce8;border-top:1px solid #bcaa7b55;min-height:58px}
.status{border:0;margin:0;padding:0;min-height:0;max-width:620px;font-size:12px;text-align:left;line-height:1.6}.action{margin:0;flex-shrink:0}.primary{font-size:12px;min-width:205px;padding:9px 12px}#skip-motion{position:absolute;right:24px;bottom:calc(100% + 8px);font-size:10px;padding:6px 10px;margin:0;background:#1d3028}
.hand-dock{height:var(--hand-height);flex:0 0 var(--hand-height);background:linear-gradient(#182923f5,#0d1918);border-top:1px solid #c8ab7377;padding:7px 24px 4px;box-shadow:0 -12px 30px #10201588;position:relative;z-index:3}
.hand-head{margin:0 0 4px;gap:12px;line-height:1.5}.hand-head h2{font-size:12px}.hand-head h2 span{color:var(--gold);margin-left:8px}.dock-hint{font-size:10px;color:#b6c5b7;margin-left:auto}#piles{font-size:10px;color:#b6c5b7}
.hand{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;max-height:none;height:calc(100% - 24px);padding:3px 3px 7px;scrollbar-width:thin;scrollbar-color:#9e8b60 #12211c;scroll-snap-type:x proximity;align-items:stretch}
.card{flex:0 0 108px;width:108px;min-width:0;padding:4px;border:1px solid #7b805d;border-radius:5px;background:#25372c;scroll-snap-align:start;position:relative;transition:border-color .15s,box-shadow .15s;cursor:zoom-in;outline-offset:-2px}
.card:hover,.card:focus-within{border-color:#efcf91;box-shadow:0 0 0 1px #efcf9188}.card.selected{padding:3px;border:2px solid #e1bf7d;background:#3d422e}.card.reserved{border-color:#8ac6c0}.card .art.painted-art{height:65px;aspect-ratio:auto;flex-shrink:0;margin:0}.card .painted-art img{object-fit:cover;object-position:center 38%}.card>.card-name{font-size:12px;line-height:1.55;white-space:nowrap}.card>.stats{font-size:9px;line-height:1.5}.card>.effect{display:none}.card-actions{flex-direction:row;gap:3px;margin-top:auto;padding-top:3px}.card-actions button{min-height:27px;min-width:0;flex:1;padding:3px 1px;font-size:9px;white-space:nowrap;line-height:1.1}.card .set-placeholder{min-height:0;height:102px;flex:1;font-size:11px}.set-placeholder>span{font-size:26px}.set-placeholder strong{font-size:10px}.set-placeholder small{font-size:9px}
#support-stage{position:absolute;right:22px;bottom:calc(var(--hand-height) + 70px);width:320px;max-height:calc(100% - var(--hand-height) - 110px);overflow:auto;z-index:6;background:#152b25f5;box-shadow:0 10px 40px #0009;backdrop-filter:blur(12px);border-color:#cbb181;margin:0;padding:13px}#support-stage h2{font-family:serif;font-size:17px}#support-stage p{font-size:11px}.support-option{padding:9px 0;font-size:11px}#support-stage .hint{display:none}
.card-inspector{position:absolute;left:24px;bottom:calc(var(--hand-height) + 72px);z-index:8;width:410px;display:grid;grid-template-columns:160px minmax(0,1fr);gap:16px;padding:12px;background:linear-gradient(140deg,#27352af7,#10221cf7);border:1px solid #e0c28b;box-shadow:0 12px 48px #000b;border-radius:7px;backdrop-filter:blur(16px)}.card-inspector>img{width:100%;height:auto;aspect-ratio:4/5;object-fit:contain;border:1px solid #baa67988;border-radius:3px}.inspect-info{padding:10px 4px 0 0;min-width:0}.inspect-info small{font-size:9px;color:#b7c3ae;letter-spacing:.12em}.inspect-info h2{font-family:serif;font-size:25px;line-height:1.4;color:#f0dfb9;margin:5px 0 2px}.inspect-info [data-reading]{font-size:10px;color:#bdc5b5;margin:0 0 14px}.inspect-stats{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px;color:#e0cb9b;line-height:1.7}.inspect-info [data-effect]{font-size:13px;color:#f1efe1;line-height:1.8;border-top:1px solid #c1ac7555;padding-top:10px;margin-top:10px}.inspect-info .inspect-note{font-size:10px;color:#b3c1b0;margin-bottom:0}.inspect-close{position:absolute;right:4px;top:3px;padding:2px 8px;background:transparent;border:0;font-size:18px;color:#c8bd9b}
.settings-dialog{color:var(--text);background:#14251ef7;border:1px solid #b7a277;border-radius:8px;width:min(660px,calc(100vw - 24px));max-height:85dvh;padding:22px;box-shadow:0 20px 80px #0009}.settings-dialog::backdrop{background:#081410ac;backdrop-filter:blur(5px)}.settings-head{display:flex;align-items:center;justify-content:space-between}.settings-head h2{font-family:serif;font-size:23px}.settings-head button{padding:5px 12px}.settings-dialog aside{display:block}.settings-dialog .sound-controls{margin:18px 0}.settings-dialog .notice{font-size:11px}.settings-dialog #log{max-height:200px}.settings-dialog p{font-size:12px}.settings-dialog a{color:var(--gold)}
@media(min-width:1500px) and (min-height:850px){:root{--hand-height:220px}.card{flex-basis:128px;width:128px}.card .art.painted-art{height:91px}.card-actions button{min-height:32px;font-size:10px}.card>.card-name{font-size:13px}}
@media(max-width:760px){:root{--hand-height:177px}body>header{height:46px;padding:6px 12px}.brand{font-size:7px}.brand strong{font-size:14px}.top-nav{gap:8px}.top-nav a{font-size:10px}.top-nav button{font-size:10px;padding:5px 8px}main{height:calc(100dvh - 46px)}.duel-hud{width:calc(100% - 20px);padding:7px 10px;margin-top:8px;gap:8px;grid-template-columns:minmax(0,1fr) 55px minmax(0,1fr)}.fighter strong{font-size:19px}.fighter small{font-size:8px}.fighter .ailment{font-size:8px}.fighter>span{font-size:10px}.turn-marker span{font-size:8px}.turn-marker b{font-size:19px}.arena{padding:8px 12px 4px;gap:14px}.field-side{flex:0 1 145px}.field-label{font-size:8px;padding:2px 8px}.slot{height:clamp(115px,27dvh,245px);min-height:0;padding:4px;margin-top:5px}.slot .card-name{font-size:13px}.slot .stats{font-size:9px;gap:5px}.slot .art.painted-art{height:calc(100% - 37px)}.versus{width:55px;height:55px;font-size:6px;padding:5px}.prepared-summary{font-size:8px;min-height:17px;margin-top:4px;padding:2px 4px}.command-bar{padding:6px 12px;gap:8px;min-height:68px;flex-wrap:wrap}.status{text-align:center;font-size:10px;max-width:none;width:100%;line-height:1.4}.primary{padding:7px 12px;font-size:11px;min-width:205px}.hand-dock{padding:5px 10px 3px}.dock-hint{font-size:8px}#piles{font-size:8px}.hand-head h2{font-size:10px}.hand{gap:7px}.card{flex-basis:104px;width:104px}.card .art.painted-art{height:60px}.card-actions button{min-height:30px}.card>.card-name{font-size:11px}.card-inspector{left:10px;right:10px;width:min(370px,calc(100% - 20px));bottom:calc(var(--hand-height) + 78px);grid-template-columns:112px minmax(0,1fr);gap:12px;padding:10px}.inspect-info{padding-top:3px}.inspect-info h2{font-size:21px}.inspect-info [data-reading]{margin-bottom:7px}.inspect-stats{font-size:11px;gap:4px 8px}.inspect-info [data-effect]{font-size:12px;padding-top:7px;margin:7px 0}.inspect-info .inspect-note{font-size:9px}#support-stage{right:10px;bottom:calc(var(--hand-height) + 78px);width:min(310px,calc(100% - 20px));max-height:calc(100% - var(--hand-height) - 100px)}#skip-motion{right:12px;bottom:calc(100% + 3px);padding:4px 7px;font-size:9px}}
@media(max-height:620px){:root{--hand-height:145px}body>header{height:40px}main{height:calc(100dvh - 40px)}.duel-hud{margin-top:5px;padding:5px 10px}.fighter strong{font-size:16px}.fighter .ailment{display:none}.fighter progress{margin:2px 0;height:4px}.fighter small{font-size:8px}.fighter>span{font-size:9px}.arena{padding:4px 12px;gap:20px}.slot{height:clamp(70px,25dvh,155px);min-height:0}.slot .art.painted-art{height:calc(100% - 25px)}.slot .card-name{font-size:11px}.slot .stats{font-size:8px}.slot .card-back small,.back-title{display:none}.back-emblem{font-size:28px}.back-orbit{font-size:75px}.prepared-summary{min-height:14px;font-size:8px}.field-label{font-size:8px}.command-bar{min-height:42px;flex-wrap:nowrap;padding:5px 12px}.status{width:auto;font-size:9px}.primary{min-width:175px;padding:6px;font-size:10px}.card .art.painted-art{height:38px}.card>.stats{font-size:8px}.card-actions button{min-height:26px}.card-inspector{bottom:calc(var(--hand-height) + 49px);grid-template-columns:90px minmax(0,1fr);width:335px}.inspect-info h2{font-size:18px}.inspect-info [data-reading]{margin-bottom:3px}.inspect-info [data-effect]{font-size:11px;margin:4px 0;padding-top:4px}.inspect-info .inspect-note{display:none}#support-stage{bottom:calc(var(--hand-height) + 48px);max-height:calc(100% - var(--hand-height) - 60px)}}
@media(max-width:360px){.top-nav a{display:none}.duel-hud{grid-template-columns:minmax(0,1fr) 38px minmax(0,1fr)}.fighter strong{font-size:17px}.arena{gap:7px}.versus{width:44px;height:44px;font-size:5px}.dock-hint{display:none}.card-inspector{grid-template-columns:95px minmax(0,1fr)}}
.slot{max-height:calc(100% - 50px);max-width:100%}.hand{justify-content:safe center}
body>header .brand{min-width:0;flex:1}body>header .brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.top-nav{flex-shrink:0}.top-nav a,.top-nav button{white-space:nowrap}
@media(max-width:760px){body>header{gap:8px}.brand strong{font-size:12px}.top-nav{gap:5px}.top-nav a{font-size:9px}.top-nav button{font-size:9px;padding:6px}.slot{width:100%}}
/* Effect choices take space in the command area instead of covering a fighter. */
.command-bar{flex-wrap:wrap}.command-bar #support-stage{position:static;flex:1 0 100%;width:100%;max-width:760px;max-height:130px;overflow:auto;margin:0 auto 3px;padding:8px 12px;box-shadow:none;backdrop-filter:none}.command-bar #support-stage h2{font-size:13px;line-height:1.5}.command-bar #support-stage>p:first-of-type{display:none}.command-bar #support-stage p{margin:3px 0;font-size:10px}.command-bar .support-option{padding:5px 0;font-size:11px}.command-bar .support-option input{width:18px;height:18px}.command-bar #support-options{display:flex;gap:12px}.command-bar #support-options>label{flex:1;min-width:0}.command-bar #support-cost{color:var(--gold)}
@media(max-width:760px){.command-bar #support-stage{max-height:128px;padding:6px 9px}.command-bar #support-options{display:block}.command-bar .support-option{font-size:10px;padding:4px 0}.command-bar #support-stage h2{font-size:12px}}
@media(max-height:620px){.command-bar{flex-wrap:wrap}.command-bar #support-stage{max-height:85px}.command-bar #support-stage h2{display:none}.command-bar #support-options{display:flex}.slot{max-height:calc(100% - 37px)}.command-bar:has(#support-stage:not([hidden])) .status{display:none}}
@media(max-height:450px) and (min-width:650px){
  :root{--hand-height:112px}body>header{height:33px;padding:4px 16px}.brand{font-size:6px}.brand strong{font-size:14px}main{height:calc(100dvh - 33px)}.top-nav button{padding:4px 10px;font-size:10px}.duel-hud{padding:4px 10px;margin-top:4px;gap:12px}.fighter small{font-size:7px;line-height:1.3}.fighter strong{font-size:16px;display:inline;margin-right:12px}.fighter>span{font-size:10px}.fighter progress{height:4px;margin:2px 0}.fighter .mp{display:none}.fighter .ailment{display:none}.turn-marker b{font-size:18px;line-height:1.2}.turn-marker span{font-size:8px}.arena{padding:3px 12px;gap:54px}.field-side{flex:0 0 115px}.field-label{font-size:7px;line-height:1.2;padding:2px 7px}.slot{height:103px;width:78px;max-height:calc(100% - 29px);margin-top:3px;padding:3px}.slot .card-name{font-size:10px;line-height:1.2}.slot .stats{font-size:7px;line-height:1.2}.slot .art.painted-art{height:calc(100% - 22px)}.slot small{font-size:7px;margin:2px}.prepared-summary{font-size:7px;line-height:1.2;min-height:12px;margin-top:2px;padding:2px}.versus{width:48px;height:48px;font-size:6px}.command-bar{min-height:33px;padding:3px 16px;gap:10px}.primary{padding:5px;font-size:10px}.status{font-size:9px}.hand-dock{padding:3px 16px 2px}.hand-head{line-height:1.3;margin-bottom:1px}.hand-head h2{font-size:10px}.hand{height:calc(100% - 18px);padding:2px 2px 4px}.card{padding:3px;flex-basis:102px}.card .art.painted-art{height:27px}.card>.card-name{font-size:10px;line-height:1.3}.card>.stats{font-size:8px;line-height:1.2}.card-actions{padding-top:2px}.card-actions button{min-height:26px;font-size:8px}.command-bar #support-stage{flex:1 1 60%;max-height:65px;width:auto;max-width:none;margin:0;padding:3px 8px}.command-bar #support-options{display:flex}.command-bar .support-option{font-size:9px;padding:2px 0}.command-bar #support-cost{font-size:9px;line-height:1.2}.card-inspector{bottom:calc(var(--hand-height) + 39px);padding:8px;grid-template-columns:90px minmax(0,1fr);width:340px}.inspect-info{padding-top:0}.inspect-info h2{font-size:17px}.inspect-info [data-effect]{font-size:11px}.inspect-info small{font-size:7px}
}
@media(prefers-reduced-motion:reduce){.card{transition:none}.battle::after{animation:none}}
