:root {
  --red: #C42127;
  --red-dark: #A6171D;
  --cream: #EFE6CE;
  --gold: #e7c873;
  --ink: #1a130d;
  --bg: #151515;
  --bg-soft: #1d1d1d;
  --radius: 30px;
  --font-body: 'Oswald', 'Arial Narrow', Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The browser's own stylesheet hides [hidden] with `display: none`, but that is a
   USER-AGENT rule, and any author rule setting `display` beats it. #code-output below
   sets `display: block`, which silently defeated `el.hidden = true`: the attribute was
   set, the element kept rendering, and the "hide code" button did nothing on screen.
   `!important` is the standard guard and belongs here, not on the one element, so the
   next thing toggled with .hidden does not rediscover this. */
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
}

.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  /* Top padding leaves room for the absolutely-positioned language switch, so it
     never crowds the wordmark on a narrow phone. */
  padding: 44px 22px 24px;
  text-align: center;
}

/* The phone's language is only a guess (a Dutch phone bought in Germany asks for
   German), so the switch has to be reachable without being loud. Absolute, so it
   costs the centred column no vertical space; a generous tap target under a small
   label, because it sits near the top edge where thumbs are clumsy. */
.lang {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 8px 12px;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--cream);
  opacity: .6;
  text-decoration: none;
  border: 1px solid rgba(239, 230, 206, .28);
  border-radius: 999px;
  line-height: 1;
}
.lang:hover, .lang:focus-visible { opacity: 1; }

/* The source is an 800px-wide wordmark, so this can grow a long way before it
   softens; 192px is double the original 96 and still a quarter of the intrinsic
   width. `max-width` keeps it inside the card on a narrow phone, where the content
   box is under 300px. */
.logo { width: 192px; max-width: 100%; height: auto; margin-bottom: 10px; }
h1 { font-size: 1.5rem; letter-spacing: .04em; margin: 0 0 18px; text-transform: uppercase; }

.stamps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 0;
  margin: 0 0 16px;
}

.stamps li {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(239, 230, 206, .35);
  border-radius: 50%;
  font-size: .95rem;
  color: rgba(239, 230, 206, .45);
}

/* A filled stamp IS a pizza: the whole disc, not a glyph sitting on a coloured one.
   Crust to the edge, cheese, pepperoni, and the cuts that stop it reading as a
   biscuit. Inline SVG in a data URI rather than the 🍕 emoji, because the emoji is a
   different drawing on every phone and none of them are these colours.

   An empty stamp is a dashed outline carrying its number, so filled and empty differ
   by fill, border style AND content, never by colour alone. */
.stamps li.filled {
  border: none;
  font-size: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27 viewBox%3D%270 0 24 24%27%3E%3Ccircle cx%3D%2712%27 cy%3D%2712%27 r%3D%2712%27 fill%3D%27%23d9a441%27%2F%3E%3Ccircle cx%3D%2712%27 cy%3D%2712%27 r%3D%279.5%27 fill%3D%27%23f2e3b8%27%2F%3E%3Cg stroke%3D%27%23e3cf9a%27 stroke-width%3D%270.5%27%3E%3Cpath d%3D%27M12 2.5 V21.5 M2.5 12 H21.5 M5.3 5.3 L18.7 18.7 M18.7 5.3 L5.3 18.7%27%2F%3E%3C%2Fg%3E%3Ccircle cx%3D%2712%27 cy%3D%276.2%27 r%3D%271.9%27 fill%3D%27%23C42127%27%2F%3E%3Ccircle cx%3D%276.4%27 cy%3D%2711%27 r%3D%271.75%27 fill%3D%27%23C42127%27%2F%3E%3Ccircle cx%3D%2717.2%27 cy%3D%2710.2%27 r%3D%271.75%27 fill%3D%27%23C42127%27%2F%3E%3Ccircle cx%3D%279%27 cy%3D%2717%27 r%3D%271.65%27 fill%3D%27%23C42127%27%2F%3E%3Ccircle cx%3D%2715.8%27 cy%3D%2716.4%27 r%3D%271.6%27 fill%3D%27%23C42127%27%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
}

.count { font-size: 1.1rem; margin: 0 0 6px; }
.reward { color: var(--gold); margin: 0 0 20px; }
.notice { background: rgba(231, 200, 115, .12); border-radius: 14px; padding: 12px; margin: 0 0 16px; }

.code-box button, .privacy button {
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: var(--red);
  color: var(--cream);
  width: 100%;
  cursor: pointer;
}
.code-box button:active { background: var(--red-dark); }
.code-box button:disabled { opacity: .55; cursor: default; }

/* Three parts, three jobs. The digits are the only thing set wide and large, because
   they are what a guest reads aloud across a counter; the label and the countdown sit
   quietly around them, and a sentence written here ("the code has expired", "no
   connection") is a sentence, not a code, so it must not inherit that treatment. */
#code-output {
  display: block;
  margin-top: 14px;
  color: var(--gold);
}

#code-message {
  display: block;
  font-size: 1rem;
  letter-spacing: .06em;
  opacity: .85;
}

#code-value:not(:empty) {
  display: block;
  font-size: 2.4rem;
  letter-spacing: .22em;
  /* The spacing is applied on the right of every character including the last, which
     visually shifts the whole code off centre. Pull it back by one gap. */
  text-indent: .22em;
  line-height: 1.15;
}

#code-seconds {
  display: block;
  font-size: .85rem;
  letter-spacing: .04em;
  opacity: .7;
  margin-top: 2px;
}

.install { margin-top: 22px; }
.save-hint { font-size: .9rem; opacity: .75; margin: 0; }

#install-button {
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 20px;
  width: 100%;
  border: 1px solid var(--gold);
  border-radius: 999px;
  /* Outlined, not solid: "show the code" is the thing a guest came here to press,
     and two filled red buttons stacked would compete for that. */
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}
#install-button:active { background: rgba(231, 200, 115, .14); }
#install-button:disabled { opacity: .55; cursor: default; }
.install-why { font-size: .85rem; opacity: .7; margin: 8px 0 0; }

/* iOS cannot be given a button, so it gets the two taps drawn out instead. Left
   aligned, because a numbered list centred on the page is hard to follow. */
.install-lead { font-size: .9rem; opacity: .8; margin: 0 0 8px; }
.install-steps {
  margin: 0;
  padding-left: 1.4em;
  text-align: left;
  font-size: .9rem;
  opacity: .85;
}
.install-steps li { margin-bottom: 4px; }
.install-steps li:last-child { margin-bottom: 0; }
.ios-share {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -.18em;
  margin-right: .15em;
  color: var(--gold);
}
.privacy { margin-top: 22px; text-align: left; font-size: .9rem; opacity: .85; }
.privacy summary { cursor: pointer; }
.privacy button.danger { background: transparent; border: 1px solid rgba(239, 230, 206, .4); margin-top: 10px; }

@media (min-width: 520px) { .card { padding: 48px 30px 28px; } }
