:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--ink:#18202c;--paper:#fff8e8;--surface:#fffdf8;--gold:#f5b942;--gold-dark:#9a6517;--blue:#2f6fc9;--blue-dark:#204a8f;--green:#3c8b5b;--red:#c23c3c;--lavender:#d7c6ff;--line:#18202c2e;--shadow:0 22px 50px #2c231226;background:var(--paper);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html{background:var(--paper);min-width:320px;min-height:100%}body{background:linear-gradient(#2f6fc912 1px, transparent 1px), linear-gradient(90deg, #2f6fc912 1px, transparent 1px), radial-gradient(circle at 50% 0%, #f5b9423b, transparent 36rem), var(--paper);background-size:22px 22px,22px 22px,auto,auto;min-width:320px;min-height:100vh;margin:0;overflow-x:hidden}button{font:inherit}button:not(:disabled){cursor:pointer}.app-shell,.puzzle-shell{width:min(1180px,100vw - 24px);margin:0 auto;padding:16px 0 48px}.app-header{justify-content:space-between;align-items:center;gap:14px;min-height:66px;padding:10px 0;display:flex}.app-header.compact{z-index:8;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#fff8e8e6;border-bottom:2px solid #18202c14;min-height:58px;position:sticky;top:0}.brand-mark,.home-link,.coin-chest,.help-button,.icon-action,.submit-action,.secondary-action,.primary-action,.unlock-action{border:2px solid var(--ink);min-height:44px;color:var(--ink);border-radius:8px;justify-content:center;align-items:center;gap:8px;text-decoration:none;display:inline-flex;box-shadow:0 4px #18202c2e}.brand-mark{background:var(--surface);padding:0 14px;font-weight:900}.home-link,.help-button,.icon-action,.secondary-action{background:var(--surface);padding:0 12px;font-weight:800}.coin-chest{background:#fff6ce;justify-content:space-between;min-width:116px;padding:6px 10px}.chest-drawing{flex:none;width:38px;height:32px;position:relative}.chest-lid,.chest-body,.chest-lock{border:2px solid var(--ink);position:absolute;left:0}.chest-lid{background:var(--gold);border-radius:12px 12px 4px 4px;width:38px;height:16px;top:0}.chest-body{background:#b66b28;border-radius:4px;width:38px;height:20px;bottom:0}.chest-lock{background:#f9df78;border-radius:2px;width:10px;height:10px;top:14px;left:14px}.coin-count{align-items:center;gap:5px;font-size:20px;font-weight:900;display:inline-flex}.coin-burst{z-index:30;pointer-events:none;position:fixed;inset:0;overflow:hidden}.burst-coin{width:var(--coin-size);height:var(--coin-size);border:2px solid var(--ink);background:radial-gradient(circle at 34% 30%, #fff9bd 0 18%, transparent 19%), linear-gradient(135deg, #ffe77a, var(--gold) 54%, #d18422);opacity:0;animation:coin-flight 1.45s cubic-bezier(.18, .76, .26, 1) var(--delay) both;border-radius:50%;position:fixed;transform:translate(-50%,-50%)scale(.35);box-shadow:inset 0 -3px #9a651757,0 6px 14px #18202c33}.burst-coin span{border:2px solid #9a651794;border-radius:50%;position:absolute;inset:25%}.coin-target-pop{opacity:0;border:3px solid #f5b942cc;border-radius:50%;width:42px;height:42px;animation:.72s ease-out 1.05s both coin-target-pop;position:fixed;transform:translate(-50%,-50%)scale(.2)}@keyframes coin-flight{0%{opacity:0;transform:translate(-50%,-50%)scale(.35)rotate(0)}12%{opacity:1}34%{opacity:1;transform:translate(-50%, -50%) translate(var(--burst-x), var(--burst-y)) scale(1.12) rotate(var(--spin))}64%{opacity:1;transform:translate(-50%, -50%) translate(calc(var(--burst-x) * .82), calc(var(--burst-y) - 24px)) scale(.96) rotate(calc(var(--spin) * 1.5))}to{opacity:0;transform:translate(-50%, -50%) translate(var(--target-x), var(--target-y)) scale(.38) rotate(calc(var(--spin) * 2.35))}}@keyframes coin-target-pop{0%{opacity:0;transform:translate(-50%,-50%)scale(.2)}28%{opacity:1;transform:translate(-50%,-50%)scale(1)}to{opacity:0;transform:translate(-50%,-50%)scale(1.9)}}.quest-hero,.puzzle-banner{border:3px solid var(--ink);background:linear-gradient(135deg, #d7c6ff9e, #fffdf8eb 46%), var(--surface);box-shadow:var(--shadow);border-radius:8px;gap:14px;margin:22px 0 24px;padding:clamp(22px,4vw,42px);display:grid}.puzzle-banner{grid-template-columns:minmax(0,1fr) auto auto;align-items:center}.themed-surface{isolation:isolate;border-color:var(--theme-deep,var(--ink));background:linear-gradient(135deg, var(--theme-soft,#e8f3ff), #fffdf8f0 58%), var(--surface);position:relative;overflow:hidden}.themed-surface:before{content:"";z-index:-2;background:repeating-linear-gradient(135deg,#fff0 0 13px,#18202c0b 13px 15px);position:absolute;inset:0}.themed-surface:after{content:"";z-index:-1;border:4px solid var(--theme-secondary,var(--gold));opacity:.36;border-radius:8px;width:104px;height:104px;position:absolute;top:-24px;right:-18px;transform:rotate(14deg)}.themed-surface>*{position:relative}.theme-art{flex:none;display:block;position:relative}.theme-art.card{width:100%;height:82px}.theme-art.hero{justify-self:end;width:clamp(160px,18vw,178px);height:clamp(96px,15vw,142px)}.puzzle-banner .help-button{justify-self:end}.theme-ring,.theme-icon{border-radius:8px;justify-content:center;align-items:center;display:inline-flex;position:absolute}.theme-ring{background:#fffdf880;border:2px dashed #18202c40}.theme-ring.outer{width:64px;height:64px;top:8px;right:18px;transform:rotate(12deg)}.theme-ring.inner{border-color:var(--theme-secondary,var(--gold));width:42px;height:42px;top:24px;right:78px;transform:rotate(-10deg)}.theme-icon{border:2px solid var(--ink);background:var(--surface);color:var(--theme-deep,var(--blue-dark));box-shadow:0 4px #18202c24}.theme-icon svg{stroke-width:2.5px;width:62%;height:62%}.theme-icon.main{border-color:var(--theme-deep,var(--ink));background:var(--theme-primary,var(--blue-dark));color:#fff;width:48px;height:48px;top:16px;right:32px}.theme-icon.accent{background:var(--theme-secondary,var(--gold));width:34px;height:34px;color:var(--ink);top:4px;right:2px}.theme-icon.detail{border-color:var(--theme-deep,var(--ink));width:32px;height:32px;color:var(--theme-deep,var(--blue-dark));top:44px;right:86px}.theme-art.hero .theme-ring.outer{width:104px;height:104px;top:16px;right:22px}.theme-art.hero .theme-ring.inner{width:70px;height:70px;top:46px;right:86px}.theme-art.hero .theme-icon.main{width:74px;height:74px;top:32px;right:44px}.theme-art.hero .theme-icon.accent{width:46px;height:46px;top:10px;right:4px}.theme-art.hero .theme-icon.detail{width:42px;height:42px;top:86px;right:118px}.themed-surface .quest-kicker,.themed-surface .card-kicker{color:var(--theme-deep,var(--blue-dark))}.quest-kicker,.card-kicker,.modal-kicker,.work-kicker{color:var(--blue-dark);letter-spacing:.08em;text-transform:uppercase;margin:0;font-size:.78rem;font-weight:900}h1,h2,h3,p{overflow-wrap:break-word}h1{letter-spacing:0;max-width:850px;margin:0;font-size:clamp(2.3rem,8vw,5.3rem);line-height:.94}.puzzle-banner h1{font-size:clamp(2rem,7vw,4rem)}.quest-hero p:last-child,.puzzle-banner p:last-child,.puzzle-card p{color:#18202cb8;max-width:720px;margin:0;font-size:clamp(1rem,2vw,1.22rem);line-height:1.35}.difficulty-switcher{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 22px;display:grid}.difficulty-button{border:3px solid var(--ink);background:var(--surface);text-align:left;border-radius:8px;align-content:center;gap:6px;min-height:84px;padding:12px;display:grid;box-shadow:0 5px #18202c29}.difficulty-button[aria-pressed=true]{border-color:var(--blue-dark);background:#dff2ff}.difficulty-button span{font-size:clamp(1.15rem,3vw,1.6rem);font-weight:950}.difficulty-button small{color:#18202cb8;font-size:.86rem;line-height:1.1}.puzzle-shelf{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;display:grid}.puzzle-card{border:3px solid var(--ink);background:var(--surface);border-radius:8px;align-content:space-between;gap:16px;min-height:282px;padding:18px;display:grid;box-shadow:0 7px #18202c1f}.puzzle-card.themed-surface{border-color:var(--theme-deep,var(--ink));background:linear-gradient(135deg, var(--theme-soft,#e8f3ff), #fffdf8f0 58%), var(--surface)}.puzzle-card.completed{background:linear-gradient(180deg, #eefaf2, var(--surface))}.puzzle-card.completed.themed-surface{background:linear-gradient(135deg, #dff5e7f0, #fffdf8f0 62%), var(--surface);border-color:#1d693b}.puzzle-card.completed.themed-surface:after{border-color:#79c996}.puzzle-card h2{margin:6px 0 8px;font-size:clamp(1.5rem,4vw,2.2rem);line-height:.98}.card-meta,.tag-row{flex-wrap:wrap;gap:8px;display:flex}.card-meta span,.complete-pill{color:#18202cbd;background:#f4f7ff;border:1px solid #18202c29;border-radius:999px;align-items:center;min-height:30px;padding:4px 9px;font-size:.82rem;font-weight:750;display:inline-flex}.card-meta .complete-pill{color:#1d693b;background:#dff5e7}.themed-surface .card-meta span:not(.complete-pill){color:var(--theme-deep,#18202cbd);background:#fffdf8c7;border-color:#18202c33}.primary-action,.unlock-action,.submit-action{background:var(--gold);min-height:48px;padding:0 14px;font-weight:950}.unlock-action:disabled,.icon-action:disabled{cursor:not-allowed;opacity:.46;box-shadow:none}.play-layout{grid-template-columns:minmax(250px,330px) minmax(0,1fr);align-items:start;gap:16px;display:grid}.clue-panel,.grid-panel{border:3px solid var(--ink);background:var(--surface);border-radius:8px;box-shadow:0 6px #18202c1a}.clue-panel{padding:18px;position:sticky;top:78px}.puzzle-shell .clue-panel,.puzzle-shell .grid-panel{border-color:var(--theme-deep,var(--ink))}.clue-panel h2,.grid-panel h3{margin:0 0 12px;font-size:1.35rem;line-height:1}.puzzle-shell .clue-panel{background:linear-gradient(180deg, var(--theme-soft,#e8f3ff), #fffdf8f0 72%), var(--surface)}.puzzle-shell .clue-panel h2{color:var(--theme-deep,var(--blue-dark))}.clue-panel ol{gap:12px;margin:0;padding-left:20px;display:grid}.clue-panel li{line-height:1.28}.grid-area{gap:12px;min-width:0;display:grid}.toolbar{z-index:5;border:3px solid var(--ink);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#fffdf8f2;border-radius:8px;flex-wrap:wrap;justify-content:space-between;gap:10px;padding:10px;display:flex;position:sticky;top:78px;box-shadow:0 5px #18202c1a}.tool-group{flex-wrap:wrap;gap:8px;display:flex}.tool-button{border:2px solid var(--ink);background:var(--surface);border-radius:8px;justify-content:center;align-items:center;gap:6px;min-width:68px;min-height:44px;font-weight:950;display:inline-flex}.tool-button[aria-pressed=true]{border-color:var(--blue-dark);color:var(--blue-dark);background:#dff2ff}.puzzle-shell .tool-button[aria-pressed=true]{background:var(--theme-soft,#dff2ff);border-color:var(--theme-deep,var(--blue-dark));color:var(--theme-deep,var(--blue-dark))}.submit-action{background:#baf0ce}.check-note{border:2px solid var(--red);color:#8e2e2e;background:#fff0ed;border-radius:8px;align-items:center;gap:8px;min-height:44px;padding:10px 12px;font-weight:800;display:flex}.grid-stack{gap:14px;display:grid}.grid-panel{overflow:hidden}.grid-panel h3{border-bottom:2px solid var(--line);background:#edf6ff;margin:0;padding:12px}.puzzle-shell .grid-panel h3{border-bottom-color:var(--theme-deep,var(--line));background:linear-gradient(90deg, var(--theme-soft,#edf6ff), #edf6ff 72%);color:var(--theme-deep,var(--blue-dark))}.logic-matrix{width:100%;display:grid;overflow-x:auto}.matrix-row{display:contents}.axis-label,.corner-cell{border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fff8dc;min-height:52px;padding:7px;font-size:clamp(.72rem,2vw,.88rem);font-weight:900;line-height:1.05}.column-label{writing-mode:vertical-rl;text-align:left;justify-content:center;align-items:end;min-width:42px;display:flex;transform:rotate(180deg)}.row-label{align-items:center;display:flex}.matrix-cell{border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-width:42px;min-height:52px;color:var(--ink);background:#fff;place-items:center;font-size:1.35rem;font-weight:950;display:grid}.matrix-cell:hover,.matrix-cell:focus-visible{outline-offset:-3px;outline:3px solid #2f6fc96b}.matrix-cell.marked-o{color:#197240;background:#e7f8ed}.matrix-cell.marked-x{color:#b12f2f;background:#fff1f1}.modal-backdrop{z-index:20;background:#18202c6b;place-items:center;padding:18px;display:grid;position:fixed;inset:0}.modal-panel{border:3px solid var(--ink);background:var(--surface);width:min(560px,100%);box-shadow:var(--shadow);border-radius:8px;gap:14px;padding:clamp(20px,5vw,34px);display:grid}.modal-panel h2{margin:0;font-size:clamp(2rem,7vw,3.5rem);line-height:.95}.modal-panel p{color:#18202cb8;margin:0;font-size:1.05rem;line-height:1.35}.modal-panel ul{gap:8px;margin:0;padding-left:20px;display:grid}.modal-actions{flex-wrap:wrap;gap:10px;display:flex}.success-panel{background:linear-gradient(140deg, #f5b94247, #fffdf8f2 44%), var(--surface)}@media (prefers-reduced-motion:reduce){.burst-coin,.coin-target-pop{display:none}}@media (width<=920px){.puzzle-shelf{grid-template-columns:repeat(2,minmax(0,1fr))}.play-layout{grid-template-columns:1fr}.clue-panel{position:static}}@media (width<=680px){.app-shell,.puzzle-shell{width:min(100vw - 16px,680px);padding-bottom:28px}.app-header{gap:8px}.brand-mark{min-height:42px;padding:0 10px;font-size:.88rem}.coin-chest{min-width:100px}.quest-hero,.puzzle-banner{padding:20px}.puzzle-banner{grid-template-columns:1fr}.theme-art.hero{justify-self:start;width:154px;height:108px}.theme-art.hero .theme-ring.outer{width:84px;height:84px;top:10px;right:20px}.theme-art.hero .theme-ring.inner{width:54px;height:54px;top:34px;right:82px}.theme-art.hero .theme-icon.main{width:58px;height:58px;top:24px;right:42px}.theme-art.hero .theme-icon.accent{width:38px;height:38px}.theme-art.hero .theme-icon.detail{width:34px;height:34px;top:70px;right:112px}.puzzle-banner .help-button{justify-self:start}.difficulty-switcher,.puzzle-shelf{grid-template-columns:1fr}.difficulty-button{min-height:70px}.toolbar{position:static}.tool-group{width:100%}.tool-button,.icon-action,.submit-action{flex:1;min-width:0;padding-inline:8px}.column-label,.matrix-cell{min-width:44px}.axis-label,.corner-cell,.matrix-cell{min-height:48px}}
