/* Phone battle controls (ability audit, lane ui, 2026-09-30). On a phone (body.mobile or body.portrait) every control a
   thumb has to hit is at least 40 CSS px on its smaller side. --tap is set by js/ui.js setStage(): the stage px that make
   41 CSS px at the current stage scale (about 95 on a 390 px phone, where the stage is scaled to about 0.43).
   Loaded after every other sheet; the selectors carry #game / ids so they beat the older phone rules. */

/* ---- the Leader ability button: on the board under the Leader (js/ui.js placeAct), no longer inside the Leader card.
   Desktop keeps the old look: bottom edge 40 px under the Leader, small. (UI-1) */
#game #board0 > .act { position: absolute; z-index: 700; padding: 6px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%); }
:is(body.mobile, body.portrait) #game #board0 > .act { transform: translate(-50%, 0); display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap, 96px); min-height: var(--tap, 96px); max-width: 330px;
  padding: 6px 22px; font-size: 20px; line-height: 1.1; white-space: normal; text-align: center; border-radius: 16px; }
body.portrait #game #board0 > .act { max-width: 276px; } /* between my player plate and the crystal bar */

/* ---- the Command pill (mine): 40 px tall; portrait sits above my field row, landscape above the Leader (UI-1, UI-2) */
:is(body.mobile, body.portrait) #game .cmd.mine { min-height: var(--tap, 96px); max-width: 540px; padding: 0 22px 0 20px; gap: 12px; font-size: 20px; border-radius: 18px; }
body.portrait #game .cmd.mine { max-width: 520px; } /* clear of the round medallion and the End Turn orb */
:is(body.mobile, body.portrait) #game .cmd.mine i { font-size: 26px; }
:is(body.mobile, body.portrait) #game .cmd.mine span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:is(body.mobile, body.portrait) #game .cmd.mine b { min-width: 42px; height: 42px; font-size: 22px; }

/* ---- prompt bar: Skip / Pass / No block (UI-3). Landscape: up a little so the taller bar clears my row. Portrait: on
   the centre line between the round medallion and the End Turn orb, clear of both field rows. */
:is(body.mobile, body.portrait) #game #promptBar .btn { min-height: var(--tap, 96px); min-width: calc(var(--tap, 96px) * 1.4); padding: 0 28px; font-size: 24px; white-space: nowrap; }
:is(body.mobile, body.portrait) #game #promptBar .ptxt { min-width: 0; }
body.mobile:not(.portrait) #game #promptBar { top: 372px; }
body.portrait #game #promptBar { top: calc(var(--ph) / 2 - 62px); max-width: 510px; padding: 12px 12px 12px 18px; }
body.portrait #game #promptBar .ptxt { font-size: 21px; line-height: 1.25; max-width: 300px; }
body.portrait #game #promptBar .btn { font-size: 21px; padding: 0 20px; }

