/* The page around the WebGL build (spec 2026-10-06-web-version). Dark like the game, so the margins around the
   canvas and the iPhone's safe-area strips read as part of it. */
:root {
  --bg: #141418;
  --panel: #1f1f26;
  --text: #ecedf2;
  --muted: #9a9cab;
  --accent: #3b6cf6;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* No magnifier, text selection, callout or double-tap zoom on long presses — the game's own gestures. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overflow: hidden;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

/* The canvas lives inside the safe area: on an iPhone home-screen app the game never sits under the notch or the
   home indicator, so Screen.safeArea has nothing left to correct. */
#game {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}
#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  outline: none;
}

#fork, #loading, #failure {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-y: auto;
  touch-action: pan-y;
}
#fork > :not(.fork__logo) { max-width: 420px; width: 100%; }
/* Centred while it fits, scrollable from the top when it does not (a small iPhone in landscape): flex
   centring would push the top out of reach. */
#fork { justify-content: flex-start; }
#fork > :first-child { margin-top: auto; }
#fork > :last-child { margin-bottom: auto; }

.fork__logo, .loading__logo { flex: none; width: 96px; height: 96px; border-radius: 22px; }
.fork__title { font-size: 22px; line-height: 1.25; margin: 16px 0 8px; }
.fork__lead { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 0 0 16px; }
.fork__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  text-align: left;
}
.fork__steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.35;
}
.fork__num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fork__icon { flex: none; width: 24px; height: 24px; margin-left: auto; color: #4d8dff; }
.fork__note { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 8px 0 0; }

.fork__primary {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  margin: 8px 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.fork__secondary {
  display: block;
  margin: 18px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}

.loading__bar {
  width: 220px;
  height: 6px;
  border-radius: 3px;
  background: var(--panel);
  overflow: hidden;
  margin-top: 24px;
}
.loading__fill { width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
.loading__text { color: var(--muted); font-size: 14px; margin-top: 12px; }

.failure__title { font-size: 19px; font-weight: 600; margin: 0 0 8px; }
.failure__hint { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 16px; max-width: 360px; }
#failure .fork__primary { max-width: 260px; }
