﻿@font-face{font-family:SUITE;src:url('assets/fonts/SUITE-Variable.woff2') format('woff2');font-weight:300 900;font-display:swap}
:root{font-family:SUITE,system-ui,sans-serif;color:#4c4656;background:#f8f3e9;--accent:#a46477;--soft:#f3e2e3;--ink:#4c4656;--board:#d4b4b0}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 15% 15%,#f3dfd980,transparent 55%),radial-gradient(ellipse at 85% 80%,#e2e9d580,transparent 50%);min-height:100dvh}body[data-game=village]{--accent:#527c6b;--soft:#e0ecdf;--board:#abc5ad}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;border:1px solid #ddd1c5;background:#fffaf0;border-radius:14px;padding:10px 16px;min-height:44px;font-weight:800;touch-action:manipulation}button:disabled{opacity:.5;cursor:default}button:hover:not(:disabled){filter:brightness(.97)}button:focus-visible,a:focus-visible{outline:3px solid #6686b6;outline-offset:2px}[hidden]{display:none!important}.puzzle-app{max-width:1120px;margin:auto;padding:22px 28px;min-height:100dvh;display:flex;flex-direction:column;gap:22px}header{display:flex;align-items:center;gap:12px}.home-link{font-weight:900;font-size:15px;text-decoration:none;color:var(--accent);letter-spacing:1px}.edition{margin-left:auto;margin-right:20px;font-size:10px;letter-spacing:2px;color:#a09181}.icon-button{font-size:12px;padding:8px 12px;min-height:36px;background:#fffcf780}.menu{flex:1;display:grid;grid-template-columns:1.2fr 1fr;align-items:center;gap:70px;padding:30px 34px}.eyebrow{font-size:10px;letter-spacing:3px;color:var(--accent);font-weight:850}.intro h1{font-size:clamp(32px,4.4vw,52px);line-height:1.17;letter-spacing:-2px;margin:18px 0}.intro p{font-size:14px;line-height:1.7;color:#918375}.hero-art{height:260px;position:relative;display:flex;align-items:center;justify-content:center;border-radius:50%;background:radial-gradient(ellipse,#e5d1b860,transparent 68%);margin-top:22px}.hero-art svg{width:145px;height:145px;filter:drop-shadow(0 12px 5px #79664618);transform:rotate(-12deg)}.hero-art svg:nth-child(2){width:180px;height:180px;transform:translateY(-25px) rotate(6deg);margin:0 -30px;z-index:1}.hero-art svg:nth-child(3){transform:rotate(15deg)}.menu-actions{background:#fffdf6c9;border:1px solid #e8dece;border-radius:28px;padding:30px;box-shadow:0 15px 45px #86755209;display:flex;flex-direction:column;gap:12px}.progress-summary{font-size:14px;margin-bottom:12px;color:#897b6c;line-height:1.7}.primary{background:var(--accent);color:#fffdf6;border-color:transparent;min-height:54px;box-shadow:0 5px 0 #57444715;font-size:16px}.secondary{background:var(--soft);border:0;text-align:left}.secondary span{float:right;font-size:11px;font-weight:500;padding-top:4px}.menu-links{display:flex;gap:8px}.menu-links button{flex:1;font-size:13px}.save-note{text-align:center;font-size:11px;color:#918878;margin:9px 0 0}.local-label{text-align:center;font-size:10px;color:#aa9c8a}.game{flex:1;display:grid;grid-template-columns:280px minmax(0,570px);align-items:center;justify-content:center;gap:42px}.game-sidebar{align-self:center}.game-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.game-heading span{font-size:10px;color:var(--accent);font-weight:800}.game-sidebar h1{font-size:27px;letter-spacing:-1px;margin:16px 0}.stats{display:flex;gap:10px;margin:14px 0}.stats>div{background:#fffbf5;border:1px solid #e6dacd;border-radius:18px;padding:14px 18px;flex:1}.stats small{display:block;font-size:11px;color:#968373;margin-bottom:4px}.stats strong{font-size:26px;font-weight:900}.goals{display:flex;flex-direction:column;gap:9px;font-size:13px}.goal{display:flex;align-items:center;gap:8px;background:#fff8;padding:5px 10px;border-radius:14px}.goal svg{height:35px;width:35px}.goal .goal-text{flex:1}.goal progress{width:65px;height:6px;accent-color:var(--accent)}.ice-icon{width:35px;height:30px;border:3px solid #b5d4e4;border-radius:8px;background:#d9edf5}.companion{margin-top:16px;display:flex;align-items:center;gap:12px;background:var(--soft);padding:8px 12px;border-radius:18px}.companion svg{width:55px;height:55px}.companion .ability{flex:1;font-size:12px;line-height:1.5}.companion progress{display:block;width:100%;accent-color:var(--accent);height:7px;margin-top:6px}.coach{font-size:12px;color:#8d7c6c;line-height:1.65;min-height:40px;margin:15px 0}.tools{display:flex;gap:8px}.tools button{flex:1;font-size:12px;padding:10px 8px}.board-area{min-width:0;width:100%;max-width:570px;justify-self:center}.board{--n:7;display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));gap:5px;background:var(--board);border:7px solid var(--board);border-radius:23px;box-shadow:0 8px 0 #79645714,0 18px 40px #8e79621a;aspect-ratio:1;touch-action:none;user-select:none}.cell{position:relative;padding:0;border:0;min-height:0;border-radius:12px;background:#fff7ee;box-shadow:inset 0 -3px 0 #cdb9a329;display:flex;align-items:center;justify-content:center;overflow:visible;transition:background .15s,transform .15s;touch-action:none}.cell:nth-child(even){background:#fffaf4}.cell svg{width:90%;height:90%;pointer-events:none;filter:drop-shadow(0 2px 0 #6346390b)}.cell.selected{outline:3px solid #aa6d91;outline-offset:-2px;background:#f7e3eb;z-index:2;transform:scale(.94)}.cell.frost{background:#d6eaf2;box-shadow:inset 0 0 0 3px #afccdf}.cell.frost2{box-shadow:inset 0 0 0 5px #91b4d2}.cell.frost:after{content:'❄';position:absolute;right:1px;bottom:0;color:#618ba8;font-size:14px;pointer-events:none}.cell.preview{background:#f6e8aa;box-shadow:inset 0 0 0 2px #d4b768}.cell.hint{animation:hint 1s ease-in-out infinite}.cell.clearing{animation:pop .25s ease-in forwards}.cell.falling{animation:land .24s ease-out}.cell.rock{background:#cbd5c7}.cell.new-building{animation:build .5s ease-out}.board.armed .cell{cursor:crosshair}.board-caption{display:flex;justify-content:space-between;gap:8px;min-height:27px;margin-top:14px;font-size:11px;color:#9c8978}.board-caption #combo{color:var(--accent);font-weight:900}.tray{display:flex;align-items:center;gap:10px;margin-bottom:14px}.tray .piece{width:52px;height:52px;border-radius:13px;background:#fff9ef;border:1px solid #ded7c5;padding:3px}.tray .piece:first-of-type{width:64px;height:64px;border:2px solid #8caa8d;background:#eaf0db}.tray svg{width:100%;height:100%}.tray small{font-size:10px;color:#938671}.tray .reserve{margin-left:auto;display:flex;gap:5px;align-items:center;font-size:11px;padding:4px 10px}.reserve svg{width:42px;height:42px}.village-board{--n:6;gap:5px}.village-board .cell{background:#eef1df}.village-board .cell:nth-child(even){background:#e5ecd7}footer{text-align:center;font-size:9px;letter-spacing:1.5px;color:#a99a86;margin-top:auto;padding:8px}footer b{color:#7c8e7c}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#514858ed;color:#fff7ee;padding:12px 20px;border-radius:16px;font-size:13px;z-index:10;max-width:90vw;text-align:center;pointer-events:none}dialog{border:1px solid #ded3c5;border-radius:25px;background:#fffaf1;color:var(--ink);width:min(540px,92vw);max-height:85dvh;padding:24px;box-shadow:0 30px 100px #33263330}dialog::backdrop{background:#453e4e66;backdrop-filter:blur(4px)}.dialog-head{display:flex;align-items:center;justify-content:space-between}.dialog-head button{border:0;font-size:24px;padding:0 8px;background:transparent}.dialog-head .eyebrow{font-size:9px}dialog h2{font-size:25px;letter-spacing:-.8px;margin:14px 0}#dialog-body{font-size:13px;line-height:1.85;color:#8b7768}#dialog-body p{margin:8px 0}#dialog-actions{display:flex;gap:8px;margin-top:20px}#dialog-actions button{flex:1}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.level-grid button{padding:7px 2px;min-height:56px}.level-grid small{display:block;font-size:9px;color:#b58d47}.world-title{margin:20px 0 8px;font-weight:900;color:var(--accent)}.animal-select{display:flex;gap:8px}.animal-select button{flex:1;font-size:12px;padding:8px}.animal-select svg{display:block;width:60px;height:60px;margin:auto}.animal-select .active{background:var(--soft);outline:2px solid var(--accent)}.catalog{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.catalog>div{text-align:center;border:1px solid #e6ddcb;border-radius:14px;padding:10px 4px;line-height:1.5;font-size:11px}.catalog svg{width:70px;height:70px;display:block;margin:auto}.catalog .locked{filter:grayscale(1);opacity:.4}.result-art{display:flex;justify-content:center}.result-art svg{width:110px;height:110px}.stars{text-align:center;font-size:30px;color:#d5ad55;letter-spacing:10px}.result-score{text-align:center;font-size:35px;font-weight:900;color:var(--accent)}.help-example{display:flex;align-items:center;gap:5px}.help-example svg{width:45px;height:45px}.save-error{color:#aa4e57}.confirm-actions{display:flex;gap:10px}@keyframes pop{50%{transform:scale(1.15)}100%{transform:scale(.2);opacity:0}}@keyframes land{from{transform:translateY(-12px);opacity:.5}to{transform:none;opacity:1}}@keyframes hint{50%{box-shadow:inset 0 0 0 3px #d5ab59;transform:scale(.94)}}@keyframes build{40%{transform:scale(1.2)}75%{transform:scale(.95)}}
@media(max-width:760px){.puzzle-app{padding:12px 14px;gap:14px;min-height:100dvh}header{gap:8px}.edition{display:none}.home-link{margin-right:auto;font-size:12px}.icon-button{font-size:11px;padding:7px 9px}.menu{display:flex;flex-direction:column;gap:10px;padding:5px 12px;justify-content:center}.intro{text-align:center}.intro h1{font-size:33px;margin:10px 0}.intro p{font-size:12px;margin:6px 0}.hero-art{height:140px;margin-top:4px}.hero-art svg{width:100px;height:100px}.hero-art svg:nth-child(2){width:125px;height:125px;transform:translateY(-5px) rotate(6deg);margin:0 -15px}.menu-actions{width:100%;max-width:420px;padding:20px;gap:9px;border-radius:22px}.progress-summary{margin:0 0 4px;font-size:12px}.game{display:flex;flex-direction:column;justify-content:center;gap:10px;min-height:0}.game-sidebar{width:100%;max-width:490px;display:grid;grid-template-columns:1fr 1fr;gap:7px 10px;align-items:center}.game-heading{grid-column:1/-1}.game-sidebar h1{font-size:18px;margin:0;grid-column:1}.stats{grid-column:2;grid-row:2;gap:6px;margin:0;justify-content:flex-end}.stats>div{padding:4px 9px;border-radius:10px;flex:initial;min-width:65px}.stats small{font-size:9px;margin:0}.stats strong{font-size:18px}.goals{grid-column:1/-1;flex-direction:row;gap:6px}.goal{flex:1;padding:1px 6px;font-size:11px}.goal svg,.ice-icon{width:25px;height:25px}.goal progress{display:none}.companion{grid-column:1;grid-row:4;margin:0;padding:3px 6px;gap:5px;border-radius:11px}.companion svg{width:32px;height:32px}.companion .ability{font-size:10px}.companion progress{margin-top:2px;height:5px}.coach{display:none}.tools{grid-column:2;grid-row:4;gap:5px}.tools button{min-height:36px;font-size:10px;padding:5px}.board-area{max-width:min(490px,calc(100dvh - 250px));width:100%}.board{gap:3px;border-width:5px;border-radius:17px}.cell{border-radius:8px}.board-caption{font-size:10px;margin-top:8px;min-height:18px}.tray{gap:6px;margin-bottom:7px}.tray .piece{width:34px;height:34px;border-radius:8px}.tray .piece:first-of-type{width:42px;height:42px}.tray .reserve{min-height:42px;padding:2px 6px}.reserve svg{width:32px;height:32px}body[data-game=village] .companion{grid-column:1}body[data-game=village] .board-area{max-width:min(460px,calc(100dvh - 275px))}footer{padding:3px;font-size:8px}dialog{padding:18px}}
@media(max-width:760px) and (max-height:650px) and (orientation:portrait){.puzzle-app{padding:8px 10px;gap:8px}.menu{gap:5px;padding:0 10px}.hero-art{height:95px}.hero-art svg{height:77px;width:77px}.hero-art svg:nth-child(2){width:90px;height:90px}.intro h1{font-size:29px;margin:7px 0}.intro p{font-size:11px}.menu-actions{padding:14px;gap:7px}.primary{min-height:45px;font-size:14px}.save-note{margin-top:3px;font-size:10px}.eyebrow{font-size:8px}.game{gap:6px}.game-sidebar{gap:5px 7px}.game-sidebar h1{font-size:16px}.board-area{max-width:min(460px,calc(100dvh - 242px))}body[data-game=village] .board-area{max-width:min(450px,calc(100dvh - 275px))}.board-caption{font-size:9px}.local-label{font-size:9px}}
@media(orientation:landscape) and (max-height:600px){.puzzle-app{padding:8px 16px;gap:8px}header{height:33px}.edition{display:none}.menu{display:grid;grid-template-columns:1fr 1fr;gap:25px;padding:5px 20px}.intro h1{font-size:30px;margin:9px 0}.intro p{font-size:11px}.hero-art{height:100px}.hero-art svg{height:80px;width:80px}.hero-art svg:nth-child(2){height:95px;width:95px}.menu-actions{padding:15px;gap:6px}.primary{min-height:44px;font-size:14px}.progress-summary{font-size:11px;margin:0}.save-note{margin:2px 0;font-size:9px}.local-label{font-size:9px}.menu-links button,.secondary{padding:7px;font-size:11px;min-height:35px}.game{display:grid;grid-template-columns:minmax(210px,270px) auto;gap:22px;align-items:center}.game-sidebar{display:block}.game-heading span{font-size:9px}.game-sidebar h1{font-size:19px;margin:7px 0}.stats{margin:7px 0;display:flex;justify-content:flex-start}.stats>div{flex:1;padding:5px 10px}.stats strong{font-size:20px}.stats small{font-size:9px}.goals{display:flex;flex-direction:row;font-size:10px}.goal{padding:3px;font-size:10px}.goal svg,.ice-icon{width:23px;height:23px}.goal progress{display:none}.companion{margin-top:8px;padding:4px 8px}.companion svg{width:32px;height:32px}.companion .ability{font-size:10px}.coach{display:none}.tools{margin-top:8px}.tools button{min-height:34px;padding:5px;font-size:11px}.board-area{width:calc(100dvh - 112px);max-width:none}.board-caption{font-size:9px;margin-top:6px}.board{gap:3px;border-width:5px;border-radius:15px}.cell{border-radius:7px}body[data-game=village] .board-area{width:calc(100dvh - 142px);max-width:none}.tray{margin-bottom:5px;gap:3px}.tray .piece{width:26px;height:26px;padding:1px}.tray .piece:first-of-type{width:32px;height:32px}.tray small{font-size:8px}.tray .reserve{padding:1px 4px;font-size:9px;min-height:30px}.reserve svg{width:25px;height:25px}footer{padding:0;font-size:7px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
@media(max-width:760px) and (max-height:650px) and (orientation:portrait){.board-area{max-width:calc(100dvh - 282px)}body[data-game=village] .board-area{max-width:calc(100dvh - 293px)}body[data-game=village] .companion{display:none}body[data-game=village] .goals{grid-column:1;grid-row:3}body[data-game=village] .tools{grid-column:2;grid-row:3}}
body[data-game=snack][data-world="1"]{--board:#cfbf9c;--soft:#f0e7cc;--accent:#9b7846}body[data-game=snack][data-world="2"]{--board:#adc9d0;--soft:#dfecee;--accent:#567e92}body[data-game=snack][data-world="3"]{--board:#bcb1cc;--soft:#ebe2ef;--accent:#876992}body[data-game=snack][data-world="4"]{--board:#b7c8c4;--soft:#e3ece5;--accent:#5e857b}body[data-game=snack][data-world="5"]{--board:#d5b99b;--soft:#f3e7d5;--accent:#aa7e55}
.resident{position:absolute;right:-1px;bottom:-2px;width:31%!important;height:35%!important;filter:drop-shadow(0 1px 1px #7773)!important;pointer-events:none}.cell.new-building .resident{animation:build .6s ease-out}.goal.done{background:#e3ecd5}.goal.done .goal-text:after{content:' ✓';color:#648561;font-weight:900}
.snack-piece{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:1;transform-origin:50% 65%}.snack-piece svg{flex:none}.snack-spark{position:absolute;inset:8%;z-index:4;border:2px solid #fff5c7;border-radius:50%;box-shadow:0 -5px 0 -3px #edc575,5px 0 0 -3px #edc575,0 5px 0 -3px #edc575,-5px 0 0 -3px #edc575;pointer-events:none}body[data-game=snack] .board{overflow:hidden;isolation:isolate}body[data-game=snack] .cell.frost:after{z-index:2}body[data-game=snack] .cell.selected{transform:none}body[data-game=snack] .cell.hint{animation:snack-hint 1s ease-in-out infinite}@keyframes snack-hint{50%{box-shadow:inset 0 0 0 3px #d5ab59}}
.town-order-list{display:grid;gap:10px}.town-order-card{display:flex;gap:12px;padding:10px;background:#e9f0df;border-radius:15px}.town-order-card>svg{width:56px;height:56px;flex:none}.town-order-card p{font-size:12px!important;margin:3px 0!important}.town-order-card small{font-size:11px}.town-order-button{font-size:12px;text-align:left;min-height:32px;border:1px solid #bfd3ac;background:#ecf3df;color:#557447}.menu-links #town-orders-menu{font-size:11px;padding:6px}.menu-links button{min-width:0}@media(max-width:760px){.town-order-button{font-size:10px;min-height:25px;padding:3px 6px;line-height:1.35}}

.rescue-marker{position:absolute;left:3px;bottom:1px;font-size:13px;z-index:3;line-height:1;pointer-events:none;text-shadow:0 1px 0 white}
.difficulty-choice{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:5px 10px;font-size:12px;color:var(--ink)}
.difficulty-choice select{width:100%;min-height:36px;padding:5px 8px;border:1px solid #ddcdbb;border-radius:10px;background:#fffbf5;color:var(--ink);font:inherit}
.difficulty-choice small{grid-column:1/-1;font-size:10px;color:#897b6c}
.low-moves{color:#b34e55}.board.last-chance{outline:3px solid #b58d47;outline-offset:3px}
.cell.skill-preview{box-shadow:inset 0 0 0 3px #b58d47;background:#fff0bb}
.result-message{text-align:center}body[data-game=snack] #dialog-actions{flex-wrap:wrap}body[data-game=snack] #dialog-actions button{flex:1 1 40%;min-height:42px}
@media(max-width:760px){body[data-game=snack] .hero-art{height:115px}body[data-game=snack] .menu-actions{gap:8px}body[data-game=snack] .tools button{padding:5px 2px;font-size:10px;white-space:nowrap}}
@media(max-width:760px) and (max-height:650px) and (orientation:portrait){body[data-game=snack] .hero-art{height:60px}body[data-game=snack] .hero-art svg{width:55px;height:55px}body[data-game=snack] .hero-art svg:nth-child(2){width:65px;height:65px}body[data-game=snack] .menu-actions{gap:6px;padding:12px}.difficulty-choice{font-size:11px;gap:3px 7px}.difficulty-choice small{font-size:9px}}
@media(orientation:landscape) and (max-height:600px){body[data-game=snack] .hero-art{height:85px}body[data-game=snack] .menu-actions{gap:5px;padding:12px}.difficulty-choice select{min-height:30px}.difficulty-choice small{font-size:9px}}
