/* styles.css — full-screen canvas + overlay panels (SPEC §0, §6).
   Phase B: functional layout. Phase D: real child-drawn doodle polish. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #fdf6e3;
  font-family: Georgia, 'Times New Roman', serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;       /* taps go to canvas as game input */
}

/* ── Canvas ──────────────────────────────────────────────────────────────── */
#game {
  display: block;
  width: 100vw; height: 100vh;
  position: fixed; inset: 0;
}

/* ── Generic overlay — stacks above canvas ───────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  pointer-events: none;     /* children re-enable as needed */
  z-index: 10;
}

/* ── Name / Lobby ────────────────────────────────────────────────────────── */
#name-screen {
  justify-content: flex-end;
  gap: 0;
}

.from-banner {
  pointer-events: auto;
  background: #2d5a27;
  color: #fff;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  font-size: clamp(15px, 4vw, 18px);
  font-family: sans-serif;
  letter-spacing: 0.01em;
}

.name-box {
  pointer-events: auto;
  width: 100%;
  background: rgba(253, 246, 227, 0.97);
  border-top: 3px solid #5c3a1e;
  padding: 28px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.name-prompt {
  font-size: clamp(16px, 4.5vw, 20px);
  color: #333;
  text-align: center;
}

#name-input {
  width: 100%;
  padding: 14px 16px;
  font-size: clamp(18px, 5vw, 22px);
  font-family: Georgia, serif;
  border: 3px solid #5c3a1e;
  border-radius: 8px;
  background: #fff;
  color: #222;
  outline: none;
  -webkit-appearance: none;
}
#name-input:focus { border-color: #2d5a27; }

/* ── Result / Near-miss boxes ────────────────────────────────────────────── */
.result-box {
  pointer-events: auto;
  width: 100%;
  background: rgba(253, 246, 227, 0.97);
  border-top: 3px solid #5c3a1e;
  padding: 28px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.big-number {
  font-size: clamp(64px, 22vw, 110px);
  font-weight: bold;
  color: #2d5a27;
  line-height: 1;
}
.near-miss-red { color: #c0392b; }

.result-label {
  font-size: clamp(15px, 4vw, 18px);
  color: #333;
  text-align: center;
  font-family: sans-serif;
}

.near-miss-label {
  font-size: clamp(22px, 6vw, 28px);
  font-weight: bold;
  color: #c0392b;
}
.near-miss-sub {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #666;
  font-family: sans-serif;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button {
  width: 100%;
  border: none;
  border-radius: 10px;
  font-size: clamp(17px, 4.5vw, 20px);
  padding: 16px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: opacity 0.1s;
  -webkit-tap-highlight-color: transparent;
}
button:active { opacity: 0.75; }

.btn-primary   { background: #2d5a27; color: #fff; }
.btn-secondary { background: #fff; color: #2d5a27; border: 2px solid #2d5a27; }
.btn-ghost     { background: transparent; color: #999;
                 font-size: clamp(14px, 3.5vw, 16px); padding: 10px; }
