:root {
  color-scheme: dark;
  --ink: #f7f6f0;
  --ink-muted: #c8cac3;
  --ink-dim: #969a92;
  --canvas: #222421;
  --surface: #333333;
  --surface-raised: #3a3c38;
  --surface-soft: #2b2d2a;
  --line: #4b4f48;
  --line-strong: #686d64;
  --green: #79ad00;
  --green-bright: #95cf12;
  --green-deep: #587d00;
  --yellow: #ffed8d;
  --red: #f0645c;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --step--1: clamp(0.84rem, 0.81rem + 0.14vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.42rem);
  --step-2: clamp(1.56rem, 1.37rem + 0.92vw, 2.06rem);
  --step-3: clamp(2.15rem, 1.74rem + 2vw, 3.2rem);
  --shadow: 0 24px 70px rgb(0 0 0 / 0.3);
  --radius-small: 7px;
  --radius-medium: 12px;
  --radius-large: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  background:
    radial-gradient(circle at 12% 18%, rgb(121 173 0 / 0.12), transparent 24rem),
    radial-gradient(circle at 88% 58%, rgb(255 237 141 / 0.06), transparent 28rem),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgb(255 255 255 / 0.018) 80px
    ),
    var(--canvas);
}

button,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--yellow);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #fff5bd;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: #172000;
  font-weight: 700;
  background: var(--green-bright);
  border-radius: var(--radius-small);
  transform: translateY(-180%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgb(121 173 0 / 0.45);
}

.site-header__inner,
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 108px;
  gap: 2rem;
}

.site-logo {
  flex: 0 0 auto;
  width: clamp(204px, 22vw, 224px);
  height: auto;
}

.site-header__tagline {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.page-shell--centered {
  display: grid;
  min-height: calc(100vh - 260px);
  place-items: center;
  padding-block: clamp(3rem, 8vw, 7rem);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 6rem);
  padding: clamp(2.3rem, 5vw, 4.4rem) 0 clamp(1.8rem, 4vw, 3rem);
}

.eyebrow,
.game__overline,
.guess-panel__kicker {
  margin: 0 0 0.42rem;
  color: var(--green-bright);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.06;
}

.intro h1 {
  max-width: none;
  margin-bottom: 0;
  font-size: var(--step-3);
  letter-spacing: -0.025em;
}

.intro__copy {
  max-width: 42rem;
  margin: 0 0 0.25rem;
  color: var(--ink-muted);
  font-size: var(--step-0);
}

