/* Geometry follows the owner's annotated recovered battlefield.
   Keep the recovered card treatment, colours and left navigation. */
body:has(#app:not([hidden])) #app .main{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:12px 62px minmax(340px,1fr) 48px 166px 14px;gap:8px;height:100dvh;min-height:800px;align-content:stretch}
body:has(#app:not([hidden])) #app .battle-mode{font-size:8px;letter-spacing:1.7px;line-height:12px;white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-top-row{display:grid;grid-template-columns:minmax(320px,1.25fr) minmax(210px,1fr) auto;gap:12px;align-items:center;min-width:0}
body:has(#app:not([hidden])) #app .battle-top-row .player-line{margin:0;gap:10px;min-width:0}
body:has(#app:not([hidden])) #app .battle-top-row .player-name{flex-shrink:0}
body:has(#app:not([hidden])) #app .battle-top-row .counter-row{margin-left:auto;gap:12px;white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-top-row .currency{font-size:16px;gap:6px}
body:has(#app:not([hidden])) #app .battle-top-row .currency .pip{width:22px;height:22px}
body:has(#app:not([hidden])) #app .battle-top-row .phasebar{min-width:0;padding:9px 10px;gap:8px}
body:has(#app:not([hidden])) #app .battle-top-row .phasebar p{display:none}
body:has(#app:not([hidden])) #app .battle-top-row .phasebar strong{font-size:12px;white-space:normal}
body:has(#app:not([hidden])) #app .battle-top-row .phase-steps{gap:4px}
body:has(#app:not([hidden])) #app .battle-top-row .step{width:18px}
body:has(#app:not([hidden])) #app .battle-top-row .round{white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-top-row .round strong{font-size:27px}
body:has(#app:not([hidden])) #app .battle-top-row .round span{font-size:8px;margin-right:5px}
body:has(#app:not([hidden])) #app .board{display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1.5fr) 30px minmax(0,1.5fr) minmax(0,1fr);row-gap:10px;min-height:0;height:100%;margin:0}
body:has(#app:not([hidden])) #app .board .lane{height:100%;min-height:0;align-items:stretch}
body:has(#app:not([hidden])) #app .board .lane+.lane{margin-top:0}
body:has(#app:not([hidden])) #app .board .slot,body:has(#app:not([hidden])) #app .board .base .slot{height:100%;min-height:0}
body:has(#app:not([hidden])) #app .board .king-slot{height:100%;min-height:0}
body:has(#app:not([hidden])) #app .board .battle-divider{height:30px;margin-top:0;margin-bottom:0;display:flex;align-items:center;justify-content:center}
body:has(#app:not([hidden])) #app .battle-command-row{position:relative;display:grid;grid-template-columns:120px auto minmax(70px,1fr) auto auto;grid-template-rows:48px;gap:8px;align-items:center;min-width:0}
body:has(#app:not([hidden])) #app .battle-command-row>.player-line,body:has(#app:not([hidden])) #app .battle-command-row>.actionbar{display:contents}
body:has(#app:not([hidden])) #app .battle-command-row .player-name{grid-column:1;grid-row:1;gap:7px;min-width:0}
body:has(#app:not([hidden])) #app .battle-command-row .player-name strong{font-size:11px}
body:has(#app:not([hidden])) #app .battle-command-row .player-name small{font-size:8px;white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-command-row .avatar{height:28px;width:28px;flex-shrink:0}
body:has(#app:not([hidden])) #app .battle-command-row .counter-row{grid-column:4;grid-row:1;gap:9px;white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-command-row .actionbar>.action-group:first-child{grid-column:2;grid-row:1;gap:5px}
body:has(#app:not([hidden])) #app .battle-command-row .actionbar>.btn.primary,body:has(#app:not([hidden])) #app .battle-command-row .actionbar>.action-group:last-child:not(:first-child){grid-column:5;grid-row:1;justify-self:end;white-space:nowrap}
body:has(#app:not([hidden])) #app .battle-command-row .btn{font-size:10px;padding:9px 8px}
body:has(#app:not([hidden])) #app .battle-command-row .actionbar>.btn.primary{min-width:130px}
body:has(#app:not([hidden])) #app .battle-command-row .hand-header{grid-column:3;grid-row:1;min-width:0;margin:0;padding:0;text-align:center;font-size:8px;white-space:nowrap;display:block}
body:has(#app:not([hidden])) #app .battle-command-row .hand-header>span:last-child{display:none}
body:has(#app:not([hidden])) #app .battle-command-row .selection-hint{position:absolute;top:100%;left:0;right:0;margin:0;padding:4px 30px 4px 10px;z-index:5;font-size:10px}
body:has(#app:not([hidden])) #app .battle-command-row .auction-panel{position:absolute;bottom:100%;right:0;max-width:350px;margin:0 0 5px;padding:6px 10px;z-index:3}
body:has(#app:not([hidden])) #app .battle-command-row .auction-panel p,body:has(#app:not([hidden])) #app .battle-command-row .auction-panel .eyebrow{display:none}
body:has(#app:not([hidden])) #app .battle-command-row .auction-panel strong{font-size:15px}
body:has(#app:not([hidden])) #app .hand{height:166px;min-height:0;padding:5px 3px;align-items:center;overflow-x:auto;overflow-y:hidden;margin:0}
body:has(#app:not([hidden])) #app .hand-card{height:151px;flex-shrink:0}
body:has(#app:not([hidden])) #app .help-label{font-size:8px;line-height:14px;margin:0;padding:0}
/* The right rail is a full log at rest. Card inspection temporarily replaces it. */
body:has(#app:not([hidden])) #app .rightbar{position:sticky;top:0;height:100dvh;min-height:0;max-height:100dvh;display:flex;flex-direction:column;overflow:hidden;align-self:start}
body:has(#app:not([hidden])) #app .rightbar .detail{display:none}
body:has(#app:not([hidden])) #app .rightbar .log{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:0;border:0}
body:has(#app:not([hidden])) #app .rightbar .log h3{flex-shrink:0;margin:0 0 15px}
body:has(#app:not([hidden])) #app .rightbar .log-list{height:auto;min-height:0;flex:1;overflow-y:auto;scrollbar-width:thin}
body:has(#app .hand-card:hover,#app .slot.occupied:hover,#app .king-slot:hover,#app .hand-card:focus-visible,#app .slot.occupied:focus-visible,#app .king-slot:focus-visible) #app .rightbar .detail{display:block;overflow-y:auto;max-height:100%;min-height:0}
body:has(#app .hand-card:hover,#app .slot.occupied:hover,#app .king-slot:hover,#app .hand-card:focus-visible,#app .slot.occupied:focus-visible,#app .king-slot:focus-visible) #app .rightbar .log{display:none}
@media(max-width:1450px) and (min-width:1101px){body:has(#app:not([hidden])) #app .main{padding-left:18px;padding-right:18px}body:has(#app:not([hidden])) #app .battle-top-row{grid-template-columns:minmax(290px,1.3fr) minmax(180px,1fr) auto;gap:8px}body:has(#app:not([hidden])) #app .battle-top-row .counter-row{gap:8px}body:has(#app:not([hidden])) #app .battle-top-row .phase-steps{display:none}body:has(#app:not([hidden])) #app .battle-top-row .round strong{font-size:23px}body:has(#app:not([hidden])) #app .battle-command-row{grid-template-columns:90px auto minmax(60px,.5fr) auto auto;gap:6px}body:has(#app:not([hidden])) #app .battle-command-row .counter-row{gap:6px;font-size:9px}body:has(#app:not([hidden])) #app .battle-command-row .btn{font-size:9px;padding:9px 6px}body:has(#app:not([hidden])) #app .battle-command-row .actionbar>.btn.primary{min-width:115px}body:has(#app:not([hidden])) #app .battle-command-row .avatar{width:23px;height:23px}}
@media(max-height:850px) and (min-width:1101px){body:has(#app:not([hidden])) #app .main{min-height:775px;grid-template-rows:12px 52px minmax(460px,1fr) 44px 140px 12px;gap:6px;padding-top:15px;padding-bottom:8px}body:has(#app:not([hidden])) #app .battle-command-row{grid-template-rows:44px}body:has(#app:not([hidden])) #app .hand{height:140px}body:has(#app:not([hidden])) #app .hand-card{height:127px}body:has(#app:not([hidden])) #app .hand-card img{height:78px}body:has(#app:not([hidden])) #app .hand-card .card-title{top:85px;font-size:11px}body:has(#app:not([hidden])) #app .board{row-gap:7px;grid-template-rows:1fr 1.5fr 22px 1.5fr 1fr}body:has(#app:not([hidden])) #app .board .battle-divider{height:22px}}
@media(max-width:1100px){body:has(#app:not([hidden])) #app .main{height:auto;min-height:0;display:flex;flex-direction:column;gap:9px}body:has(#app:not([hidden])) #app .battle-top-row{grid-template-columns:1fr auto;gap:8px}body:has(#app:not([hidden])) #app .battle-top-row .opponent-line{grid-column:1/-1}body:has(#app:not([hidden])) #app .battle-top-row .phasebar{grid-column:1;grid-row:2}body:has(#app:not([hidden])) #app .battle-top-row .round{grid-column:2;grid-row:2}body:has(#app:not([hidden])) #app .board{height:500px;flex-shrink:0}body:has(#app:not([hidden])) #app .battle-command-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}body:has(#app:not([hidden])) #app .battle-command-row .own-line{display:flex;justify-content:space-between;width:100%}body:has(#app:not([hidden])) #app .battle-command-row .actionbar{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}body:has(#app:not([hidden])) #app .battle-command-row .hand-header{width:100%;text-align:left}body:has(#app:not([hidden])) #app .rightbar{position:static;height:100dvh;min-height:400px}}
@media(max-width:680px){body:has(#app:not([hidden])) #app .board{height:460px}body:has(#app:not([hidden])) #app .battle-top-row .counter-row{gap:7px}body:has(#app:not([hidden])) #app .battle-top-row .phasebar strong{font-size:10px}body:has(#app:not([hidden])) #app .battle-command-row .counter-row{gap:7px}body:has(#app:not([hidden])) #app .rightbar{height:360px;min-height:360px}body:has(#app:not([hidden])) #app .hand{height:140px}body:has(#app:not([hidden])) #app .hand-card{height:126px}}
