/* Preserve the existing desktop form spacing after introducing bounded bodies. */
.mobile-form-body { display: flex; flex-direction: column; gap: calc(24 * var(--ui-unit)); }
.mobile-form-body > .avalon-button { align-self: center; width: calc(280 * var(--ui-unit)); max-width: 100%; }
/* Small-screen adaptation only. Load after desktop-wardrobe.css.
   Keep the native pixel palette, warm-yellow portraits and 180:276 cards.
   visualViewport variables are supplied by full-app; dvh is the fallback. */
@media (max-width: 800px), (max-width: 1000px) and (max-height: 460px), (pointer: coarse) and (max-height: 600px) {
  :root { --mobile-height: var(--mobile-viewport-height, 100dvh); }
  .game-modal-layer, .account-layer {
    top: var(--mobile-viewport-top, 0px); bottom: auto;
    height: var(--mobile-height); max-height: var(--mobile-height);
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: auto; overscroll-behavior: contain;
  }
  .game-document, .game-document:has(.rule-body), .account-panel.avalon-document {
    max-height: calc(var(--mobile-height) - 24px); min-width: 0;
    scroll-padding-block: 12px; overscroll-behavior: contain;
  }
  .game-document > :not(.settings-body):not(.rule-body):not(.wardrobe-content):not(.mo-table-wrap):not(.cl-scroll-body):not(.scrollable-modal-body),
  .game-document .avalon-paired, .game-document .avalon-paired > button { flex-shrink: 0; }
  .game-document .document-close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .game-document:not(.desktop-wardrobe) > .document-title { min-height: 46px; padding-right: 48px; padding-left: 48px; }
  .avalon-input, select.avalon-input { min-height: 44px; font-size: max(16px, 1em); }
  .game-document input, .game-document select, .account-layer input, .account-layer select { scroll-margin-block: 12px; }
  .game-document.native-settings { max-height: calc(var(--mobile-height) - 24px); }
  .settings-save-status { margin-block: 0; flex-shrink: 0; }
  .game-document.native-dropdown { max-height: calc(var(--mobile-height) - 84px); }
  .rule-body, .wardrobe-list, .target-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .game-toolbar, #game[data-stage="menu"] .game-toolbar {
    top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  }
  .game-toolbar .original-icon.avalon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; }
  .toolbar-right, .toolbar-profile { gap: 8px; }
  .game-hud .room-code { margin: 0; font-size: 14px; line-height: 20px; }
  .game-hud .phase-title { margin: 3px 0; font-size: 24px; line-height: 1.2; }
  .game-hud .mission-track { margin: 0; font-size: 12px; line-height: 18px; }
  #game[data-stage="waiting"] .game-hud {
    left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); transform: none;
    max-width: calc(100vw - 128px); min-height: 44px; padding: 6px 8px; gap: 6px;
  }
  #game[data-stage="waiting"] .game-hud .room-code { font-size: 14px; min-height: 24px; padding: 0; }
  .room-strip { gap: 8px; }
  #game[data-stage="waiting"] .room-strip > .avalon-button { width: 44px; min-width: 44px; min-height: 44px; padding: 10px; }
  #game[data-stage="waiting"] .game-actions {
    bottom: max(16px, env(safe-area-inset-bottom)); width: calc(100vw - 32px); max-width: 520px;
    gap: 10px; flex-wrap: wrap; overflow: visible;
  }
  #game[data-stage="waiting"] .game-actions > .avalon-button { flex: 1 1 120px; max-width: 240px; min-width: 0; min-height: 48px; }
  .start-reason { font-size: 16px; line-height: 22px; }
  body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game[data-stage="waiting"] .game-actions { bottom: max(148px, calc(env(safe-area-inset-bottom) + 136px)); }
  #touch-movement { left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); width: 120px; height: 120px; }
  #touch-interact { right: max(12px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); min-width: 100px; min-height: 52px; font-size: 18px; }
  #interaction-hint { bottom: max(144px, calc(env(safe-area-inset-bottom) + 132px)); max-width: calc(100vw - 32px); font-size: 14px; }
  .game-notice, .connection-note { max-width: calc(100vw - 24px); font-size: 14px; }
  .connection-note { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .target-list .player-token { min-width: 0; }
  .submission-status { max-width: 100%; font-size: 14px; line-height: 20px; flex: none; }
}

