/* Mobile menus are content-sized. Match geometry never changes the physics. */
.rotate-prompt{position:fixed;inset:0;z-index:7;display:grid;place-items:center;overflow:auto;padding:16px;background:radial-gradient(ellipse at 15% 40%,#123a49aa,transparent 70%),#050b17}
.rotate-card{width:min(380px,100%);padding:20px;text-align:center}
.rotate-card>svg{width:56px;height:56px;margin-bottom:12px;stroke:var(--cyan);stroke-width:2;filter:drop-shadow(0 0 10px #24e5ff55)}
.rotate-card h2{font:700 25px/1.2 var(--display);margin-bottom:12px}
.rotate-card p{color:#acc3d7;font-size:13px;line-height:1.6;margin-bottom:18px}
.rotate-card button{min-height:44px}.rotate-card .plain{width:100%;margin-top:8px;border-color:transparent;background:transparent;color:#a5bed2}
.rotation-waiting .game-topline,.rotation-waiting .preview-corner{visibility:hidden}
.rotation-waiting .game-frame{visibility:hidden}
/* The whole play surface accepts touch; controls occupy one 44px HUD row. */
.mobile .game-screen{padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);touch-action:none;user-select:none;-webkit-user-select:none}
.mobile .game-frame{position:absolute;left:var(--court-x,0);top:var(--court-y,44px);width:var(--court-w,100vw)}
.mobile .game-frame canvas{height:var(--court-h);aspect-ratio:auto}
.mobile .game-screen:after{content:none!important}
.mobile .game-bottomline,.mobile .game-screen>.preview-corner,.mobile .game-topline p{display:none}
.mobile .game-topline{top:env(safe-area-inset-top,0px);left:max(6px,env(safe-area-inset-left,0px));right:max(6px,env(safe-area-inset-right,0px));height:44px}
.mobile .game-actions{display:contents}
.mobile .game-actions button{position:absolute;top:0;width:44px;min-height:44px;padding:12px;display:flex;align-items:center;justify-content:center}
.mobile #pauseGame{left:0}.mobile #matchFullscreen{right:0}
.mobile .game-actions button span{display:none}
.mobile .game-actions button svg{width:18px;height:18px;margin:0}
#mobileHud{position:fixed;top:env(safe-area-inset-top,0px);left:calc(env(safe-area-inset-left,0px) + 56px);right:calc(env(safe-area-inset-right,0px) + 56px);height:44px;display:grid;grid-template-columns:minmax(0,1fr) 106px minmax(0,1fr);align-items:center;gap:6px;pointer-events:none;z-index:4;font-family:var(--mono);user-select:none}
#mobileScore{text-align:center;line-height:1}
.mobile-score-line{display:flex;justify-content:center;align-items:center;gap:12px;font-size:27px;font-weight:700;font-variant-numeric:tabular-nums}
.mobile-score-line>span{font-size:16px;color:#8595b5}
#mobileScoreLeft{color:var(--cyan);text-shadow:0 0 12px #24e5ff88}
#mobileScoreRight{color:var(--pink);text-shadow:0 0 12px #ff3dc588}
#mobileTarget{display:block;font-size:8px;letter-spacing:1px;color:#9aaad3;margin-top:3px}
.mobile-effects{min-width:0;display:flex;flex-wrap:wrap;align-content:center;align-items:center;gap:2px 4px;max-height:40px}
#mobileEffects1{justify-content:flex-end}
.mobile-effect{display:inline-flex;align-items:center;gap:2px;min-width:24px;height:18px;padding:0 3px;border:1px solid color-mix(in srgb,var(--effect-color) 45%,transparent);border-radius:3px;background:#0a1024cc;color:var(--effect-color);font-size:9px;font-variant-numeric:tabular-nums}
.mobile-effect canvas{width:14px;height:14px}
.mobile-pickup{font-size:10px;letter-spacing:.5px;text-shadow:0 0 8px currentColor}
.mobile .game-overlay{position:fixed;inset:44px 0 0;padding:8px 12px}
.mobile .game-overlay-card{width:min(400px,100%);max-height:calc(100dvh - 60px);padding:14px 20px;gap:8px}
.mobile .game-overlay-card h2{font-size:26px;margin:0}.mobile .game-overlay-card .eyebrow{display:none}
.mobile .game-overlay-card p{font-size:12px}.mobile .game-overlay-card button{margin:0;min-height:44px}
.mobile .game-overlay-card #returnLobby{margin-top:0}
.dialog-header{position:sticky;top:-27px;z-index:1;background:#101c2d;padding:8px 0}
.dialog-header .icon-button{min-height:44px;min-width:44px}
.dialog-footer{position:sticky;bottom:-27px;padding:12px 0 0;background:#0b1424;z-index:1}
.in-match-options #rulesReadOnly,.in-match-options #matchFields{display:none}
.in-match-options #personalFields{margin-bottom:0}

@media(pointer:coarse),(max-width:600px){
  body[data-selector=inline] .design-stage{min-height:0;padding:18px 14px}
  body[data-selector=inline] .design-shell{display:block;max-width:720px;margin:auto}
  body[data-selector=inline] .hero{display:block;text-align:center;margin:0 0 16px}
  body[data-selector=inline] .wordmark{font-size:40px;line-height:1;letter-spacing:-1.5px}
  body[data-selector=inline] .wordmark span{display:inline;margin:0}
  body[data-selector=inline] .hero .eyebrow,body[data-selector=inline] .court-preview{display:none}
  body[data-selector=inline] .lobby{padding:15px;border-radius:5px}
  body[data-selector=inline] .roster{gap:20px}
  body[data-selector=inline] .matchup-card{padding:10px 10px 66px;min-height:178px}
  body[data-selector=inline] .matchup-name{font-size:24px;margin:8px 0}
  .matchup-top{font-size:9px;letter-spacing:1px;min-height:28px}
  .matchup-detail{font-size:10px;line-height:1.5}
  .matchup-top .account-button{min-width:44px;min-height:44px;margin:-8px -8px -8px 0}
  .inline-opponents{left:6px;right:6px;bottom:8px;gap:3px}
  .inline-opponents button{min-height:44px;font-size:9px;padding:5px 2px;gap:3px}
  .inline-opponents .mode-glyph{font-size:14px;height:14px}
  body[data-selector=inline] .status-line{margin:12px 0;min-height:25px;font-size:12px}
  body[data-selector=inline] .rules-row{padding-top:12px}
  body[data-selector=inline] .start-row{margin-top:12px}
  body[data-selector=inline] .menu-tools{margin-top:8px;justify-content:center;gap:18px}
  .menu-tools button{min-height:44px;font-size:11px}
  .options-button,.room-actions button,.copy-button,.share-button{min-height:44px!important}
  .rules-summary{font-size:11px;line-height:1.5}
  .preview-tools{padding:10px 14px}.preview-tools summary{min-height:24px;line-height:24px}
  .dialog{padding:18px;max-height:calc(100dvh - 24px);overscroll-behavior:contain}
  .dialog-header{top:-18px;padding-top:0;margin-bottom:14px}.dialog-header h2{font-size:25px}
  .dialog-header .eyebrow{display:none}
  .dialog-footer{bottom:-18px;margin-top:12px}
  .dialog .switch-row{min-height:44px;margin-top:8px}
  .dialog .field-label{margin-top:12px}.dialog fieldset{margin-bottom:18px}
  .dialog .segmented button,.dialog select{min-height:44px}
}

/* A wide phone is still a phone: use height as well as width. */
@media(pointer:coarse) and (min-width:601px){
html.compact-menu body[data-selector=inline] .design-stage{min-height:0!important;padding:10px 18px!important}
html.compact-menu body[data-selector=inline] .design-shell{display:block;max-width:850px;margin:auto}
html.compact-menu body[data-selector=inline] .hero{display:block;text-align:left;margin:0 0 7px}
html.compact-menu body[data-selector=inline] .wordmark{font-size:27px;line-height:1;letter-spacing:-1px}
html.compact-menu body[data-selector=inline] .wordmark span{display:inline;margin:0}
html.compact-menu body[data-selector=inline] .hero .eyebrow,html.compact-menu body[data-selector=inline] .court-preview{display:none}
html.compact-menu body[data-selector=inline] .lobby{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(220px,.9fr);gap:7px 18px;padding:12px}
html.compact-menu #invitation{grid-column:1/-1}
html.compact-menu body[data-selector=inline] .roster{grid-column:1;grid-row:2/5;gap:18px;margin:0!important;align-self:stretch}
html.compact-menu body[data-selector=inline] .matchup-card{padding:6px 10px 55px;min-height:152px}
html.compact-menu body[data-selector=inline] .matchup-name{font-size:23px;margin:5px 0}
html.compact-menu body[data-selector=inline] .matchup-detail{font-size:10px}
html.compact-menu .matchup-top{min-height:24px;font-size:8px}
html.compact-menu .inline-opponents{left:5px;right:5px;bottom:6px}
html.compact-menu .inline-opponents button{min-height:44px;font-size:9px;padding:4px 1px}
html.compact-menu .inline-opponents .mode-glyph{display:none}
html.compact-menu body[data-selector=inline] .status-line{grid-column:2;margin:0;min-height:0;line-height:1.35;font-size:11px}
html.compact-menu .spectators{grid-column:2;margin:0}
html.compact-menu body[data-selector=inline] .rules-row{grid-column:2;gap:8px;padding-top:7px;align-items:center}
html.compact-menu .rules-copy .eyebrow{display:none}
html.compact-menu .rules-summary{font-size:11px;line-height:1.4}
html.compact-menu body[data-selector=inline] .start-row{grid-column:2;margin:0;align-self:end}
html.compact-menu body[data-selector=inline] .menu-tools{margin-top:3px;justify-content:flex-end;gap:20px}
html.compact-menu .menu-tools button{min-height:44px;font-size:11px}
html.compact-menu .mobile .game-topline p{max-width:210px}
html.compact-menu #optionsDialog:not(.in-match-options){width:min(760px,calc(100vw - 24px));max-width:none;display:grid;grid-template-columns:1.4fr 1fr;column-gap:22px}
html.compact-menu #optionsDialog:not([open]){display:none}
html.compact-menu #optionsDialog .dialog-header,html.compact-menu #optionsDialog .dialog-footer,html.compact-menu #rulesReadOnly{grid-column:1/-1}
html.compact-menu #optionsDialog fieldset{margin-bottom:0}
html.compact-menu #optionsDialog:not(.in-match-options) #matchFields{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px}
html.compact-menu #matchFields .segmented button{padding:10px 4px}
html.compact-menu #matchFields>.switch-row{align-self:end;min-height:44px;margin-bottom:0}
html.compact-menu .dialog-header{margin-bottom:8px}
html.compact-menu .dialog-header h2{font-size:23px}
html.compact-menu .dialog legend{padding-bottom:7px;margin-bottom:8px;font-size:10px}
html.compact-menu .dialog .switch-row small{display:none}
html.compact-menu #optionsDialog .field-label{font-size:11px;margin:7px 0 5px}
html.compact-menu .dialog .dialog-footer{margin-top:8px}
html.compact-menu .in-match-options{width:min(610px,calc(100vw - 24px));max-width:none}
html.compact-menu .in-match-options #personalFields{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
html.compact-menu .in-match-options #personalFields legend{display:none}
html.compact-menu .in-match-options .switch-row{flex-direction:column;gap:12px;text-align:center;border:1px solid #29465a;border-radius:5px;padding:12px 6px;margin:0}

}

@media(prefers-reduced-motion:reduce){.touch-rail{transition:none}}
