body { padding: 0; margin: 0 }
#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas { background: #1E1A17 }
.unity-mobile #unity-canvas { width: 100%; height: 100% }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

/* ==========================================================================
   MOBILE TOUCH
   ==========================================================================

   The game handles touch itself (SockCity.Game.PlacementController): one finger taps to place or
   drags to pan, two fingers pinch to zoom the city anchored on the gesture midpoint. None of that
   survives if the browser claims the gesture first, and by default it does.

   `touch-action: none` is the load-bearing rule. Without it a one-finger drag scrolls the page
   instead of panning the map, and a pinch is swallowed before Unity ever sees it. This matters
   most inside the PRS arcade, where the game runs in an iframe on a page that scrolls and where
   the surrounding site is ~2000px taller than the viewport.

   Measured before this: a drag across the game scrolled the page, and a pinch took
   visualViewport.scale from 1 to 5 — the website zoomed, the city did not.
   ========================================================================== */

/* Everywhere: a gesture that starts on the canvas belongs to the game, not the page. */
#unity-canvas { touch-action: none; display: block; }
#unity-container { touch-action: none; }

/* Pointer: coarse means a finger rather than a mouse. Desktop behaviour is left untouched. */
@media (pointer: coarse) {
  html, body {
    height: 100%;
    overflow: hidden;            /* nothing to scroll, so no scroll can be stolen */
    overscroll-behavior: none;   /* no pull-to-refresh, no rubber-band bounce */
    touch-action: none;
  }

  body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;      /* no iOS long-press callout over the map */
    -webkit-tap-highlight-color: transparent;
  }
}

/* ==========================================================================
   ROTATE PROMPT
   ==========================================================================

   The HUD is a single landscape layout — portrait is not a cramped version of the game, it is an
   unusable one. This is deliberately CSS-only: it cannot desync from game state, it cannot fail to
   run, and it costs Unity nothing. Desktop windows are exempt (fine pointer), so a narrow window
   still plays.
   ========================================================================== */

#unity-rotate { display: none }

/*
  Driven by a class set from JavaScript, deliberately NOT by @media (orientation: portrait).

  Inside the PRS arcade the game runs in an iframe, and an orientation media query inside an iframe
  is evaluated against the IFRAME's own box — which is always wide, because the cabinet holds a
  16:10 frame. On a portrait phone the query reported landscape and the prompt never appeared, which
  is exactly the case it exists for. screen.orientation and the screen's dimensions describe the
  device rather than the frame, so they are correct in both the cabinet and on a direct link.
*/
html.prs-portrait-device #unity-rotate {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  /* Sampled from the shipped HUD (#1E1A17), not #1E1A17, so it cannot drift. */
  background: #1E1A17;
  color: #F2E9D8;
  font-family: arial, helvetica, sans-serif;
}

html.prs-portrait-device .rotate-icon { font-size: 64px; line-height: 1; animation: prs-rotate-hint 2.6s ease-in-out infinite }
html.prs-portrait-device .rotate-title { font-size: 20px; font-weight: bold }
html.prs-portrait-device .rotate-sub { font-size: 14px; opacity: 0.7 }

@keyframes prs-rotate-hint {
  0%, 45% { transform: rotate(0deg) }
  55%, 100% { transform: rotate(-90deg) }
}