/* Narrow portrait: compact header, independently scrollable roster, fixed footer. */
@media (max-width: 600px) {
  .native-menu { overflow-y: auto; pointer-events: auto; padding: 80px 20px 20px; justify-content: safe center; }
  .menu-brand { flex-shrink: 0; margin-bottom: 24px; }
  .menu-options { flex-shrink: 0; gap: 12px; }
  .menu-options .avalon-button { height: 48px; min-height: 48px; }
  .toolbar-nickname { max-width: calc(100vw - 180px); font-size: 14px; }
  #game:not([data-stage="waiting"]) .game-hud { top: 70px; left: 12px; right: 12px; width: auto; max-width: none; transform: none; }
  #game[data-stage="waiting"] .game-hud { display: flex; flex-direction: column; align-items: flex-start; }
  .target-list .token-art { width: 28px; height: 36px; }
  .game-modal-layer:has(.desktop-wardrobe) { padding: 12px; align-items: center; }
  .desktop-wardrobe.wardrobe-document {
    width: 100%; height: calc(var(--mobile-height) - 24px); min-height: 0; max-height: calc(var(--mobile-height) - 24px);
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px clamp(112px, calc(var(--mobile-height) * .24), 180px) minmax(0, 1fr) 48px;
    gap: 8px; padding: 12px; overflow: hidden;
  }
  .desktop-wardrobe > .document-title { margin: 0; padding: 2px 42px 8px; font-size: 24px; }
  .desktop-wardrobe > .document-close { top: 10px; right: 10px; }
  .desktop-wardrobe .wardrobe-stage { min-height: 0; }
  .desktop-wardrobe .wardrobe-art { inset: 4px 0 4px 48%; max-height: none; }
  .desktop-wardrobe .wardrobe-art > .original-portrait { max-height: 100%; }
  .desktop-wardrobe .wardrobe-nickname { top: 8px; }
  .desktop-wardrobe .nickname-value { font-size: 20px; }
  .desktop-wardrobe .wardrobe-caption { bottom: 12px; }
  .desktop-wardrobe .wardrobe-name { font-size: 20px; line-height: 26px; }
  .desktop-wardrobe .wardrobe-nickname .avalon-input { min-height: 44px; font-size: 16px; }
  .desktop-wardrobe .nickname-actions { top: 46px; }
  .desktop-wardrobe .nickname-actions .avalon-button { min-width: 44px; min-height: 44px; font-size: 14px; }
  .desktop-wardrobe .wardrobe-stage:has(.nickname-actions:not([hidden])) .wardrobe-caption { display: none; }
  .desktop-wardrobe .wardrobe-list { grid-auto-rows: 120px; min-height: 0; gap: 8px; scroll-padding-block: 4px; }
  .desktop-wardrobe .wardrobe-content > .avalon-paired button { font-size: 20px; }
  .desktop-wardrobe .wardrobe-message { bottom: 64px; font-size: 12px; }
  .desktop-wardrobe:has(.wardrobe-nickname .avalon-input:focus) { grid-template-rows: 44px 112px minmax(0, 1fr) 44px; }
  .game-document:has(.rule-body) { height: calc(var(--mobile-height) - 24px); }
  .rule-tabs { flex-shrink: 0; }
  .rule-tabs .avalon-button { min-height: 44px; font-size: 14px; }
  .rule-body { max-height: none; }
}

