:root {
  --paper: #141210;
  --paper-tint: #1e1a17;
  --ink: #f4efe9;
  --ink-soft: #bdb2a8;
  --orange: #f58220;
  --orange-legible: #ffa945;
  --rule: #6f665f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

.screen {
  min-height: 100dvh;
  max-width: 44rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}
h1 { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.6rem); line-height: 1.15; margin: 0; font-weight: 700; }
.eyebrow { margin: 0; color: var(--orange-legible); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }
.note { min-height: 1.4em; margin: 0; color: var(--ink-soft); text-align: center; }
.error { margin: 0; color: #ff8a80; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  border-radius: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { opacity: .35; cursor: default; }
.primary {
  background: var(--orange);
  color: #1a1714;
  font-weight: 700;
  font-size: 1.5rem;
  min-height: 4.5rem;
}
.link { background: none; color: var(--ink-soft); text-decoration: underline; font-size: .95rem; padding: .5rem; align-self: center; }

.phone {
  display: block;
  min-height: 4.5rem;
  padding: .8rem 1rem;
  border: 2px solid var(--rule);
  border-radius: 1rem;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  text-align: center;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.keypad button {
  background: var(--paper-tint);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  min-height: clamp(3.6rem, 9vh, 5rem);
}
.keypad button:active, .choice:active, .options button:active { background: var(--orange); color: #1a1714; }
.keypad .soft { font-size: 1.1rem; color: var(--ink-soft); }

.audience p { margin: 0 0 .6rem; color: var(--ink-soft); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.choice { background: var(--paper-tint); border: 2px solid var(--rule); font-size: 1.3rem; min-height: 4.5rem; font-weight: 600; }

.ask { justify-content: flex-start; padding-top: max(2rem, env(safe-area-inset-top)); }
.options { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-top: .5rem; }
@media (min-width: 700px) { .options { grid-template-columns: 1fr 1fr; } }
.options button {
  background: var(--paper-tint);
  border: 2px solid var(--rule);
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 600;
  min-height: clamp(4.5rem, 12vh, 6.5rem);
  padding: .75rem 1rem;
  text-align: center;
}
/* A phone held upright: six answers and Skip must fit without scrolling. */
@media (max-height: 900px) and (max-width: 699px) { .options button { min-height: 3.6rem; } }
.skip { background: none; border: 2px solid var(--rule); color: var(--ink-soft); font-size: 1.25rem; min-height: 4rem; margin-top: .5rem; }

.message { text-align: center; align-items: center; }
.message h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }

.setup-form { display: flex; flex-direction: column; gap: 1rem; }
.setup-form label { display: flex; flex-direction: column; gap: .4rem; color: var(--ink-soft); }
.setup-form input[type="password"], .setup-form input[type="text"] {
  font: inherit; font-size: 1.3rem; color: var(--ink); background: var(--paper-tint);
  border: 2px solid var(--rule); border-radius: .75rem; padding: .9rem 1rem; user-select: text; -webkit-user-select: text;
}
.setup-form .check { flex-direction: row; align-items: center; gap: .6rem; }
.setup-form .check input { width: 1.4rem; height: 1.4rem; }

.test-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  background: #ffd54a; color: #1a1714; text-align: center; font-weight: 700; padding: .35rem; font-size: .9rem;
}
/* The fixed banner must not sit on top of a screen's first line. */
.test-banner:not([hidden]) ~ .screen { padding-top: calc(max(2rem, env(safe-area-inset-top)) + 1.75rem); }
