/* Cards keep each game's frame and preferred type size. The contents reflow inside
   that frame if the translation or the current roster needs more room. */
.game-sign { overflow: clip !important; overflow-wrap: anywhere }
.fit-body { display: flow-root; min-inline-size: 0; zoom: var(--sign-scale, 1) }
.game-sign :where(button, a, input, fieldset, img) { max-inline-size: 100% }
.game-sign :where(button, a, h1, h2, label, p, small) { overflow-wrap: anywhere }
#host #lineup { min-width: 0; flex: 1 1 12em }
#host #lobby { align-items: center }
#phone #playerName { width: 100%; min-width: 0 }
#host #helpBox { max-height: calc(100% - var(--edge) - 60px) }
#host #count > div { max-height: calc(100% - 2 * var(--edge)) }
#countNum { display:block; line-height:1.2 }
#host[data-game="targets"] #count > div { width: min(90%, calc(clamp(88px, 20vmin, 215px) + 32px)) }
#muuuRadio { max-height: calc(100dvh - 105px) }
#slotMapDialog[open] { margin: auto; overflow: clip }
#slotMapDialog .slot-map-sheet { max-height: 90dvh }
#host #slotVoteLobby:not([hidden]) { display: block }
#slotVoteLobby > .fit-body { display: grid; height: 100%; grid-template-rows: inherit; gap: inherit }
#slotVoteLobby .vote-header > * { min-width: 0 }
#slotVoteLobby .ballot-caption h2 { white-space: normal; overflow: visible }
#phone:not([hidden]) {
  position: fixed; inset: var(--phone-top, 0px) 0 auto; height: var(--phone-height, 100dvh);
  min-height: 0; width: 100%; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center; overflow: clip !important;
}
body.handset { overflow: clip }
#phone .phone-inner { max-height: 100%; min-width: 0; max-width: 100%; margin: 0 auto }
#phone:has(#padSound:not([hidden]), #padLanguage:not([hidden])) { padding-top: max(58px, env(safe-area-inset-top)) }
@media (max-height: 540px) and (orientation: landscape) {
  #host[data-stage="finished"] #lineup:has(> :nth-child(4)) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px}
  #host[data-stage="finished"] #lineup .roster { flex-wrap: wrap; gap: 3px 5px }
  #host #panel .roster .badge { flex: none }
  #phone[data-choosing="true"] .phone-inner { width: min(100%,900px) }
  #phone[data-choosing="true"] .phone-inner > .fit-body { display:grid;grid-template-columns:minmax(0, .85fr) minmax(0, 1.5fr);column-gap:14px;align-items:center }
  #phone[data-choosing="true"] .fit-body > * { grid-column:1 }
  #phone[data-choosing="true"] #driverChoices { grid-column:2;grid-row:1 / span 9;margin:0 }
  #phone[data-choosing="true"] #slotHandCar { height:36px;margin-bottom:2px }
  #phone[data-choosing="true"] #phoneButtons { gap:4px }
  #phone[data-choosing="true"] #phoneButtons button { padding:6px 10px }
}
@media (max-height: 450px) and (orientation:landscape) {
  #phone:not([data-choosing="true"]):has(#nameField:not([hidden])) .phone-inner {
    width:min(100%,780px); padding:8px 14px;
  }
  #phone:has(#nameField:not([hidden])) :is(#volleyHandPlayer,#runnerHandPlayer,#fishingFace,#basketHandPlayer,#tennisHandPlayer,#phoneGeneral,#westernBadge,#skiPortrait) {
    float:inline-end; width:48px; height:48px; object-fit:contain; margin:0 3px 0 8px;
  }
  #phone:has(#nameField:not([hidden])) #phoneTitle { font-size:26px; margin-block:3px }
  #phone:has(#nameField:not([hidden])) :is(#phoneKind,#phoneInfo,#sensorStatus,#nameField) { margin-block:4px }
  #phone:has(#nameField:not([hidden])) #phoneButtons button { padding:7px 11px }
}
@media (max-height: 550px) and (orientation:landscape) {
  #slotMapDialog .slot-map-sheet { padding:8px 12px }
  #slotMapDialog header { margin-block-end:6px }
  #slotMapOptions img { height:min(24dvh,110px); object-fit:contain }
  #slotMapOptions strong { padding:4px 7px }
}
