/* Fonts are served from this site, never from a third party.
   Grandstander and Atkinson Hyperlegible: SIL Open Font License 1.1;
   Special Elite: Apache License 2.0. Licences are in /fonts. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Grandstander";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/grandstander-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Grandstander";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/grandstander-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/special-elite-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/special-elite-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Palette: a polar night sky, the gold of the missing star, aurora mint for
   success, snow-white paper for the telegrams, one postmark red for stamps. */
:root {
  --night: #141A3A;
  --dusk: #232C5E;
  --aurora: #6FE3C1;
  --gold: #F5B83D;
  --gold-deep: #C98A12;
  --snow: #F1F5FB;
  --ink: #1B2140;
  --ink-soft: #4A5378;
  --stamp: #D9452F;

  --display: "Grandstander", "Trebuchet MS", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --type: "Special Elite", "Courier New", monospace;

  --radius: 14px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(111, 227, 193, .22), transparent 60%),
    radial-gradient(80% 50% at 85% 10%, rgba(126, 140, 255, .18), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--dusk) 100%);
  background-attachment: fixed;
  color: var(--snow);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.topbar, main, .foot { position: relative; z-index: 1; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  color: var(--gold);
  text-decoration: none;
  font-size: 17px;
  letter-spacing: .01em;
}

.sound {
  font: 14px var(--body);
  color: var(--snow);
  background: transparent;
  border: 1px solid rgba(241, 245, 251, .35);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 8px var(--gutter) 32px;
  outline: none;
}

.foot {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  font-size: 14px;
  color: rgba(241, 245, 251, .7);
  text-align: center;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 12px;
}

h1 { font-size: clamp(34px, 9vw, 52px); }
h2 { font-size: clamp(26px, 6.5vw, 34px); }
h3 { font-size: 21px; }

p { margin: 0 0 14px; }

:focus-visible {
  outline: 3px solid var(--aurora);
  outline-offset: 3px;
}

/* ---------- The star: the signature. Five points light up as pieces are found. */

.star {
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.star .pt, .star .core {
  fill: rgba(241, 245, 251, .08);
  stroke: rgba(241, 245, 251, .45);
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: fill .6s ease, stroke .6s ease;
}

.star .pt.lit, .star .core.lit {
  fill: var(--gold);
  stroke: #FFE3A3;
}

.star .pt.just {
  animation: ignite 1.1s ease;
}

.star.whole {
  filter: drop-shadow(0 0 18px rgba(245, 184, 61, .75));
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes ignite {
  0% { fill: #FFF6DC; transform: scale(1.08); }
  100% { fill: var(--gold); transform: scale(1); }
}

@keyframes glow {
  50% { filter: drop-shadow(0 0 34px rgba(245, 184, 61, .95)); }
}

.star .digit {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
}

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 18px;
}

.progress .star { margin: 0; flex: none; }

.progress-label {
  font-family: var(--type);
  font-size: 15px;
  color: rgba(241, 245, 251, .85);
}

/* ---------- Telegram paper */

.paper {
  background: var(--snow);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 18px 40px rgba(5, 8, 25, .45);
  position: relative;
}

.paper + .paper { margin-top: 18px; }

.telegram-head {
  font-family: var(--type);
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px dashed rgba(27, 33, 64, .2);
  padding-bottom: 10px;
  margin-bottom: 14px;
  display: grid;
  gap: 2px;
}

.telegram-head strong { color: var(--ink); font-weight: normal; }

.stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 6px;
  padding: 3px 8px;
  transform: rotate(6deg);
  opacity: .9;
}

.telegram-body p { font-size: 19px; }

.typed { font-family: var(--type); }

/* ---------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font: 700 18px var(--body);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:active { transform: translateY(1px); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--gold-deep);
}

.btn-gold:active { box-shadow: 0 3px 0 var(--gold-deep); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 2px solid currentColor;
}

.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn-wide { width: 100%; }

/* ---------- Landing */

.hero { padding: 14px 0 8px; text-align: center; }

.hero .star { margin-bottom: 10px; }

.hero .lede {
  font-size: 19px;
  color: rgba(241, 245, 251, .88);
  max-width: 30em;
  margin: 0 auto 6px;
}

.hero .btn-row { justify-content: center; }

.section { margin-top: 40px; }

.section > h2 { color: var(--gold); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(241, 245, 251, .1);
  color: var(--gold);
}

.steps strong { display: block; font-family: var(--display); font-size: 19px; }

.pass {
  text-align: left;
}

.pass .price {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  margin: 4px 0 4px;
}

.pass .small { color: var(--ink-soft); font-size: 15px; }

.pass ul {
  margin: 14px 0 0;
  padding-left: 1.1em;
}

.pass li { margin: 4px 0; }

.faq details {
  border-top: 1px solid rgba(241, 245, 251, .18);
  padding: 12px 0;
}

.faq details:last-child { border-bottom: 1px solid rgba(241, 245, 251, .18); }

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style-position: outside;
}

