:root {
  --night: #0b0f2c;
  --night-deep: #050717;
  --star: #fef3a3;
  --player: #ff9ab1;
  --card-bg: #fff8e8;
  --card-ink: #1a1f3a;
  --correct: #4ade80;
  --wrong: #ef4444;
  --ui: #ffe9c2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--night-deep);
  color: var(--ui);
  font-family: 'Press Start 2P', system-ui, sans-serif;
  overflow: hidden;
  position: fixed;            /* lock the page — no rubber-band scroll on iOS */
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#game-shell {
  position: fixed;
  top: 0;
  left: 0;
  /* 100vw/100vh are only a pre-JS fallback (vh is universally supported —
     the dvh unit broke in the Instagram in-app browser). main.js immediately
     sizes this in px from the VISUAL viewport so the canvas fits the
     actually-visible area. */
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(180deg, #050717 0%, #0b0f2c 60%, #1d244d 100%);
}

/* Container just fills the shell — Phaser's FIT scale mode does the
   aspect-ratio letterboxing itself, so we no longer need a CSS 16:9 box.
   The letterbox bars show the shell's dark gradient. */
#game-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#game-container canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* suppress native gestures (pinch zoom, scroll, double-tap zoom) so swipes
     land in the game instead of moving the page */
  touch-action: none;
}

/* ---- top-right control buttons (mute, fullscreen) ---- */
.corner-btn {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  z-index: 10;
  background: rgba(0,0,0,0.45);
  border: 2px solid var(--ui);
  border-radius: 8px;
  color: var(--ui);
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.corner-btn:hover { background: rgba(0,0,0,0.65); }

#mute-btn { right: calc(12px + env(safe-area-inset-right, 0px)); }
#mute-btn[data-muted="true"] { opacity: 0.55; }

#fullscreen-btn { right: calc(58px + env(safe-area-inset-right, 0px)); }
#fullscreen-btn[hidden] { display: none; }

#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--night-deep);
  color: var(--ui);
  font-size: 14px;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.4s;
}
#loading.hidden { opacity: 0; }

@media (max-width: 600px) {
  .corner-btn { font-size: 14px; padding: 4px 8px; }
  #fullscreen-btn { right: calc(48px + env(safe-area-inset-right, 0px)); }
}
