/* Marble — per-game styles. Inherits everything from ../shared/chrome.css and
   ../shared/tokens.css.

   Two canvases share the frame. #world is the three.js scene and sits
   underneath, filling the frame whatever size chrome.css gives it. #game is the
   house canvas UI on top, and it keeps every rule chrome.css already writes for
   it (size, touch-action, focus and embed modes). The world canvas is
   transparent, so the Portal wash on .game-wrap is the sky. */
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
#game {
  position: relative;
  z-index: 1;
  cursor: grab;
}
#game:active { cursor: grabbing; }

/* Clear of the notch and the status bar: the same insets play.js takes off
   the frame's size, so the frame sits exactly in what is left. */
body.mode-mobile .play-row,
body.embed .play-row {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* The cover (DESIGN-SYSTEM 3). The .splash frame, cover sizing and fade come
   from chrome.css; this supplies the art per mode, over the city's own dusk
   while the picture is still arriving. The art is rendered from the game:
   level 25's hologram bridge over the sky train, the marble at its edge.

   Mobile art is 1170 x 2532. Its wordmark is 70.7% of the width, inside the
   82% safe zone (0.38 / 0.462), and sits 14% to 19% down, clear of the 8.9%
   an iPhone SE crops off the top; the marble clears the bottom crop too.
   A phone or tablet held sideways is still "mobile" but landscape, and there
   the tall art would be cut down to a strip through the middle, so it gets
   the landscape art.

   A 3D game takes seconds to arrive and build, so the cover stays up until the
   game has drawn itself (index.html), and it must never be a blank while the
   art itself is on its way: under each picture sits a tiny copy of it, inline
   here (two thousand bytes), that shows the moment the page does. */
.splash {
  --dusk: linear-gradient(180deg, #05040C 0%, #140A26 35%, #3A1238 62%, #1A0B22 100%);
  --lq-mobile: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA4KCw0LCQ4NDA0QDw4RFiQXFhQUFiwgIRokNC43NjMuMjI6QVNGOj1OPjIySGJJTlZYXV5dOEVmbWVabFNbXVn/2wBDAQ8QEBYTFioXFypZOzI7WVlZWVl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K5RjzUmwcdow0mmVjJIt9lc0MfDtbIdWknr+H//2Q==');
  background-image: var(--dusk);
}
body.mode-desktop .splash { background-image: url('./splash-desktop.jpg?v=2'), var(--lq-desktop), var(--dusk); }
body.mode-mobile  .splash { background-image: url('./splash-mobile.jpg?v=2'),  var(--lq-mobile), var(--dusk); }
@media (orientation: landscape) {
  body.mode-mobile .splash { background-image: url('./splash-desktop.jpg?v=2'), var(--lq-desktop), var(--dusk); }
}
/* The loading bar, low on the cover: it always moves, a step at a time as each
   part of the game arrives and slowly in between, so a slow phone never looks
   stuck. The fill is a transform, which the browser animates even while the
   game is busy building the city. */
.splash-load {
  position: absolute; left: 50%; bottom: calc(3% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 22px 15px; border-radius: 16px;
  background: rgba(10, 16, 28, 0.66);
}
/* The wide picture has the marble low in the middle, so there the bar sits in the bottom right corner. */
body.mode-desktop .splash-load { left: auto; right: 18px; bottom: 16px; transform: none; }
@media (orientation: landscape) {
  body.mode-mobile .splash-load { left: auto; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: 12px; transform: none; }
}
.splash-load-label { font: 600 16px/1.2 Inter, system-ui, -apple-system, sans-serif; color: rgba(255, 255, 255, 0.92); white-space: nowrap; }
.splash-load-track { display: block; width: 184px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
/* Ready, on a phone: the cover waits for one tap, because a phone lets sound
   start only from a finger lifting (the owner chose this over sound arriving a
   few seconds into the first drag). The whole cover takes the tap; the pill
   breathes a soft ring so it reads as a button. */
.splash.tap { cursor: pointer; }
.splash.tap .splash-load { animation: splash-tap 1.6s ease-in-out infinite; }
.splash.tap .splash-load-label { font-weight: 700; color: #FFFFFF; }
@keyframes splash-tap {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.2); }
}
@media (prefers-reduced-motion: reduce) { .splash.tap .splash-load { animation: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); } }
.splash-load-fill {
  display: block; width: 100%; height: 100%; border-radius: 3px; background: #FFFFFF;
  box-shadow: 0 0 10px rgba(110, 200, 255, 0.9);
  transform-origin: left center; transform: scaleX(var(--load, 0.06));
  transition: transform var(--load-t, 6s) cubic-bezier(0.2, 0.7, 0.3, 1);
}