/* Short landscape also includes 568px devices, which formerly got portrait UI. */
@media (min-width: 480px) and (max-width: 1000px) and (max-height: 460px), (pointer: coarse) and (min-width: 480px) and (orientation: landscape) and (max-height: 600px) {
  .native-menu { padding: 58px 12px 8px; justify-content: flex-start; overflow-y: auto; pointer-events: auto; }
  .menu-brand { position: static; margin: 0 0 4px; }
  .native-menu h1 { font-size: 24px; line-height: 29px; }
  .menu-subtitle { font-size: 12px; line-height: 14px; margin: 0; }
  .menu-motto { font-size: 12px; line-height: 14px; margin: 2px 0 0; }
  .menu-options { position: static; width: min(280px, 100%); gap: 4px; }
  .menu-options .avalon-button { min-height: 44px; height: 44px; font-size: 18px; }
  /* Keep four native vertically stacked entries; short screens scroll the menu. */
  #game:not([data-stage="waiting"]) .game-hud { top: 8px; left: 12px; right: 124px; width: auto; max-width: none; transform: none; }
  .game-hud .phase-title { font-size: 22px; line-height: 26px; }
  .game-hud .mission-track { line-height: 16px; }
  #game[data-stage="waiting"] .game-hud { display: flex; flex-direction: row; align-items: center; background: none; border: 0; padding: 0; }
  #game[data-stage="waiting"] .game-hud .room-code { display: flex; align-items: center; min-height: 44px; border: 1px solid #a6aaa6; background: #292622; padding: 6px 8px; white-space: nowrap; }
  .game-document:not(.desktop-wardrobe):not(.native-dropdown) { padding: 12px 20px; gap: 10px; }
  .game-document:not(.desktop-wardrobe) > .document-title { font-size: 24px; margin: 0; padding-bottom: 8px; }
  .game-document.native-settings .settings-body { flex: 0 1 auto; }
  .game-modal-layer:has(.desktop-wardrobe) { padding: 10px 12px; align-items: center; }
  .desktop-wardrobe.wardrobe-document {
    width: min(760px, 100%); height: calc(var(--mobile-height) - 20px); min-height: 0; max-height: calc(var(--mobile-height) - 20px);
    grid-template-columns: minmax(156px, 32%) minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) 44px;
    gap: 6px 12px; padding: 8px 12px; overflow: hidden;
  }
  .desktop-wardrobe > .document-title { grid-column: 1 / -1; grid-row: 1; padding: 3px 48px 8px; margin: 0; font-size: 24px; }
  .desktop-wardrobe > .document-close { top: 8px; right: 8px; }
  .desktop-wardrobe .wardrobe-stage { grid-column: 1; grid-row: 2; min-height: 0; }
  .desktop-wardrobe .wardrobe-art { inset: 44px 12px 24px; max-height: none; }
  .desktop-wardrobe .wardrobe-art > .original-portrait { max-height: 100%; }
  .desktop-wardrobe .wardrobe-nickname { left: 6px; right: 6px; top: 0; flex-wrap: nowrap; }
  .desktop-wardrobe .nickname-value { font-size: 18px; }
  .desktop-wardrobe .wardrobe-nickname .avalon-input { min-height: 44px; font-size: 16px; }
  .desktop-wardrobe .nickname-actions { top: 46px; left: 0; right: auto; }
  .desktop-wardrobe .nickname-actions .avalon-button { min-height: 44px; min-width: 52px; font-size: 14px; }
  .desktop-wardrobe .wardrobe-stage:has(.nickname-actions:not([hidden])) .wardrobe-art { top: 94px; }
  .desktop-wardrobe .wardrobe-caption { left: 0; right: 0; bottom: 2px; }
  .desktop-wardrobe .wardrobe-name { font-size: 14px; line-height: 20px; }
  .desktop-wardrobe .wardrobe-list { grid-column: 2; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 120px; min-height: 0; gap: 6px; }
  .desktop-wardrobe .wardrobe-content > .avalon-paired { grid-column: 1 / -1; grid-row: 3; width: min(356px, 100%); }
  .desktop-wardrobe .wardrobe-content > .avalon-paired button { min-height: 44px; font-size: 20px; }
  .desktop-wardrobe:has(.wardrobe-nickname .avalon-input:focus) { grid-template-rows: 44px minmax(0, 1fr) 44px; }
  .desktop-wardrobe .wardrobe-message { bottom: 54px; }
  .rule-grid { grid-template-columns: repeat(3, minmax(0, 142px)); gap: 16px; }
}


