:root:fullscreen { background: #09090b; }
@media (pointer:coarse) and (orientation:landscape) {
 body.match-choice-open .return-to-mat,
 body.match-choice-open .resume-mat-choice,
 body.match-choice-open #mobileToolbarHandle,
 body.match-choice-open > .topbar,
 body.match-choice-open .match-message-drawer,
 body.match-choice-open .match-message-handle,
 body.match-choice-open .fs-scroll-hint { visibility:hidden!important;pointer-events:none!important; }
 body.mat-inspection dialog[open]::backdrop { backdrop-filter:none!important;-webkit-backdrop-filter:none!important; }
}
@media (pointer: coarse) {
  body { padding-top: env(safe-area-inset-top,0px); }
  .crew-bar { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
}
@media (pointer: coarse) and (orientation: landscape) {
  body:has(#gameScreen:not([hidden])) > .topbar { padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right)); }
  #gameScreen:not([hidden]) { bottom: env(safe-area-inset-bottom,0px); height: calc(100dvh - var(--match-content-top,44px) - env(safe-area-inset-bottom,0px)); padding-inline: max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right)); }
  #gameScreen .player-hand-zone .hand-row { bottom: env(safe-area-inset-bottom,0px); }
}

/* Phones and tablets: the Crew bar steps aside during a match so the board gets the whole screen
   (controller.js re-measures the header rows and moves the match up). It's back on the setup screen. */
@media (pointer: coarse) {
  body:has(#gameScreen:not([hidden])) .crew-bar { display: none !important; }
}

/* Phone/tablet browsers: room to scroll during a match so the browser can hide its address bar and tabs
   (mobile-display.js). The match itself stays fixed to the screen and grows into the freed space (dvh). */
@media (pointer: coarse) and (orientation: landscape) {
  html.browser-bars body:has(#gameScreen:not([hidden])) { overflow: visible; min-height: calc(100lvh + 240px); }
}

/* "Scroll up for full screen" hint (mobile-display.js) in the empty corner under HIDDEN HAND. Swipes pass through it. */
.fs-scroll-hint { display: none; }
@media (pointer: coarse) and (orientation: landscape) {
  .fs-scroll-hint:not([hidden]) { display: flex; position: fixed; right: max(12px,env(safe-area-inset-right)); bottom: max(10px,env(safe-area-inset-bottom)); z-index: 900; width: 140px; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; pointer-events: none; color: #ffd21c; font: 800 11px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-align: center; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
  .fs-scroll-arrow { font-size: 30px; line-height: 1; animation: fs-scroll-nudge 1.4s ease-in-out infinite; }
}
@keyframes fs-scroll-nudge { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .fs-scroll-arrow { animation: none; } }

/* CREW in the top bar on phones and tablets (mobile-display.js) */
@media (pointer: coarse) {
  .crew-bar.crew-in-menu { position: static; display: flex; min-height: 0; padding: 0; gap: 0; background: none; border: 0; z-index: auto; }
  .crew-bar.crew-in-menu > button { min-height: 44px; padding: 0 16px; }
  .crew-bar.crew-in-menu .crew-friends { display: none; }
  .crew-bar.crew-in-menu .crew-panel { position: fixed; left: 12px; right: auto; z-index: 1200; }
}

