
:root{--ink:#30294c;--muted:#706780;--purple:#7560c8;--purple-dark:#5942a6;--pink:#f59abc;--mint:#aae3d2;--paper:#fffdfb;--line:#e7dff0;--shadow:0 18px 50px #594a8420;--radius:25px;color-scheme:light;font-family:ui-rounded,"Trebuchet MS",system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink)}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 12% 0%,#ffe6ee 0,transparent 38%),radial-gradient(ellipse at 100% 55%,#e1f5ee 0,transparent 40%),#f5f0fb}button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default}button,a{touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid #bd72a3;outline-offset:4px}button{border:0}img,canvas{display:block}svg.icon{width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}button svg{pointer-events:none}[hidden]{display:none!important}.sprite{position:absolute;width:0;height:0;overflow:hidden}.shell{max-width:1320px;margin:auto;padding:24px 32px 0}.topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:26px}.brand{display:flex;gap:12px;align-items:center;text-align:left;padding:0;background:none}.brand-mark{width:53px;height:53px;display:grid;place-items:center;border-radius:18px;background:var(--purple);color:#fff;box-shadow:0 7px 0 #ded3f3;transform:rotate(-7deg)}.brand-mark svg{width:32px;height:32px}.brand-name{display:block;font-weight:900;font-size:21px;letter-spacing:-.7px}.brand-note{display:block;color:var(--muted);font-size:11px;letter-spacing:1.6px;margin-top:3px;text-transform:uppercase}.top-actions{display:flex;gap:9px;align-items:center}.pill{display:flex;align-items:center;gap:7px;background:#fff9;border:1px solid #fff;padding:10px 14px;border-radius:999px;font-size:13px;font-weight:800}.pill .icon{color:#d79b3f}.sound{display:flex;align-items:center;gap:8px;background:#fff9;border:1px solid #fff;border-radius:999px;padding:11px 15px;font-size:13px;font-weight:800}.sound[aria-pressed=true]{background:#e5def7;color:var(--purple-dark)}.hero{position:relative;display:grid;grid-template-columns:1fr auto;align-items:center;gap:30px;padding:32px 38px;background:linear-gradient(105deg,#fffdfc,#eee7fb);border:1px solid #fff;border-radius:30px;box-shadow:var(--shadow);overflow:hidden}.eyebrow{margin:0 0 10px;text-transform:uppercase;letter-spacing:2px;color:var(--purple);font-weight:900;font-size:11px}.hero h1{font-size:clamp(30px,4vw,47px);letter-spacing:-1.7px;margin:0;line-height:1.08;max-width:650px}.hero h1 em{font-style:normal;color:var(--purple)}.hero p{font-size:15px;line-height:1.65;max-width:550px;margin:15px 0 0;color:var(--muted)}.hero-mini{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}.mini-tag{font-size:11px;border:1px solid #e3d9ed;border-radius:999px;padding:7px 11px;background:#fff8;color:#706080;font-weight:800}.section-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:31px 0 17px}.section-title h2{margin:0;font-size:21px;letter-spacing:-.5px}.section-title p{font-size:13px;color:var(--muted);margin:5px 0 0}.difficulty{display:flex;gap:6px;background:#e9e0f3;border:1px solid #e4d9ef;padding:5px;border-radius:18px}.level{padding:10px 17px;border-radius:13px;font-weight:900;font-size:14px;background:none;min-width:68px;line-height:1.1}.level small{display:block;font-size:9px;letter-spacing:.5px;margin-top:4px;font-weight:600;color:var(--muted)}.level[aria-pressed=true]{background:#fff;color:var(--purple-dark);box-shadow:0 3px 8px #55417215}.gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:21px}.motif{padding:10px 10px 0;background:var(--paper);border:1px solid #fff;border-radius:27px;box-shadow:0 9px 25px #5d437912;text-align:left;overflow:hidden;transition:transform .18s,box-shadow .18s}.motif:hover{transform:translateY(-5px);box-shadow:0 16px 35px #5d437927}.motif-image{position:relative;border-radius:19px;overflow:hidden;aspect-ratio:1/1}.motif-image img{width:100%;height:100%;object-fit:cover;transition:transform .3s}.motif:hover .motif-image img{transform:scale(1.03)}.motif-badge{position:absolute;left:12px;top:12px;border:1px solid #fff5;background:#fffef3e6;backdrop-filter:blur(5px);color:#645070;display:flex;gap:5px;align-items:center;font-size:11px;font-weight:900;border-radius:999px;padding:7px 10px}.motif-badge svg{width:14px;height:14px;color:#be852c}.motif-copy{padding:16px 10px 19px}.motif-copy h3{font-size:18px;letter-spacing:-.35px;margin:0}.motif-copy p{margin:7px 0 16px;color:var(--muted);font-size:12px;line-height:1.5;min-height:36px}.motif-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}.motif-action{display:flex;gap:6px;align-items:center;color:var(--purple-dark);font-size:12px;font-weight:900}.star-row{display:flex;gap:4px}.star-row svg{width:15px;height:15px;color:#d9cfdf}.star-row svg.earned{color:#d4a24a;fill:#ffe8a8}.resume{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:21px;padding:14px 21px;background:#e5f3ed;border:1px solid #cfe5db;border-radius:19px}.resume p{margin:0;font-size:13px;line-height:1.5}.resume strong{display:block;font-size:14px}.text-btn{padding:8px 5px;display:inline-flex;gap:7px;align-items:center;background:none;font-size:13px;font-weight:800;color:var(--purple-dark)}.howto{display:flex;gap:16px;align-items:center;margin:26px 0;padding:20px 25px;background:#fff8;border:1px solid #fff;border-radius:22px}.howto .icon{width:28px;height:28px;color:var(--purple)}.howto p{font-size:13px;line-height:1.6;margin:0;color:var(--muted)}.howto strong{display:block;color:var(--ink);font-size:14px}.footer{padding:22px 4px 30px;color:#837a90;display:flex;justify-content:space-between;gap:15px;font-size:11px;line-height:1.5}.footer a{color:var(--purple-dark);font-weight:800;text-decoration:none}.game-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:19px}.game-title-group{display:flex;align-items:center;gap:13px}.back{display:grid;place-items:center;background:#fffa;border:1px solid #fff;width:43px;height:43px;border-radius:15px}.game-heading h1{font-size:25px;letter-spacing:-.7px;line-height:1.1;margin:0}.game-subtitle{font-size:12px;color:var(--muted);margin:6px 0 0}.game-meta{display:flex;gap:10px}.meta-item{background:#fff9;border:1px solid #fff;border-radius:15px;padding:10px 16px;text-align:center;min-width:79px}.meta-item strong{display:block;font-size:18px;font-variant-numeric:tabular-nums}.meta-item span{font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:1px}.game-layout{display:grid;grid-template-columns:minmax(0,1.14fr) minmax(300px,.86fr);gap:23px;align-items:start}.board-panel,.tray-panel{background:var(--paper);border:1px solid #fff;border-radius:27px;box-shadow:var(--shadow);padding:20px}.panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px}.panel-top h2{font-size:15px;margin:0;letter-spacing:-.2px}.help-toggle{display:flex;align-items:center;gap:6px;padding:8px 11px;border-radius:10px;background:#f3edf9;color:#706485;font-size:11px;font-weight:900;border:1px solid #ece3f4}.help-toggle[aria-pressed=true]{background:#e3f3ec;color:#4f776b;border-color:#d2e8dd}.help-toggle svg{width:16px;height:16px}.board-wrap{position:relative;aspect-ratio:1/1;width:100%;background:#e5dcee;overflow:hidden;border-radius:17px;border:2px solid #dad0e6;isolation:isolate;box-shadow:inset 0 0 25px #79709020}.board-wrap .reference{position:absolute;inset:0;opacity:0;transition:opacity .2s;width:100%;height:100%;object-fit:cover;pointer-events:none}.board-wrap.show-help .reference{opacity:.29}.board-wrap.complete .reference{opacity:1}.board-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}.slots{position:absolute;inset:0;display:grid;grid-template-columns:repeat(var(--n),1fr);grid-template-rows:repeat(var(--n),1fr);z-index:3}.slot{border:1px dashed #ffffff80;background:none;padding:0;position:relative;display:grid;place-items:center;transition:background .12s;min-width:0;min-height:0}.slot-label{font-size:clamp(11px,2.4vw,18px);font-weight:900;background:#fff9;color:#8e7ba6;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;pointer-events:none}.slot.placed{border-color:transparent}.slot.placed .slot-label{display:none}.slot:not(:disabled):hover{background:#fff3}.slots.has-selection .slot:not(:disabled){cursor:crosshair}.slot.drop-hover{background:#fbecd978!important;box-shadow:inset 0 0 0 4px #ffde92}.slot.hint{background:#fbe8a899!important;box-shadow:inset 0 0 0 4px #e3b746;animation:hint-pulse .65s ease-in-out infinite alternate}.board-wrap.complete{border-color:#a0cfbc}.board-wrap.complete .slots{display:none}.progress-row{display:flex;gap:12px;align-items:center;margin-top:18px}.progress-track{height:10px;flex:1;border-radius:999px;background:#ece4f2;overflow:hidden}.progress-bar{height:100%;width:0;background:linear-gradient(90deg,#b9a7e9,#82ceb8);border-radius:999px;transition:width .3s}.progress-label{font-size:12px;min-width:68px;font-weight:900;color:#77658d;font-variant-numeric:tabular-nums;text-align:right}.board-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.tool{display:flex;align-items:center;justify-content:center;gap:6px;border:1px solid #e7deef;border-radius:13px;background:#f9f5fc;padding:11px 13px;font-size:12px;font-weight:800}.tool svg{width:17px;height:17px}.tool.primary{background:var(--purple);border-color:var(--purple);color:#fff}.tool.primary:hover{background:var(--purple-dark)}.tool:not(.primary):hover{background:#eee6f6}.tool:disabled{opacity:.4}.tray-intro{color:var(--muted);font-size:12px;line-height:1.6;margin:-5px 0 14px}.tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-content:start;max-height:620px;overflow-y:auto;overscroll-behavior:contain;padding:6px 6px 12px;scrollbar-width:thin;scrollbar-color:#b9aad3 transparent}.piece{position:relative;padding:0;aspect-ratio:1;background:linear-gradient(150deg,#f3edf8,#ede6f4);border:2px solid #e7ddef;border-radius:19px;min-width:0;touch-action:none;user-select:none;cursor:grab;transition:background .15s,border .15s,transform .15s;display:grid;place-items:center}.piece canvas{width:100%;height:100%;filter:drop-shadow(0 3px 3px #4b36663c);pointer-events:none;user-select:none}.piece:hover{background:#e8def6;border-color:#c7b6e3;transform:translateY(-2px)}.piece.selected{background:#fcebcf;border-color:#e1b662;box-shadow:0 0 0 3px #f6e0b277}.piece.drag-origin{opacity:.4;cursor:grabbing}.piece.wrong{animation:shake .32s}.status{display:flex;align-items:center;gap:10px;padding:14px 16px;margin-top:15px;background:#f1ebf8;border-radius:15px;color:#79658b;font-size:12px;line-height:1.5;min-height:60px}.status .icon{color:#a080bb;flex-shrink:0}.tray-empty{grid-column:1/-1;text-align:center;padding:37px 12px}.tray-empty svg{width:46px;height:46px;margin:auto;color:#cc9d48;fill:#ffedbf}.tray-empty h3{font-size:21px;margin:14px 0 8px}.tray-empty p{font-size:13px;color:var(--muted);line-height:1.5}.drag-ghost{position:fixed;pointer-events:none;z-index:120;filter:drop-shadow(0 10px 10px #38265f55);will-change:transform;opacity:.98}.drag-ghost canvas{width:100%;height:100%}dialog{border:0;border-radius:29px;padding:27px;background:var(--paper);color:var(--ink);max-width:min(550px,calc(100vw - 30px));width:100%;box-shadow:0 25px 90px #22133344}dialog::backdrop{background:#27213b9c;backdrop-filter:blur(7px)}.dialog-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.dialog-top h2{font-size:21px;letter-spacing:-.5px;margin:0}.close{display:grid;place-items:center;border:1px solid #e9e0ef;background:#f4eef9;border-radius:50%;width:35px;height:35px}.preview-img{width:100%;border-radius:18px}.dialog-note{font-size:12px;line-height:1.6;color:var(--muted);margin:14px 0 0}.dialog-actions{display:flex;gap:9px;margin-top:22px;flex-wrap:wrap}.dialog-actions button{flex:1}.celebration{text-align:center;padding-top:4px}.win-star{width:84px;height:84px;display:grid;place-items:center;background:#fff0c8;border-radius:27px;margin:0 auto 18px;transform:rotate(-8deg)}.win-star .icon{width:50px;height:50px;color:#bc8b37;fill:#ffda85}.celebration h2{font-size:33px;letter-spacing:-1px;margin:0}.celebration>p{font-size:14px;line-height:1.7;color:var(--muted)}.win-stats{display:flex;justify-content:center;gap:32px;margin:22px 0}.win-stat strong{display:block;font-size:23px;color:var(--purple-dark)}.win-stat span{font-size:11px;color:var(--muted)}.award{font-size:12px;background:#e9f5ee;color:#527a66;border-radius:12px;padding:12px}.confetti-container{position:fixed;inset:0;pointer-events:none;z-index:200;overflow:hidden}.confetti{position:absolute;top:-30px;width:9px;height:16px;border-radius:3px;animation:fall var(--dur) var(--delay) cubic-bezier(.22,.61,.36,1) forwards}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.no-js{background:#fff0d0;border:2px solid #e6bd6d;padding:20px;margin:20px;border-radius:18px;font:16px system-ui}.fallback{font-size:13px;background:#ffead2;padding:12px;border-radius:12px;margin:12px 0}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}@keyframes hint-pulse{from{opacity:1}to{opacity:.7}}@keyframes fall{to{transform:translate3d(var(--dx),110vh,0) rotate(var(--turn));opacity:0}}
@media(min-width:1100px){.game-layout{grid-template-columns:minmax(0,1.14fr) minmax(340px,.86fr)}.tray[data-count="16"],.tray[data-count="25"]{grid-template-columns:repeat(4,minmax(0,1fr))}.tray[data-count="4"]{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1000px){.shell{padding:20px 22px 0}.hero{padding:28px}.gallery{gap:16px}.game-layout{gap:16px;grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr)}.board-panel,.tray-panel{padding:15px}.tray{gap:7px;padding:4px}.tool{padding:10px;font-size:11px}.game-heading h1{font-size:22px}.slot-label{width:24px;height:24px}}
@media(max-width:750px){.gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.hero{gap:14px}.hero h1{font-size:32px}.section-title{align-items:flex-start;flex-direction:column}.difficulty{align-self:stretch;justify-content:space-between}.level{flex:1}.game-layout{grid-template-columns:1fr}.board-panel{max-width:570px;width:100%;margin:auto}.tray-panel{width:100%;max-width:570px;margin:auto}.tray,.tray[data-count="4"],.tray[data-count="9"]{grid-template-columns:repeat(4,minmax(0,1fr));max-height:440px}.game-heading{max-width:570px;margin:0 auto 18px;align-items:flex-start}.game-meta{gap:5px}.meta-item{padding:8px 10px;min-width:61px}.meta-item strong{font-size:16px}.meta-item span{font-size:8px}.game-heading h1{font-size:20px}.game-subtitle{font-size:11px}.game-title-group{gap:9px}.back{width:35px;height:35px;flex-shrink:0}.howto{padding:17px}.footer{flex-direction:column;gap:7px}.topbar{padding-bottom:22px}.tool{font-size:12px}.slot-label{width:26px;height:26px}.motif-copy p{min-height:36px}.brand-name{font-size:19px}}
@media(max-width:450px){.shell{padding:15px 12px 0}.brand-mark{width:44px;height:44px;border-radius:14px}.brand-name{font-size:17px}.brand-note{font-size:9px;letter-spacing:1px}.brand{gap:10px}.sound{padding:10px}.sound-label{display:none}.pill{padding:9px 11px;font-size:12px}.top-actions{gap:6px}.hero{padding:23px;display:block}.hero h1{font-size:34px}.hero p{font-size:13px}.hero-mini{gap:6px}.mini-tag{padding:6px 8px;font-size:10px}.gallery{gap:12px}.motif{border-radius:21px;padding:7px 7px 0}.motif-image{border-radius:15px}.motif-copy{padding:12px 5px 14px}.motif-copy h3{font-size:15px}.motif-copy p{font-size:11px;margin-bottom:10px;min-height:50px}.motif-badge{font-size:9px;padding:5px 7px;left:7px;top:7px}.motif-foot{align-items:flex-start;flex-direction:column-reverse;gap:8px}.motif-action{font-size:11px}.level{padding:10px 12px;min-width:0}.resume{padding:12px 15px}.resume p{font-size:11px}.resume strong{font-size:12px}.tray{gap:6px}.piece{border-radius:13px}.game-meta .meta-item.moves{display:none}.game-heading h1{font-size:18px}.tray-panel,.board-panel{padding:13px;border-radius:23px}.panel-top h2{font-size:14px}.dialog-actions{flex-direction:column}.howto p{font-size:12px}.slot-label{width:22px;height:22px;font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.motif:hover,.piece:hover{transform:none}.confetti-container{display:none}}
@media(print){.topbar,.hero,.section-title,.howto,.footer,.game-heading,.tray-panel,.board-tools,.progress-row,.panel-top,dialog{display:none!important}.gallery{grid-template-columns:repeat(2,1fr)}.motif{break-inside:avoid;box-shadow:none}.game-layout{display:block}.board-panel{box-shadow:none;max-width:680px}.board-wrap .reference{opacity:1!important}.slots{display:none}}

@media(max-width:750px){.tray[data-count="4"]{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none}.tray[data-count="9"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* iPhone/iPad web app: safe areas (notch, home indicator), no long-press menus, no double-tap zoom */
html{touch-action:manipulation;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}html.standalone,html.standalone body{overscroll-behavior:none}
.install-hint{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:21px;padding:14px 16px 14px 21px;background:#efe8fb;border:1px solid #e0d4f3;border-radius:19px}.install-hint p{margin:0;font-size:13px;line-height:1.5;color:var(--muted)}.install-hint strong{display:block;font-size:14px;color:var(--ink)}.install-hint .close{flex-shrink:0}.share-glyph{display:inline-block;font-weight:900;color:var(--purple-dark)}
@media(hover:none){.motif:hover,.piece:hover{transform:none}.motif:hover .motif-image img{transform:none}.piece:hover{background:linear-gradient(150deg,#f3edf8,#ede6f4);border-color:#e7ddef}.piece.selected:hover{background:#fcebcf;border-color:#e1b662}}
@media(orientation:landscape) and (min-width:751px) and (min-height:600px) and (max-height:1000px){.board-wrap{width:min(100%,max(320px,calc(100dvh - 285px)));margin:0 auto}}
/* Theme (world) picker */
.themes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 21px}.theme{display:flex;align-items:center;gap:13px;padding:10px 14px 10px 10px;text-align:left;background:#fff8;border:2px solid #fff;border-radius:24px;box-shadow:0 6px 18px #5d437910;transition:transform .15s,box-shadow .15s,border-color .15s}.theme img{width:64px;height:64px;border-radius:50%;object-fit:cover;border:4px solid #fff;box-shadow:0 4px 12px #7d639530;flex-shrink:0}.theme-name{display:flex;align-items:center;gap:6px;font-weight:900;font-size:17px;letter-spacing:-.3px}.theme-name .icon{color:var(--purple)}.theme-stars{display:flex;align-items:center;gap:5px;margin-top:5px;font-size:12px;font-weight:800;color:var(--muted)}.theme-stars .icon{width:15px;height:15px;color:#d4a24a;fill:#ffe8a8}.theme[aria-pressed=true]{background:#fff;border-color:var(--purple);box-shadow:0 10px 26px #5d437926}.theme:not([aria-pressed=true]):hover{transform:translateY(-3px)}.theme.locked img{filter:grayscale(.55);opacity:.75}.theme.locked .theme-stars .icon{color:var(--muted);fill:none}.demo-note .store-links{display:flex;gap:14px;margin-top:6px}.demo-note a{color:var(--purple-dark);font-weight:800}.gate{display:flex;align-items:center;gap:12px;margin-top:16px;font-size:20px;font-weight:900}.gate input{width:90px;font:inherit;padding:8px 12px;border:2px solid #e3d9ed;border-radius:12px;background:#fff;color:var(--ink)}.gate-error{margin:10px 0 0;font-size:12px;color:#a2475f}.unlock-status{min-height:1.4em;margin:12px 0 0;font-size:13px;font-weight:800;color:var(--purple-dark)}
@media(max-width:750px){.themes{gap:8px}.theme{flex-direction:column;text-align:center;gap:7px;padding:10px 6px 12px}.theme img{width:58px;height:58px}.theme-name{justify-content:center;font-size:14px}.theme-stars{justify-content:center;margin-top:3px}}
@media(max-width:450px){.themes{gap:6px;margin-bottom:16px}.theme{border-radius:19px;padding:8px 4px 10px}.theme img{width:52px;height:52px;border-width:3px}.theme-name{font-size:12px;gap:4px}.theme-name .icon{display:none}.theme-stars{font-size:11px}}
@media(hover:none){.theme:not([aria-pressed=true]):hover{transform:none}}
.pill{white-space:nowrap}
/* Start-page video (medien/start.mp4) */
.hero-media{position:relative;width:270px;height:270px;border-radius:34px;border:8px solid #fff;background:#efe7fa;box-shadow:0 14px 40px #7d639540;overflow:hidden;transform:rotate(3deg)}.hero-video{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}.hero-play{position:absolute;left:50%;top:50%;width:76px;height:76px;margin:-38px 0 0 -38px;display:grid;place-items:center;border-radius:50%;background:#fffffff0;color:var(--purple);border:4px solid var(--ink);box-shadow:0 8px 22px #29284f40}.hero-play .icon{width:34px;height:34px;fill:currentColor;stroke:none;margin-left:4px}
@media(max-width:1000px){.hero-media{width:220px;height:220px}}
@media(max-width:750px){.hero{display:flex;flex-direction:column;align-items:stretch;gap:18px}.hero-media{order:-1;align-self:center;width:min(100%,280px);height:auto;aspect-ratio:1;border-radius:28px;transform:rotate(-2deg)}}
/* Learning labels: numbers, letters or dice dots on the board places and, if wanted, on the pieces. */
.learn-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px 16px;margin:-4px 0 20px;padding:12px 14px 12px 18px;background:#f7f2fc;border:1px solid #ece3f4;border-radius:20px}
.learn-copy h3{margin:0;font-size:15px}.learn-copy p{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}
.learn-controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}
.mode{display:flex;flex-direction:column;align-items:center;padding:10px 14px;border-radius:13px;font-weight:900;font-size:14px;background:none;min-width:64px;line-height:1.1}
.mode small{display:block;font-size:9px;letter-spacing:.5px;margin-top:4px;font-weight:600;color:var(--muted)}
.mode .icon{width:16px;height:16px;stroke-width:2}
.mode[aria-pressed=true]{background:#fff;color:var(--purple-dark);box-shadow:0 3px 8px #55417215}
.help-toggle:disabled{opacity:.45;cursor:default}
.mode-note{grid-column:1/-1;margin:0;font-size:12px;color:var(--muted)}
.slot-label{color:var(--purple-dark);background:#ffffffde;box-shadow:0 2px 6px #4b366630}
.slot-label.is-dice,.piece-label.is-dice{border-radius:24%}
.dice{width:80%;height:80%;fill:currentColor}
.piece-label{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:32%;aspect-ratio:1;display:grid;place-items:center;border-radius:50%;background:#fffffff2;color:var(--purple-dark);font-weight:900;font-size:14px;line-height:1;box-shadow:0 2px 6px #4b366640;pointer-events:none}
@supports (width:1cqw){.slots{container-type:size}
.slot-label{width:clamp(22px,calc(100cqw / var(--n) * .36),76px);height:auto;aspect-ratio:1;font-size:clamp(11px,calc(100cqw / var(--n) * .23),46px)}
.piece,.drag-ghost{container-type:inline-size}.piece-label{font-size:clamp(11px,19cqw,40px)}}
@media(max-width:750px){.learn-row{grid-template-columns:1fr;padding:12px}.learn-controls{justify-content:stretch}.learn-controls .modes{flex:1 1 100%}.mode{flex:1}.learn-controls .help-toggle{flex:1 1 100%;justify-content:center}}
@media(max-width:450px){.mode{padding:10px 6px;min-width:0}}
/* Treasure route: one station per picture, the chest opens when all pictures of a world are done at the chosen piece count. */
.route{margin:0 0 22px;padding:14px 16px 16px;background:linear-gradient(105deg,#fff8ec,#f3ecfb);border:1px solid #f1e3cf;border-radius:22px}
.route-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.route-head h3{margin:0;font-size:15px}.route-head p{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}
.route-chests{display:inline-flex;align-items:center;gap:6px;padding:6px 11px;border-radius:999px;background:#fff;font-size:12px;font-weight:900;color:#9C5F3A;white-space:nowrap}
.route-chests .icon{width:17px;height:17px;color:#C27A48}
.route-map{position:relative;margin:12px auto 0;max-width:820px;border-radius:18px;overflow:hidden;border:3px solid #e9d3ac;box-shadow:inset 0 0 0 3px #fff6e4,0 6px 16px #9c5f3a22}
.map-art-wrap,.map-art{position:absolute;inset:0;width:100%;height:100%;display:block}
.map-trail{fill:none;stroke:#8a6a4a;stroke-width:7;stroke-dasharray:2 15;stroke-linecap:round}
.map-trail.walked{stroke:#e3a83a;stroke-width:11;stroke-dasharray:22 12}
.route-path{position:absolute;inset:0;list-style:none;margin:0;padding:0}
.route-path li{position:absolute;display:grid;place-items:center;transform:translate(-50%,-50%)}
.station{position:relative;width:100%;aspect-ratio:1;padding:0;border-radius:50%;background:#fff;border:4px solid #fff;box-shadow:0 4px 10px #29284f33}
.station img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;filter:grayscale(.6) opacity(.75)}
.station.done{border-color:#ffd36e}.station.done img,.station.next img{filter:none}
.station.next{border-color:var(--purple);animation:station-pulse 1.3s ease-in-out infinite alternate}
.station-badge{position:absolute;right:-6px;bottom:-6px;min-width:24px;height:24px;padding:0 5px;border-radius:12px;display:grid;place-items:center;background:var(--purple);color:#fff;font-size:12px;font-weight:900;border:2px solid #fff}
.station.done .station-badge{background:#e3a83a}.station-badge .icon{width:14px;height:14px;stroke-width:3}
.route-goal span{display:block;width:100%}
.route-goal .chest{display:block;width:100%;height:auto;filter:drop-shadow(0 4px 6px #5d437930)}
.route-goal.open .chest{animation:chest-glow 1.6s ease-in-out infinite alternate}
@keyframes station-pulse{to{box-shadow:0 0 0 7px #7560c830}}
@keyframes chest-glow{to{transform:scale(1.06)}}
.win-star .chest{width:72px;height:72px}
@media(max-width:450px){.route{padding:12px}.route-head{flex-direction:column;gap:8px}.station{border-width:3px}.station-badge{min-width:20px;height:20px;font-size:10px;right:-4px;bottom:-4px;padding:0 3px}}
/* Language picker: a small pill with the language code; the real select lies invisibly on top, so the device's own picker opens. */
.lang{position:relative;display:flex;align-items:center;gap:7px;background:#fff9;border:1px solid #fff;border-radius:999px;padding:10px 14px;font-size:13px;font-weight:800;cursor:pointer}.lang .icon{color:var(--purple)}.lang select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}.lang:focus-within{outline:3px solid #bd72a3;outline-offset:4px}
@media(max-width:450px){.lang{padding:10px}.lang #langCode{display:none}.topbar{gap:8px}.brand-mark{flex-shrink:0}}
@media(max-width:400px){.brand{gap:8px}.brand-mark{width:38px;height:38px;border-radius:12px}.brand-mark svg{width:24px;height:24px}.brand-name{font-size:15px}.pill{padding:9px}.top-actions{gap:5px}}
/* Phone in portrait: picture and pieces share one screen, so a piece can go from the strip at the bottom straight into the picture without scrolling. The picture takes the room that is left; the strip holds one row and scrolls sideways. */
@media(max-width:750px) and (orientation:portrait){
/* The shell already keeps clear of the notch and home bar, so body drops its safe-area padding here and the puzzle screen cannot scroll or bounce. */
body.playing{padding-top:0;padding-bottom:0;overflow:hidden}
body.playing .shell{height:100vh;height:100dvh;display:flex;flex-direction:column;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom))}
body.playing .topbar{padding-bottom:8px}body.playing .brand-note,body.playing .footer{display:none}
body.playing main,body.playing #gamePage{flex:1;min-height:0;display:flex;flex-direction:column}
body.playing .game-heading{margin:0 0 8px;max-width:none;align-items:center}body.playing .game-heading h1{font-size:19px}body.playing .game-subtitle{margin-top:2px}body.playing .meta-item{padding:6px 12px;min-width:0}body.playing .meta-item strong{font-size:16px}
body.playing .game-layout{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}
body.playing .board-panel{flex:1;min-height:0;max-width:none;display:flex;flex-direction:column;padding:10px;border-radius:21px}
body.playing .tray-panel{flex:none;max-width:none;padding:10px;border-radius:21px}
body.playing .panel-top{margin-bottom:6px}body.playing .panel-top h2{font-size:14px}body.playing .help-toggle,body.playing .text-btn{padding-top:6px;padding-bottom:6px}
body.playing .board-fit{flex:1;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
body.playing .board-wrap{width:min(100cqw,100cqh);margin:0}
body.playing .progress-row{margin-top:8px}
body.playing .board-tools{flex-wrap:nowrap;margin-top:8px;gap:6px}body.playing .tool{flex:1 1 0;min-width:0;padding:8px 6px;font-size:11px;line-height:1.15;text-align:left}body.playing .tool svg{flex:none}
body.playing .tray-intro{display:none}
body.playing .tray,body.playing .tray[data-count]{--piece:76px;display:grid;grid-auto-flow:column;grid-template-columns:none;grid-template-rows:var(--piece);grid-auto-columns:var(--piece);gap:6px;max-height:none;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding:2px 2px 8px}
body.playing .status{margin-top:6px;padding:7px 12px;min-height:0;font-size:12px;line-height:1.35}
}
/* Short phones: a bit smaller pieces and less spacing, so the picture stays big enough to aim at. */
@media(max-width:750px) and (orientation:portrait) and (max-height:800px){
body.playing .tray,body.playing .tray[data-count]{--piece:72px}
body.playing .topbar{padding-bottom:4px}body.playing .brand-mark{width:34px;height:34px}body.playing .game-subtitle{display:none}body.playing .progress-row{margin-top:6px}body.playing .board-tools{margin-top:6px}
}