/* ---- Play (over the lifted card: js/ui.js updateHud centres it), Mulligan / Triumph / match over (UI-4) */
:is(body.mobile, body.portrait) #game #playBtn { min-height: var(--tap, 96px); padding: 0 40px; font-size: 28px; white-space: nowrap; transform: translateX(-50%); }
:is(body.mobile, body.portrait) :is(#mulligan, #triumph, #over) .actions .btn { min-height: var(--tap, 96px); min-width: calc(var(--tap, 96px) * 1.4); padding: 0 34px; font-size: 26px; }

/* ---- Brace: crystal gems, - / +, No Brace / Brace (UI-5). The gem keeps its look; the button around it is the target. */
:is(body.mobile, body.portrait) #game .pz .bz-gems { gap: 4px; }
:is(body.mobile, body.portrait) #game .pz .bz-gem { display: grid; place-items: center; min-width: var(--tap, 96px); min-height: var(--tap, 96px); padding: 0; }
:is(body.mobile, body.portrait) #game .pz .bz-gem i { width: 52px; height: 66px; }
:is(body.mobile, body.portrait) #game .pz .bz-row .btn { width: var(--tap, 96px); height: var(--tap, 96px); }
:is(body.mobile, body.portrait) #game .pz .pz-btns .btn { min-height: var(--tap, 96px); padding: 0 34px; font-size: 26px; }

/* ---- Command splash (UI-6): portrait keeps the name on screen (it wraps) in the middle band; a prompt that opens
   while it plays hides it once the name has shown (js/ui.js cutSplash) */
#game #cmdSplash.go.cut { animation: none; opacity: 0; }
body.portrait #game #cmdSplash { top: calc(var(--ph) / 2 - 180px); height: 360px; }
body.portrait #game #cmdSplash .band { top: 40px; height: 280px; }
body.portrait #game #cmdSplash .a { left: 22px; margin-left: 0; top: 80px; width: 200px; height: 200px; }
body.portrait #game #cmdSplash .txt { left: 236px; right: 20px; width: auto; margin-left: 0; top: 60px; }
body.portrait #game #cmdSplash .k { font-size: 20px; }
body.portrait #game #cmdSplash .n { font-size: 50px; line-height: 1.02; white-space: normal; }
body.portrait #game #cmdSplash .x { max-width: none; font-size: 27px; line-height: 1.3; }

/* ---- portrait: my back row moved up 30 px (js/ui.js geometry) to make room under the Leader, so my plate moves too */
body.portrait #game .bplate.s0 { top: calc(var(--ph) - 282px); }

/* ---- a phone keeps :hover on the last card it touched, and style.css lifts a hovered hand card to z 700 (!important):
   it then hides its neighbour's strip and steals its taps. On touch screens a hand card keeps its own place (UI-8). */
@media (hover: none) { #game #layer .card.inhand:not(.dragging):hover { z-index: var(--z, 500) !important; } }

/* Inspectable leader controls retain pointer events even while unavailable. */
#game #board0 > .act[aria-disabled="true"] { opacity: .55; cursor: help; }
#game #board0 > :is(.act, .cmd.mine) { touch-action: none; -webkit-touch-callout: none; user-select: none; }

/* The landscape hand overlaps the crystal band. Keep saved resources readable on either turn,
   above ordinary hand cards (z 500+) and below lifted cards and the response HUD. */
:is(body.mobile, body.portrait) #game .crystalbar { z-index: 600; }

/* Phone battle reveals use a flat face swap. Nested art/foil layers can show through a 3D
   backface as mirrored text on mobile compositors. Keep the outer travel/rest transforms,
   but never rotate the inner face stack or draw the hidden face. Desktop keeps its flip. */
:is(body.mobile, body.portrait) #game #layer .card { perspective: none; }
:is(body.mobile, body.portrait) #game #layer .card > .flip { transform: none; transform-style: flat; transition: none; }
:is(body.mobile, body.portrait) #game #layer .card > .flip > :is(.face, .backface) { transform: none; backface-visibility: visible; visibility: visible; transition: none; }
:is(body.mobile, body.portrait) #game #layer .card.down > .flip > .face,
:is(body.mobile, body.portrait) #game #layer .card:not(.down) > .flip > .backface { display: none; }

/* Explicit two-step leader activation. Stage-relative sizing keeps the review and both actions on phones. */
#game #abilityConfirm { position: absolute; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 24px; background: rgba(4, 2, 12, .78); pointer-events: auto; }
#game #abilityConfirm section { box-sizing: border-box; width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 30px; border: 1px solid #e8ba5a; border-radius: 20px; background: #160d27; color: #fff4d6; box-shadow: 0 18px 70px #000; }
#game #abilityConfirm .ac-kind, #game #abilityConfirm .ac-cost { font-size: 20px; color: #e8ba5a; }
#game #abilityConfirm h3 { margin: 12px 0; font-size: 36px; }
#game #abilityConfirm p { font-size: 24px; line-height: 1.45; }
#game #abilityConfirmStatus { color: #c9bfdc; }
#game #abilityConfirm .ac-actions { display: flex; justify-content: flex-end; gap: 18px; margin-top: 24px; }
#game #abilityConfirm .btn { min-height: 48px; min-width: 120px; font-size: 22px; }
:is(body.mobile, body.portrait) #game #abilityConfirm .btn { min-height: var(--tap, 96px); min-width: calc(var(--tap, 96px) * 1.4); font-size: 30px; }
:is(body.mobile, body.portrait) #game #abilityConfirm :is(p, .ac-kind, .ac-cost) { font-size: 30px; }
