/* Apple Ball: page shell, game column and canvas (owner: CORE).

   Layout: one portrait column, #game. On phones it is the whole viewport.
   On wide screens it is centered at min(100vw, 62% of the height, 520px)
   and the page background shows around it. The canvas fills the column
   edge to edge (under the notch too, viewport-fit=cover); anything that
   must avoid the notch or home indicator uses the --safe-* tokens.
   #ui sits over the canvas with pointer-events off; UI turns them back on
   for its own buttons and cards (css/ui.css). */

@font-face {
  font-family: "Archivo Expanded";
  src: url("../fonts/archivo-expanded-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--fg);
}
body.ab {
  font: var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  /* A soft glow behind the column on wide screens. */
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, #1a1f52 0%, rgba(26, 31, 82, 0) 70%),
    var(--bg);
}

#game {
  position: relative;
  display: block;
  margin: 0 auto;
  width: min(100vw, calc(100vh * 0.62), 520px);
  width: min(100vw, calc(100dvh * 0.62), 520px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-2);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  contain: layout paint;
}
/* Wide screens: lift the column off the page a little. */
@media (min-aspect-ratio: 62/100) {
  #game { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 80px rgba(0, 0, 0, 0.6); }
}

#c {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}

#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Read by boot.js to turn the safe-area insets into world units. */
#ab-safe-probe {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  top: 0; left: 0;
  width: 0; height: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

.ab-noscript {
  position: fixed;
  inset: auto 0 40% 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font: var(--font);
}