/* SVG's intrinsic aspect ratio must not expand its grid row on short screens. */
@media (max-width: 800px), (max-width: 1000px) and (max-height: 460px), (pointer: coarse) and (max-height: 600px) {
  .desktop-wardrobe .wardrobe-art > .original-portrait {
    position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; max-height: none;
  }
}
/* Waiting-room toasts must not cover the sole Ready / Start action. */
@media (max-width: 800px), (max-width: 1000px) and (max-height: 460px), (pointer: coarse) and (max-height: 600px) {
  body:has(#game[data-stage="waiting"]) #game-notice { bottom: max(80px, calc(env(safe-area-inset-bottom) + 68px)); }
  body:has(#game[data-stage="waiting"] .start-reason) #game-notice { bottom: max(128px, calc(env(safe-area-inset-bottom) + 116px)); }
  body:has(#game[data-stage="waiting"]):has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game-notice { bottom: max(190px, calc(env(safe-area-inset-bottom) + 178px)); }
}
/* A pending request uses the right decision column instead of a third clipped row. */

/* Phone recording regression: use available viewport height, including wide phones. */
/* Fullscreen uses the shared S preset, including touch sizing, in desktop-theme.css. */
@media (max-width: 800px), (pointer: coarse) and (max-height: 600px) {
  .toolbar-profile { min-width: 0; }
  .toolbar-nickname { min-width: 0; max-width: max(24px, calc(100vw - 276px)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar-right { flex: none; margin-left: auto; }
  #game[data-stage="waiting"] .game-hud { max-width: calc(100vw - 220px); }
  #touch-interact { white-space: nowrap; min-width: 144px; padding: 8px 12px; font-size: 16px; }
  body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #interaction-hint {
    left: auto; right: max(12px, env(safe-area-inset-right)); bottom: max(82px, calc(env(safe-area-inset-bottom) + 72px));
    transform: none; max-width: 180px; text-align: right;
  }
  .game-document.mobile-form-document { overflow: hidden; gap: 8px; }
  .mobile-form-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; scrollbar-color: #79694d #b2a484; }
  .mobile-form-body > * { flex-shrink: 0; }
  .mobile-form-body > .avalon-button { align-self: center; min-height: 44px; width: min(280px, 100%); }
  .game-document > .mobile-form-footer { flex-shrink: 0; margin: 0; }
  .mobile-form-footer > .avalon-button { min-height: 44px; font-size: 18px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  #game[data-stage="waiting"] .game-hud { top: 68px; right: 12px; max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; }
}
@media (min-width: 480px) and (max-width: 1000px) and (max-height: 460px), (pointer: coarse) and (min-width: 480px) and (orientation: landscape) and (max-height: 600px) {
  .game-document:not(.desktop-wardrobe):not(.native-dropdown) { width: min(680px, 100%); max-width: 100%; gap: 8px; padding: 10px 18px; }
  .game-document:not(.desktop-wardrobe) > .document-title { min-height: 44px; padding: 3px 48px 7px; margin: 0; line-height: 30px; }
  .game-document .document-close { top: 10px; right: 16px; }
  .account-field { font-size: 16px; gap: 4px; }
  .account-copy { font-size: 16px; line-height: 1.4; margin: 0; }
  .account-mail-note, .account-message { font-size: 14px; line-height: 1.4; margin: 0; }
  .game-document .avalon-input { min-height: 44px; font-size: 18px; padding: 6px 10px; }
  .mobile-form-body > .account-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; text-align: left; gap: 8px; }
  .mobile-form-body > .avalon-button { font-size: 18px; padding: 6px 12px; }
  .game-document.native-dropdown { top: 64px; right: max(12px, env(safe-area-inset-right)); width: 250px; max-height: calc(var(--mobile-height) - 76px); padding: 6px; gap: 4px; }
  .native-dropdown > .avalon-button { min-height: 44px; font-size: 16px; padding: 6px 10px; }
  .native-settings .settings-body { gap: 10px; }
  .settings-body .account-field:has(select) { grid-template-columns: 120px minmax(0, 1fr); }
  .game-document:has(.rule-body) { height: calc(var(--mobile-height) - 24px); overflow: hidden; }
  .rule-tabs { flex-shrink: 0; }
  .rule-tabs .avalon-button { min-height: 44px; padding: 4px 10px; font-size: 16px; }
  .rule-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  .rule-faction { margin: 4px 0 8px; font-size: 18px; }
  .rule-grid { grid-template-columns: repeat(3, minmax(0, 100px)); gap: 12px; }
  .rule-role .court-card { width: clamp(60px, calc((var(--mobile-height) - 210px) * .65), 100px); }
  .rule-role > .avalon-button { min-height: 44px; font-size: 14px; margin-top: 4px; }
  .desktop-wardrobe .wardrobe-list { grid-auto-rows: 112px; }
  #game:not([data-stage="waiting"]) .game-hud { right: 220px; }
  #game[data-stage="waiting"] .game-hud { top: 12px; }
}

@media (orientation: landscape) and (max-height: 340px) and (pointer: coarse) { .menu-motto { display: none; } }

@media (max-width: 800px), (pointer: coarse) and (max-height: 600px) { .game-modal-layer .game-document.mobile-form-document > .mobile-form-body { flex: 1 1 auto; min-height: 0; } }

/* One stable seat toggle for pointer and touch; seating itself is readiness. */
#touch-movement { pointer-events: none; }
#joystick, #touch-interact { pointer-events: auto; }
#touch-interact { min-width: 144px; min-height: 48px; white-space: nowrap; }
#game[data-stage="waiting"] .game-actions { bottom: max(18px, env(safe-area-inset-bottom)); }
@media (max-width: 800px), (pointer: coarse) and (max-height: 600px) {
 body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game[data-stage="waiting"] .game-actions,
 #game[data-stage="waiting"] .game-actions { bottom: max(18px, env(safe-area-inset-bottom)); width: min(220px, calc(100vw - 320px)); gap: 0; }
 #game[data-stage="waiting"] .game-actions > .avalon-button { width: 100%; max-width: 220px; min-width: 0; font-size: 16px; }
}
@media (max-width: 600px) and (orientation: portrait) {
 body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game[data-stage="waiting"] .game-actions,
 #game[data-stage="waiting"] .game-actions { bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px)); width: 180px; }
}

/* Desktop proximity prompt follows the native chair anchor; touch keeps its one button. */
#pc-seat-hint{position:absolute;left:0;top:0;pointer-events:none;white-space:nowrap;font-size:14px;line-height:1.4;color:#eee9d8;text-shadow:0 1px 3px #000,0 0 4px #000;padding:2px 5px;z-index:3;}
#pc-seat-hint[hidden]{display:none!important;}

/* Opt-in packed scene labels. Renderer supplies scene-relative top-left and
   measured content height; desktop/unpacked labels retain their native style. */
.court-labels[data-packed="true"] .court-nameplate {
 box-sizing:border-box;width:max-content;height:auto;max-width:160px;max-height:none;
 display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;
 padding:2px 4px;font-size:12px;line-height:16px;white-space:normal;
 text-align:center;background:transparent;border-radius:0;
}
.court-labels[data-packed="true"] .court-label-name {
 grid-column:1 / -1;grid-row:1;min-width:0;display:block;
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2;
}
.court-labels[data-packed="true"] .court-nameplate[data-match-marker~="leader"]::before {
 content:'队长';grid-column:1;grid-row:2;display:block;line-height:16px;
}
.court-labels[data-packed="true"] .court-nameplate[data-match-marker~="team"]::after {
 content:'出征';grid-column:2;grid-row:2;display:block;line-height:16px;
}
.court-labels[data-packed="true"] .court-label-lines {
 position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;
 fill:none;stroke:none;
}

/* Team voting follows native screen-pixel sizing, rather than filling the free
   screen. The native 720p–1080p card is 180×276, including its transparent edge. */
.game-document:has(.decision-team-list) {overflow:hidden;}
#modals .decision-team-list {display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow:auto;}
.decision-team-list > .avalon-button {min-height:44px;white-space:normal;overflow-wrap:anywhere;flex-shrink:0;}

/* Toolbar controls share one registered row height: MenuIcon 64 / CourtIcon 72.
   The fullscreen text action keeps the SmallAction width; it no longer uses its
   42-unit height beside taller icon controls. All touch siblings retain 44px. */
.game-toolbar {--toolbar-control-size:calc(72 * var(--ui-unit));}
#game[data-stage="menu"] .game-toolbar {--toolbar-control-size:calc(64 * var(--menu-unit));}
@media (max-width:800px), (max-height:620px) {
 .game-toolbar {--toolbar-control-size:48px;}
 #game[data-stage="menu"] .game-toolbar {--toolbar-control-size:44px;}
}
@media (max-width:800px), (max-width:1000px) and (max-height:460px), (pointer:coarse) and (max-height:600px) {
 .game-toolbar, #game[data-stage="menu"] .game-toolbar {--toolbar-control-size:44px;}
}
#game .game-toolbar .avalon-button:is(.original-icon,.toolbar-fullscreen) {
 box-sizing:border-box;height:var(--toolbar-control-size);min-height:var(--toolbar-control-size);
}
#game .game-toolbar .original-icon.avalon-button {width:var(--toolbar-control-size);min-width:var(--toolbar-control-size);}
#game .game-toolbar .toolbar-fullscreen.preset-toolbar-action {
 width:calc(172 * var(--ui-unit));min-width:calc(172 * var(--ui-unit));padding:calc(4 * var(--ui-unit)) calc(12 * var(--ui-unit));white-space:nowrap;
 box-shadow:0 0 0 max(1px,calc(2 * var(--ui-unit))) #131412;
}
@media (pointer:coarse) {
 #game .game-toolbar .avalon-button:is(.original-icon,.toolbar-fullscreen) {height:max(44px,var(--toolbar-control-size));min-height:max(44px,var(--toolbar-control-size));}
 #game .game-toolbar .original-icon.avalon-button {width:max(44px,var(--toolbar-control-size));min-width:max(44px,var(--toolbar-control-size));}
}

.court-labels .court-nameplate[hidden]{display:none!important}
@media(max-height:460px){.game-document.role-guide-detail>.role-guide-layout{max-height:calc(100dvh - 145px);overflow:auto}}
#game[data-stage="waiting"] .game-actions:has(.native-lobby-status){flex-direction:column;align-items:center;gap:4px}
.native-lobby-status{margin:0;text-align:center;color:#dfd5b9;text-shadow:1px 2px #1b1813;font-size:clamp(12px,2vw,18px);line-height:1.25}
@media(max-height:460px){.native-lobby-status{font-size:12px}}
@media(max-width:650px) and (orientation:landscape){#game[data-stage="waiting"] .game-hud .room-code{font-size:12px}}
@media(max-height:460px) and (orientation:landscape){
 body:has(#touch-movement:not([hidden])) #game[data-stage="waiting"] .game-actions:has(.native-lobby-status),#game[data-stage="waiting"] .game-actions:has(.native-lobby-status){top:auto;bottom:max(18px,env(safe-area-inset-bottom));height:auto;min-height:0;max-height:none}
 #game[data-stage="waiting"] .game-actions:has(.native-lobby-status)>.avalon-button{flex:none;height:48px}
}

@media(max-height:460px) and (orientation:landscape){body:has(#touch-movement:not([hidden]) #joystick:not([hidden])) #game[data-stage="waiting"] .game-actions:has(.native-lobby-status){bottom:max(18px,env(safe-area-inset-bottom))}}