.faq details p { margin: 8px 0 0; color: rgba(241, 245, 251, .85); }

/* ---------- Setup form */

.field { margin-bottom: 18px; }

.field > label, .field > legend {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

fieldset { border: 0; padding: 0; margin: 0 0 18px; }

.hint { font-size: 15px; color: var(--ink-soft); margin: -2px 0 8px; }

.names { display: grid; gap: 8px; }

.names input {
  width: 100%;
  font: 18px var(--body);
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid rgba(27, 33, 64, .2);
  background: #fff;
  color: var(--ink);
}

.names input:focus { border-color: var(--dusk); outline: none; box-shadow: 0 0 0 3px rgba(111, 227, 193, .6); }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice span {
  display: block;
  border: 2px solid rgba(27, 33, 64, .2);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  height: 100%;
}

.choice span b { display: block; font-family: var(--display); font-size: 19px; }
.choice span small { color: var(--ink-soft); font-size: 15px; }

.choice input:checked + span {
  border-color: var(--dusk);
  background: rgba(111, 227, 193, .25);
}

.choice input:focus-visible + span { outline: 3px solid var(--aurora); outline-offset: 2px; }

.error {
  color: var(--stamp);
  font-weight: 700;
  min-height: 1.5em;
  margin: 8px 0 0;
}

/* ---------- Puzzles */

.puzzle-title { color: var(--ink); margin-bottom: 6px; }

.kicker {
  font-family: var(--type);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.board {
  margin: 16px 0 6px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #E4ECF8, #D6E1F2);
}

.slots, .tiles, .options, .seq, .sack, .cipher, .key, .grid, .keypad {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.slot {
  width: 42px;
  height: 50px;
  border-bottom: 3px solid var(--ink);
  display: grid;
  place-items: center;
  font: 800 26px var(--display);
}

.tiles { margin-top: 16px; }

.tile {
  width: 52px;
  height: 56px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font: 800 26px var(--display);
  box-shadow: 0 4px 0 rgba(27, 33, 64, .25);
  cursor: pointer;
}

.tile[disabled] { opacity: .25; cursor: default; box-shadow: none; }

.seq span {
  font-size: 34px;
  min-width: 46px;
  height: 54px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
}

.seq .blank {
  border: 3px dashed var(--ink-soft);
  border-radius: 10px;
  color: var(--ink-soft);
}

.options { margin-top: 14px; }

.opt {
  min-width: 64px;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid rgba(27, 33, 64, .18);
  background: #fff;
  color: var(--ink);
  font: 700 22px var(--body);
  cursor: pointer;
}

.options:not(.words) .opt { font-size: 28px; min-width: 72px; }
.options.words { flex-direction: column; align-items: stretch; }
.options.words .opt { font-size: 19px; text-align: left; }

.opt.wrong { animation: shake .4s ease; border-color: var(--stamp); }
.opt.right { background: var(--aurora); border-color: var(--aurora); }

@keyframes shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.sack span { font-size: 38px; width: 52px; text-align: center; }

.cipher { flex-wrap: nowrap; gap: 4px; }

.cipher span {
  font-size: clamp(20px, 6vw, 30px);
  flex: 1 1 0;
  max-width: 46px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 10px;
}

.key {
  margin-top: 14px;
  gap: 6px;
}

.key div {
  display: grid;
  justify-items: center;
  background: rgba(255, 255, 255, .6);
  border-radius: 8px;
  padding: 4px 8px;
  min-width: 44px;
}

.key div span:first-child { font-size: 22px; }
.key div span:last-child { font: 800 18px var(--display); }

.riddle {
  font-size: 21px;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid.big { grid-template-columns: repeat(4, 1fr); }

.card {
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: var(--dusk);
  color: var(--snow);
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(5, 8, 25, .4);
  display: grid;
  place-items: center;
  transition: background .2s ease, transform .2s ease;
}

.card::after { content: "✦"; color: var(--gold); font-size: 22px; }
.card.up { background: #fff; }
.card.up::after { content: none; }
.card.done { background: rgba(111, 227, 193, .5); box-shadow: none; }

.feedback {
  min-height: 1.6em;
  margin: 10px 0 0;
  font-weight: 700;
  text-align: center;
}

.feedback.bad { color: var(--stamp); }

/* ---------- Piece found */

.found { text-align: center; }

.found .big-digit {
  font-family: var(--display);
  font-weight: 800;
  font-size: 96px;
  line-height: 1;
  color: var(--gold-deep);
  margin: 6px 0 4px;
}

/* ---------- Lock */

.codebox {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 16px;
}

.codebox span {
  width: 48px;
  height: 58px;
  border-radius: 10px;
  background: #fff;
  border: 2px solid rgba(27, 33, 64, .2);
  display: grid;
  place-items: center;
  font: 800 30px var(--display);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

.keypad .tile { width: 100%; }

/* ---------- Finale and certificate */

.finale { text-align: center; }

.signature {
  font-family: var(--display);
  font-size: 26px;
  color: var(--stamp);
  margin-top: 4px;
}

.cert-preview {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 14px;
  box-shadow: 0 10px 24px rgba(5, 8, 25, .25);
}

.center { text-align: center; }
.muted { color: rgba(241, 245, 251, .75); }
.paper .muted { color: var(--ink-soft); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 560px) {
  .paper { padding: 28px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.notice {
  margin: 14px auto 0;
  max-width: 30em;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(111, 227, 193, .16);
  border: 1px solid rgba(111, 227, 193, .5);
  font-size: 16px;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--aurora);
  text-decoration: underline;
  cursor: pointer;
}

main:focus-visible { outline: none; }

/* ---------- Privacy and terms pages */

.doc { padding-bottom: 48px; }
.doc h1 { color: var(--ink); font-size: clamp(32px, 8vw, 44px); }
.doc h2 { color: var(--ink); font-size: 21px; margin: 26px 0 8px; }
.doc p, .doc li { font-size: 17px; }
.doc ul { padding-left: 1.2em; margin: 0 0 14px; }
.doc li { margin: 4px 0; }
.doc a { color: var(--dusk); }
.doc-lede { font-size: 19px !important; color: var(--ink-soft); }
.doc-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid rgba(27, 33, 64, .15); }
.foot a { color: inherit; }

/* ---------- Two passes */

.pass-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.pass-grid .paper + .paper { margin-top: 0; }
.pass-grid .pass { display: flex; flex-direction: column; gap: 6px; }
.pass-grid .pass h3 { margin: 0; padding-right: 64px; }
.pass-grid .pass .btn { margin-top: auto; }
.pass .players { margin: 0 0 8px; font-size: 17px; }
.pass .players b { font-family: var(--display); font-size: 22px; }

@media (min-width: 560px) {
  .pass-grid { grid-template-columns: 1fr 1fr; }
}

.more-players { margin-top: 8px; }
.add-player { margin-top: 10px; font-size: 16px; }

/* ---------- Pasting a pass link */

.have-pass { margin-top: 18px; }
.have-pass label { display: block; font-size: 15px; margin-bottom: 6px; color: rgba(241, 245, 251, .85); }
.have-pass-row { display: flex; gap: 8px; }
.have-pass input {
  flex: 1;
  min-width: 0;
  font: 16px var(--body);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(241, 245, 251, .35);
  background: rgba(241, 245, 251, .08);
  color: var(--snow);
}
.have-pass .btn { min-height: 44px; padding: 8px 16px; font-size: 16px; }

/* ---------- Sign in, and Your family */

.have-pass h3 { font-size: 19px; margin: 0 0 4px; color: var(--snow); }
.have-pass form + form { margin-top: 12px; }
.signin-note { min-height: 1.4em; margin: 6px 0 0; font-size: 15px; color: rgba(241, 245, 251, .85); }

.members { list-style: none; margin: 14px 0 8px; padding: 0; }
.member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(27, 33, 64, .12);
  flex-wrap: wrap;
}
.member b { display: block; word-break: break-all; font-weight: 700; }
.tag { font-size: 14px; color: var(--ink-soft); }
.tag.joined { color: #1E7A5E; font-weight: 700; }
.member-actions { display: flex; gap: 14px; }
.member-actions .linklike { color: var(--dusk); font-size: 15px; }
.member-actions .danger { color: var(--stamp); }

.invite-ready {
  margin: 14px 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(111, 227, 193, .22);
  border: 1px solid rgba(30, 122, 94, .3);
}
.invite-ready p { margin: 0 0 8px; }
.invite-ready .btn-row { margin: 8px 0; }

.invite-form { margin-top: 14px; display: grid; gap: 8px; }
.invite-form label { font-weight: 700; }
.invite-form input[type=text] {
  font: 18px var(--body);
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid rgba(27, 33, 64, .2);
  background: #fff;
  color: var(--ink);
}
.invite-form .check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.invite-form .check input { width: 20px; height: 20px; }
.family .small { color: var(--ink-soft); font-size: 15px; }
