:root {
  --ink: #294f4b;
  --muted: #6d817d;
  --paper: #fffdf7;
  --cream: #fff4d8;
  --line: #ded3b6;
  --green: #4e9b7b;
  --green-dark: #34745f;
  --yellow: #f1bd4b;
  --coral: #ec766d;
  --blue: #68aecd;
  --purple: #8d75b8;
  --shadow: 0 18px 38px rgba(72, 74, 52, 0.13);
  --soft-shadow: 0 9px 22px rgba(72, 74, 52, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: #f5efd8;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.88) 0 3px, transparent 4px) 0 0 / 34px 34px,
    radial-gradient(circle at 88% 16%, rgba(110, 174, 151, 0.12), transparent 25%),
    linear-gradient(145deg, #fbf6e5, #f1e8c8);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible {
  outline: 4px solid rgba(82, 149, 192, 0.38);
  outline-offset: 3px;
}

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

.loading-card {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 2px solid var(--line);
  border-radius: 38px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.loading-card span {
  font-size: 54px;
}

.loading-card p {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

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

.brand-button,
.round-button,
.atlas-button,
.primary-button,
.secondary-button,
.hint-button,
.back-link {
  border: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.brand-button:hover,
.round-button:hover,
.atlas-button:hover,
.primary-button:hover,
.secondary-button:hover,
.hint-button:hover:not(:disabled),
.back-link:hover {
  transform: translateY(-2px);
}

.brand-button:active,
.round-button:active,
.atlas-button:active,
.primary-button:active,
.secondary-button:active,
.hint-button:active:not(:disabled),
.back-link:active {
  transform: translateY(1px);
}

.brand-button {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 13px 7px 8px;
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.78);
  text-align: left;
}

.brand-button:hover {
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #d6c6a4;
  border-radius: 16px;
  color: var(--coral);
  background: #fff8e7;
  font-size: 25px;
  box-shadow: inset 0 -4px 0 rgba(212, 186, 129, 0.16);
}

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

.brand-button small {
  margin-bottom: 2px;
  color: #9b6d2e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.brand-button strong {
  font-size: 19px;
  line-height: 1.05;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-button,
.atlas-button {
  min-height: 50px;
  border: 2px solid #d8cdaa;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 5px 0 rgba(169, 151, 106, 0.22);
}

.round-button {
  width: 50px;
  padding: 0;
  border-radius: 16px;
  font-size: 25px;
  font-weight: 900;
}

.atlas-button {
  padding: 0 16px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.atlas-button span {
  margin-right: 7px;
  color: var(--green-dark);
}

.hero-card,
.how-card,
.game-shell,
.result-card,
.atlas-shell,
.detail-card {
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  overflow: hidden;
  border-radius: 42px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 58px 28px 50px 58px;
}

.eyebrow {
  display: inline-block;
  color: #a06f29;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.hero-copy h1 {
  max-width: 560px;
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5.3vw, 71px);
  line-height: 0.98;
}

.hero-copy > p:not(.gentle-note) {
  max-width: 590px;
  margin: 23px 0 28px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.hero-buttons,
.result-actions,
.center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.hint-button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 17px;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--green);
  box-shadow: 0 7px 0 var(--green-dark);
}

.primary-button:hover {
  background: #58a884;
  box-shadow: 0 9px 0 var(--green-dark);
}

.secondary-button {
  border: 2px solid #d8cdaa;
  background: #fffaf0;
  box-shadow: 0 6px 0 rgba(169, 151, 106, 0.23);
}

.gentle-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.gentle-note span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-weight: 900;
}

.hero-visual {
  position: relative;
  min-height: 480px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(135deg, #d5eadf, #b7dbd1);
  background-size: 32px 32px, 32px 32px, auto;
}

.hero-rings {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 345px;
  height: 345px;
  border: 44px solid rgba(255, 253, 242, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -48%);
  box-shadow: 0 0 0 30px rgba(255, 253, 242, 0.16);
}

.hero-doctor {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: -3%;
  width: 88%;
  height: 94%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 20px 16px rgba(54, 91, 88, 0.2));
}

.hero-organ {
  position: absolute;
  z-index: 3;
  width: 86px;
  height: 86px;
  padding: 8px;
  border: 4px solid white;
  border-radius: 25px;
  background: #fff9ed;
  box-shadow: var(--soft-shadow);
  transform: rotate(-7deg);
}

.hero-organ-brain {
  top: 38px;
  left: 25px;
}

.hero-organ-heart {
  right: 25px;
  top: 105px;
  transform: rotate(8deg);
}

.hero-label {
  position: absolute;
  z-index: 4;
  right: 30px;
  bottom: 25px;
  padding: 9px 14px;
  border: 2px solid #caa34d;
  border-radius: 10px;
  color: #815a20;
  background: #ffe9aa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  transform: rotate(-2deg);
}

.organ-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.how-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 26px;
  align-items: center;
  margin-top: 20px;
  padding: 30px 34px;
  border-radius: 30px;
}

.how-card h2,
.routes-section h2,
.section-heading h1 {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps-list li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid #e4dcc5;
  border-radius: 20px;
  background: #fffaf0;
}

.steps-list li > span,
.question-number {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.steps-list strong,
.steps-list small {
  display: block;
}

.steps-list strong {
  margin-bottom: 3px;
  font-size: 16px;
}

.steps-list small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.routes-section {
  padding: 48px 0 10px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading > p,
.atlas-intro {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.route-card {
  min-width: 0;
  min-height: 245px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 25px;
  border: 2px solid #d9d0b8;
  border-radius: 28px;
  text-align: left;
  box-shadow: 0 9px 0 rgba(151, 137, 105, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.route-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 13px 0 rgba(151, 137, 105, 0.2);
}

.route-map { background: #e5f1ed; }
.route-functions { background: #fff0d2; }
.route-team { background: #f1e9f4; }

.route-icon {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid white;
  border-radius: 18px;
  color: white;
  background: var(--green);
  font-size: 28px;
  box-shadow: var(--soft-shadow);
}

.route-functions .route-icon { background: var(--yellow); color: #704d17; }
.route-team .route-icon { background: var(--purple); }

.route-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.route-copy em {
  color: #9a6c2d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.route-copy strong {
  margin: 9px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1.05;
}

.route-copy small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.route-copy b {
  margin-top: auto;
  padding-top: 18px;
  color: var(--green-dark);
  font-size: 14px;
}

.adult-note {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-top: 26px;
  padding: 20px 24px;
  border: 2px dashed #cfbd90;
  border-radius: 22px;
  background: rgba(255, 248, 226, 0.74);
}

.adult-note > span {
  font-size: 28px;
}

.adult-note strong {
  display: block;
  margin-bottom: 4px;
}

.adult-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.game-shell {
  overflow: hidden;
  border-radius: 38px;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 28px 34px 25px;
  border-bottom: 2px dashed #d8ceb1;
  background: #fffaf0;
}

.game-head h1 {
  margin: 6px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
}

.game-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.progress-dots {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.progress-dots span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8b8774;
  background: #ede8d7;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.progress-dots .done {
  color: white;
  background: var(--green);
}

.progress-dots .current {
  color: #674a18;
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(241, 189, 75, 0.18);
}

.map-layout,
.function-layout,
.team-layout {
  display: grid;
  gap: 22px;
  padding: 25px 28px;
  background: linear-gradient(160deg, #f6fbf5, #f7f2df);
}

.map-layout {
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.question-column,
.answer-column,
.scenario-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.guide-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 105px 1fr;
  align-items: center;
  overflow: hidden;
  border: 2px solid #d7ceb7;
  border-radius: 25px;
  background: #fffaf0;
  box-shadow: var(--soft-shadow);
}

.guide-card img {
  width: 105px;
  height: 132px;
  align-self: end;
  object-fit: contain;
  object-position: bottom center;
  background: linear-gradient(145deg, #e5f2ed, #d5e9e3);
}

.guide-card div {
  min-width: 0;
  padding: 15px 15px 15px 13px;
}

.guide-card span {
  color: #9a6c2d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.guide-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.question-card,
.scenario-card,
.focus-organ-card,
.body-panel,
.organ-choice-panel {
  border: 2px solid #ddd4bc;
  border-radius: 27px;
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.question-card,
.scenario-card {
  padding: 25px;
}

.organ-callout {
  min-height: 220px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.organ-callout h2,
.question-card > h2,
.scenario-card h2 {
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  line-height: 1.1;
}

.organ-callout p,
.scenario-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.body-panel {
  min-width: 0;
  padding: 18px 20px 14px;
}

.panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.panel-label span {
  color: #9a6c2d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.panel-label small {
  padding: 7px 11px;
  border-radius: 12px;
  color: var(--muted);
  background: #f0ecdc;
  font-weight: 800;
}

.body-canvas {
  position: relative;
  width: min(395px, 100%);
  aspect-ratio: 340 / 600;
  margin: 0 auto;
  border: 2px solid #d6d1bd;
  border-radius: 34px;
  background:
    linear-gradient(rgba(82, 140, 124, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 140, 124, 0.07) 1px, transparent 1px),
    #edf6ef;
  background-size: 24px 24px;
  overflow: hidden;
}

.body-silhouette {
  position: absolute;
  inset: 2.5% 8%;
  width: 84%;
  height: 95%;
  filter: drop-shadow(0 10px 10px rgba(54, 91, 88, 0.12));
}

.organ-target {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  min-width: 44px;
  min-height: 44px;
  padding: 2px;
  border: 3px dashed rgba(54, 91, 88, 0.43);
  border-radius: 45%;
  background: rgba(255, 255, 255, 0.62);
  transform: translate(-50%, -50%);
  transition: transform 150ms ease, background 150ms ease, border 150ms ease;
}

.organ-target .organ-svg {
  opacity: 0.18;
  filter: grayscale(1);
}

.organ-target:hover:not(:disabled) {
  z-index: 4;
  transform: translate(-50%, -50%) scale(1.1);
  background: white;
}

.organ-target.is-wrong {
  z-index: 5;
  border-style: solid;
  border-color: #d95f58;
  background: #fff0ed;
  animation: targetNudge 220ms ease;
}

.organ-target.is-hint {
  z-index: 5;
  border-style: solid;
  border-color: #d59a22;
  background: #fff2bd;
  box-shadow: 0 0 0 7px rgba(241, 189, 75, 0.2);
  animation: pulseHint 1.2s ease-in-out infinite;
}

.organ-target.is-correct {
  z-index: 6;
  border-style: solid;
  border-color: var(--green-dark);
  background: white;
  box-shadow: 0 0 0 7px rgba(78, 155, 123, 0.2);
}

.organ-target.is-correct .organ-svg {
  opacity: 1;
  filter: none;
}

.orientation-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.function-layout {
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  align-items: stretch;
}

.focus-organ-card {
  min-height: 545px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,0.9) 0 28%, transparent 29%),
    linear-gradient(145deg, #e5f1ed, #d9ebdf);
}

.focus-organ-art {
  width: min(270px, 82%);
  aspect-ratio: 1;
  margin: 24px auto 10px;
  padding: 25px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--soft-shadow);
}

.focus-organ-card h2 {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.focus-organ-card p {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.text-options {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.text-option {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 16px 10px 10px;
  border: 2px solid #dcd3ba;
  border-radius: 21px;
  background: #fffaf0;
  text-align: left;
  transition: transform 150ms ease, border 150ms ease, background 150ms ease;
}

.text-option > span {
  width: 68px;
  height: 68px;
  padding: 8px;
  border-radius: 17px;
  background: white;
}

.text-option strong {
  font-size: 15px;
  line-height: 1.4;
}

.text-option:hover:not(:disabled) {
  transform: translateX(4px);
  border-color: #9ebbaa;
}

.text-option.is-wrong,
.organ-option.is-wrong {
  border-color: #d95f58;
  background: #fff0ed;
  animation: nudge 220ms ease;
}

.text-option.is-hint,
.organ-option.is-hint {
  border-color: #d59a22;
  background: #fff4c8;
  box-shadow: 0 0 0 4px rgba(241, 189, 75, 0.16);
}

.text-option.is-correct,
.organ-option.is-correct {
  border-color: var(--green-dark);
  background: #e5f4e9;
  box-shadow: 0 0 0 4px rgba(78, 155, 123, 0.16);
}

.team-layout {
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  align-items: start;
}

.scenario-card {
  min-height: 245px;
  background: linear-gradient(145deg, #fff9e8, #fff1cf);
}

.scenario-card h2 {
  margin-top: 13px;
  font-size: 27px;
  line-height: 1.28;
}

.organ-choice-panel {
  padding: 20px;
}

.organ-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.organ-option {
  min-width: 0;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px solid #dcd3ba;
  border-radius: 23px;
  background: #fffaf0;
  transition: transform 150ms ease, border 150ms ease, background 150ms ease;
}

.organ-option .organ-svg {
  width: 125px;
  height: 125px;
}

.organ-option strong {
  font-size: 17px;
  text-align: center;
}

.organ-option:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #9ebbaa;
}

.feedback-placeholder,
.feedback {
  margin: 0 28px;
  border-radius: 22px;
}

.feedback-placeholder {
  min-height: 66px;
  display: grid;
  align-items: center;
  padding: 15px 20px;
  border: 2px dashed #d7ceb7;
  color: var(--muted);
  background: #fffaf0;
  font-size: 14px;
}

.feedback {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 18px 20px;
  border: 2px solid;
}

.feedback.success {
  border-color: #93c6a9;
  background: #e4f3e7;
}

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

.feedback.hint {
  border-color: #e1bd64;
  background: #fff4c9;
}

.feedback-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 22px;
  font-weight: 900;
}

.feedback.error .feedback-icon { background: var(--coral); }
.feedback.hint .feedback-icon { background: var(--yellow); color: #6b4a12; }

.feedback strong {
  display: block;
  margin-bottom: 4px;
  font-size: 19px;
}

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

.feedback p {
  font-size: 15px;
}

.feedback small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.game-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 28px 28px;
  background: var(--paper);
}

.hint-button {
  border: 2px solid #d9ba65;
  background: #fff2bd;
  box-shadow: 0 6px 0 rgba(180, 134, 36, 0.24);
}

.hint-button:disabled {
  opacity: 0.52;
  box-shadow: none;
  cursor: default;
}

.result-card,
.atlas-shell,
.detail-card {
  border-radius: 38px;
}

.result-card {
  padding: 46px 40px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(241, 189, 75, 0.2), transparent 22%),
    radial-gradient(circle at 90% 20%, rgba(78, 155, 123, 0.17), transparent 24%),
    var(--paper);
}

.result-card h1 {
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}

.result-stars span {
  color: #ddd6c1;
  font-size: 52px;
  text-shadow: 0 4px 0 rgba(109, 91, 47, 0.1);
}

.result-stars .earned {
  color: var(--yellow);
}

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

.result-stats {
  width: min(600px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 25px auto;
}

.result-stats div {
  padding: 16px 10px;
  border: 2px solid #ddd4bc;
  border-radius: 19px;
  background: #fffaf0;
}

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

.result-stats strong {
  font-size: 29px;
}

.result-stats small {
  color: var(--muted);
}

.result-organs {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 28px 0;
}

.result-organs div {
  min-width: 0;
  min-height: 150px;
  display: grid;
  grid-template-rows: minmax(96px, 112px) minmax(28px, auto);
  align-items: center;
  padding: 9px 6px;
  border: 2px solid #e2dac3;
  border-radius: 17px;
  background: #f6f0df;
}

.result-organs .organ-svg {
  width: 100%;
  height: 100%;
  max-height: 112px;
  aspect-ratio: 1;
}

.result-organs span {
  min-width: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.result-actions {
  justify-content: center;
}

.atlas-shell {
  padding: 36px;
}

.atlas-intro {
  margin: -5px 0 25px;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.atlas-card {
  position: relative;
  min-width: 0;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 14px 16px;
  border: 2px solid #dcd3ba;
  border-radius: 25px;
  background: #fffaf0;
  text-align: center;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.atlas-card.is-open:hover {
  transform: translateY(-4px);
  box-shadow: var(--soft-shadow);
}

.atlas-card.is-locked {
  color: #9b9889;
  background: #efecdf;
}

.atlas-number {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.atlas-art {
  width: 155px;
  height: 155px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  padding: 14px;
  border-radius: 50%;
  background: #e5f1ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 66px;
  font-weight: 900;
}

.atlas-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.1;
}

.atlas-card small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.center-actions {
  justify-content: center;
  margin-top: 25px;
}

.detail-card {
  padding: 28px 34px 34px;
}

.back-link {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: #f2eddd;
  font-weight: 900;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.8fr) minmax(0, 1.2fr);
  gap: 38px;
  align-items: center;
  margin-top: 24px;
}

.detail-art {
  aspect-ratio: 1;
  padding: 50px;
  border: 3px solid #d8cfb7;
  border-radius: 38px;
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 46%, transparent 47%),
    linear-gradient(145deg, #d9ece5, #c7dfd5);
  box-shadow: var(--soft-shadow);
}

.detail-layout h1 {
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 50px;
}

.detail-location {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
}

.detail-layout section {
  margin-top: 12px;
  padding: 16px 18px;
  border: 2px solid #dfd6be;
  border-radius: 19px;
  background: #fffaf0;
}

.detail-layout section strong {
  color: var(--green-dark);
}

.detail-layout section p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.detail-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 27px;
  padding: 17px 20px;
  border-radius: 20px;
  background: #e5f3e9;
}

.detail-note span {
  color: var(--coral);
  font-size: 28px;
}

.detail-note p {
  margin: 0;
  line-height: 1.45;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

@keyframes targetNudge {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  35% { transform: translate(-50%, -50%) translateX(-5px); }
  70% { transform: translate(-50%, -50%) translateX(5px); }
}

@keyframes pulseHint {
  0%, 100% { box-shadow: 0 0 0 5px rgba(241, 189, 75, 0.16); }
  50% { box-shadow: 0 0 0 10px rgba(241, 189, 75, 0.27); }
}

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

  .hero-copy {
    padding: 44px 20px 42px 38px;
  }

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

  .route-card {
    flex-direction: column;
  }

  .map-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .team-layout {
    grid-template-columns: minmax(0, 0.82fr) minmax(370px, 1.18fr);
  }

  .progress-dots span {
    width: 31px;
    height: 31px;
  }
}

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

  .topbar {
    gap: 7px;
  }

  .brand-button {
    min-width: 0;
    padding-right: 8px;
  }

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

  .brand-button small {
    font-size: 8px;
  }

  .brand-button strong {
    font-size: 16px;
  }

  .round-button {
    width: 46px;
    min-height: 46px;
  }

  .atlas-button {
    min-height: 46px;
    padding: 0 11px;
    font-size: 13px;
  }

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

  .hero-copy {
    padding: 38px 27px 34px;
  }

  .hero-copy h1 {
    font-size: 47px;
  }

  .hero-visual {
    min-height: 390px;
  }

  .how-card {
    padding: 26px 22px;
  }

  .steps-list {
    grid-template-columns: 1fr;
  }

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

  .route-card {
    min-height: 0;
    flex-direction: row;
  }

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

  .game-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 25px 21px 22px;
  }

  .progress-dots {
    width: 100%;
    justify-content: space-between;
  }

  .map-layout,
  .function-layout,
  .team-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .question-column {
    grid-template-columns: 1fr 1fr;
  }

  .organ-callout {
    min-height: auto;
  }

  .body-panel {
    order: -1;
  }

  .body-canvas {
    width: min(370px, 100%);
  }

  .focus-organ-card {
    min-height: 0;
  }

  .answer-column {
    grid-template-columns: 0.7fr 1.3fr;
    align-items: start;
  }

  .scenario-column {
    grid-template-columns: 0.75fr 1.25fr;
    align-items: stretch;
  }

  .feedback-placeholder,
  .feedback {
    margin: 0 18px;
  }

  .game-actions {
    padding: 18px 18px 24px;
  }

  .result-organs {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

  .detail-art {
    width: min(410px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .app {
    width: calc(100% - 16px);
  }

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

  .brand-button {
    min-height: 54px;
    gap: 7px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 13px;
    font-size: 21px;
  }

  .brand-button small {
    display: none;
  }

  .brand-button strong {
    width: 105px;
    font-size: 15px;
  }

  .top-actions {
    gap: 6px;
  }

  .round-button {
    width: 44px;
    min-height: 44px;
    border-radius: 14px;
  }

  .atlas-button {
    min-height: 44px;
    padding: 0 9px;
    font-size: 12px;
  }

  .atlas-button span {
    display: none;
  }

  .hero-card,
  .game-shell,
  .result-card,
  .atlas-shell,
  .detail-card {
    border-radius: 28px;
  }

  .hero-copy {
    padding: 30px 20px 27px;
  }

  .hero-copy h1 {
    font-size: 39px;
  }

  .hero-copy > p:not(.gentle-note) {
    margin: 17px 0 22px;
    font-size: 17px;
  }

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

  .hero-visual {
    min-height: 340px;
  }

  .hero-organ {
    width: 67px;
    height: 67px;
  }

  .how-card h2,
  .routes-section h2,
  .section-heading h1 {
    font-size: 29px;
  }

  .route-card {
    padding: 20px;
  }

  .route-icon {
    width: 48px;
    height: 48px;
    font-size: 23px;
  }

  .route-copy strong {
    font-size: 23px;
  }

  .adult-note {
    padding: 17px;
  }

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

  .progress-dots span {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .map-layout,
  .function-layout,
  .team-layout {
    padding: 12px;
  }

  .question-column,
  .answer-column,
  .scenario-column {
    grid-template-columns: 1fr;
  }

  .body-panel {
    padding: 13px 8px 10px;
  }

  .body-canvas {
    width: min(330px, 100%);
  }

  .guide-card {
    grid-template-columns: 86px 1fr;
  }

  .guide-card img {
    width: 86px;
    height: 110px;
  }

  .question-card,
  .scenario-card {
    padding: 20px;
  }

  .organ-callout h2,
  .question-card > h2,
  .scenario-card h2 {
    font-size: 25px;
  }

  .focus-organ-card {
    padding: 22px 15px;
  }

  .focus-organ-art {
    width: min(230px, 78%);
    margin-top: 14px;
  }

  .text-option {
    grid-template-columns: 59px 1fr;
    padding-right: 11px;
  }

  .text-option > span {
    width: 59px;
    height: 59px;
  }

  .text-option strong {
    font-size: 14px;
  }

  .organ-choice-panel {
    padding: 12px;
  }

  .organ-choice-grid {
    gap: 8px;
  }

  .organ-option {
    min-height: 165px;
    padding: 8px;
  }

  .organ-option .organ-svg {
    width: 100px;
    height: 100px;
  }

  .feedback-placeholder,
  .feedback {
    margin: 0 12px;
  }

  .feedback {
    padding: 15px;
  }

  .game-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 15px 12px 22px;
  }

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

  .result-card {
    padding: 34px 16px 28px;
  }

  .result-card h1 {
    font-size: 38px;
  }

  .result-stats {
    gap: 6px;
  }

  .result-stats div {
    padding: 12px 5px;
  }

  .result-stats small {
    font-size: 10px;
  }

  .result-organs {
    gap: 5px;
  }

  .result-organs div {
    min-height: 112px;
    grid-template-rows: 72px minmax(26px, auto);
    padding: 5px 3px;
  }

  .result-organs .organ-svg {
    max-height: 72px;
  }

  .atlas-shell {
    padding: 26px 12px;
  }

  .atlas-grid {
    gap: 8px;
  }

  .atlas-card {
    min-height: 245px;
    padding: 16px 8px 13px;
  }

  .atlas-art {
    width: 125px;
    height: 125px;
  }

  .atlas-card strong {
    font-size: 17px;
  }

  .detail-card {
    padding: 20px 14px 25px;
  }

  .detail-art {
    padding: 35px;
  }

  .detail-layout h1 {
    font-size: 39px;
  }
}

@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;
  }
}
