:root {
  --ink: #244e47;
  --muted: #6e827c;
  --paper: #fffcf5;
  --cream: #f7efdf;
  --line: #decfac;
  --green: #4b9d7d;
  --green-dark: #28725c;
  --terracotta: #c7794e;
  --violet: #746d94;
  --gold: #e5b552;
  --error: #dc6e62;
  --shadow: 0 15px 0 rgba(113, 93, 59, 0.16);
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 11%, rgba(230, 183, 89, 0.12), transparent 27%),
    radial-gradient(circle at 92% 18%, rgba(75, 157, 125, 0.13), transparent 30%),
    linear-gradient(145deg, #fff9ec, #f7f4e9 52%, #edf6ed);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(65, 101, 87, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  pointer-events: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(226, 171, 69, 0.58);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
}

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 54px;
}

.topbar,
.brand,
.sound-button,
.hero-actions,
.counter,
.section-heading,
.route-head,
.route-foot,
.game-top,
.progress-wrap,
.choices-heading,
.feedback,
.game-actions,
.result-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(93, 74, 45, 0.12);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  max-width: 230px;
  font-family: Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.11em;
  line-height: 1.05;
}

.brand small {
  margin-top: 3px;
  color: #8c6b43;
  font-size: 11px;
}

.sound-button,
.secondary-button,
.hint-button,
.small-button {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.9);
}

.sound-button {
  min-height: 48px;
  gap: 8px;
  padding: 8px 16px;
}

.sound-button b {
  font-size: 14px;
}

.hero,
.game-shell,
.result-card,
.catalogue {
  border: 3px solid var(--line);
  border-radius: 36px;
  background: rgba(255, 252, 245, 0.96);
}

.hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  min-height: 500px;
  overflow: hidden;
  box-shadow: 0 24px 40px rgba(71, 77, 58, 0.12);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 44px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8e6941;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1.08;
}

h1 {
  max-width: 650px;
  margin-bottom: 16px;
  font-size: clamp(42px, 5.1vw, 62px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 45px);
}

h3 {
  margin-bottom: 12px;
  font-size: 27px;
}

.lead,
.hero-copy > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.primary-button {
  min-height: 58px;
  padding: 14px 24px;
  border: 0;
  border-radius: 17px;
  background: var(--green);
  box-shadow: 0 8px 0 var(--green-dark);
  color: white;
  font-size: 18px;
  font-weight: 800;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: #419370;
}

.primary-button:active {
  box-shadow: 0 3px 0 var(--green-dark);
}

