:root {
  --paper: #f5efe3;
  --ink: #433c31;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  text-align: center;
  /* The whole page is the tap target; stop double-tap zoom stealing taps. */
  touch-action: manipulation;
  /* And stop the mobile browser flashing its blue overlay on every tap —
     the page is one large button, so the default highlight covers the whole
     screen and reads as an error, not an answer. */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

main {
  display: grid;
  place-items: center;
  align-content: center;
  /* grid-gap first — plain gap on grid needs Chrome 66, floor is 61 */
  grid-gap: 3rem;
  gap: 3rem;
  padding: 2rem;
  cursor: pointer;
}

main, footer { position: relative; z-index: 2; }

/* The whole page is the tap target, underneath the visible content so the
   text stays in the accessibility tree instead of being pruned by
   role="button" on an ancestor. Chrome 61 has no `inset` shorthand (that
   needs 87) — four longhands instead. */
#surface {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

/* Chrome 61 keeps the UA outline (no :focus-visible there); modern browsers
   trade it for the quiet masthead cue. */
#surface:focus { outline: 2px solid var(--line, #b9ab90); outline-offset: -2px; }
@supports selector(:focus-visible) {
  #surface:focus { outline: none; }
  #surface:focus-visible { outline: 2px solid #b9ab90; outline-offset: -2px; }
}

h1 {
  font-weight: normal;
  font-size: 1.05rem;
  letter-spacing: 0.35em;
  opacity: 0.55;
  margin: 0;
}

#question {
  font-size: 1.6rem;
  line-height: 1.45;
  max-width: 18ch;
  margin: 0;
  min-height: 4.6em; /* holds its slot, so arriving reflows nothing */
  opacity: 0;
  transition: opacity 1.6s ease;
}

#question.showing { opacity: 1; }

/* Settled: no more question is coming, so the surface stops advertising an action. */
#surface:disabled { cursor: default; }

footer {
  font-size: 0.72rem;
  opacity: 0.5;
  padding: 0 1rem 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  #question { transition: none; }
}
