@font-face {
  font-family: "Real Beef";
  font-display: swap;
  src: url("../assets/fonts/REALBEEF.otf") format("opentype");
}

@font-face {
  font-family: "Lora";
  font-display: swap;
  font-style: normal;
  font-weight: 400;
  src: url("../assets/fonts/Lora-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-display: swap;
  font-style: italic;
  font-weight: 400;
  src: url("../assets/fonts/Lora-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-display: swap;
  font-style: normal;
  font-weight: 600;
  src: url("../assets/fonts/Lora-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-display: swap;
  font-style: normal;
  font-weight: 700 900;
  src: url("../assets/fonts/Lora-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-display: swap;
  font-style: italic;
  font-weight: 700 900;
  src: url("../assets/fonts/Lora-BoldItalic.woff2") format("woff2");
}

:root {
  --flag-blue: #41b6e6;
  --flag-red: #e4002b;
  --flag-white: #ffffff;
  --river-green: #00966c;
  --incorrect-pink: #f28095;
  --cta-white: #ffffff;
  --cta-gray: #565a5c;
  --cta-dark-gray: #000000;
  --ink: var(--cta-dark-gray);
  --paper: var(--flag-white);
  --paper-soft: var(--cta-white);
  --signal-red: var(--flag-red);
  --civic-blue: var(--flag-blue);
  --street-white: var(--cta-white);
  --map-gray: #c8cbcc;
  --muted: var(--cta-gray);
  --shadow: 0 24px 80px rgba(37, 40, 42, 0.16);
  --title-font: "Real Beef", Impact, "Arial Black", sans-serif;
  --secondary-font: "Lora", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--secondary-font);
  background: var(--paper);
}

.password-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}

body.app-unlocked .password-gate {
  display: none;
}

.noscript-panel {
  width: min(560px, calc(100% - 36px));
  margin: 24px auto 0;
  padding: 18px;
  border: 2px solid var(--ink);
  background: var(--paper-soft);
}

.gate-panel {
  width: min(560px, 100%);
  padding: clamp(20px, 5vw, 32px);
  border: 2px solid var(--ink);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.gate-copy {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
}

.beta-notes {
  margin: 0 0 20px;
  padding-left: 0;
  list-style: none;
  line-height: 1.5;
}

.beta-notes li {
  position: relative;
  padding-left: 28px;
}

.beta-notes li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 0;
  width: 14px;
  height: 16px;
  background: url("../assets/chicago-star-dark.svg") center / contain no-repeat;
}

.beta-notes li + li {
  margin-top: 8px;
}

.gate-form {
  display: grid;
  gap: 10px;
}

.gate-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.gate-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.gate-input {
  min-width: 0;
  min-height: 60px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.gate-error {
  min-height: 1.25rem;
  margin-bottom: 0;
  color: var(--signal-red);
  font-weight: 700;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 28px 18px 28px;
}

body.app-locked .app-shell {
  display: none;
}

.hero {
  max-width: 720px;
  margin: 0 auto 22px;
  text-align: center;
  animation: rise-in 500ms ease-out both;
}

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

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

h1 {
  margin-bottom: 8px;
  font-family: var(--title-font);
  font-size: clamp(3rem, 14vw, 7rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover,
.title-link:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--signal-red);
  text-underline-offset: 0.12em;
}

.lede {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  line-height: 1.35;
}

.beta-banner {
  max-width: 640px;
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: rgba(65, 182, 230, 0.14);
  font-size: 0.98rem;
  line-height: 1.4;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 22px;
  align-items: stretch;
  padding: clamp(16px, 3vw, 28px);
  border: 2px solid var(--ink);
  background: var(--flag-white);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: rise-in 650ms 80ms ease-out both;
}

.quiz-header {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
}

h2 {
  margin-bottom: 0;
  font-family: var(--title-font);
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0;
}

.attempts {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--civic-blue);
  font-weight: 900;
}

.map-panel {
  min-height: 420px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--map-gray);
}

.street-map rect {
  fill: var(--map-gray);
}

.street-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.streets path {
  stroke: var(--street-white);
  stroke-width: 12;
}

.streets .diagonal {
  stroke-width: 8;
  opacity: 0.82;
}

.streets .correct-street {
  stroke: var(--ink);
  stroke-width: 15;
}

.streets .incorrect-street {
  stroke: var(--incorrect-pink);
}

.map-panel.solved-ns .correct-ns,
.map-panel.solved-ew .correct-ew {
  stroke: var(--river-green);
}

.landmark {
  fill: var(--signal-red);
  stroke: var(--paper);
  stroke-width: 4;
}

.labels {
  opacity: 0;
  transition: opacity 180ms ease;
}

.labels-visible .labels {
  opacity: 1;
}

.labels text.revealed-label {
  opacity: 1;
}

.labels text {
  fill: var(--cta-gray);
  paint-order: stroke;
  stroke: var(--map-gray);
  stroke-width: 3px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 180ms ease;
}

.labels .label-ew {
  dominant-baseline: middle;
}

.labels-visible .labels text {
  opacity: 1;
}

.guess-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.answer-fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 900;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.column-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.option-list {
  display: grid;
  gap: 10px;
}

button {
  min-height: 60px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0;
}

.answer-option {
  min-height: 54px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-soft);
  text-align: left;
}

.answer-option.selected {
  color: var(--paper);
  background: var(--signal-red);
}

.answer-option.incorrect {
  color: var(--ink);
  background: var(--incorrect-pink);
}

.answer-option.correct {
  color: var(--cta-white);
  background: var(--river-green);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.feedback {
  min-height: 78px;
  padding: 16px;
  border: 2px dashed rgba(86, 90, 92, 0.5);
  color: var(--muted);
  background: var(--paper-soft);
  font-size: 1.1rem;
  line-height: 1.35;
}

.feedback p {
  margin-bottom: 0;
}

.feedback strong {
  color: var(--ink);
}

.result-pill {
  display: inline-block;
  margin: 0 4px 6px 0;
  padding: 3px 8px;
  color: var(--ink);
  font-weight: 900;
}

.result-correct {
  background: var(--river-green);
}

.result-incorrect {
  background: var(--incorrect-pink);
}

.puzzle-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.secondary-button {
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.site-footer {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 18px 30px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
  text-decoration-color: var(--signal-red);
  text-underline-offset: 0.18em;
}

@media (max-width: 760px) {
  .password-gate {
    padding-inline: 12px;
  }

  .gate-controls {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding-inline: 12px;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .quiz-header {
    display: grid;
  }

  .attempts {
    justify-self: start;
  }

  .map-panel,
  .street-map {
    min-height: 340px;
  }

  .answer-grid {
    gap: 10px;
  }

  .answer-option {
    min-height: 50px;
    font-size: 1rem;
  }

  .puzzle-actions {
    justify-content: stretch;
  }

  .secondary-button {
    flex: 1;
  }
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
