:root {
  --ink: #244f47;
  --muted: #71827c;
  --paper: #fffdf7;
  --cream: #fbf3df;
  --line: #dfd1ad;
  --green: #4da27f;
  --green-dark: #28735d;
  --gold: #dfa840;
  --red: #d96559;
  --blue: #387fae;
  --shadow: 0 13px 0 rgba(103, 87, 55, 0.15);
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

* {
  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 10% 10%, rgba(228, 173, 65, 0.13), transparent 27%),
    radial-gradient(circle at 92% 16%, rgba(77, 162, 127, 0.14), transparent 30%),
    linear-gradient(145deg, #fff9ed, #f9f5e9 52%, #edf6ec);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(70, 103, 91, 0.1) 1px, transparent 1px);
  background-size: 25px 25px;
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(224, 166, 58, 0.55);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
}

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

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

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

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

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

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

.topbar,
.brand,
.top-actions,
.hero-actions,
.hero-progress,
.section-heading,
.route-foot,
.game-head,
.progress-wrap,
.art-label,
.feedback,
.game-actions,
.result-actions,
.gallery-head,
.gallery-copy,
.gallery-actions {
  display: flex;
  align-items: center;
}

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

.brand {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.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(89, 72, 43, 0.13);
  font-size: 26px;
}

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

.brand strong {
  font-family: Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.08em;
}

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

.top-actions {
  gap: 10px;
}

.top-button,
.secondary-button,
.hint-button,
.delete-button {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink);
  font-weight: 800;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.top-button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 14px;
}

.top-button b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #e6f2e9;
  font-size: 12px;
}

.top-button:hover,
.secondary-button:hover,
.hint-button:hover {
  border-color: #b99d65;
  background: #fff7e5;
}

.primary-button,
.start-button {
  min-height: 56px;
  padding: 13px 23px;
  border: 0;
  border-radius: 17px;
  background: var(--green);
  box-shadow: 0 8px 0 var(--green-dark);
  color: white;
  font-size: 18px;
  font-weight: 900;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover,
.start-button:hover {
  background: #429470;
  color: white;
}

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

.secondary-button,
.hint-button {
  padding: 11px 18px;
}

.hero,
.game-shell,
.result-shell,
.gallery-head {
  border: 3px solid var(--line);
  border-radius: 36px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 24px 42px rgba(72, 78, 61, 0.12);
}

.hero {
  display: grid;
  min-height: 490px;
  grid-template-columns: 1.03fr 0.97fr;
  overflow: hidden;
}

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

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

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

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

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

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

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

.hero-art {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 28px;
  background: linear-gradient(145deg, #e2f0e6, #f6e2bd);
}

.hero-art .collection-svg {
  width: 100%;
  max-width: 520px;
}

.art-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 11px rgba(52, 59, 49, 0.16));
}

.culture-note {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 24px 0 50px;
  padding: 20px 24px;
  border: 2px solid #dfc16d;
  border-radius: 24px;
  background: #fff4cc;
}

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

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

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

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

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

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

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

.route-card {
  display: flex;
  min-width: 0;
  min-height: 365px;
  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, #fff7e6, #f6e6d1);
}

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

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

.route-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  place-items: center;
  border: 3px solid rgba(79, 145, 118, 0.24);
  border-radius: 18px;
  background: white;
  font-size: 28px;
}

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

.route-place {
  margin: 18px 0;
  color: #886942;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.route-foot {
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px dashed #d7cab0;
}

.route-foot > span {
  color: #8b7558;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.start-button {
  min-height: 48px;
  padding: 10px 17px;
  box-shadow: none;
  font-size: 15px;
}

.start-button:active {
  box-shadow: none;
}

.game-shell {
  padding: 30px;
}

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

.game-head h1 {
  margin-bottom: 0;
  font-size: clamp(38px, 4.6vw, 56px);
}

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

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

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

.studio-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 20px;
}

.art-panel,
.task-panel {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 28px;
}

.art-panel {
  overflow: hidden;
  background: linear-gradient(150deg, #dfede5, #f6e7c6);
}

.art-label {
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 253, 247, 0.76);
}

.art-label strong {
  font-family: Georgia, serif;
}

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

.art-stage {
  display: grid;
  min-height: 440px;
  padding: 30px;
  place-items: center;
}

.art-stage .art-svg {
  width: min(100%, 410px);
}

.task-panel {
  display: flex;
  min-height: 512px;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  background: var(--paper);
}

.task-panel h2 {
  font-size: clamp(28px, 3.4vw, 39px);
}

.choices-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.choice-card {
  display: grid;
  min-width: 0;
  min-height: 92px;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 3px solid #ded8ca;
  border-radius: 21px;
  background: white;
  box-shadow: 0 7px 0 rgba(104, 88, 59, 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: #91c3ae;
  background: #f2faf5;
}

.choice-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  background: #edf1ea;
  color: #7a654a;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.choice-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.choice-card.is-hinted {
  border-color: #d8ae4e;
  background: #fff8df;
  box-shadow: 0 0 0 5px rgba(223, 168, 64, 0.18), 0 7px 0 rgba(104, 88, 59, 0.14);
}

