:root {
  --ink: #214b43;
  --muted: #6c7d75;
  --paper: #fffdf7;
  --line: #ddceb1;
  --green: #438f69;
  --coral: #df745f;
  --accent: #4f956d;
  color: var(--ink);
  background: #ece8d9;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; overflow-x: clip; }
body { background: radial-gradient(circle at 9% 8%, #fff, transparent 28rem), linear-gradient(145deg, #e3ecd9, #f3e8d5 55%, #e1e9dc); }
button, a { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.app { width: min(1120px, calc(100% - 32px)); margin: 24px auto 34px; overflow: hidden; border: 1px solid #d5c7a8; border-radius: 34px; background: rgba(255,253,247,.98); box-shadow: 0 24px 60px rgba(65,73,51,.15); }
.game-bar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.game-brand { min-width: 0; display: inline-flex; align-items: center; gap: 13px; padding: 4px 8px 4px 4px; border-radius: 18px; color: inherit; text-decoration: none; transition: background .18s ease; }
.game-brand:hover { background: #eef5e7; }
.game-brand:focus-visible, button:focus-visible { outline: 4px solid rgba(67,143,105,.3); outline-offset: 3px; }
.game-brand > span:last-child { display: grid; gap: 2px; }
.game-brand strong { font-size: clamp(18px,2.3vw,25px); }
.game-brand small { color: var(--muted); font-size: 13px; }
.game-icon { flex: 0 0 56px; width: 56px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: #efe0bc; }
.game-icon svg { width: 48px; height: 42px; fill: #fff9e8; stroke: #705b40; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.game-icon circle { fill: #d97863; stroke: none; }
.age-pill, .counter { padding: 10px 15px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-weight: 900; }

.screen { display: none; }
.screen.is-active { display: block; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
h1, h2, h3 { margin-top: 0; }
h1, h2, h3, p { overflow-wrap: anywhere; }

.home-screen { grid-template-columns: 1fr 1fr; gap: 28px 38px; padding: 48px 48px 36px; background: linear-gradient(110deg,#f8eed8 0 52%,#dfeeda 52%); }
.home-screen.is-active { display: grid; }
.hero-copy { align-self: center; }
.hero-copy h1 { margin-bottom: 18px; font-size: clamp(39px,5vw,58px); line-height: 1; letter-spacing: -.04em; }
.hero-copy > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: clamp(18px,2vw,21px); line-height: 1.46; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0; }
.hero-facts span { padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-weight: 900; }
.primary-button, .secondary-button, .hint-button, .restart-button, .next-button, .check-button { min-height: 54px; padding: 13px 22px; border-radius: 17px; cursor: pointer; font-weight: 900; }
.primary-button, .next-button, .check-button { border: 0; color: #fff; background: var(--green); box-shadow: 0 7px 0 #2f7658; }
.primary-button:hover, .next-button:hover, .check-button:hover:not(:disabled) { filter: brightness(1.04); }

.hero-scene { position: relative; min-height: 355px; overflow: hidden; border: 1px solid #d7c9a8; border-radius: 32px; background: #e3ead8; }
.hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.how-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 6px; }
.how-strip article { min-height: 114px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.how-strip b { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--coral); font-size: 23px; }
.how-strip span { display: grid; gap: 4px; }
.how-strip small { color: var(--muted); }

.routes-screen, .play-screen, .result-screen { padding: 38px 42px 44px; }
.section-title, .task-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-title h2, .task-head h2 { margin-bottom: 0; font-size: clamp(28px,4vw,44px); }
.section-title > p { color: var(--muted); font-weight: 900; }
.route-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 16px; margin-top: 28px; }
.route-card { min-width: 0; display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 0 12px 28px rgba(72,66,47,.09); }
.route-art { height: 170px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: linear-gradient(145deg,#edf4df,#f5e3cb); }
.route-art img { width: 67%; height: 86%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.route-card > p { margin: 17px 0 7px; color: var(--accent); font-size: 12px; font-weight: 900; }
.route-card h3 { min-height: 50px; margin-bottom: 8px; font-size: 22px; }
.route-card > small { min-height: 66px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.route-meta { display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 13px; font-weight: 900; }
.route-progress { height: 8px; margin: 9px 0 16px; overflow: hidden; border-radius: 99px; background: #e8e4d7; }
.route-progress i { display: block; height: 100%; background: var(--accent); }
.route-card > button { min-height: 54px; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border: 0; border-radius: 17px; color: #fff; background: var(--accent); cursor: pointer; font-weight: 900; }
.back-link { margin-top: 26px; border: 0; background: transparent; color: #2d7355; cursor: pointer; font-weight: 900; }

.task-head { justify-content: flex-start; }
.task-head > div { flex: 1; }
.round-button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 23px; }
.progress-line { height: 8px; margin: 18px 0; overflow: hidden; border-radius: 99px; background: #e8e4d7; }
.progress-line i { display: block; height: 100%; background: var(--accent); }

.mystery-card { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 260px auto; align-items: center; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(110deg,#fffdf7,#e7f1de); }
.mystery-copy h3 { margin-bottom: 7px; font-size: clamp(24px,3.3vw,36px); }
.mystery-copy > p:last-child { margin: 0; color: var(--muted); line-height: 1.4; }
.mystery-stage { position: relative; min-height: 170px; overflow: hidden; border-radius: 21px; background: linear-gradient(#cfe5c5 0 69%,#cbb587 69%); }
.stage-glow { position: absolute; right: 10%; top: 8%; width: 58px; aspect-ratio: 1; border-radius: 50%; background: #f3ce75; opacity: .76; }
.stage-basket { position: absolute; z-index: 2; left: 19%; bottom: 4%; width: 64%; height: 82%; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,.18)); }
.basket-cloth { position: absolute; z-index: 3; left: 33%; right: 24%; top: 39%; height: 28%; border-radius: 52% 48% 42% 58%; background: #83ad8e; transform: rotate(-4deg); box-shadow: inset 0 -7px 0 rgba(36,83,63,.11); }
.secret-reveal { position: absolute; z-index: 4; inset: 6px; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 5px; border: 4px solid #fff; border-radius: 18px; color: #fff; background: rgba(52,122,88,.94); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.secret-reveal img { min-height: 0; width: 100%; height: 124px; object-fit: contain; }
.secret-reveal b { padding: 2px 7px; }
.answer-count { justify-self: end; min-width: 116px; padding: 10px 12px; border-radius: 99px; text-align: center; background: #fff; box-shadow: 0 5px 14px rgba(53,67,47,.08); color: var(--muted); font-size: 13px; font-weight: 900; }

.question-panel, .candidate-panel, .control-card { margin-top: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 23px; background: #fff; }
.question-panel > header, .candidate-panel > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.question-panel h3, .candidate-panel h3 { margin: 0; }
.question-panel header > span, .candidate-panel header > span { color: var(--muted); font-size: 13px; font-weight: 900; }
.question-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.question-grid button { position: relative; min-height: 132px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 1fr auto; align-items: start; gap: 8px 10px; padding: 15px; border: 2px solid #ddcfb4; border-radius: 19px; text-align: left; background: #fffaf0; cursor: pointer; transition: .18s ease; }
.question-grid button:not(:disabled):hover { transform: translateY(-3px); border-color: var(--accent); }
.question-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--coral); font-weight: 900; }
.question-grid b { align-self: center; line-height: 1.34; }
.question-grid small { grid-column: 2; color: var(--accent); font-weight: 900; }
.question-grid .answer-pill { grid-column: 1 / -1; justify-self: stretch; padding: 6px 10px; border-radius: 10px; text-align: center; color: #fff; font-weight: 900; letter-spacing: .08em; }
.answer-pill.is-yes { background: #438f69; }
.answer-pill.is-no { background: #d87963; }
.question-grid button.is-asked { border-color: #a8c6aa; background: #edf5e8; }
.question-grid button.is-highlighted { animation: answerPulse 1s ease-in-out infinite alternate; }
@keyframes answerPulse { to { box-shadow: 0 0 0 6px rgba(241,181,62,.37); } }

.candidate-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 15px 0; }
.candidate-grid button { min-height: 178px; display: grid; grid-template-rows: 1fr auto; padding: 9px; border: 2px solid #e1d5bd; border-radius: 18px; background: #fff; cursor: pointer; }
.candidate-grid button:disabled { cursor: not-allowed; }
.candidate-grid button.is-selected { border-color: var(--accent); background: #edf7ed; box-shadow: 0 0 0 4px rgba(68,143,105,.16); }
.candidate-grid button.is-eliminated { opacity: .23; filter: grayscale(1); }
.candidate-grid img { width: 100%; height: 128px; object-fit: contain; }
.candidate-grid b { font-size: 16px; }
.candidate-panel.is-locked .candidate-grid { opacity: .4; filter: grayscale(.5); }
.check-button { width: 100%; }
.check-button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }

.control-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.feedback { min-height: 65px; display: grid; align-content: center; gap: 4px; padding: 10px 13px; border-radius: 15px; background: #f3f1e8; }
.feedback span { color: var(--muted); font-size: 13px; }
.feedback[data-tone="good"], .feedback[data-tone="success"] { background: #e2f1df; }
.feedback[data-tone="soft"] { background: #fff0e4; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hint-button { color: #2d7355; border: 2px solid #91bea2; background: #eef8ef; }
.restart-button { border: 1px solid var(--line); background: #fff; }
.task-tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.task-tabs button { min-height: 36px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-weight: 900; }
.task-tabs .is-current { color: #fff; background: var(--accent); }
.task-tabs .is-done:not(.is-current) { background: #e4f1df; }

.result-screen.is-active { display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; gap: 38px; min-height: 550px; }
.result-scene { position: relative; min-height: 380px; overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(#dbeaca 0 68%,#cfb88c 68%); }
.result-sun { position: absolute; right: 9%; top: 9%; width: 88px; aspect-ratio: 1; border-radius: 50%; background: #f2cf75; box-shadow: 0 0 0 20px rgba(242,207,117,.22); }
.result-scene img { position: absolute; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,.18)); }
.result-scene img:nth-child(2) { z-index: 2; left: 6%; bottom: 7%; width: 54%; height: 69%; }
.result-scene img:last-child { z-index: 3; right: 7%; bottom: 10%; width: 38%; height: 50%; }
.result-screen h2 { font-size: clamp(34px,5vw,56px); line-height: 1; }
.result-screen > div:last-child > p:not(.eyebrow) { color: var(--muted); font-size: 19px; }
.result-actions { display: flex; gap: 12px; }
.secondary-button { border: 2px solid #92bca3; background: #fff; }

@media (max-width: 900px) {
  .home-screen { grid-template-columns: 1fr; }
  .mystery-card { grid-template-columns: 1fr 230px; }
  .answer-count { grid-column: 1 / -1; justify-self: stretch; }
  .control-card { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .result-screen.is-active { grid-template-columns: 1fr; }
  .result-scene { min-height: 310px; }
}

@media (max-width: 720px) {
  .app { width: calc(100% - 16px); margin: 8px auto 20px; border-radius: 24px; }
  .game-bar { min-height: 76px; padding: 10px 13px; }
  .game-icon { width: 46px; height: 46px; flex-basis: 46px; }
  .game-brand small { display: none; }
  .home-screen { padding: 30px 16px 20px; }
  .hero-copy h1 { font-size: clamp(35px,10vw,50px); }
  .hero-scene { min-height: 255px; }
  .how-strip { grid-template-columns: 1fr; }
  .routes-screen, .play-screen, .result-screen { padding: 28px 16px 32px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card h3, .route-card > small { min-height: 0; }
  .route-art { height: 160px; }
  .mystery-card { grid-template-columns: 1fr; }
  .mystery-stage { min-height: 190px; }
  .question-panel > header, .candidate-panel > header { display: block; }
  .question-grid { grid-template-columns: 1fr; }
  .question-grid button { min-height: 94px; grid-template-rows: 1fr; }
  .question-grid small, .question-grid .answer-pill { grid-column: 2; }
  .candidate-grid button { min-height: 140px; }
  .candidate-grid img { height: 96px; }
  .actions { display: grid; }
  .actions button { width: 100%; }
}

@media (max-width: 430px) {
  .game-brand strong { font-size: 15px; }
  .age-pill { display: none; }
  .hero-copy > p:not(.eyebrow) { font-size: 17px; }
  .hero-facts span { padding: 8px 10px; font-size: 13px; }
  .primary-button { width: 100%; }
  .hero-scene { min-height: 225px; }
  .how-strip article { min-height: 90px; padding: 13px; }
  .task-head { gap: 8px; }
  .task-head h2 { font-size: 22px; }
  .counter { padding: 7px 9px; font-size: 12px; }
  .mystery-card { padding: 14px; }
  .question-panel, .candidate-panel, .control-card { padding: 12px; }
  .question-grid button { padding: 11px; }
  .candidate-grid { gap: 5px; }
  .candidate-grid button { min-height: 118px; padding: 4px; }
  .candidate-grid img { height: 78px; }
  .candidate-grid b { font-size: 11px; }
  .result-actions { display: grid; }
  .result-actions button { width: 100%; }
}
