:root{
  --cream:#f7efe1;--cream2:#fbf5eb;--paper:#fff9ef;--forest:#294737;--forest-deep:#1e3529;
  --red:#a94f48;--red-deep:#8f403b;--gold:#c69a53;--gold-light:#e7ca8f;--ink:#342b24;--muted:#74695e;
  --line:rgba(67,48,33,.14);--softline:rgba(198,154,83,.30);--shadow:0 20px 52px rgba(62,44,31,.14);--shadow-soft:0 10px 28px rgba(62,44,31,.10);
  color-scheme:light;
}
*{box-sizing:border-box}html{min-width:320px;background:var(--cream);scroll-behavior:smooth}body{margin:0;min-width:320px;color:var(--ink);font-family:Inter,ui-rounded,"Avenir Next",Avenir,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:radial-gradient(circle at 18% 0%,rgba(255,255,255,.96),transparent 38rem),linear-gradient(180deg,#fbf5eb 0%,var(--cream) 76%)}button,input{font:inherit}button{-webkit-tap-highlight-color:transparent;cursor:pointer}button:focus-visible,input:focus-visible{outline:4px solid rgba(198,154,83,.38);outline-offset:3px}[hidden]{display:none!important}img{max-width:100%;display:block}.app-shell{width:min(1240px,calc(100% - 28px));margin:0 auto;padding:clamp(16px,3vw,36px) 0 44px}.screen{animation:screenIn .36s ease both}@keyframes screenIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}.eyebrow{margin:0;color:var(--forest);font-size:.76rem;font-weight:950;letter-spacing:.21em}.button{min-height:52px;border:0;border-radius:999px;padding:0 24px;font-weight:900;box-shadow:var(--shadow-soft);transition:transform .18s ease,box-shadow .18s ease}.button:active{transform:translateY(1px) scale(.99)}.button-primary{background:var(--forest);color:#fff8ee}.button-secondary{background:#f2e4c9;color:var(--forest);box-shadow:none}.tiny-note{color:#8d8074;font-size:.92rem}

/* access */
.access-screen{min-height:calc(100vh - 80px);display:grid;grid-template-columns:minmax(0,1.05fr) minmax(440px,.95fr);align-items:center;gap:clamp(34px,6vw,90px)}.access-visual img{width:100%;filter:drop-shadow(0 12px 24px rgba(87,59,37,.08))}.access-copy h1,.home-heading h1,.game-heading h1{font-family:Georgia,"Times New Roman",serif;color:var(--forest-deep);letter-spacing:-.045em}.access-copy h1{margin:10px 0 20px;font-size:clamp(48px,6.7vw,92px);line-height:.93}.lead{margin:0 0 28px;color:#776b60;font:clamp(18px,2vw,25px)/1.48 Georgia,serif;max-width:660px}.code-card{padding:25px;border:1px solid var(--line);border-radius:28px;background:rgba(255,249,239,.86);box-shadow:var(--shadow-soft);text-align:left}.code-card label{display:block;color:var(--forest-deep);font-weight:950;font-size:1rem}.code-card>p{margin:6px 0 16px;color:var(--muted);font-size:.94rem}.code-row{display:flex;gap:10px}.code-row input{min-width:0;flex:1;height:52px;border:1px solid rgba(67,48,33,.18);border-radius:999px;background:#fffdf8;padding:0 18px;text-transform:uppercase;font-weight:850;letter-spacing:.08em;color:var(--forest-deep)}.form-message{min-height:20px;margin:11px 0 0!important;color:var(--red)!important;font-size:.86rem!important;font-weight:800}.form-message.success{color:var(--forest)!important}

/* home */
.home-screen{padding:24px 0 26px}.home-heading{text-align:center;max-width:920px;margin:0 auto 27px}.home-heading h1{font-size:clamp(44px,6.3vw,78px);line-height:.96;margin:10px 0 13px}.home-heading>p:last-child{max-width:760px;margin:0 auto;color:var(--muted);font:clamp(17px,2vw,21px)/1.5 Georgia,serif}.mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.mode-card{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:30px;background:#fff9ef;padding:0;text-align:left;box-shadow:var(--shadow-soft);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.mode-card:hover{transform:translateY(-3px);box-shadow:var(--shadow);border-color:rgba(198,154,83,.38)}.mode-art{height:164px;border-bottom:1px solid var(--line);background:linear-gradient(145deg,#f2e5cf,#f9f2e6);display:flex;align-items:center;justify-content:center;gap:9px;padding:18px}.pattern-art span{position:relative;width:68px;height:88px;border:1px solid rgba(198,154,83,.36);background:#fffdf8;border-radius:17px;display:grid;place-items:center;box-shadow:0 7px 15px rgba(63,43,29,.08)}.pattern-art img{width:78%;height:78%;object-fit:contain}.pattern-art .q{font:700 38px Georgia,serif;color:#c49a58;background:#f4e8d4;border-style:dashed}.pattern-art .small img{width:52%;height:52%}.pattern-art .medium img{width:67%;height:67%}.pattern-art .large img{width:86%;height:86%}.pattern-art span b{position:absolute;left:7px;top:5px;color:var(--red);font-size:.72rem}.master-art span:not(.q){width:70px}.master-art span:nth-child(2) img{width:64%;height:64%}.master-art span:nth-child(3) img{width:79%;height:79%}.mode-copy{display:flex;flex-direction:column;padding:21px}.mode-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#efe1c0;color:var(--gold);font-size:1rem;margin-bottom:9px}.mode-name{color:var(--forest-deep);font:700 31px/1 Georgia,serif}.mode-detail{margin-top:7px;color:var(--red-deep);font-size:.86rem;font-weight:950;letter-spacing:.04em}.mode-caption{min-height:42px;margin-top:8px;color:var(--muted);font-size:.85rem;line-height:1.45}.mode-cta{margin-top:16px;color:var(--forest);font-weight:950;font-size:.9rem}.mode-cta b{font-size:1.15rem}.mode-ribbon{position:absolute;right:14px;top:14px;z-index:2;padding:7px 10px;border-radius:999px;background:var(--forest);color:#fff8ee;font-size:.61rem;font-weight:950;letter-spacing:.08em}.mode-ribbon.red{background:var(--red)}.challenge-strip{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin:17px auto 3px}.challenge-strip span{padding:8px 11px;border-radius:999px;background:#f3e5c9;color:var(--forest);font-size:.68rem;font-weight:950;letter-spacing:.055em}.how-to{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:900px;margin:15px auto 0}.how-step{display:flex;align-items:center;gap:11px;padding:14px 15px;border-radius:18px;background:rgba(255,249,239,.64);border:1px solid var(--line)}.how-step>span{flex:0 0 34px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--forest);color:#fff;font-weight:950}.how-step strong{display:block;color:var(--forest-deep);font-size:.9rem}.how-step small{display:block;margin-top:2px;color:var(--muted);line-height:1.3}

/* game shell */
.game-screen{padding:4px 0 18px}.game-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:16px;margin-bottom:16px}.icon-button{width:54px;height:54px;border:1px solid var(--line);border-radius:50%;background:#fff9ef;color:var(--forest);font-size:2rem;line-height:1}.game-heading h1{font-size:clamp(38px,5vw,58px);line-height:.95;margin:4px 0 0}.game-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.pill,.text-button{min-height:42px;border-radius:999px;border:1px solid var(--line);padding:0 14px;display:inline-flex;align-items:center;justify-content:center;background:#fff9ef;color:var(--forest);font-size:.74rem;font-weight:950;letter-spacing:.04em}.text-button{cursor:pointer}.mode-pill{background:var(--forest);color:#fff}.skill-pill{background:#f0dfb8;color:var(--red-deep)}.star-pill{gap:6px;color:var(--gold)}.star-pill b{color:var(--forest)}.round-pill{gap:5px}.round-pill span{font-size:.62rem;color:var(--muted)}

/* puzzle */
.play-card{padding:clamp(18px,2.8vw,30px);border-radius:32px;background:rgba(255,249,239,.8);border:1px solid var(--line);box-shadow:var(--shadow-soft)}.challenge-copy{text-align:center;max-width:760px;margin:0 auto 20px}.challenge-kicker{margin:0;color:var(--red-deep);font-size:.72rem;font-weight:950;letter-spacing:.12em}.challenge-copy h2,.answer-heading h2{margin:6px 0 5px;color:var(--forest-deep);font:700 clamp(30px,4vw,43px)/1 Georgia,serif;letter-spacing:-.03em}.challenge-copy p:last-child,.answer-heading p:not(.feedback){margin:0;color:var(--muted);font-size:.94rem}.pattern-stage{display:flex;justify-content:center;align-items:stretch;gap:10px;flex-wrap:wrap;max-width:1120px;margin:0 auto;min-height:154px}.pattern-tile{position:relative;width:clamp(108px,12vw,144px);height:clamp(126px,14vw,166px);border:1px solid rgba(198,154,83,.36);border-radius:24px;background:#fffdf8;display:grid;place-items:center;padding:11px;box-shadow:0 9px 20px rgba(65,44,29,.08);overflow:hidden;transition:transform .18s ease,border-color .18s ease,background .18s ease}.pattern-tile.question{border-style:dashed;background:#f4e8d4}.pattern-tile.question::before{content:"?";color:#c49a58;font:700 clamp(39px,6vw,59px) Georgia,serif}.pattern-tile img{max-width:84%;max-height:84%;object-fit:contain}.pattern-tile.size-s img{width:49%;height:49%}.pattern-tile.size-m img{width:66%;height:66%}.pattern-tile.size-l img{width:88%;height:88%}.pattern-tile.clickable{cursor:pointer}.pattern-tile.clickable:hover{transform:translateY(-2px);border-color:rgba(198,154,83,.72)}.pattern-tile.wrong{animation:wrongShake .46s ease}.pattern-tile.fixed{border:3px solid rgba(41,71,55,.48);background:#f1f5ed;animation:correctPop .42s cubic-bezier(.2,.9,.35,1.15)}.pattern-tile.fixed::after{content:"✓";position:absolute;right:8px;top:8px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#718878;color:white;font-weight:950}.pattern-tile.clue{box-shadow:0 0 0 5px rgba(198,154,83,.18),0 9px 20px rgba(65,44,29,.08)}.token-stack{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:2px;flex-wrap:wrap;align-content:center}.token-stack img{object-fit:contain}.token-stack.count-2 img{width:45%;height:45%}.token-stack.count-3 img{width:39%;height:39%}.token-stack.count-4 img{width:37%;height:37%}.token-count{position:absolute;left:9px;top:7px;min-width:26px;height:26px;border-radius:999px;background:#f0dfb8;color:var(--forest);display:grid;place-items:center;font-size:.72rem;font-weight:950}.stage-hint{min-height:22px;margin:14px 0 0;text-align:center;color:var(--gold);font-weight:900;font-size:.84rem}

/* answers */
.answer-section{margin-top:14px;padding:16px clamp(14px,2vw,22px);border-radius:30px;background:rgba(255,249,239,.72);border:1px solid var(--line);box-shadow:var(--shadow-soft);animation:answerIn .3s ease both}@keyframes answerIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}.answer-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:12px}.feedback{min-height:28px;margin:0!important;color:var(--forest)!important;font-weight:900;text-align:right;max-width:480px}.answer-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;max-width:940px;margin:0 auto}.answer-grid.easy{grid-template-columns:repeat(3,minmax(0,1fr));max-width:720px}.answer-card{position:relative;min-height:126px;border:1px solid rgba(198,154,83,.32);border-radius:23px;background:#fffdf8;display:grid;place-items:center;padding:9px;box-shadow:0 8px 18px rgba(65,44,29,.08);transition:transform .17s ease,border-color .17s ease,box-shadow .17s ease}.answer-card:hover{transform:translateY(-2px);border-color:rgba(198,154,83,.62);box-shadow:0 13px 25px rgba(65,44,29,.12)}.answer-card.correct{border:3px solid rgba(41,71,55,.48);background:#f1f5ed;animation:correctPop .42s cubic-bezier(.2,.9,.35,1.15)}.answer-card.correct::after{content:"✓";position:absolute;right:8px;top:8px;width:31px;height:31px;border-radius:50%;display:grid;place-items:center;background:#718878;color:white;font-weight:950}.answer-card.wrong{animation:wrongShake .46s ease}.answer-card.hint-pulse{animation:hintPulse 1.1s ease 2}.answer-card .token-stack{height:98px}.answer-card .token-stack>img:only-child{max-width:86%;max-height:88%}.answer-card .token-count{left:8px;top:7px}.answer-card.size-s .token-stack>img:only-child{width:49%;height:49%}.answer-card.size-m .token-stack>img:only-child{width:66%;height:66%}.answer-card.size-l .token-stack>img:only-child{width:88%;height:88%}.next-row{text-align:center;margin-top:12px}.next-button{min-width:180px}.round-track{height:7px;margin:12px auto 0;background:#e8ddc8;border-radius:999px;overflow:hidden}.round-track span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--red),var(--gold));border-radius:inherit;transition:width .45s ease}.step-slots{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:7px}.step-slot{width:29px;height:29px;border-radius:50%;display:grid;place-items:center;background:#f0dfb8;color:var(--forest);font-size:.72rem;font-weight:950}.step-slot.filled{background:var(--forest);color:#fff}@keyframes correctPop{50%{transform:scale(1.04)}}@keyframes wrongShake{0%,100%{transform:translateX(0)}18%{transform:translateX(-9px)}36%{transform:translateX(8px)}54%{transform:translateX(-6px)}72%{transform:translateX(4px)}}@keyframes hintPulse{0%,100%{box-shadow:0 8px 18px rgba(65,44,29,.08)}50%{box-shadow:0 0 0 7px rgba(198,154,83,.22),0 10px 24px rgba(65,44,29,.12)}}

/* win */
.win-layer{position:fixed;inset:0;z-index:30;display:grid;place-items:center;padding:18px;background:rgba(30,53,41,.68);backdrop-filter:blur(7px)}.win-card{position:relative;width:min(560px,100%);text-align:center;background:#fff9ef;border-radius:40px;padding:28px clamp(22px,5vw,48px) 34px;box-shadow:0 30px 80px rgba(21,35,27,.34);overflow:hidden}.win-art{width:min(360px,82%);margin:0 auto 18px}.win-card h2{margin:7px 0 8px;color:var(--forest-deep);font:700 clamp(48px,8vw,76px)/.95 Georgia,serif;letter-spacing:-.04em}.win-card>p:not(.eyebrow){color:var(--muted);font:1.15rem/1.5 Georgia,serif}.win-stats{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.win-stat{display:inline-flex;align-items:center;gap:10px;padding:12px 20px;border-radius:999px;background:#efe1c2;color:var(--muted);font-weight:900;margin:8px 0 22px}.win-stat strong{color:var(--forest);font-size:1.25rem}.win-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden}.confetti-piece{position:absolute;top:-20px;width:10px;height:14px;border-radius:3px;background:var(--gold);animation:confettiFall var(--dur,2.2s) ease-in forwards;transform:translateX(0) rotate(0deg)}.confetti-piece:nth-child(3n){background:var(--red)}.confetti-piece:nth-child(4n){background:var(--forest)}@keyframes confettiFall{to{transform:translate(var(--drift,0),110vh) rotate(540deg)}}

/* footer */
.brand-footer{display:flex;justify-content:center;align-items:center;padding:8px 16px 28px;margin:0 auto;min-height:54px}.brand-footer img{display:block;width:120px;max-width:34vw;height:auto;opacity:.72}

@media(max-width:1040px){.mode-grid{grid-template-columns:1fr 1fr}.challenge-card{grid-column:1/-1;max-width:650px;width:100%;justify-self:center}.pattern-stage{gap:8px}.pattern-tile{width:clamp(96px,14vw,126px);height:clamp(116px,16vw,150px)}}
@media(max-width:900px){.access-screen{grid-template-columns:1fr;min-height:auto;text-align:center;padding:28px 0}.access-visual{order:2;max-width:720px;margin:0 auto}.access-copy{order:1}.lead{margin-left:auto;margin-right:auto}.code-card{text-align:left}.game-header{grid-template-columns:auto 1fr}.game-actions{grid-column:1/-1;justify-content:flex-end}.answer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.answer-grid.easy{grid-template-columns:repeat(3,minmax(0,1fr))}.pattern-tile{width:clamp(92px,16vw,120px)}}
@media(max-width:640px){.app-shell{width:min(100% - 16px,1240px);padding-top:10px}.access-copy h1{font-size:clamp(43px,13.5vw,62px)}.code-row{flex-direction:column}.code-row .button{width:100%}.home-heading h1{font-size:clamp(40px,12.3vw,57px)}.mode-grid{grid-template-columns:1fr}.challenge-card{grid-column:auto;max-width:none}.mode-art{height:145px}.pattern-art span{width:61px;height:77px;border-radius:15px}.how-to{grid-template-columns:1fr}.how-step{padding:12px 8px}.challenge-strip{gap:5px}.challenge-strip span{font-size:.59rem;padding:6px 8px}.game-header{gap:9px;margin-bottom:13px}.icon-button{width:48px;height:48px}.game-heading h1{font-size:clamp(34px,10.4vw,48px)}.game-actions{justify-content:flex-start;gap:7px}.pill,.text-button{min-height:44px;padding:0 13px}.skill-pill{max-width:165px;text-align:center}.play-card{border-radius:25px;padding:15px 9px}.challenge-copy{margin-bottom:15px}.pattern-stage{gap:6px;flex-wrap:wrap;overflow:visible;justify-content:center;padding:2px}.pattern-tile{flex:0 0 calc(25% - 6px);width:calc(25% - 6px);max-width:92px;height:102px;border-radius:17px;padding:7px}.pattern-tile.question::before{font-size:37px}.token-count{left:5px;top:5px;min-width:23px;height:23px;font-size:.64rem}.answer-section{border-radius:23px;padding:16px 9px}.answer-heading{display:block}.feedback{text-align:left;margin-top:9px!important}.answer-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:none}.answer-grid.easy{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-width:none}.answer-card{min-height:105px;border-radius:17px;padding:6px}.answer-card .token-stack{height:82px}.answer-grid.easy .answer-card{min-height:93px}.answer-grid.easy .answer-card .token-stack{height:72px}.win-actions{grid-template-columns:1fr}.win-card{border-radius:30px}.brand-footer{padding:5px 12px 22px}.brand-footer img{width:100px;max-width:42vw}}
@media(max-width:400px){.game-heading h1{font-size:31px}.round-pill span{display:none}.pattern-tile{flex-basis:76px;width:76px;height:96px}.answer-card{min-height:96px}.answer-grid.easy{gap:5px}.answer-grid.easy .answer-card{min-height:87px}.mode-caption{min-height:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
