:root {
  --ink: #2e5057;
  --muted: #718188;
  --paper: #fffdf7;
  --cream: #fff4d7;
  --line: #ded5b9;
  --blue: #6e99aa;
  --blue-dark: #426f7f;
  --blue-pale: #e7f1f4;
  --coral: #d98270;
  --coral-pale: #fff0ea;
  --yellow: #efbc58;
  --yellow-pale: #fff2c5;
  --green: #6f9c7b;
  --green-pale: #e8f2e9;
  --shadow: 0 18px 48px rgba(48, 72, 79, 0.12);
}

* { box-sizing: border-box; }
.animal-portrait { display: block; width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 7px 7px rgba(49, 73, 65, .15)); }

html {
  min-width: 0;
  background: #f4f7ef;
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 6% 8%, rgba(239, 188, 88, 0.2) 0 115px, transparent 116px),
    radial-gradient(circle at 96% 29%, rgba(110, 153, 170, 0.15) 0 110px, transparent 111px),
    linear-gradient(145deg, #f2f7ef 0%, #fffaf1 57%, #f0f4f5 100%);
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid rgba(79, 139, 171, 0.38); outline-offset: 3px; }

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

.topbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 16px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(66, 111, 127, 0.22);
  color: #fff;
}

.brand-mark i { font-size: 25px; font-style: normal; }
.brand-mark b { position: absolute; top: 2px; right: 5px; color: var(--yellow); font-size: 12px; }
.brand > span:last-child { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; letter-spacing: -0.03em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.top-spark { color: var(--yellow); font-size: 24px; }
.back-button, .city-badge {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.84);
}
.back-button { width: 48px; padding: 0; color: var(--ink); font-size: 24px; cursor: pointer; }
.back-button:hover { background: #fff; transform: translateY(-1px); }
.city-badge { gap: 6px; padding: 0 13px; }
.city-badge > span { color: var(--coral); font-size: 18px; }
.city-badge strong { font-family: Georgia, serif; font-size: 17px; }
.city-badge small { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }

.hero {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  min-height: 480px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 44px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 34px 50px 60px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: anywhere; }
.hero h1, .game-header h1, .result-copy h1 { margin: 0; color: var(--ink); letter-spacing: -0.055em; line-height: 0.98; }
.hero h1 { max-width: 520px; font-size: clamp(44px, 5.2vw, 69px); }
.hero-copy > p:not(.eyebrow) { max-width: 530px; margin: 22px 0 26px; color: var(--muted); font-size: 17px; font-weight: 700; line-height: 1.55; }

.primary-button, .secondary-button, .hint-button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 0;
  background: var(--blue);
  box-shadow: 0 8px 0 var(--blue-dark);
  color: #fff;
}
.primary-button:hover { transform: translateY(-2px); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--blue-dark); }

