html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #000; color: #eee;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
#stage { position: fixed; inset: 0; touch-action: none; }
#cam, #view { position: absolute; inset: 0; width: 100%; height: 100%; }
#cam { object-fit: cover; background: #000; }
#view { touch-action: none; }

.panel {
  position: fixed; inset: 0; z-index: 2; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 40%, #2a0a0c 0%, #070505 70%);
  touch-action: manipulation;
}
.panel.dim { background: rgba(0, 0, 0, 0.62); }
.panel[hidden] { display: none; }
h1 { margin: 0 0 12px; font-size: clamp(34px, 11vw, 64px); letter-spacing: 0.08em; color: #f2e8e0; text-shadow: 0 0 24px rgba(200, 20, 20, 0.6); }
.lead { margin: 0 0 18px; font-size: 18px; color: #d8cfc8; }
ol { margin: 0 0 26px; padding-left: 1.3em; max-width: 26em; text-align: left; font-size: 16px; line-height: 1.45; color: #cfc6bf; }
li { margin: 4px 0; }
.small { margin: 18px 0 0; max-width: 26em; font-size: 13px; color: #9a918b; }
.score { margin: 4px 0 6px; font-size: 22px; }
.score b { font-size: 30px; color: #fff; }
button {
  font-family: inherit; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: 0.12em; color: #fff; cursor: pointer;
  padding: 22px 56px; border-radius: 999px; border: 2px solid #d43a3a; background: #7d0e10;
  box-shadow: 0 0 30px rgba(220, 30, 30, 0.35);
}
#againBtn { margin-top: 26px; }
button:disabled { opacity: 0.5; cursor: default; }
button:active:not(:disabled) { transform: scale(0.97); }
/* a phone on its side (as low as 320 px): the whole start screen must fit */
@media (max-height: 430px) {
  .panel { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  h1 { margin-bottom: 4px; font-size: 34px; }
  .lead { margin-bottom: 8px; font-size: 16px; }
  ol { margin-bottom: 14px; max-width: 40em; font-size: 14px; }
  button { padding: 16px 48px; }
  .small { margin-top: 10px; max-width: none; }
}

#note {
  position: fixed; z-index: 1; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom));
  max-width: 88vw; padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.65);
  font-size: 14px; line-height: 1.35; text-align: center; pointer-events: none;
}
#note[hidden] { display: none; }
#safe {
  position: fixed; top: 0; left: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
