:root {
  color-scheme: light;
  --ink: #294f4c;
  --muted: #6b817c;
  --paper: #fffdf7;
  --cream: #f5efd9;
  --green: #4b9e76;
  --green-dark: #34775b;
  --yellow: #efb743;
  --coral: #ed7467;
  --blue: #58a8d2;
  --purple: #8870b7;
  --line: rgba(181, 153, 94, .34);
  --shadow: 0 18px 42px rgba(77, 67, 42, .12), 0 5px 0 rgba(146, 119, 62, .13);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--cream); }
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 18px 18px, rgba(255,255,255,.7) 0 2px, transparent 2.5px) 0 0 / 36px 36px,
    linear-gradient(145deg, #fbf4de, #eee7cd);
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(88,168,210,.44); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }

.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 20px 0 48px; }
.paper-card { border: 2px solid var(--line); border-radius: 38px; background: rgba(255,253,247,.97); box-shadow: var(--shadow); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; color: #fff; background: var(--green); border: 4px solid #fff8e8; border-radius: 18px; box-shadow: 0 5px 0 rgba(51,117,89,.23); transform: rotate(-3deg); }
.brand-mark svg { width: 31px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.brand b { display: block; font-size: 20px; letter-spacing: -.35px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 9px; }
.top-button { min-height: 45px; padding: 0 17px; border: 2px solid rgba(147,119,62,.28); border-radius: 15px; background: var(--paper); box-shadow: 0 4px 0 rgba(147,119,62,.14); font-weight: 900; }
.top-button.is-active { border-color: rgba(75,158,118,.52); color: var(--green-dark); }
.top-button span { margin-left: 4px; color: var(--green-dark); }

.eyebrow { margin-bottom: 9px; color: #aa6911; font: 700 13px Georgia, serif; letter-spacing: 2.2px; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 470px; overflow: hidden; }
.hero-copy { padding: 55px 54px 46px; }
.hero h1 { max-width: 530px; margin-bottom: 18px; font-size: clamp(43px,5vw,66px); line-height: .98; letter-spacing: -2.4px; }
.hero-text { max-width: 540px; margin-bottom: 27px; color: #536f69; font-size: 19px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.button { min-height: 52px; padding: 0 20px; border: 0; border-radius: 15px; font-weight: 900; transition: transform .15s, box-shadow .15s; }
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:not(:disabled):active { transform: translateY(2px); }
.button svg, .card-link svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.primary { color: #fff; background: var(--green); box-shadow: 0 6px 0 var(--green-dark); }
.secondary { border: 2px solid rgba(162,133,76,.43); background: var(--paper); box-shadow: 0 5px 0 rgba(162,133,76,.19); }
.hint-button { color: #744c00; background: #ffe09a; box-shadow: 0 5px 0 #d69c22; }
.button:disabled { opacity: .55; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 25px; margin: 40px 0 0; padding: 0; list-style: none; }
.hero-stats li { display: flex; align-items: baseline; gap: 7px; }
.hero-stats b { color: var(--coral); font: 700 27px Georgia, serif; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-art { position: relative; display: grid; align-content: center; padding: 36px 30px; overflow: hidden; background: linear-gradient(150deg,#dcefe8 0 52%,#f7d78b 52%); }
.hero-art::before, .hero-art::after { position: absolute; width: 220px; height: 220px; border: 38px solid rgba(255,255,255,.26); border-radius: 50%; content: ""; }
.hero-art::before { top: -105px; right: -65px; }
.hero-art::after { bottom: -120px; left: -75px; }
.hero-path { position: absolute; top: 42%; left: 8%; width: 84%; border-top: 4px dashed rgba(65,126,101,.28); transform: rotate(-3deg); }
.hero-art .mini-chain { position: relative; z-index: 1; }
.hero-note { position: relative; z-index: 1; width: min(330px,92%); margin: 30px auto 0; padding: 16px 20px; border: 3px solid rgba(255,255,255,.72); border-radius: 19px; background: rgba(255,253,247,.92); box-shadow: 0 6px 0 rgba(127,105,65,.15); text-align: center; }
.hero-note b, .hero-note span { display: block; }
.hero-note b { margin-bottom: 4px; font-size: 21px; }
.hero-note span { color: var(--muted); }

.mini-chain { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
.mini-chain span { position: relative; display: grid; width: 64px; height: 77px; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 20px; background: rgba(255,253,247,.88); box-shadow: 0 5px 0 rgba(88,82,56,.12); transform: translateY(calc((var(--mini) - 2.5) * 2px)); }
.mini-chain span::after { position: absolute; right: -8px; width: 10px; border-top: 3px dotted rgba(76,123,105,.45); content: ""; }
.mini-chain span:last-child::after { display: none; }
.mini-chain img { width: 92%; height: 92%; object-fit: contain; }

.how { display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 28px; margin-top: 26px; padding: 28px 34px; }
.how h2 { margin: 0; font-size: 29px; line-height: 1.05; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.steps article { position: relative; min-height: 92px; padding: 17px 12px 14px 55px; border: 2px dashed #dfc998; border-radius: 19px; }
.steps article > span { position: absolute; top: 15px; left: 12px; display: grid; width: 32px; height: 32px; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-weight: 900; }
.steps b { display: block; margin-bottom: 3px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }

.levels-section { margin-top: 36px; }
.section-heading h2 { margin: 0 0 20px; font-size: 31px; }
.level-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.level-card { position: relative; min-width: 0; padding: 28px; overflow: hidden; border: 2px solid var(--line); border-radius: 31px; box-shadow: var(--shadow); }
.level-card.coral { background: #f9ded7; }
.level-card.blue { background: #dcecf2; }
.level-card.green { background: #e2eedb; }
.level-number { position: absolute; top: 14px; right: 20px; color: rgba(41,79,76,.12); font: 700 70px Georgia, serif; }
.level-card > p { margin-bottom: 9px; color: #9d651d; font: 700 12px Georgia,serif; letter-spacing: 1.4px; text-transform: uppercase; }
.level-card h3 { position: relative; margin-bottom: 7px; font-size: 25px; }
.level-note { display: block; min-height: 42px; color: var(--muted); line-height: 1.4; }
.level-card .mini-chain { min-height: 100px; margin: 18px -12px; }
.level-card .mini-chain span { width: 47px; height: 62px; border-radius: 15px; }
.level-meta { display: flex; justify-content: space-between; gap: 8px; margin: 19px 0 14px; color: var(--muted); font-size: 13px; }
.level-meta span:last-child { color: #a16a13; }
.card-link { display: flex; width: 100%; min-height: 49px; align-items: center; justify-content: space-between; padding: 0 15px; color: #fff; border: 0; border-radius: 14px; background: var(--green); box-shadow: 0 5px 0 var(--green-dark); font-weight: 900; }
.grownup-note { max-width: 850px; margin: 34px auto 0; color: var(--muted); text-align: center; line-height: 1.45; }

.game-card { padding: 25px 30px 30px; }
.game-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.back-button { display: grid; width: 50px; height: 50px; place-items: center; border: 2px solid rgba(179,149,91,.46); border-radius: 16px; background: var(--paper); box-shadow: 0 4px 0 rgba(154,127,70,.15); font-size: 31px; }
.game-head p { margin: 0 0 2px; color: #a56b15; font: 700 12px Georgia,serif; letter-spacing: 1.5px; text-transform: uppercase; }
.game-head > strong { font: 400 16px Georgia,serif; }
.game-head > strong span { color: var(--coral); font-size: 27px; }
.progress-track { height: 9px; margin: 16px 0 24px 64px; overflow: hidden; border-radius: 99px; background: #eee5cb; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--yellow),var(--coral)); transition: width .25s; }
.mission { text-align: center; }
.mission h1 { margin-bottom: 7px; font-size: clamp(31px,4vw,45px); letter-spacing: -1px; }
.mission > p:last-child { color: var(--muted); font-size: 17px; }

.chain-board { position: relative; display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; margin: 25px 0 32px; padding: 23px; border-radius: 31px; background: linear-gradient(135deg,#eaf3e3,#f7ebca); }
.chain-board::before { position: absolute; top: 50%; left: 5%; width: 90%; border-top: 4px dashed rgba(74,140,111,.23); content: ""; }
.animal-token { position: relative; display: grid; min-width: 0; min-height: 155px; place-items: center; align-content: center; padding: 9px 7px 7px; border: 3px solid rgba(255,255,255,.92); border-radius: 24px; background: rgba(255,253,247,.9); box-shadow: 0 7px 0 rgba(100,91,56,.12); }
.chain-board .animal-token:nth-child(even) { transform: translateY(8px); }
.animal-token img { position: relative; z-index: 1; width: 100%; height: 112px; object-fit: contain; }
.animal-token small { position: relative; z-index: 2; display: block; min-height: 22px; margin-top: -2px; padding: 4px 8px; color: #fff; border-radius: 8px; background: var(--green); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.animal-token.hint-part { border-color: var(--yellow); box-shadow: 0 0 0 5px rgba(239,183,67,.19), 0 7px 0 rgba(100,91,56,.12); }
.answer-token { animation: pop .35s ease-out; }
.empty-token { border: 3px dashed #c79b39; background: rgba(255,244,199,.82); }
.empty-token > span { display: grid; width: 68px; height: 68px; place-items: center; color: #ad781b; border: 3px solid #ddb657; border-radius: 50%; background: #fff9e9; font: 700 42px Georgia,serif; }
.empty-token small { color: #81550c; background: transparent; }

.choice-panel { max-width: 980px; margin: 0 auto; }
.choice-title { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.choice-title h2 { margin-bottom: 15px; font-size: 31px; }
.choice-title > span { margin-bottom: 19px; color: var(--muted); }
.options { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; }
.option { position: relative; display: grid; min-width: 0; min-height: 178px; grid-template-rows: 112px auto; place-items: center; padding: 10px; border: 2px solid rgba(179,149,91,.31); border-radius: 22px; background: var(--paper); box-shadow: 0 6px 0 rgba(151,124,70,.2); transition: transform .15s, border-color .15s; }
.option:not(:disabled):hover { border-color: var(--blue); transform: translateY(-3px); }
.option img { width: 100%; height: 105px; object-fit: contain; }
.option > span:last-child { min-width: 0; text-align: center; }
.option b { display: block; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.option small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.option-number { position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; width: 27px; height: 27px; place-items: center; color: #fff; border-radius: 50%; background: #9ab0aa; font-size: 12px; font-weight: 900; }
.option.is-wrong { border-color: var(--coral); background: #fbe1dc; opacity: .72; }
.option.is-wrong .option-number { background: var(--coral); }
.option.is-correct { border-color: var(--green); background: #dff1e4; }
.option.is-correct .option-number { background: var(--green); }
.feedback { display: flex; min-height: 57px; align-items: center; gap: 12px; margin-top: 17px; padding: 11px 15px; border-radius: 17px; }
.feedback > span { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; color: #fff; border-radius: 50%; font-weight: 900; }
.feedback p { margin: 0; line-height: 1.4; }
.feedback b { display: block; margin-bottom: 2px; }
.feedback.quiet { background: #f2eee2; }
.feedback.quiet > span { background: #9eb2ad; }
.feedback.error { color: #98473f; background: #fbe0dc; }
.feedback.error > span { background: var(--coral); }
.feedback.success { color: #35785d; background: #ddf0e3; }
.feedback.success > span { background: var(--green); }
.hint-card { margin-top: 11px; padding: 14px 17px; border: 2px dashed #d6a434; border-radius: 17px; background: #fff6d6; }
.hint-card span { display: block; margin-bottom: 4px; color: #9a6511; font: 700 12px Georgia,serif; letter-spacing: 1.4px; text-transform: uppercase; }
.hint-card p { margin: 0; line-height: 1.45; }
.game-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 13px; margin-top: 15px; }

.discovery { display: grid; grid-template-columns: 1fr 410px; align-items: center; gap: 25px; margin-top: 25px; padding: 26px 30px; }
.discovery h2 { margin-bottom: 8px; font-size: 25px; }
.discovery p:last-child { margin: 0; color: var(--muted); line-height: 1.45; }
.discovery .mini-chain span { width: 56px; height: 70px; }

.result { display: grid; grid-template-columns: .88fr 1.12fr; min-height: 560px; overflow: hidden; }
.result-art { position: relative; display: grid; align-content: center; padding: 40px 22px; background: linear-gradient(145deg,#dcefe8,#f3d994); }
.result-art .mini-chain { flex-wrap: wrap; }
.result-art .mini-chain span { width: 78px; height: 98px; }
.result-art > span { width: max-content; margin: 30px auto 0; padding: 10px 17px; color: #fff; border: 3px solid #fff; border-radius: 10px; background: var(--coral); box-shadow: 0 5px 0 rgba(136,70,61,.22); font-weight: 900; transform: rotate(-3deg); }
.result-copy { padding: 48px 43px; }
.result h1 { max-width: 560px; margin-bottom: 20px; font-size: clamp(39px,5vw,58px); line-height: 1; }
.stars { margin-bottom: 19px; }
.stars span { color: #ddd2b7; font: 700 48px Georgia,serif; }
.stars .earned { color: #eba92f; text-shadow: 0 3px 0 #c9841f; }
.result-copy > p { color: var(--muted); font-size: 17px; line-height: 1.5; }
.result dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 22px 0; }
.result dl div { padding: 13px 8px; border-radius: 15px; background: #f3eee0; text-align: center; }
.result dt { color: var(--muted); font-size: 12px; }
.result dd { margin: 4px 0 0; font: 700 25px Georgia,serif; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { margin-top: 17px; padding: 0; color: var(--green-dark); border: 0; background: transparent; font-weight: 900; text-decoration: underline; }

.album-head { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 34px 40px; }
.album-head h1 { margin-bottom: 8px; font-size: 42px; }
.album-head p:last-child { margin: 0; color: var(--muted); }
.album-head > strong { display: grid; width: 118px; height: 118px; flex: 0 0 auto; place-items: center; align-content: center; border: 7px solid #c7b6e4; border-radius: 50%; background: #f8f2ff; text-align: center; }
.album-head > strong b { color: var(--coral); font: 700 28px Georgia,serif; }
.album-head > strong span { color: var(--muted); font-size: 11px; }
.album-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 20px; }
.album-card { position: relative; min-width: 0; min-height: 270px; padding: 19px 17px 17px; border: 2px solid var(--line); border-radius: 25px; background: var(--paper); box-shadow: var(--shadow); }
.card-index { position: absolute; top: 12px; right: 14px; color: #b88934; font: 700 12px Georgia,serif; }
.album-card .mini-chain { min-height: 105px; margin: 11px -9px 15px; padding: 10px 5px; border-radius: 19px; background: #eee8f5; }
.album-card .mini-chain span { width: 45px; height: 59px; border-radius: 14px; }
.album-card h2 { margin-bottom: 7px; font-size: 19px; }
.album-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.album-card.is-locked { display: grid; place-items: center; align-content: center; text-align: center; background: rgba(255,253,247,.66); }
.locked-mark { display: grid; width: 74px; height: 74px; margin-bottom: 16px; place-items: center; color: #b39a70; border: 3px dashed #ccb887; border-radius: 50%; font: 700 37px Georgia,serif; }
.album-back { display: block; margin: 25px auto 0; }

@keyframes pop { from { transform: scale(.72); opacity: .3; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 44px 42px 38px; }
  .hero-art { min-height: 350px; }
  .how { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; }
  .level-card > p, .level-card h3, .level-card .level-note { grid-column: 1; }
  .level-card .mini-chain { grid-column: 2; grid-row: 1 / span 4; }
  .level-meta, .card-link { grid-column: 1 / -1; }
  .discovery { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .result-art { min-height: 320px; }
  .album-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 700px) {
  .chain-board { grid-template-columns: repeat(3,1fr); }
  .chain-board::before { display: none; }
  .chain-board .animal-token:nth-child(even) { transform: none; }
  .animal-token { min-height: 140px; }
  .options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .options.count-3 .option:last-child, .options.count-5 .option:last-child { grid-column: 1 / -1; }
  .how { padding: 26px; }
  .steps { grid-template-columns: 1fr; }
  .steps article { min-height: 70px; }
  .album-head { align-items: flex-start; }
}

@media (max-width: 520px) {
  .app { width: min(100% - 18px,1120px); padding-top: 10px; }
  .paper-card { border-radius: 28px; }
  .topbar { align-items: flex-start; gap: 8px; margin-bottom: 11px; }
  .brand { gap: 7px; }
  .brand-mark { width: 43px; height: 43px; border-width: 3px; border-radius: 14px; }
  .brand-mark svg { width: 26px; }
  .brand b { font-size: 16px; }
  .brand small { display: none; }
  .top-actions { gap: 5px; }
  .top-button { min-height: 42px; padding: 0 10px; border-radius: 13px; font-size: 12px; }
  .hero-copy { padding: 36px 23px 32px; }
  .hero h1 { font-size: 45px; }
  .hero-text { font-size: 17px; }
  .hero-actions .button { width: 100%; }
  .hero-stats { gap: 13px; margin-top: 31px; }
  .hero-art { min-height: 300px; padding: 28px 12px; }
  .hero-art .mini-chain span { width: 49px; height: 65px; border-radius: 16px; }
  .how { padding: 23px 18px; }
  .how h2, .section-heading h2 { font-size: 26px; }
  .level-card { display: block; padding: 24px 20px; }
  .level-card .mini-chain { margin: 14px -7px; }
  .level-card .mini-chain span { width: 45px; }
  .game-card { padding: 16px 12px 19px; }
  .game-head { gap: 9px; }
  .back-button { width: 47px; height: 47px; }
  .progress-track { margin: 14px 0 20px; }
  .mission h1 { font-size: 31px; }
  .mission > p:last-child { font-size: 15px; }
  .chain-board { gap: 8px; margin: 20px 0 27px; padding: 13px 8px; border-radius: 24px; }
  .animal-token { min-height: 122px; padding: 5px; border-radius: 18px; }
  .animal-token img { height: 91px; }
  .empty-token > span { width: 53px; height: 53px; font-size: 33px; }
  .choice-title h2 { font-size: 27px; }
  .choice-title > span { font-size: 12px; }
  .options { gap: 9px; }
  .option { min-height: 155px; grid-template-rows: 93px auto; padding: 7px; border-radius: 19px; }
  .option img { height: 90px; }
  .option b { font-size: 15px; }
  .game-actions .button { width: 100%; }
  .discovery { padding: 22px 15px; }
  .discovery .mini-chain span { width: 45px; height: 59px; }
  .result-art { min-height: 285px; padding: 28px 12px; }
  .result-art .mini-chain span { width: 56px; height: 73px; }
  .result-copy { padding: 34px 22px; }
  .result h1 { font-size: 42px; }
  .result dl { gap: 5px; }
  .result-actions .button { width: 100%; }
  .album-head { padding: 25px 21px; }
  .album-head h1 { font-size: 32px; }
  .album-head > strong { width: 85px; height: 85px; border-width: 5px; }
  .album-grid { grid-template-columns: 1fr; }
  .album-card { min-height: 250px; }
}

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