.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero-facts span { display: flex; min-height: 48px; align-items: baseline; gap: 7px; padding: 9px 13px; border-radius: 15px; background: #eef2ee; }
.hero-facts strong { font-family: Georgia, serif; font-size: 21px; }
.hero-facts small { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }

.hero-art { display: grid; min-width: 0; padding: 34px 42px 34px 0; place-items: center; }
.hero-city {
  position: relative;
  width: min(100%, 455px);
  aspect-ratio: 1.08;
  overflow: hidden;
  border: 9px solid #fff;
  border-radius: 38px;
  background:
    radial-gradient(circle at 78% 16%, #fff0a6 0 48px, transparent 49px),
    linear-gradient(180deg, #dceef1 0 67%, #c4d59c 67% 100%);
  box-shadow: 0 18px 38px rgba(55, 78, 82, 0.17);
}
.hero-buildings { position: absolute; z-index: 2; right: -2%; bottom: 17%; display: flex; width: 82%; align-items: flex-end; }
.hero-buildings svg { width: 16%; min-width: 0; }
.hero-buildings svg:nth-child(2n) { transform: scale(0.78); transform-origin: bottom; }
.hero-road { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 20%; background: #7c8986; }
.hero-road::after { position: absolute; top: 45%; right: 0; left: 0; border-top: 5px dashed #fff3b1; content: ""; }
.hero-bus {
  position: absolute;
  z-index: 5;
  right: 12%;
  bottom: 6%;
  display: grid;
  width: 70px;
  height: 43px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 15px;
  background: var(--coral);
  box-shadow: 0 6px 12px rgba(46, 70, 76, 0.18);
  color: #fff;
  font-size: 23px;
}
.hero-animal { position: absolute; z-index: 4; bottom: -26px; left: -3%; width: 45%; }
.hero-animal svg { display: block; width: 100%; }
.hero-sun { position: absolute; top: 10%; right: 18%; color: #fff8c9; font-size: 22px; }
.hero-sign {
  position: absolute;
  z-index: 6;
  top: 8%;
  left: 8%;
  padding: 8px 11px;
  border: 3px solid #fff;
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(46, 70, 76, 0.16);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.how-section, .districts-section, .map-section { padding-top: 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { max-width: 670px; margin: 0; color: var(--ink); font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.045em; line-height: 1.03; }
.section-heading > p { max-width: 390px; margin: 0 0 5px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.5; text-align: right; }

.steps-grid, .districts-grid { display: grid; gap: 14px; }
.steps-grid { grid-template-columns: repeat(3, 1fr); }
.steps-grid article { display: flex; min-width: 0; min-height: 112px; align-items: center; gap: 16px; padding: 18px; border: 2px solid var(--line); border-radius: 24px; background: rgba(255, 253, 247, 0.9); }
.steps-grid article > b { display: grid; width: 54px; height: 54px; flex: 0 0 54px; place-items: center; border: 4px solid #fff; border-radius: 18px; background: var(--blue); box-shadow: 0 5px 12px rgba(52, 74, 78, 0.13); color: #fff; font-family: Georgia, serif; font-size: 22px; }
.steps-grid article:nth-child(2) > b { background: var(--coral); }
.steps-grid article:nth-child(3) > b { background: var(--green); }
.steps-grid strong, .steps-grid small { display: block; }
.steps-grid strong { margin-bottom: 6px; font-size: 17px; }
.steps-grid small { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.4; }

.districts-grid { grid-template-columns: repeat(3, 1fr); }
.district-card {
  display: flex;
  min-width: 0;
  min-height: 380px;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.district-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 16px 34px rgba(49, 73, 79, 0.12); }
.district-top, .district-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.district-top b { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; background: var(--accent); color: #fff; font-family: Georgia, serif; font-size: 16px; }
.district-top small { color: var(--accent); font-size: 13px; font-weight: 900; }
.district-street {
  display: flex;
  height: 120px;
  align-items: flex-end;
  justify-content: center;
  margin: 12px 0 15px;
  overflow: hidden;
  padding: 7px 5px 0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--pale) 0 76%, #84918d 76% 100%);
}
.district-street svg { width: 13%; min-width: 0; }
.district-street svg:nth-child(2n) { transform: scale(0.8); transform-origin: bottom; }
.district-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.district-copy small { color: var(--accent); font-family: Georgia, serif; font-size: 10px; font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; }
.district-copy strong { margin: 5px 0 8px; font-size: 23px; letter-spacing: -0.035em; }
.district-copy span { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.45; }
.district-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 900; }
.district-footer span { color: var(--muted); }
.district-footer b { color: var(--accent); }

.city-map {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  min-height: 220px;
  align-items: end;
  overflow: hidden;
  padding: 18px 18px 10px;
  border: 3px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 82% 16%, #fff0a5 0 40px, transparent 41px),
    linear-gradient(180deg, #deedf1 0 77%, #7f8d8b 77% 100%);
  box-shadow: 0 12px 32px rgba(50, 75, 79, 0.08);
}
.city-map > span { display: grid; min-width: 0; align-items: end; }
.city-map svg { display: block; width: 100%; }
.city-map svg.closed { opacity: 0.7; filter: grayscale(0.65); }
.city-map > span:nth-child(3n) { transform: scale(0.8); transform-origin: bottom; }
.city-map > span:nth-child(4n) { transform: scale(0.9); transform-origin: bottom; }

.parent-note { display: flex; min-height: 88px; align-items: center; gap: 16px; margin-top: 24px; padding: 18px 23px; border: 2px solid #d2d7d0; border-radius: 24px; background: rgba(237, 242, 238, 0.95); }
.parent-note > span { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 16px; background: var(--blue); color: #fff; font-size: 22px; }
.parent-note p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.55; }
.parent-note strong { color: var(--ink); }

.game-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 3px 12px; }
.game-header h1 { font-size: clamp(37px, 5vw, 61px); }
.game-header > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.progress-number { display: grid; width: 92px; height: 92px; flex: 0 0 92px; place-items: center; align-content: center; border: 3px solid var(--line); border-radius: 29px; background: var(--paper); }
.progress-number strong { font-family: Georgia, serif; font-size: 30px; line-height: 1; }
.progress-number small { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 900; }
.progress-track { height: 12px; overflow: hidden; margin: 6px 0 14px; border-radius: 999px; background: #dedfd8; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #79a9b8); transition: width 0.28s ease; }

.stage-banner { display: flex; min-height: 70px; align-items: center; justify-content: center; gap: 18px; margin-bottom: 15px; padding: 10px; border: 2px solid var(--line); border-radius: 23px; background: rgba(255, 253, 247, 0.88); }
.stage-banner span { display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 7px 15px 7px 8px; border-radius: 16px; color: var(--muted); font-weight: 900; }
.stage-banner span b { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #e7e8e2; }
.stage-banner span.active { background: var(--blue-pale); color: var(--blue-dark); }
.stage-banner span.active b { background: var(--blue); color: #fff; }
.stage-banner span.done { color: var(--green); }
.stage-banner span.done b { background: var(--green); color: #fff; }
.stage-banner i { color: #aaa99e; font-style: normal; font-weight: 900; }

.game-layout { display: grid; grid-template-columns: minmax(0, 0.87fr) minmax(0, 1.13fr); gap: 16px; }
.scene-card, .choice-card { min-width: 0; border: 3px solid var(--line); border-radius: 34px; background: var(--paper); box-shadow: 0 12px 34px rgba(48, 72, 79, 0.08); }
.scene-card { display: flex; flex-direction: column; overflow: hidden; padding: 18px; background: linear-gradient(180deg, #f3f9fa 0%, #fff8e8 100%); }
.dispatch-label { display: flex; min-height: 58px; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 18px; background: #fff; }
.dispatch-label > span { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 13px; background: var(--coral-pale); color: var(--coral); font-size: 20px; font-weight: 900; }
.dispatch-label.ready > span { background: var(--green-pale); color: var(--green); }
.dispatch-label small, .dispatch-label strong { display: block; }
.dispatch-label small { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.dispatch-label strong { margin-top: 3px; font-size: 15px; }

.call-scene {
  position: relative;
  min-height: 302px;
  flex: 1;
  overflow: hidden;
  margin: 12px 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 65% 24%, #fff0ae 0 73px, transparent 74px),
    linear-gradient(180deg, #dcecf0 0 73%, #8b9995 73% 100%);
}
.call-scene::after { position: absolute; right: 7%; bottom: 5%; left: 7%; height: 29px; border-radius: 50%; background: rgba(44, 71, 78, 0.15); content: ""; }
.resident-animal, .professional-animal { position: absolute; z-index: 3; bottom: -7px; left: -3%; width: 59%; }
.resident-animal svg, .professional-animal svg { display: block; width: 100%; }
.call-building, .work-building { position: absolute; z-index: 2; right: 5%; bottom: 12%; width: 41%; }
.call-building svg, .work-building svg { display: block; width: 100%; }
.call-building svg { opacity: 0.84; filter: grayscale(0.55); }
.call-signal, .work-spark { position: absolute; z-index: 4; top: 8%; left: 20%; color: var(--coral); font-family: Georgia, serif; font-size: 38px; font-weight: 900; }
.work-scene { background: radial-gradient(circle at 70% 22%, #fff0ae 0 73px, transparent 74px), linear-gradient(180deg, #dff0ed 0 73%, #899893 73% 100%); }
.work-building { right: 1%; width: 45%; }
.work-spark { color: var(--yellow); }
.call-text { display: flex; min-height: 110px; gap: 10px; padding: 15px; border: 2px solid #e4ddc9; border-radius: 21px; background: #fffdf8; }
.call-text > span { color: var(--blue); font-family: Georgia, serif; font-size: 34px; font-weight: 900; line-height: 0.9; }
.call-text p { margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.48; }

.choice-card { padding: 24px; }
.choice-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.choice-heading h2 { max-width: 560px; margin: 0; font-size: clamp(28px, 3.4vw, 41px); letter-spacing: -0.045em; line-height: 1.04; }
.choice-heading > span { display: grid; width: 54px; height: 54px; flex: 0 0 54px; place-items: center; border-radius: 17px; background: var(--coral); box-shadow: 0 5px 0 #a95c51; color: #fff; font-family: Georgia, serif; font-size: 24px; font-weight: 900; }

.answers-grid { display: grid; gap: 10px; }
.answer-card { display: grid; min-width: 0; min-height: 80px; grid-template-columns: 48px minmax(0, 1fr) 27px; align-items: center; gap: 12px; padding: 10px 13px; border: 2px solid #dedacc; border-radius: 20px; background: #fffefa; color: var(--ink); text-align: left; cursor: pointer; transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease; }
.answer-card:not(:disabled):hover { transform: translateX(3px); border-color: var(--blue); background: #f6fafb; }
.answer-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px; background: #edf0ee; color: var(--blue-dark); font-size: 19px; font-weight: 900; }
.answer-card > span:nth-child(2) { min-width: 0; }
.answer-card small, .answer-card strong { display: block; }
.answer-card small { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.answer-card strong { font-size: 13px; line-height: 1.36; }
.answer-card > b { color: #aaa99c; font-size: 18px; text-align: center; }
.answer-card.wrong { border-color: #e2a198; background: var(--coral-pale); color: #8b554e; }
.answer-card.wrong .answer-icon { background: var(--coral); color: #fff; }
.answer-card.wrong > b { color: var(--coral); }
.answer-card.correct { border-color: #7aaa89; background: var(--green-pale); color: #467252; }
.answer-card.correct .answer-icon { background: var(--green); color: #fff; }
.answer-card.correct > b { color: var(--green); }
.answer-card:disabled { cursor: default; opacity: 1; }

.feedback { display: flex; min-height: 82px; align-items: center; gap: 12px; margin-top: 13px; padding: 13px 15px; border-radius: 20px; }
.feedback > span:not(.feedback-building) { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 15px; font-size: 22px; font-weight: 900; }
.feedback-building { width: 54px; height: 66px; flex: 0 0 54px; overflow: hidden; }
.feedback-building svg { width: 54px; transform: translateY(-2px); }
.feedback strong, .feedback small { display: block; }
.feedback strong { margin-bottom: 4px; font-size: 14px; }
.feedback small { font-size: 11px; font-weight: 800; line-height: 1.4; }
.neutral-feedback { background: #eff2ef; color: var(--muted); }
.neutral-feedback > span { background: #fff; color: var(--blue); }
.wrong-feedback { background: var(--coral-pale); color: #8c5952; }
.wrong-feedback > span { background: #fff; color: var(--coral); }
.hint-feedback { background: var(--yellow-pale); color: #806123; }
.hint-feedback > span { background: #fff; color: #c38b27; }
.correct-feedback { background: var(--green-pale); color: #467252; }
.correct-feedback > span:not(.feedback-building) { background: #fff; color: var(--green); }

.game-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 13px; }
.hint-button, .secondary-button { padding: 0 19px; border: 2px solid #e0bd62; background: var(--yellow-pale); color: #805f1f; }
.hint-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.hint-button:disabled { cursor: default; opacity: 0.6; transform: none; }
.next-button { min-width: 220px; }

.result-card { display: grid; grid-template-columns: 0.9fr 1.1fr; min-height: 620px; overflow: hidden; border: 3px solid var(--line); border-radius: 42px; background: var(--paper); box-shadow: var(--shadow); }
.result-city {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 15%, #fff0a6 0 62px, transparent 63px),
    linear-gradient(180deg, #dceef1 0 76%, #81908d 76% 100%);
}
.result-street { position: absolute; z-index: 2; right: -2%; bottom: 12%; display: flex; width: 83%; align-items: flex-end; }
.result-street svg { width: 14%; min-width: 0; }
.result-street svg:nth-child(2n) { transform: scale(0.78); transform-origin: bottom; }
.result-animal { position: absolute; z-index: 3; bottom: -12px; left: -6%; width: 55%; }
.result-animal svg { display: block; width: 100%; }
.result-sun { position: absolute; top: 10%; right: 17%; color: #fff9d2; font-size: 31px; }
.result-city > b { position: absolute; z-index: 5; top: 10%; left: 8%; padding: 9px 12px; border: 4px solid #fff; border-radius: 14px; background: var(--blue); color: #fff; font-size: 10px; letter-spacing: 0.08em; transform: rotate(-4deg); }
.result-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 48px; }
.result-copy h1 { font-size: clamp(42px, 5vw, 65px); }
.result-copy > p:not(.eyebrow) { margin: 20px 0 12px; color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1.55; }
.stars { margin: 6px 0 14px; color: var(--yellow); font-size: 38px; letter-spacing: 0.08em; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stats span { min-width: 0; padding: 12px; border-radius: 17px; background: #f1f3ed; text-align: center; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-family: Georgia, serif; font-size: 24px; }
.result-stats small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.result-copy blockquote { margin: 16px 0; padding: 14px 17px; border-left: 5px solid var(--blue); border-radius: 0 16px 16px 0; background: var(--blue-pale); color: var(--blue-dark); font-size: 13px; font-weight: 900; line-height: 1.45; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-actions .secondary-button { border-color: var(--line); background: #f4f3ed; color: var(--ink); }

.fatal-error { margin-top: 80px; padding: 40px; border: 3px solid var(--coral); border-radius: 32px; background: var(--paper); }

@media (max-width: 930px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 48px 44px 20px; }
  .hero-art { padding: 15px 44px 42px; }
  .hero-city { width: min(100%, 510px); }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid article { min-height: 96px; }
  .districts-grid { grid-template-columns: 1fr; }
  .district-card { min-height: 240px; display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 18px; }
  .district-top { grid-column: 1 / -1; }
  .district-street { height: 112px; margin: 10px 0; }
  .district-copy { align-self: center; }
  .district-footer { grid-column: 1 / -1; }
  .city-map { grid-template-columns: repeat(8, 1fr); min-height: 310px; }
  .game-layout { grid-template-columns: 1fr; }
  .scene-card { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 12px; }
  .dispatch-label { grid-column: 1 / -1; }
  .call-scene { min-height: 310px; margin: 0; }
  .call-text { min-height: 310px; align-items: center; }
  .result-card { grid-template-columns: 0.84fr 1.16fr; }
  .result-copy { padding: 35px; }
}

@media (max-width: 700px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 12px; }
  .topbar { margin-bottom: 10px; }
  .city-badge { width: 48px; padding: 0; gap: 0; }
  .city-badge strong, .city-badge small { display: none; }
  .hero { border-radius: 32px; }
  .hero-copy { padding: 36px 25px 15px; }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-art { padding: 12px 24px 28px; }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; margin-top: 10px; text-align: left; }
  .city-map { grid-template-columns: repeat(6, 1fr); min-height: 390px; }
  .game-header { align-items: flex-start; }
  .progress-number { width: 72px; height: 72px; flex-basis: 72px; border-radius: 23px; }
  .progress-number strong { font-size: 24px; }
  .stage-banner { gap: 8px; }
  .stage-banner span { padding-right: 9px; }
  .scene-card { display: flex; }
  .call-scene { min-height: 300px; }
  .call-text { min-height: 0; align-items: flex-start; }
  .choice-card { padding: 18px; }
  .choice-heading h2 { font-size: 30px; }
  .result-card { grid-template-columns: 1fr; }
  .result-city { min-height: 360px; }
}

@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 15px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 8px; }
  .top-actions { gap: 6px; }
  .back-button, .city-badge { width: 44px; min-height: 44px; border-radius: 14px; }
  .hero h1 { font-size: 43px; }
  .hero-copy { padding-inline: 20px; }
  .hero-copy .primary-button { width: 100%; }
  .hero-facts { width: 100%; }
  .hero-facts span { flex: 1; min-width: 82px; justify-content: center; }
  .hero-art { padding-inline: 16px; }
  .hero-city { border-width: 6px; border-radius: 29px; }
  .how-section, .districts-section, .map-section { padding-top: 43px; }
  .section-heading h2 { font-size: 34px; }
  .steps-grid article { padding: 14px; }
  .district-card { display: flex; min-height: 360px; }
  .district-street { height: 108px; }
  .city-map { grid-template-columns: repeat(4, 1fr); min-height: 620px; padding-inline: 9px; }
  .parent-note { align-items: flex-start; padding: 16px; }
  .game-header h1 { font-size: 35px; }
  .game-header > div > p:last-child { font-size: 12px; }
  .progress-number { width: 66px; height: 66px; flex-basis: 66px; }
  .stage-banner { gap: 4px; padding-inline: 5px; }
  .stage-banner span { gap: 5px; padding-left: 5px; padding-right: 7px; }
  .stage-banner span b { width: 31px; height: 31px; }
  .scene-card, .choice-card { border-radius: 27px; }
  .scene-card { padding: 12px; }
  .call-scene { min-height: 280px; }
  .call-text p { font-size: 13px; }
  .choice-card { padding: 15px 12px; }
  .choice-heading { gap: 10px; }
  .choice-heading h2 { font-size: 28px; }
  .choice-heading > span { width: 48px; height: 48px; flex-basis: 48px; }
  .answer-card { min-height: 94px; grid-template-columns: 43px minmax(0, 1fr) 20px; gap: 9px; padding: 9px; }
  .answer-icon { width: 43px; height: 43px; }
  .answer-card strong { font-size: 12px; }
  .feedback { align-items: flex-start; padding: 12px; }
  .game-actions { display: grid; grid-template-columns: 1fr; }
  .game-actions button, .next-button { width: 100%; min-width: 0; }
  .result-city { min-height: 330px; }
  .result-copy { padding: 28px 20px; }
  .result-copy h1 { font-size: 42px; }
  .result-stats { gap: 5px; }
  .result-stats span { padding: 10px 5px; }
  .result-actions { display: grid; }
  .result-actions button { width: 100%; }
}

@media (max-width: 390px) {
  .app { width: calc(100% - 16px); }
  .brand span:last-child small { display: none; }
  .brand strong { font-size: 15px; }
  .hero-copy { padding-inline: 16px; }
  .hero h1 { font-size: 39px; }
  .hero-facts small { font-size: 8px; }
  .stage-banner span small { font-size: 10px; }
  .choice-heading h2 { font-size: 26px; }
  .answer-card { grid-template-columns: 40px minmax(0, 1fr) 18px; }
  .answer-icon { width: 40px; height: 40px; }
  .answer-card strong { font-size: 11px; }
  .feedback > span:not(.feedback-building) { width: 42px; height: 42px; flex-basis: 42px; }
}

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