html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #231f20; }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
       font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #f0e9dc; }

/* A phone: the canvas over the whole screen, the notch and the home bar too; the page measures the safe-area insets
   (#gm-safe) and the game keeps its bars clear of them (SafeArea.WebInset). */
#gm-stage { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100dvh; }
#gm-safe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
           padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#unity-canvas { display: block; width: 100%; height: 100%; background: #231f20; touch-action: none; outline: none; }

/* A desktop: a 9:16 box, as tall as the window. */
#gm-stage.gm-desktop { display: flex; align-items: center; justify-content: center; }
#gm-stage.gm-desktop #unity-canvas { height: 100vh; width: calc(100vh * 9 / 16); max-width: 100vw; }

/* The loading screen: the game's own backdrop (UXF4) as wide as the screen from the top, its starry sky colour above a
   taller phone's picture; the game's loading bar (its frame and fill, Assets/ArtHD/UI/Loading) near the foot. Sizes in
   cqw (1% of the loading screen's width). */
@font-face { font-family: "GM Bree"; src: url("BreeSerif-Regular.ttf") format("truetype"); font-display: swap; }
#gm-loading { position: absolute; inset: 0; overflow: hidden; background: #2a1f4a; container-type: size; }
.gm-desktop #gm-loading { left: 50%; right: auto; width: min(100vw, calc(100vh * 9 / 16)); transform: translateX(-50%); }
#gm-loading-bg { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
                 width: max(100cqw, calc(100cqh / 1.5)); height: auto; display: block; max-width: none; }
/* The bar: 273 x 34 art pixels; its channel at 18 from the left, 10 from the bottom, 237 x 14. */
#gm-bar { position: absolute; left: 12cqw; width: 76cqw; aspect-ratio: 273 / 34;
          bottom: calc(env(safe-area-inset-bottom) + 24cqw); background: url("bar_frame.png") center / 100% 100% no-repeat; }
#gm-fill { position: absolute; left: 6.59%; bottom: 29.4%; height: 41.2%; width: 0; max-width: 86.8%;
           background: url("bar_fill.png") left center / auto 100% repeat-x; transition: width 0.25s ease-out; }
#gm-loading-text, #gm-loading-note { position: absolute; left: 4cqw; right: 4cqw; text-align: center; color: #f0e9dc;
  font-family: "GM Bree", Georgia, serif; line-height: 1.15;
  text-shadow: 0 0.08em 0 #1f0e06, 0.06em 0 0 #1f0e06, -0.06em 0 0 #1f0e06, 0 -0.06em 0 #1f0e06, 0 0.1em 0.14em rgba(0, 0, 0, 0.6); }
#gm-loading-text { font-size: 5.6cqw; bottom: calc(env(safe-area-inset-bottom) + 14cqw); }
#gm-loading-text.gm-long { font-size: 3.6cqw; }
#gm-loading-note { font-size: 3.6cqw; bottom: calc(env(safe-area-inset-bottom) + 8.5cqw); opacity: 0.92; }

#gm-warning { position: absolute; left: 0; right: 0; top: 0; display: none; z-index: 2; }
#gm-warning .gm-error { background: #8c1f1f; padding: 10px; }
#gm-warning .gm-note { background: #6b5a1a; padding: 10px; }
