:root {
  --ink: #24463a;
  --muted: #66766e;
  --paper: #fffdf7;
  --line: #ded5c4;
  --green: #438e69;
  --green-dark: #326f52;
  --green-soft: #e4f2e7;
  --gold: #dca63e;
  --gold-soft: #fff3c9;
  --orange: #ce7446;
  --orange-soft: #ffeadf;
  --shadow: 0 15px 38px rgba(58, 68, 54, .13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 8%, rgba(255, 218, 103, .3), transparent 27%), radial-gradient(circle at 91% 13%, rgba(157, 221, 180, .34), transparent 30%), #f8f1dd; font-family: "Trebuchet MS", Arial, sans-serif; }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 4px solid rgba(232, 177, 58, .52); outline-offset: 3px; }
button:disabled { cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.04; }

.app { width: min(1120px, calc(100% - 32px)); margin: 24px auto 0; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; padding: 12px 15px; border: 1px solid rgba(173, 154, 106, .22); border-radius: 24px; background: linear-gradient(120deg, rgba(255, 250, 230, .97), rgba(222, 243, 222, .96)); box-shadow: 0 8px 23px rgba(72, 85, 60, .1); }
.game-brand { display: flex; min-width: 0; align-items: center; gap: 12px; }
.game-brand > span:last-child { display: grid; min-width: 0; }
.game-brand strong { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.game-brand small { margin-top: 3px; color: var(--muted); }
.game-icon { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border-radius: 18px; color: #fff5cb; background: linear-gradient(145deg, #cf8f38, #9e672e); box-shadow: 0 8px 14px rgba(137, 86, 37, .24); transform: rotate(-2deg); }
.game-icon svg { width: 43px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.8; }
.age-pill { flex: 0 0 auto; padding: 10px 14px; border: 2px solid #ead6a2; border-radius: 999px; color: #765f2d; background: #fff8dc; font-weight: 900; }

.screen { display: none; padding: 30px; overflow: hidden; border: 1px solid rgba(171, 155, 116, .28); border-radius: 34px; background: rgba(255, 253, 247, .97); box-shadow: var(--shadow); }
.screen.is-active { display: block; }
.home-screen.is-active, .result-screen.is-active { display: grid; grid-template-columns: minmax(0, .86fr) minmax(470px, 1.14fr); align-items: center; gap: 25px; }
.eyebrow { margin-bottom: 8px; color: #a36e32; font-size: 12px; font-weight: 1000; letter-spacing: .15em; }
.hero-copy h1 { max-width: 520px; margin-bottom: 16px; font-size: clamp(42px, 5.3vw, 65px); letter-spacing: -.035em; }
.hero-copy > p:not(.eyebrow) { max-width: 510px; margin-bottom: 19px; color: var(--muted); font-size: 19px; line-height: 1.45; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.hero-facts span { padding: 8px 11px; border-radius: 999px; color: #3c6653; background: #e6f1e5; font-size: 13px; font-weight: 900; }
.primary-button, .secondary-button, .route-button, .hide-button, .next-button { min-height: 54px; padding: 13px 20px; border: 0; border-radius: 17px; color: white; background: linear-gradient(145deg, #4b9b72, #347c5a); box-shadow: 0 8px 17px rgba(45, 111, 79, .2); font-weight: 1000; cursor: pointer; }
.primary-button:hover, .route-button:hover, .hide-button:hover, .next-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.secondary-button { border: 2px solid #4d8d6d; color: #356d52; background: white; box-shadow: none; }
.hero-copy .primary-button { min-width: 235px; }
.hero-board { min-height: 380px; }
.hero-board .picnic-stage { min-height: 380px; }
.hero-board .cloth { min-height: 320px; }
.how-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 2px; }
.how-strip article { display: flex; min-height: 88px; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e2dac9; border-radius: 19px; background: linear-gradient(145deg, #fffdf8, #f6f1e5); }
.how-strip article > b { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #fff7d7; background: #b97f37; }
.how-strip article span { display: grid; gap: 3px; }
.how-strip article strong { line-height: 1.1; }
.how-strip article small { color: var(--muted); line-height: 1.25; }

.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.section-title h2 { margin-bottom: 0; font-size: clamp(32px, 4vw, 46px); }
.section-title > p { margin: 0 0 4px; color: var(--muted); font-weight: 900; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; align-items: stretch; }
.route-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 10px 25px rgba(62, 76, 62, .08); }
.route-preview { position: relative; min-height: 230px; overflow: hidden; background: var(--route-soft); }
.route-preview .picnic-stage { position: absolute; inset: 0; min-height: 0; padding: 12px; border: 0; border-radius: 0; }
.route-preview .cloth { min-height: 204px; padding: 27px 10px 12px; border-width: 5px; border-radius: 20px; }
.route-preview .remember-grid { gap: 5px; }
.route-preview .memory-item { min-height: 133px; padding: 6px 3px; border-radius: 14px; }
.route-preview .memory-item img { height: 78px; }
.route-preview .memory-item b { display: none; }
.route-count { position: absolute; z-index: 9; top: 12px; right: 12px; display: grid; width: 54px; height: 54px; place-items: center; border: 4px solid rgba(255, 255, 255, .92); border-radius: 17px; color: white; background: var(--route-accent); font-size: 20px; font-weight: 1000; box-shadow: 0 5px 12px rgba(48, 61, 48, .16); transform: rotate(3deg); }
.route-copy { display: flex; min-height: 298px; flex: 1; flex-direction: column; padding: 17px; }
.route-copy h3 { margin-bottom: 10px; font-size: 25px; }
.route-copy > p:not(.eyebrow) { min-height: 79px; margin-bottom: 15px; color: var(--muted); line-height: 1.38; }
.route-progress { height: 9px; margin-top: auto; overflow: hidden; border-radius: 999px; background: #eee7da; }
.route-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #edaf45, var(--route-accent)); }
.route-meta { display: flex; justify-content: space-between; margin: 7px 1px 14px; color: #617269; font-size: 12px; font-weight: 900; }
.route-button { width: 100%; background: var(--route-accent); }
.text-button { margin-top: 18px; padding: 10px 2px; border: 0; color: #4c7462; background: transparent; font-weight: 900; cursor: pointer; }

.task-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 13px; }
.task-head h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.round-button { display: grid; width: 46px; height: 46px; place-items: center; border: 2px solid #d9e4d9; border-radius: 50%; background: #f4f8f2; font-size: 25px; cursor: pointer; }
.counter { padding: 9px 12px; border-radius: 999px; color: #476c59; background: var(--green-soft); font-weight: 1000; }
.task-progress { height: 8px; margin: 16px 0 20px; overflow: hidden; border-radius: 999px; background: #eee7d9; }
.task-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e8ad48, #4c9b72); transition: width .25s ease; }

.memory-board { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 20px; align-items: start; }
.picnic-stage-card { min-width: 0; padding: 12px; border: 1px solid #dcd3c2; border-radius: 27px; background: linear-gradient(150deg, #e8e0d0, #fffaf0); }
.picnic-stage { position: relative; min-height: 388px; overflow: hidden; padding: 20px; border: 7px solid white; border-radius: 22px; background-color: #dcebd9; background-image: linear-gradient(rgba(250, 246, 226, .53), rgba(241, 236, 212, .64)), var(--board-image); background-position: center; background-size: cover; }
.picnic-stage::before { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .5), transparent 48%), linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(72, 83, 53, .12)); content: ""; }
.cloth { position: relative; z-index: 1; display: grid; min-height: 334px; place-items: center; padding: 25px; border: 8px solid rgba(255, 253, 238, .94); border-radius: 34px; background-color: rgba(255, 244, 215, .93); background-image: linear-gradient(45deg, rgba(202, 111, 72, .1) 25%, transparent 25%, transparent 75%, rgba(202, 111, 72, .1) 75%), linear-gradient(45deg, rgba(202, 111, 72, .1) 25%, transparent 25%, transparent 75%, rgba(202, 111, 72, .1) 75%); background-position: 0 0, 18px 18px; background-size: 36px 36px; box-shadow: 0 14px 28px rgba(70, 64, 43, .18); }
.cloth::after { position: absolute; inset: 8px; pointer-events: none; border: 3px dashed rgba(170, 103, 62, .38); border-radius: 25px; content: ""; }
.remember-grid { position: relative; z-index: 2; display: grid; width: 100%; grid-template-columns: repeat(var(--item-count), minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.memory-item { position: relative; display: grid; min-width: 0; min-height: 245px; grid-template-rows: minmax(150px, 1fr) auto; place-items: center; padding: 13px 8px 11px; border: 3px solid rgba(255, 255, 255, .96); border-radius: 23px; background: rgba(255, 253, 245, .94); box-shadow: 0 9px 18px rgba(62, 62, 44, .14); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.memory-item img { width: 100%; height: 150px; object-fit: contain; filter: drop-shadow(0 7px 6px rgba(55, 57, 37, .16)); }
.memory-item b { overflow: hidden; width: 100%; color: #315748; font-size: clamp(13px, 1.2vw, 16px); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.memory-item.is-hidden { grid-template-rows: 1fr; border: 3px dashed #cdbf9d; color: #86775c; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .86) 0 13px, rgba(238, 231, 211, .86) 13px 26px); font-weight: 900; text-align: center; }
.memory-item.is-hidden::before { display: grid; width: 74px; height: 58px; place-items: center; border: 3px solid #d6c7a5; border-radius: 14px 14px 22px 22px; color: #9b896b; background: rgba(255, 250, 235, .76); content: "?"; font-size: 29px; }
.memory-item.is-found { border-color: #63aa7a; background: rgba(236, 249, 237, .97); box-shadow: 0 0 0 5px rgba(79, 157, 102, .2), 0 10px 20px rgba(47, 86, 56, .15); }
.memory-item.is-found::after { position: absolute; top: 8px; right: 8px; display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: white; background: #4f9b6a; content: "✓"; font-weight: 1000; }
.stage-note { min-height: 38px; margin: 9px 8px 0; color: var(--muted); font-size: 14px; line-height: 1.35; text-align: center; }

.guide-card { padding: 21px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 10px 24px rgba(54, 70, 58, .08); }
.guide-card h3 { font-size: 27px; }
.item-progress { display: flex; align-items: center; gap: 8px; min-height: 58px; margin: 13px 0 15px; padding: 10px; border-radius: 16px; background: #f3eee4; }
.item-dot { display: grid; width: 40px; height: 40px; flex: 1; max-width: 53px; place-items: center; border: 2px dashed #c9bda8; border-radius: 13px; color: #8c7c64; background: #fffaf0; font-weight: 1000; }
.item-dot.is-current { border-style: solid; border-color: #e6b94b; color: #755b1f; background: #fff2b8; box-shadow: 0 0 0 4px rgba(230, 185, 75, .16); }
.item-dot.is-found { border-style: solid; border-color: #61a878; color: white; background: #58a171; }
.feedback { display: grid; gap: 4px; min-height: 116px; padding: 14px; border-radius: 16px; color: #5d6f65; background: #f4f1e8; line-height: 1.3; }
.feedback b { color: var(--ink); }
.feedback.is-warn { color: #835533; background: var(--orange-soft); }
.feedback.is-warn b { color: #974c25; }
.feedback.is-hint { color: #725c21; background: #fff6d2; }
.feedback.is-success { color: #31634a; background: var(--green-soft); }
.task-actions { display: grid; gap: 9px; margin-top: 13px; }
.hide-button { width: 100%; background: linear-gradient(145deg, #c1844e, #a66a36); box-shadow: 0 8px 17px rgba(157, 94, 43, .22); }
.hint-button { display: inline-flex; min-height: 49px; align-items: center; justify-content: center; gap: 7px; padding: 11px 12px; border: 2px solid #ead69d; border-radius: 15px; background: #fff7dc; font-weight: 900; cursor: pointer; }
.hint-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.next-button { width: 100%; }

.candidate-panel { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, #fffdf8, #f6f2e7); }
.candidate-panel > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.candidate-panel h3 { margin: 0; font-size: 25px; }
.candidate-panel header small { color: var(--muted); font-weight: 900; }
.candidate-grid { display: grid; grid-template-columns: repeat(var(--candidate-columns), minmax(0, 1fr)); gap: 11px; }
.candidate-card { position: relative; display: grid; min-width: 0; min-height: 154px; place-items: center; padding: 8px; border: 3px solid #ddd5c8; border-radius: 19px; background: white; box-shadow: 0 7px 14px rgba(58, 66, 51, .1); cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.candidate-card:hover:not(:disabled) { border-color: #b99754; transform: translateY(-2px); }
.candidate-card img { width: 100%; height: 103px; object-fit: contain; }
.candidate-card b { overflow: hidden; max-width: 100%; font-size: 14px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.candidate-card.is-wrong { border-color: #d97649; background: #fff0e7; animation: card-wiggle .22s ease; }
.candidate-card.is-hint { border-color: #e6b53e; background: #fff7d4; box-shadow: 0 0 0 5px rgba(230, 181, 62, .22); }
.candidate-card.is-selected { opacity: .74; border-color: #71aa82; background: #edf7ee; }
.candidate-card.is-selected::after { position: absolute; top: 7px; right: 7px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: white; background: #4c9a68; content: "✓"; font-weight: 1000; }

.result-board { min-height: 420px; }
.result-board .picnic-stage { min-height: 420px; }
.result-board .cloth { min-height: 360px; }
.result-copy h2 { margin-bottom: 16px; font-size: clamp(37px, 5vw, 57px); }
.result-copy > p:not(.eyebrow) { color: var(--muted); font-size: 18px; line-height: 1.45; }
.result-facts { display: flex; gap: 9px; margin: 20px 0; }
.result-facts span { padding: 10px 13px; border-radius: 15px; color: #3d6854; background: var(--green-soft); font-weight: 900; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@keyframes card-wiggle { 33% { transform: translateX(-5px); } 66% { transform: translateX(5px); } }

@media (max-width: 1050px) {
  .memory-board { grid-template-columns: 1fr; }
  .guide-card { display: grid; grid-template-columns: minmax(0, .85fr) minmax(300px, 1.15fr); gap: 0 14px; }
  .guide-card .eyebrow, .guide-card h3, .item-progress { grid-column: 1; }
  .feedback, .task-actions { grid-column: 2; }
  .feedback { grid-row: 1 / span 3; }
  .task-actions { align-self: end; }
  .candidate-panel { grid-column: 1; }
}

@media (max-width: 860px) {
  .home-screen.is-active, .result-screen.is-active { grid-template-columns: 1fr; }
  .hero-board, .result-board { width: min(100%, 690px); justify-self: center; }
}

@media (max-width: 760px) {
  .app { width: min(1120px, calc(100% - 20px)); margin-top: 16px; }
  .game-head { align-items: flex-start; }
  .game-brand small { display: none; }
  .game-icon { width: 48px; height: 48px; border-radius: 15px; }
  .game-icon svg { width: 35px; }
  .screen { padding: 19px; border-radius: 25px; }
  .hero-copy h1 { font-size: clamp(38px, 11vw, 53px); }
  .how-strip { grid-template-columns: 1fr; }
  .how-strip article { min-height: 72px; }
  .route-preview { min-height: 195px; }
  .route-preview .cloth { min-height: 169px; }
  .route-preview .memory-item { min-height: 109px; }
  .route-preview .memory-item img { height: 63px; }
  .route-copy { min-height: 338px; }
  .section-title { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 650px) {
  .route-grid { grid-template-columns: 1fr; }
  .route-preview { min-height: 250px; }
  .route-preview .cloth { min-height: 225px; }
  .route-preview .memory-item { min-height: 150px; }
  .route-preview .memory-item img { height: 92px; }
  .route-copy { min-height: 270px; }
  .route-copy > p:not(.eyebrow) { min-height: 0; }
  .guide-card { display: block; }
  .feedback { min-height: 84px; }
  .picnic-stage { min-height: 0; padding: 12px; }
  .cloth { min-height: 0; padding: 15px; border-width: 6px; }
  .remember-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .remember-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .remember-grid[data-count="5"] .memory-item:last-child { grid-column: 1 / -1; width: calc(50% - 5px); justify-self: center; }
  .memory-item { min-height: 190px; grid-template-rows: 125px auto; padding: 8px 5px 8px; border-radius: 18px; }
  .remember-grid[data-count="3"] .memory-item { min-height: 180px; grid-template-rows: 116px auto; }
  .memory-item img { height: 122px; }
  .memory-item.is-hidden { grid-template-rows: 1fr; }
  .memory-item b { font-size: 12px; }
  .candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-board { min-height: 0; }
  .result-board .picnic-stage, .result-board .cloth { min-height: 0; }
}

@media (max-width: 430px) {
  .app { width: min(1120px, calc(100% - 14px)); }
  .game-head { gap: 7px; }
  .game-brand { gap: 8px; }
  .game-brand strong { font-size: 16px; }
  .age-pill { padding: 8px 9px; font-size: 12px; }
  .screen { padding: 13px; border-radius: 21px; }
  .hero-copy > p:not(.eyebrow) { font-size: 17px; }
  .task-head { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
  .round-button { width: 39px; height: 39px; }
  .task-head h2 { font-size: 24px; }
  .counter { padding: 7px 8px; font-size: 12px; }
  .picnic-stage-card { padding: 7px; border-radius: 20px; }
  .picnic-stage { border-width: 5px; border-radius: 18px; }
  .cloth { padding: 10px; border-width: 5px; border-radius: 24px; }
  .remember-grid { gap: 7px; }
  .remember-grid[data-count="3"] { gap: 5px; }
  .remember-grid[data-count="3"] .memory-item { min-height: 167px; grid-template-rows: 107px auto; padding-inline: 3px; }
  .memory-item { min-height: 176px; grid-template-rows: 112px auto; }
  .memory-item img { height: 108px; }
  .memory-item.is-hidden { grid-template-rows: 1fr; }
  .stage-note { font-size: 12px; }
  .guide-card { padding: 14px; border-radius: 20px; }
  .guide-card h3 { font-size: 23px; }
  .item-progress { gap: 5px; min-height: 54px; padding: 8px; }
  .item-dot { width: 34px; height: 34px; font-size: 13px; }
  .feedback { font-size: 14px; }
  .candidate-panel { padding: 12px; border-radius: 19px; }
  .candidate-panel > header { align-items: flex-start; flex-direction: column; }
  .candidate-panel h3 { font-size: 22px; }
  .candidate-grid { gap: 7px; }
  .candidate-card { min-height: 112px; padding: 5px; border-radius: 15px; }
  .candidate-card img { height: 72px; }
  .candidate-card b { font-size: 10px; }
  .result-facts { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