.secondary-button,
.hint-button,
.small-button {
  min-height: 48px;
  padding: 11px 18px;
  color: var(--ink);
  font-weight: 800;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.secondary-button:hover,
.hint-button:hover {
  border-color: #bfa673;
  background: #fff7e8;
}

.small-button:hover {
  border-color: transparent;
  background: #419370;
  color: white;
}

.counter {
  gap: 10px;
  margin-top: 28px;
}

.counter strong {
  font-family: Georgia, serif;
  font-size: 36px;
}

.counter span {
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  display: grid;
  min-height: 500px;
  padding: 44px 32px;
  place-items: center;
  background: linear-gradient(145deg, #e2eee8, #f6e3bd);
}

.museum-scene {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 16px rgba(80, 70, 48, 0.16));
}

.ticket {
  position: absolute;
  right: 28px;
  bottom: 26px;
  padding: 13px 18px;
  border: 2px solid #aa7650;
  background: #fff5d9;
  box-shadow: 5px 6px 0 rgba(110, 74, 45, 0.14);
  color: #765235;
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.15;
  transform: rotate(-4deg);
}

.museum-note {
  display: flex;
  gap: 16px;
  margin: 24px 0 48px;
  padding: 20px 24px;
  border: 2px solid #e0c676;
  border-radius: 24px;
  background: #fff5cf;
}

.museum-note > span {
  color: var(--green-dark);
  font-size: 28px;
}

.museum-note p {
  margin: 0;
  color: #6c6b5e;
  line-height: 1.45;
}

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

.section-heading {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading > p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.section-heading > strong {
  color: var(--green-dark);
  font-family: Georgia, serif;
  font-size: 28px;
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.route-card {
  display: flex;
  min-width: 0;
  min-height: 350px;
  flex-direction: column;
  padding: 24px;
  border: 3px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.route-1 {
  background: linear-gradient(145deg, #fffdf4, #f3e7d3);
}

.route-2 {
  background: linear-gradient(145deg, #f1faf3, #e5f0ea);
}

.route-3 {
  background: linear-gradient(145deg, #fbf8ff, #eee8f6);
}

.route-head {
  justify-content: space-between;
  margin-bottom: 25px;
}

.route-head > span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid #dce8df;
  border-radius: 17px;
  background: white;
  color: var(--green-dark);
  font-size: 25px;
}

.route-head b {
  color: var(--muted);
  font-size: 13px;
}

.route-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.route-foot {
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px dashed #d8ccb6;
}

.route-foot small {
  max-width: 140px;
  color: #8a775e;
  font-family: Georgia, serif;
  font-weight: 700;
}

.small-button {
  flex: 0 0 auto;
  border-color: transparent;
  background: var(--green);
  color: white;
}

.catalogue {
  margin-top: 64px;
  padding: 30px;
}

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

.catalogue-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5dac3;
  border-radius: 14px;
  background: #f3efe7;
  color: #958e82;
}

.catalogue-item.is-open {
  border-color: #bad9ca;
  background: #ecf7ef;
  color: var(--ink);
}

.catalogue-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #ded8cc;
  font-weight: 800;
}

.catalogue-item.is-open > span {
  background: var(--green);
  color: white;
}

.catalogue-item small,
.catalogue-item b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-item small {
  margin-bottom: 2px;
  font-size: 11px;
}

.catalogue-item b {
  font-size: 13px;
}

.game-shell {
  padding: 30px;
  box-shadow: 0 22px 42px rgba(71, 77, 58, 0.12);
}

.game-top {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.game-top h1 {
  margin-bottom: 0;
  font-size: clamp(40px, 5vw, 58px);
}

.progress-wrap {
  min-width: 330px;
  gap: 14px;
}

.progress-track {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3ded3;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 220ms ease;
}

.exhibit-layout {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 20px;
  margin-bottom: 30px;
}

.showcase,
.research-card {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 28px;
}

.showcase {
  position: relative;
  display: grid;
  min-height: 400px;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.4), transparent),
    linear-gradient(160deg, #dfece4, #d8c49e);
}

.showcase::before {
  position: absolute;
  right: 10%;
  bottom: 28px;
  left: 10%;
  height: 28px;
  border-radius: 50%;
  background: rgba(57, 73, 64, 0.2);
  content: "";
  filter: blur(8px);
}

.case-label {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #315b51;
  color: white;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.inventory-number {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: #6c5d49;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.artifact-stage {
  position: relative;
  z-index: 1;
  width: min(260px, 80%);
  padding-top: 24px;
}

.artifact-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 10px rgba(58, 54, 44, 0.22));
}

.research-card {
  display: flex;
  min-height: 400px;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  background: var(--paper);
}

.research-card h2 {
  font-size: clamp(27px, 3.2vw, 38px);
  line-height: 1.2;
}

.question {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: 10px;
  padding: 17px;
  border: 2px solid #e5c674;
  border-radius: 18px;
  background: #fff4cb;
  line-height: 1.35;
}

.question > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #563f22;
  font-size: 23px;
  font-weight: 900;
}

.choices-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.choices-heading h2 {
  margin-bottom: 0;
  font-size: 34px;
}

.choices-heading > p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.choice-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 190px;
  grid-template-rows: auto 1fr;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px 10px;
  align-items: start;
  padding: 18px;
  border: 3px solid #ded8ca;
  border-radius: 23px;
  background: white;
  box-shadow: 0 8px 0 rgba(106, 91, 61, 0.14);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.choice-card:hover:not(:disabled) {
  border-color: #9fcab7;
  background: #f5fbf7;
}

.choice-card:active:not(:disabled) {
  box-shadow: 0 4px 0 rgba(106, 91, 61, 0.14);
}

.choice-number {
  display: grid;
  width: 44px;
  height: 44px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 50%;
  background: #e8eee8;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
}

.choice-stamp {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 99px;
  background: #f1eadb;
  color: #8b6949;
  font-size: 12px;
  font-weight: 800;
}

.choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.choice-copy b {
  font-size: 19px;
  line-height: 1.23;
}

.choice-copy small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.choice-card.is-wrong {
  border-color: #e3958d;
  background: #fff0ed;
}

.choice-card.is-hinted {
  border-color: #d7ae4f;
  box-shadow: 0 0 0 5px rgba(229, 181, 82, 0.2), 0 8px 0 rgba(106, 91, 61, 0.14);
}

.choice-card.is-correct {
  border-color: #66a88d;
  background: #edf8f1;
  box-shadow: 0 8px 0 rgba(49, 112, 85, 0.25);
}

.feedback {
  gap: 18px;
  margin-top: 24px;
  padding: 22px 24px;
  border: 3px solid;
  border-radius: 25px;
}

.feedback > span {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: white;
  font-size: 32px;
  font-weight: 900;
}

.feedback > div {
  min-width: 0;
  flex: 1;
}

.feedback strong {
  display: block;
  margin-bottom: 5px;
  font-size: 21px;
}

.feedback p,
.feedback small {
  display: block;
  margin: 0;
  color: #5f766f;
  line-height: 1.45;
}

.feedback small {
  margin-top: 6px;
  font-size: 13px;
}

.feedback.error {
  border-color: #e1958d;
  background: #fff0ed;
}

.feedback.error > span {
  background: var(--error);
}

.feedback.hint {
  border-color: #e0bd69;
  background: #fff7db;
}

.feedback.hint > span {
  background: var(--gold);
  color: #67481d;
}

.feedback.success {
  border-color: #85bba2;
  background: #edf8f1;
}

.feedback.success > span {
  background: var(--green);
}

.feedback .primary-button {
  min-width: 220px;
}

.game-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.hint-button:disabled {
  opacity: 0.45;
}

.result-card {
  padding: 50px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(71, 77, 58, 0.13);
}

.result-banner {
  margin-bottom: 28px;
  padding: 24px;
  border-radius: 24px;
  background: var(--ink);
  color: white;
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.result-card h1 {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.result-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.stars {
  margin: 28px 0;
  color: #ddd4c2;
  font-size: 58px;
  letter-spacing: 8px;
}

.stars .is-on {
  color: var(--gold);
  text-shadow: 0 5px 0 #c98c2e;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 32px;
}

.result-stats > div {
  padding: 20px;
  border: 2px solid #dbe6dc;
  border-radius: 20px;
  background: #f0f7ee;
}

.result-stats strong,
.result-stats span {
  display: block;
}

.result-stats strong {
  font-family: Georgia, serif;
  font-size: 34px;
}

.result-stats span {
  margin-top: 5px;
  color: var(--muted);
}

.result-actions {
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: auto;
  }

  .routes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-card:last-child {
    grid-column: 1 / -1;
  }

  .catalogue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-top,
  .choices-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-wrap {
    width: 100%;
    min-width: 0;
  }

  .exhibit-layout {
    grid-template-columns: 1fr;
  }

  .showcase {
    min-height: 340px;
  }

  .research-card {
    min-height: 0;
  }

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

  .choice-card {
    min-height: 130px;
  }

  .choices-heading > p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .topbar {
    align-items: stretch;
  }

  .brand strong {
    max-width: 175px;
    font-size: 13px;
  }

  .brand small {
    font-size: 10px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .sound-button {
    width: 50px;
    min-width: 50px;
    padding: 8px;
  }

  .sound-button b {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .hero,
  .game-shell,
  .result-card,
  .catalogue {
    border-radius: 26px;
  }

  .hero-copy {
    padding: 34px 24px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 31px;
  }

  .hero-actions,
  .hero-actions button {
    width: 100%;
  }

  .hero-visual {
    padding: 26px 14px;
  }

  .ticket {
    right: 18px;
    bottom: 18px;
    font-size: 12px;
  }

  .museum-note {
    margin-bottom: 40px;
    padding: 18px;
  }

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

  .section-heading > p {
    max-width: none;
    text-align: left;
  }

  .routes-grid,
  .catalogue-grid {
    grid-template-columns: 1fr;
  }

  .route-card:last-child {
    grid-column: auto;
  }

  .route-card {
    min-height: 320px;
  }

  .catalogue {
    padding: 22px 16px;
  }

  .game-shell {
    padding: 20px 14px;
  }

  .game-top h1 {
    font-size: 39px;
  }

  .showcase {
    min-height: 310px;
  }

  .research-card {
    padding: 24px 18px;
  }

  .research-card h2 {
    font-size: 26px;
  }

  .question {
    align-items: flex-start;
  }

  .choice-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 16px;
  }

  .choice-number {
    width: 40px;
    height: 40px;
  }

  .feedback {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 19px;
  }

  .feedback > span {
    width: 48px;
    height: 48px;
  }

  .feedback .primary-button {
    width: 100%;
    min-width: 0;
    margin-top: 4px;
  }

  .game-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .game-actions button {
    width: 100%;
  }

  .result-card {
    padding: 30px 18px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .stars {
    font-size: 44px;
  }
}

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