.game {
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(3.5rem, 7vw, 6rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.game__accent {
  height: 6px;
  background:
    linear-gradient(90deg, var(--green) 0 68%, var(--yellow) 68% 76%, var(--line) 76%);
}

.game__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.65rem 2rem 1.35rem;
}

.game__header h2 {
  margin: 0;
  font-size: var(--step-2);
  outline: none;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  min-width: min(100%, 440px);
  margin: 0;
}

.scoreboard div {
  padding: 0.15rem 1.1rem;
  border-left: 1px solid var(--line);
}

.scoreboard dt {
  color: var(--ink-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scoreboard dd {
  margin: 0.12rem 0 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scoreboard__points dd {
  color: var(--yellow);
  font-size: 1.38rem;
}

.progress-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem 1.5rem;
}

.progress-row progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  appearance: none;
  background: var(--surface-soft);
  border: 0;
  border-radius: 0;
}

.progress-row progress::-webkit-progress-bar {
  background: var(--surface-soft);
}

.progress-row progress::-webkit-progress-value {
  background: var(--green);
  transition: width 220ms ease;
}

.progress-row progress::-moz-progress-bar {
  background: var(--green);
}

.progress-row span {
  color: var(--ink-dim);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.game__body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr);
  border-top: 1px solid var(--line);
}

.clue-region {
  min-width: 0;
  padding: 0.55rem 2rem 1.2rem;
}

.clue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.clue {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.4rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  animation: clue-in 260ms ease both;
}

.clue:last-child {
  border-bottom: 0;
}

.clue__number {
  color: var(--green-bright);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.clue__label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink-dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.clue__text {
  margin: 0;
  color: var(--ink);
}

.clue--locked {
  opacity: 0.52;
}

.clue--locked .clue__number {
  color: var(--ink-dim);
}

.clue--locked .clue__text {
  color: var(--ink-dim);
  font-style: italic;
}

.inline-media-link,
.text-button {
  margin: 0;
  padding: 0;
  color: var(--yellow);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.inline-media-link:hover,
.text-button:hover {
  color: #fff7c8;
}

.guess-panel {
  padding: 2rem;
  background:
    linear-gradient(165deg, rgb(121 173 0 / 0.15), transparent 45%),
    var(--surface-soft);
  border-left: 1px solid var(--line);
}

.guess-panel h3 {
  margin-bottom: 0.55rem;
  font-size: var(--step-2);
}

.guess-panel__hint {
  margin: 0 0 1.45rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.guess-panel form {
  display: grid;
  gap: 0.7rem;
}

.guess-panel label {
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 50px;
  padding: 0.72rem 2.7rem 0.72rem 0.85rem;
  color: #20221f;
  background: #f5f4ed;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
}

select:focus {
  border-color: var(--green-bright);
}

select:disabled {
  color: var(--ink-dim);
  background: var(--surface-raised);
  cursor: not-allowed;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.74rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button--primary {
  color: #172000;
  background: var(--green-bright);
  border-color: var(--green-bright);
}

.button--primary:hover:not(:disabled) {
  color: #111700;
  background: #a7df23;
  border-color: #a7df23;
}

.button--secondary {
  gap: 0.35rem;
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.button--secondary:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--green-bright);
}

.guess-panel__actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.feedback {
  min-height: 3.15rem;
  margin: 1rem 0 0.45rem;
  padding: 0.72rem 0;
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 600;
  border-top: 1px solid var(--line);
}

.feedback:empty {
  border-top-color: transparent;
}

.feedback[data-tone="success"] {
  color: var(--green-bright);
}

.feedback[data-tone="error"] {
  color: #ff9b94;
}

.feedback[data-tone="warning"] {
  color: var(--yellow);
}

.text-button {
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.site-footer {
  margin-top: auto;
  color: var(--ink-muted);
  background: #1b1d1a;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding: 1.6rem 0 1.8rem;
  text-align: center;
}

.site-footer__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-size: var(--step--1);
}

.site-footer p {
  margin: 0.65rem auto 0;
  font-size: 0.82rem;
}

.media-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  box-shadow: 0 30px 110px rgb(0 0 0 / 0.7);
}

.media-dialog::backdrop {
  background: rgb(13 14 12 / 0.84);
  backdrop-filter: blur(5px);
}

.media-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.media-dialog__header h2 {
  margin: 0;
  font-size: var(--step-1);
}

.dialog-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  cursor: pointer;
  place-items: center;
}

.dialog-close:hover {
  border-color: var(--green-bright);
}

.media-dialog__body {
  display: grid;
  min-height: 220px;
  background: #111210;
  place-items: center;
}

.media-dialog__body img {
  width: auto;
  max-width: 100%;
  max-height: min(70dvh, 680px);
  height: auto;
}

.media-dialog__source {
  min-height: 1.5rem;
  margin: 0;
  padding: 0.8rem 1.2rem 1rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.result-panel,
.media-page,
.not-found {
  position: relative;
  width: min(760px, 100%);
  overflow: hidden;
  padding: clamp(2rem, 7vw, 5rem);
  text-align: center;
  background:
    linear-gradient(135deg, rgb(121 173 0 / 0.17), transparent 45%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.result-panel::before,
.media-page::before,
.not-found::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  content: "";
  background: var(--green);
}

.result-panel h1,
.media-page h1,
.not-found h1 {
  margin-bottom: 1.4rem;
  font-size: var(--step-3);
}

.result-score {
  display: grid;
  width: min(330px, 100%);
  margin: 2rem auto;
  padding: 1.2rem 1rem;
  background: var(--surface-soft);
  border-block: 1px solid var(--line);
}

.result-score__label {
  color: var(--ink-dim);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-score strong {
  color: var(--green-bright);
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.result-score small {
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 1rem;
}

.result-status {
  margin: 0 auto 1.5rem;
  color: var(--ink-muted);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.media-page {
  width: min(960px, 100%);
}

.media-page__frame {
  display: grid;
  width: 100%;
  min-height: 240px;
  margin: 1.5rem auto 0;
  overflow: hidden;
  background: #111210;
  border: 1px solid var(--line);
  place-items: center;
}

.media-page__frame img {
  width: auto;
  max-width: 100%;
  max-height: 68dvh;
  height: auto;
}

.media-page__source {
  min-height: 1.6rem;
  margin: 0.8rem auto 1.5rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.media-page__message,
.not-found > p:not(.eyebrow) {
  color: var(--ink-muted);
}

.not-found .button {
  margin-top: 1rem;
}

.noscript-message {
  padding: 1rem;
  color: var(--yellow);
  border: 1px solid var(--line);
}

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

@keyframes clue-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }

  .intro__copy {
    max-width: 52rem;
  }

  .game__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .scoreboard {
    width: 100%;
  }

  .scoreboard div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .game__body {
    grid-template-columns: 1fr;
  }

  .guess-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .site-header__inner,
  .page-shell,
  .site-footer__inner {
    width: min(100% - 28px, 1180px);
  }

  .site-header__inner {
    min-height: 96px;
    gap: 1rem;
  }

  .site-logo {
    width: min(202px, 64vw);
  }

  .site-header__tagline {
    display: none;
  }

  .intro {
    padding: 2rem 0 1.5rem;
  }

  .intro h1 {
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  .game {
    margin-bottom: 3.5rem;
    border-radius: var(--radius-medium);
  }

  .game__header {
    gap: 1.35rem;
    padding: 1.35rem 1.1rem 1.1rem;
  }

  .scoreboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .scoreboard div {
    min-width: 0;
    padding: 0.1rem 0.5rem;
  }

  .scoreboard dt {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
  }

  .scoreboard dd,
  .scoreboard__points dd {
    font-size: 0.95rem;
  }

  .progress-row {
    padding: 0 1.1rem 1.2rem;
  }

  .progress-row span {
    display: none;
  }

  .clue-region {
    padding: 0.25rem 1.1rem 0.7rem;
  }

  .clue {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    padding: 1rem 0;
  }

  .clue__number {
    font-size: 1.05rem;
  }

  .guess-panel {
    padding: 1.35rem 1.1rem 1.5rem;
  }

  .button {
    width: 100%;
  }

  .site-footer__inner {
    padding-block: 1.4rem;
  }

  .site-footer__line {
    align-items: center;
    flex-direction: column;
    gap: 0.2rem;
  }

  .site-footer__line span[aria-hidden="true"] {
    display: none;
  }

  .media-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .result-panel,
  .media-page,
  .not-found {
    padding: 2.4rem 1.1rem 2rem;
    border-radius: var(--radius-medium);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