.choice-card.is-correct {
  border-color: #63a78a;
  background: #edf8f1;
  box-shadow: 0 7px 0 rgba(40, 115, 93, 0.2);
}

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

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

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

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

.feedback p {
  margin: 0;
  color: #5f756e;
  line-height: 1.45;
}

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

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

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

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

.feedback.success {
  border-color: #88bda5;
  background: #edf8f1;
}

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

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

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

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

.result-shell {
  display: grid;
  min-height: 620px;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
}

.result-art {
  display: grid;
  min-width: 0;
  padding: 42px;
  place-items: center;
  background: linear-gradient(145deg, #e2eee5, #f3dfba);
}

.result-art .art-svg {
  width: min(100%, 430px);
}

.result-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 48px 42px;
}

.name-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  text-align: left;
}

.name-field span {
  color: #7e694e;
  font-size: 13px;
  font-weight: 800;
}

.name-field input {
  width: 100%;
  min-height: 54px;
  padding: 12px 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

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

.result-stats > div {
  padding: 15px 10px;
  border: 2px solid #d8e4da;
  border-radius: 17px;
  background: #f0f7ef;
  text-align: center;
}

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

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

.result-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-head {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 34px;
}

.gallery-head h1 {
  margin-bottom: 6px;
}

.gallery-head p {
  margin: 0;
}

.gallery-message {
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 2px solid #88bda5;
  border-radius: 18px;
  background: #edf8f1;
  color: var(--green-dark);
  font-weight: 800;
}

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

.gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.gallery-art {
  display: grid;
  min-height: 250px;
  padding: 18px;
  place-items: center;
  background: linear-gradient(145deg, #e5f0e8, #f5e3c6);
}

.gallery-art .art-svg {
  width: min(100%, 250px);
}

.gallery-copy {
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
}

.gallery-copy h3 {
  margin-bottom: 0;
  font-size: 21px;
}

.gallery-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.gallery-actions .secondary-button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
}

.delete-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: #ecc6c0;
  background: #fff1ee;
  color: #a04d44;
  font-size: 22px;
}

.delete-button:hover {
  border-color: #d96559;
  background: #d96559;
  color: white;
}

.empty-gallery {
  grid-column: 1 / -1;
  padding: 70px 24px;
  border: 3px dashed var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.82);
  text-align: center;
}

.empty-gallery > span {
  font-size: 56px;
}

.empty-gallery h2 {
  margin-top: 18px;
}

.print-sheet {
  display: none;
}

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

  .hero-art,
  .result-art {
    min-height: 400px;
  }

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

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

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

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

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

  .art-stage {
    min-height: 390px;
  }

  .task-panel {
    min-height: 0;
  }
}

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

  .topbar {
    align-items: stretch;
  }

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

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

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

  .top-actions .top-button {
    width: 50px;
    padding: 8px;
    justify-content: center;
  }

  .top-actions .top-button span:nth-child(2),
  .top-actions .top-button:last-child {
    display: none;
  }

  .hero,
  .game-shell,
  .result-shell,
  .gallery-head {
    border-radius: 26px;
  }

  .hero-copy,
  .result-copy {
    padding: 34px 22px;
  }

  h1 {
    font-size: 40px;
  }

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

  .hero-art,
  .result-art {
    min-height: 310px;
    padding: 18px;
  }

  .culture-note {
    align-items: flex-start;
    padding: 18px;
  }

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

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

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

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

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

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

  .game-head h1 {
    font-size: 36px;
  }

  .art-stage {
    min-height: 310px;
    padding: 18px;
  }

  .task-panel {
    padding: 23px 16px;
  }

  .task-panel h2 {
    font-size: 27px;
  }

  .choice-card {
    min-height: 104px;
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 13px;
  }

  .choice-mark {
    width: 44px;
    height: 44px;
  }

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

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

  .feedback .primary-button {
    width: 100%;
    min-width: 0;
  }

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

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

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

  .gallery-head {
    padding: 24px 20px;
  }

  .gallery-head .secondary-button {
    width: 100%;
  }

  .gallery-copy {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-actions {
    justify-content: space-between;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 18mm;
  }

  body {
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > * {
    display: none !important;
  }

  body > .print-sheet {
    display: grid !important;
    min-height: 240mm;
    place-items: center;
    align-content: center;
    color: #244f47;
    text-align: center;
  }

  .print-sheet__art {
    width: 150mm;
    max-height: 175mm;
  }

  .print-sheet__art .art-svg {
    width: 100%;
    filter: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-sheet__art .art-svg * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-sheet h1 {
    margin-top: 10mm;
    font-family: Georgia, serif;
    font-size: 28pt;
  }
}

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