/* Shared styles for the title page and the game page.
   Change the colours here to re-paint the whole game! */
:root {
  --cream: #fbf8f1;  /* page background */
  --ink:   #2b2d42;  /* text and outlines */
  --mint:  #c9efdc;
  --butter:#fff0b3;
  --sky:   #d3e8ff;
  --coral: #ffd3c7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

/* ---------- Title page ---------- */
.title-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom);
  text-align: center;
  background: linear-gradient(160deg, var(--sky), var(--cream) 45%, var(--butter));
}
.title-page h1 {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 5rem);
}
.play-button {
  display: inline-block;
  padding: 1rem 3.5rem;
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  background: var(--mint);
  border: 4px solid var(--ink);
  border-radius: 2rem;
  box-shadow: 0 6px 0 var(--ink);
}
.play-button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.by-line { margin: 0; font-size: 0.8rem; opacity: 0.6; }

/* ---------- Game page ---------- */
.game-page { overflow: hidden; touch-action: none; background: #1b2a5c; overscroll-behavior: none; }
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
/* ---- app feel on iPad Safari: no scrolling, zooming or rubber-banding (see js/touch.js) ---- */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-overflow-scrolling: auto; }
body:not(.game-page) { overflow-y: auto; touch-action: pan-y; }
.game-page canvas { display: block; width: 100vw; height: 100vh; height: 100dvh; touch-action: none; }
#fsBtn { position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 20; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 2px solid #2b2d42; background: rgba(255,255,255,.85); font: inherit; font-weight: 800; font-size: 14px; color: #2b2d42; }
.home-hint { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; padding: 10px 14px; border-radius: 14px; border: 2px dashed #b98a00; background: #fff0b3; color: #7a5b00; font-size: 14px; text-align: center; line-height: 1.4; }
.home-hint .share-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 2px solid #2b2d42; border-radius: 5px; font-size: 12px; background: #fff; vertical-align: middle; }
.home-hint button { font: inherit; font-weight: 800; min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 2px solid #2b2d42; background: #c9efdc; margin-top: 4px; }
