@font-face {
  font-family: 'Archivo';
  src: url('fonts/Archivo-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('fonts/Archivo-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #686868;
  --paper: #f5f4ef;
  --card: #ffffff;
  --line: #deddd6;
  --accent: #ffca0a;
  --accent-dark: #d7a800;
  /* Red is a signal colour, not a background. Three uses per screen, and
     never on black: it reads ~5:1 on paper and ~2.4:1 on the dark card. */
  --red: #c8102e;
  --red-dark: #9c0c23;
  --special: #14733b;
  font-family: 'Archivo', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
select {
  font: inherit;
}

.shell {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 48px 0 32px;
}

.intro {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.7rem, 13vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(1.6rem, 7vw, 2.25rem);
  letter-spacing: -0.035em;
}

.lede {
  max-width: 38rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.card {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 24px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.06);
}

.date-fields {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #a9a9a4;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

/* Password gate. Matches the select styling so the door looks like the rest
   of the app rather than a bolted-on login form. */
.gate-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #a9a9a4;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
}

.gate-input::placeholder {
  color: #8d8d88;
  opacity: 1;
}

select:focus,
.gate-input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.status.is-error {
  color: var(--red);
  font-weight: 800;
}

/* The only place the small print lives. Everything else in the app is behind
   the door, so the disclaimers are read once, here, on the way in. */
.fine-print {
  padding: 16px 2px 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.fine-print p {
  margin: 0 0 7px;
}

.fine-print p:last-child {
  margin-bottom: 0;
}

.fine-print a {
  color: var(--red);
  font-weight: 800;
}

button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 2px solid var(--red);
  border-radius: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.question {
  margin: 24px 0 0;
  border: 0;
  padding: 0;
}

.question legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 900;
}

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

.choice {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice span {
  display: grid;
  min-height: 58px;
  margin-bottom: 0;
  place-items: center;
  border: 1px solid #a9a9a4;
  background: #fff;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.choice input:checked + span {
  border: 3px solid var(--ink);
  background: #fff3b8;
  padding: 8px;
}

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

/* Loading state. Roughly a minute of waiting, so it needs to look alive. */
.loading {
  margin-top: 18px;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.loading-icon {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  height: 34px;
}

.loading-icon svg {
  width: 30px;
  height: 30px;
  fill: var(--red);
  animation: coin-pulse 1.6s ease-in-out infinite;
}

.loading-text {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.loading-track {
  height: 10px;
  margin-top: 10px;
  border: 2px solid var(--ink);
  background: #fff;
}

.loading-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}

@keyframes coin-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.75; }
}

/* Hold still for anyone who asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  .loading-icon svg {
    animation: none;
  }

  .loading-bar {
    transition: none;
  }
}

.status {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card {
  scroll-margin-top: 16px;
}

/* The McName is the only sign label on the result screen now, so it carries
   the red instead of the eyebrow that used to sit above it. */
#result-title {
  color: var(--red);
}

.back-button {
  width: auto;
  min-height: 44px;
  margin: 0 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  text-align: left;
  font-weight: 800;
}

.back-button:hover {
  background: transparent;
  text-decoration: underline;
}

.special {
  display: inline-block;
  margin-bottom: 14px;
  background: #def4e5;
  color: var(--special);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mascot {
  margin-bottom: 22px;
  color: var(--muted);
  font-weight: 700;
}

.order-box {
  margin-top: 24px;
  border-left: 7px solid var(--red);
  background: #fff9d9;
  padding: 16px;
}

.order-box span,
.order-box strong {
  display: block;
}

.order-box span {
  margin-bottom: 5px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.order-box strong {
  font-size: 1.25rem;
}

.source {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

a {
  color: inherit;
}

footer {
  padding: 10px 2px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

@media (min-width: 560px) {
  .shell {
    padding-top: 72px;
  }

  .card {
    padding: 34px;
  }

  .date-fields {
    grid-template-columns: 2fr 1fr;
  }
}

.mascot-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  /* No CSS border. Both images carry a baked 28px yellow frame from
     mc_frame_image() / mc_render_text_card(), so a border here would double it. */
  border: 0;
  margin: 14px 0 4px;
  background: #171717;
}

.text-card-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  /* No CSS border. Both images carry a baked 28px yellow frame from
     mc_frame_image() / mc_render_text_card(), so a border here would double it. */
  border: 0;
  margin: 18px 0 4px;
  background: #171717;
}

/* Out of quarters. The coin is a transparent PNG, so it sits on paper rather
   than the black the mascot images use, otherwise its drop shadow shows. */
.coin-screen {
  padding-top: 32px;
  text-align: center;
}

.coin-screen .coin {
  display: block;
  width: min(72%, 320px);
  height: auto;
  margin: 0 auto 28px;
}

.coin-screen h1 {
  margin-bottom: 14px;
  color: var(--red);
}

.coin-line {
  max-width: 26rem;
  margin: 0 auto;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
}

/* Coin standing in for a failed mascot image, inside the usual yellow frame. */
.mascot-image.coin-slot {
  background: var(--paper);
  padding: 24px;
}

.save-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
