:root {
  color-scheme: light;
  --paper: #f7f1e5;
  --forest: #17372e;
  --brick: #9f302e;
  --gold: #ba8b47;
  --text-muted: #4a5a50;
  --rule: #a69e8c;
  --serif: Baskerville, "Times New Roman", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--forest);
  font: 1rem/1.5 var(--sans);
}

:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 5px;
}

.page {
  width: min(100% - 5rem, 74rem);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin-inline: auto;
}

.masthead, .footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-color: var(--rule);
  border-style: solid;
  border-width: 0;
}

.masthead {
  padding-block: 1rem 0.85rem;
  border-bottom-width: 1px;
}

.wordmark {
  font: 700 clamp(1.7rem, 3vw, 2.45rem)/1 var(--serif);
  letter-spacing: -0.07em;
}

.place, .eyebrow, .demo {
  font-size: 0.875rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game {
  flex: 1;
  min-height: 33rem;
  display: grid;
  grid-template-areas:
    "intro scene"
    "play scene";
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.16fr);
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  gap: 1.4rem clamp(1.25rem, 4vw, 4.25rem);
  padding-block: clamp(2.2rem, 5vw, 5.25rem);
}

.intro { grid-area: intro; align-self: end; }

.demo {
  display: table;
  margin: 0 0 1.2rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  color: var(--brick);
  letter-spacing: 0.07em;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--brick);
}

h1 {
  margin: 0;
  font: 400 clamp(4.2rem, 7.5vw, 7.4rem)/0.82 var(--serif);
  letter-spacing: -0.067em;
}

h1 em {
  display: block;
  color: var(--brick);
  font-weight: 400;
}

.lead {
  max-width: 29ch;
  margin: 1.45rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.45vw, 1.22rem);
}

.scene {
  grid-area: scene;
  width: 100%;
  margin: 0;
  border: 1px solid #c1b6a1;
  background: #efe7d6;
}

.scene canvas {
  display: block;
  width: 100%;
  aspect-ratio: 600 / 510;
}

.participation {
  grid-area: play;
  align-self: start;
  max-width: 29rem;
}

.play {
  min-height: 3.25rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid var(--forest);
  border-radius: 0.15rem;
  background: var(--forest);
  color: var(--paper);
  font: 700 1rem/1.2 var(--sans);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.play:hover:enabled { background: #295043; border-color: #295043; }
.play:disabled, .play[aria-disabled="true"] { opacity: 0.66; cursor: default; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.play.play-outline { background: transparent; color: var(--forest); }
.play.play-outline:hover:enabled { background: #e8dfce; border-color: var(--forest); }
.prize-instruction {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.play[hidden] + .prize-instruction { display: none; }
.status { margin-block: 0 1rem; }
.status-title {
  margin: 0;
  font: 700 clamp(1.35rem, 2.8vw, 2.05rem)/1.1 var(--serif);
}
.status[data-kind="win"] .status-title { color: var(--brick); }
.status-message { margin: 0.45rem 0 0; color: var(--text-muted); }
.status-message:empty { display: none; }
.claim-code-block {
  display: table;
  max-width: 100%;
  margin: 0.8rem 0 0;
  padding: 0.48rem 0.75rem;
  border: 1px dashed var(--brick);
}
.claim-code-label {
  margin: 0 0 0.2rem;
  color: var(--forest);
  font-size: 0.875rem;
  font-weight: 700;
}
.claim-code {
  margin: 0;
  color: var(--brick);
  font: 700 clamp(1.05rem, 2.7vw, 1.35rem)/1.25 ui-monospace, Menlo, monospace;
  letter-spacing: 0.07em;
  overflow-wrap: anywhere;
}
.instagram-actions { margin-top: 0.75rem; }
.instagram-actions a {
  display: inline-block;
  min-height: 2rem;
  color: var(--brick);
  font-weight: 750;
  text-underline-offset: 0.2em;
}
.instagram-follow-up {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.instagram-follow-up p { margin: 0; }
.stay-here {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.footer {
  padding-block: 0.9rem 1.2rem;
  border-top-width: 1px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.footer details { flex: 1; }
.footer summary { width: fit-content; font-weight: 650; cursor: pointer; }
.footer p { max-width: 58ch; margin: 0.65rem 0 0; color: var(--text-muted); }
.footer a { color: var(--text-muted); text-underline-offset: 0.19em; }

@media (max-width: 750px) {
  .page { width: min(100% - 2rem, 33rem); }
  .game {
    grid-template-areas: "intro" "scene" "play";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.12rem;
    padding-block: 1.55rem 2rem;
  }
  h1 { font-size: clamp(3.55rem, 12vw, 5.55rem); line-height: 0.87; }
  h1 em { display: inline; }
  .title-break { display: none; }
  .lead { max-width: unset; margin-top: 0.9rem; }
  .scene { max-width: 26rem; margin-inline: auto; }
  .participation { max-width: unset; }
  .play { width: 100%; }
  .demo-actions .play { flex: 1; width: auto; padding-inline: 0.6rem; }
}

@media (max-width: 355px) {
  h1 em { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .play { transition: none; }
}
