.game-kind-picker button[data-kind="machine"]{--kind-accent:#b76418;--kind-border:#edd4a3;--kind-wash:#fff0cd;--kind-shadow:#a86a1824;background:linear-gradient(120deg,#fffdf8,#fff1d7);color:#774512}
.game-kind-picker button[data-kind="detective"]{--kind-accent:#2d8272;--kind-border:#acd6c2;--kind-wash:#e4f6e8;--kind-shadow:#22624924;background:linear-gradient(120deg,#fbfff6,#e5f5ed);color:#205649}
.game-kind-picker button[data-kind="chain"]{--kind-accent:#8150b5;--kind-border:#d6c3e9;--kind-wash:#f0e7fa;--kind-shadow:#6d449a24;background:linear-gradient(120deg,#fdfbff,#f0e4fb);color:#63408a}
.logic-machine{--logic-ink:#71471b;--logic-accent:#b45c18;--logic-wash:#fff1d3;--logic-edge:#edc77e;--logic-pale:#fffaf0}
.logic-detective{--logic-ink:#24594d;--logic-accent:#247969;--logic-wash:#dff3e6;--logic-edge:#a8d0b8;--logic-pale:#f5fcf6}
.logic-chain{--logic-ink:#593c7a;--logic-accent:#7b4bb0;--logic-wash:#eee2fb;--logic-edge:#cdb2e8;--logic-pale:#fcf8ff}
.detective-theme-picker{padding:23px;margin-bottom:16px;border:2px solid #a8d0b8;border-radius:24px;background:#f5fcf6;color:#24594d}
.detective-theme-picker h3{margin:5px 0;font-size:24px;line-height:1.25}.detective-theme-picker p{font-size:14px;line-height:1.6}.detective-theme-picker .field{margin-top:16px}
.detective-theme-preview .detective-theme-art{display:block;width:calc(100% + 56px);max-width:none;height:auto;aspect-ratio:3/2;object-fit:cover;margin:-28px -28px 23px}
.detective-theme-preview h3{max-width:none}.detective-mission.has-illustration{display:grid;grid-template-rows:auto auto;overflow:hidden}
.detective-rules{clear:both;border-top:1px solid var(--logic-edge);padding-top:22px;margin-top:23px}.detective-rules p{font-size:14px;line-height:1.65;margin:8px 0 15px}.detective-rules h4{font-size:19px;line-height:1.35;margin:23px 0 8px}
.detective-rule-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.detective-rule-facts>div{display:flex;flex-direction:column;gap:4px}.detective-rule-facts strong{font-size:28px;line-height:1.15;color:var(--logic-accent)}.detective-rule-facts span{font-size:12px;line-height:1.45}
.detective-rule-scores{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:17px 0 9px;padding:0;list-style:none}.detective-rule-scores li{display:flex;flex-direction:column;align-items:center;gap:6px;padding:13px 6px;background:#fff8dd;border:1px solid #ebd99d;border-radius:14px}.detective-rule-scores small{font-size:11px;color:#786033}.detective-rule-scores strong{font-size:25px;line-height:1.2;color:#8b5b13}.detective-rule-scores span{font-size:12px;color:#786033}
.detective-rules .detective-rule-note{font-size:12px;color:#5f7066;margin-bottom:21px}.detective-rule-together{padding:17px 18px;border-radius:16px;background:#e3f2e8}.detective-rule-together>strong{font-size:15px;line-height:1.5}.detective-rule-together p{margin:6px 0 0;font-size:13px}.detective-rule-rewards{margin-top:18px;font-size:13px}.detective-rule-rewards summary{font-weight:750;cursor:pointer;line-height:1.5;padding:7px 0}.detective-rule-rewards summary:focus-visible{outline:3px solid #237ca2;outline-offset:4px}.detective-rule-rewards p{font-size:13px}
/* Stories refer to details across the scene, so keep the whole illustration visible. */
.detective-mission-art{display:block;grid-area:1/1;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain}
@media(max-width:600px){.detective-theme-picker{padding:17px}.detective-theme-picker h3{font-size:21px}.detective-theme-preview .detective-theme-art{width:calc(100% + 40px);margin:-20px -20px 18px}}
.logic-intro{position:relative;overflow:hidden;padding:28px;border:2px solid var(--logic-edge);border-radius:28px;background:radial-gradient(circle at 95% 5%,#fff 0 12%,transparent 12.2%),var(--logic-pale);color:var(--logic-ink)}
.logic-intro h3{font-size:clamp(25px,3vw,34px);line-height:1.22;max-width:440px;margin:10px 0 16px;letter-spacing:-.5px}.logic-intro>p{line-height:1.65}.logic-intro-art{width:155px;height:155px;float:right;margin:0 -5px 15px 15px;filter:drop-shadow(0 10px 12px #65451918)}
.logic-eyebrow{color:var(--logic-accent);font-size:11px;font-weight:850;letter-spacing:1px;text-transform:uppercase;margin:0 0 5px;line-height:1.5}.logic-rules-copy{font-size:14px}.logic-reward-note{font-size:12px;line-height:1.6;color:#646879}
.logic-steps{clear:both;list-style:none;padding:0;margin:20px 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.logic-steps li{display:flex;align-items:center;gap:9px;padding:12px 10px;border-radius:14px;background:#fff9;font-size:12px;line-height:1.4;color:var(--logic-ink);border:1px solid var(--logic-edge)}.logic-steps b{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:50%;background:var(--logic-accent);color:#fff;font-size:13px}
.is-logic-room .game-shell>.adventure-entry{display:none}.is-logic-room .game-boards{width:100%;max-width:850px}.is-logic-room .game-arena{align-items:start}.is-logic-room .game-board-panel{max-width:none}.is-logic-room .game-player-score{font-size:36px}
.logic-board{width:100%;min-width:0;padding:24px;border:2px solid var(--logic-edge);border-radius:30px;background:linear-gradient(155deg,#fff,var(--logic-pale));box-shadow:0 7px 0 var(--logic-wash),0 15px 40px #5742710b;color:var(--logic-ink)}
.logic-heading{display:flex;gap:12px;align-items:center}.logic-heading img{width:72px;height:72px;flex:none}.logic-heading h3{margin:0;font-size:26px;line-height:1.15;letter-spacing:-.5px}.logic-round{align-self:flex-start;margin-left:auto;padding:7px 10px;border-radius:20px;background:var(--logic-wash);font-size:12px;font-weight:800;white-space:nowrap}
.logic-board .logic-steps{margin:17px 0 12px}.logic-guide{border-radius:17px;padding:15px 17px;background:var(--logic-wash);border:1px solid var(--logic-edge);margin-bottom:19px}.logic-guide-title{display:block;font-size:17px;line-height:1.45}.logic-guide-copy{font-size:13px;line-height:1.6;margin:5px 0 0}.logic-field h4{font-size:17px;margin:19px 0 12px;line-height:1.4}.logic-field p{font-size:13px;line-height:1.6}.logic-help{margin-top:22px;font-size:13px;line-height:1.7}.logic-help summary{cursor:pointer;font-weight:750;min-height:36px}.logic-help p{margin:10px 0}
.logic-board button{font:inherit;touch-action:manipulation}.logic-board button:focus-visible,.logic-help summary:focus-visible{outline:3px solid #237ca2;outline-offset:4px}.logic-button{min-height:46px;padding:12px 18px;border:2px solid var(--logic-edge);border-radius:15px;color:var(--logic-ink);background:#fff;font-weight:800!important;cursor:pointer;line-height:1.35;white-space:normal}.logic-primary{background:#ffda58;color:#573e14;border-color:#efc13b;box-shadow:0 4px 0 #d3a12d}.logic-button:hover:enabled{filter:brightness(1.035);transform:translateY(-1px)}.logic-button:disabled{background:#f0efed;color:#686972;border-color:#deddd9;box-shadow:none;cursor:default}
.logic-choice{position:relative;border:2px solid var(--logic-edge);border-bottom-width:4px;background:#fff;color:var(--logic-ink);border-radius:18px;padding:14px;cursor:pointer;transition:background .15s,transform .15s}.logic-choice:enabled:hover{background:var(--logic-wash);transform:translateY(-2px)}.logic-choice.is-selected{border-color:var(--logic-accent);background:var(--logic-wash);box-shadow:0 0 0 2px var(--logic-accent)}.logic-choice.is-selected:after{content:'✓';display:grid;place-items:center;position:absolute;right:6px;top:6px;width:22px;height:22px;background:var(--logic-accent);border-radius:50%;color:#fff;font-size:14px;font-weight:900}.logic-choice:disabled{cursor:default;opacity:.75}.logic-choice.is-selected:disabled{opacity:1}
.logic-answer-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:18px;padding:16px;border-radius:17px;background:var(--logic-wash)}.logic-answer-bar p{margin:0;flex:1 1 140px}.logic-answer-bar button{flex:0 1 auto}
.machine-stage{display:flex;align-items:center;justify-content:center;gap:14px;min-height:155px;padding:16px;border:1px solid #ecd5b6;border-radius:24px;background:radial-gradient(circle at 5px 5px,#edcea5 1.5px,transparent 2px) 0 0/20px 20px,#fff8e8}.machine-number{display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;width:115px;min-height:106px;border-radius:22px;background:#fff;border:3px solid #edd9ab;box-shadow:0 5px 0 #e9d8b2}.machine-number small{font-size:12px;font-weight:700}.machine-number strong{font-size:43px;line-height:1.1;color:#98542c}.machine-robot{display:flex;align-items:center;gap:12px}.machine-robot img{width:140px;height:140px;object-fit:contain}.machine-robot>span{font-size:26px;color:#b17c35;font-weight:900}.machine-inputs h4{margin-bottom:4px}.machine-inputs>p{margin:0 0 11px}.machine-numbers{display:flex;gap:10px}.machine-number-button{width:52px;height:49px;border-radius:14px;border:2px solid #e8ba68;border-bottom-width:5px;background:#ffdf8c;color:#653f19;font-size:22px!important;font-weight:800!important;cursor:pointer}.machine-number-button:enabled:hover{background:#ffe9b3}.machine-number-button:disabled{background:#eeece6;border-color:#d9d4c8;color:#878175;cursor:default}.machine-journal{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}.machine-journal>span{display:flex;flex-direction:column;gap:3px;padding:9px 15px;border-radius:12px;background:#e7f4f5;color:#265d66;font-weight:800;font-size:19px}.machine-journal small{font-size:10px;font-weight:500}.machine-journal .machine-sample{background:#f2ece2;color:#766245}.machine-rules{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.machine-rules button{display:flex;flex-direction:column;gap:6px;align-items:center}.machine-rules strong{font-size:23px}.machine-rules span{font-size:12px;line-height:1.4}
/* The story is the focal point; clues keep a shared icon/text baseline. */
.detective-mission{margin:0 0 18px;padding:0;border:1px solid #e9d39a;border-radius:20px;background:radial-gradient(ellipse at 50% 0,#fffdf1,transparent 75%),#fff6dc;box-shadow:0 3px 0 #efe2bb66;text-align:center}
.detective-mission-caption{position:relative;padding:22px 20px 23px}
.detective-mission.has-illustration .detective-mission-caption{grid-area:2/1;background:#fff8e0;border-top:1px solid #e9d39a}
.detective-mission-label{display:inline-block;margin-bottom:9px;padding:4px 12px;border-radius:20px;background:#f6e4ad;color:#73551e;font-size:10px;font-weight:850;line-height:1.4;letter-spacing:1.6px;text-transform:uppercase}
.logic-field .detective-story{margin:0;font-size:clamp(24px,2.7vw,32px);font-weight:850;line-height:1.2;letter-spacing:-.5px;color:#24594d;text-wrap:balance}
.logic-field .detective-story-copy{max-width:540px;margin:10px auto 0;font-size:14px;line-height:1.6;color:#52675a;text-wrap:pretty}
.detective-clues{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0;padding:0;list-style:none}
.detective-clues li{display:flex;flex-direction:row;align-items:center;gap:9px;min-width:0;padding:11px 12px;border-radius:14px;background:#fff5cd;border:1px solid #e3cd83;line-height:1.5;font-size:12px;color:#725223}
.detective-clues .is-locked{background:#eef1ef;border:1px dashed #c4cec5;color:#616e65}
.detective-clue-icon{display:block;flex:0 0 32px;width:32px;height:32px;object-fit:contain}
.detective-clues li>span{min-width:0}
/* Painted portraits stay vivid while the answer controls are unavailable. */
.detective-suspects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.detective-friend{display:flex;align-items:center;flex-direction:column;min-width:0;padding:10px 8px 16px;background:linear-gradient(155deg,#fffef8,#edf8e7);border-color:#a6ceb0}
.detective-friend:disabled{opacity:1}.detective-friend>strong{font-size:17px;margin-bottom:7px;color:#235443}
.detective-trait{font-size:11px;line-height:1.7;white-space:normal}
.detective-portrait{position:relative;isolation:isolate;width:150px;height:150px;max-width:100%;margin:0 0 5px;display:grid;place-items:center}
.detective-portrait:before{content:'';position:absolute;z-index:-1;inset:18px 9px 7px;border-radius:50%;background:radial-gradient(circle at 38% 28%,#fff4b5,#e5efb7 65%,#c6e2a5);box-shadow:inset 0 0 0 1px #e4d58b55}
.detective-animal{font-size:76px;line-height:1;transform:translateY(8px)}
.detective-animal-art{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 3px #65421b20)}
.detective-hat{position:absolute;top:23px;left:50px;width:51px;height:29px;border-radius:70% 65% 22% 20%;background:repeating-linear-gradient(85deg,#ffffff00 0 4px,#ffffff20 5px 6px),radial-gradient(ellipse at 30% 12%,#a4efff,#39a9dc 65%,#2172a4);border:1px solid #26789e;transform:rotate(-9deg);box-shadow:inset 0 3px 4px #fff6,0 3px 3px #50371b35}
.detective-hat:before{content:'';position:absolute;top:-11px;left:20px;width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#e2fbff,#5ebce2 75%);box-shadow:0 1px 2px #33698855}
.detective-hat:after{content:'';position:absolute;left:-2px;right:-2px;bottom:-4px;height:9px;border-radius:4px;background:linear-gradient(#7dd7f2,#3798c3);border:1px solid #297ca0;box-shadow:0 2px 2px #50371b25}
.detective-hat.hat-pink{background:repeating-linear-gradient(85deg,#ffffff00 0 4px,#ffffff25 5px 6px),radial-gradient(ellipse at 30% 12%,#ffd3e6,#ee6eac 65%,#c33c79);border-color:#b34778}
.detective-hat.hat-pink:before{background:radial-gradient(circle at 35% 30%,#ffeaf5,#ee80b2 75%)}
.detective-hat.hat-pink:after{background:linear-gradient(#ffa5cf,#df6096);border-color:#b34778}
.detective-portrait--rabbit .detective-hat{top:37px}.detective-portrait--frog .detective-hat{top:21px}
.detective-bag{position:absolute;right:3px;bottom:8px;display:grid;place-items:center;width:36px;height:38px;border:2px solid #a56b27;border-radius:7px 7px 11px 11px;background:linear-gradient(135deg,#ffe9a6,#eeb855);color:#8a461c;font-size:24px;line-height:1;text-shadow:0 1px #ffefba;box-shadow:inset 0 0 0 2px #ffe9b0,0 3px 4px #65421b30}
.detective-bag:before{content:'';position:absolute;top:-10px;left:8px;width:15px;height:10px;border:3px solid #a56b27;border-bottom:0;border-radius:10px 10px 0 0}

.chain-mission{display:flex;justify-content:center;align-items:center;gap:16px;padding:15px;border:2px solid var(--logic-edge);border-radius:20px;background:#fff}.chain-mission span{padding:11px 14px;border-radius:13px;background:#eef5fd;font-size:16px;font-weight:800}.chain-mission span:last-child{background:#fff0b9}.chain-mission b{font-size:23px}.chain-condition{padding:10px 14px;background:var(--logic-wash);border-radius:12px}.chain-assembly{padding:12px;margin:15px 0;display:flex;align-items:stretch;flex-wrap:wrap;gap:16px;min-height:141px;border:2px dashed #c5a8df;border-radius:20px;background:repeating-linear-gradient(0deg,#faf5ff 0 23px,#eee3f5 24px 25px)}.chain-slot,.chain-empty{position:relative;list-style:none;flex:0 0 calc(25% - 12px);min-width:105px}.chain-slot:not(:last-child):after{content:'→';position:absolute;right:-15px;top:43%;font-weight:900;color:#8d6aad}.chain-piece{position:relative;display:flex;align-items:center;flex-direction:column;width:100%;height:100%;padding:12px 5px 7px;gap:4px;border:2px solid #c5a4e3;border-bottom-width:5px;border-radius:15px;background:#fff;color:#543c70;cursor:pointer}.chain-piece>small{position:absolute;top:4px;left:6px;font-size:11px}.chain-piece-icon{font-size:30px}.chain-piece strong{font-size:11px;line-height:1.3}.chain-output{font-size:11px;line-height:1.4}.chain-remove{font-size:10px;color:#796a87}.chain-piece:disabled{cursor:default}.chain-piece:enabled:hover{border-color:#8652b7;background:#fff8ec}.chain-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;color:#866797;padding:10px;border:1px dashed #bb99d3;border-radius:13px;background:#ffffffa6;min-height:124px}.chain-empty b{font-size:27px}.chain-empty span{font-size:12px;font-weight:700}.chain-empty small{font-size:10px;line-height:1.4}.chain-slot.is-broken .chain-piece{border-color:#c6743e;background:#fff0e2}.chain-actions{display:flex;flex-wrap:wrap;gap:10px}.chain-actions>button{flex:1 1 200px}.logic-test{background:#e7f5f5;color:#22666c;border-color:#9dcacc;box-shadow:0 4px 0 #a4cbce}.chain-feedback{margin:17px 0;padding:12px 15px;border-radius:14px;background:#f2eff6;color:#61526b;font-size:13px}.chain-feedback p{margin:3px 0}.chain-feedback.is-success{background:#e4f5e9;color:#2c6744}.chain-feedback.is-retry{background:#fff0da;color:#81551f}.chain-trace{list-style:none;padding:0;margin:12px 0 0;display:flex;flex-wrap:wrap;gap:6px}.chain-trace li{font-size:11px;padding:6px 9px;border-radius:9px;background:#fff9;animation:logic-pop .4s both;animation-delay:calc(var(--step)*.22s)}
.chain-tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.chain-part{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;border:2px solid #ceb2e2;border-bottom-width:5px;border-radius:18px;background:#fff;color:#5b4274;padding:13px 7px;cursor:pointer}.chain-part-icon{font-size:32px}.chain-part strong{font-size:13px;line-height:1.4}.chain-part small{font-size:10px;line-height:1.45}.chain-add{padding:4px 9px;border-radius:9px;background:#f1e6fa;font-size:11px;font-weight:800;margin-top:4px}.chain-part:enabled:hover{background:#fbf4ff;border-color:#8c60b1;transform:translateY(-2px)}.chain-part:disabled{cursor:default;background:#f2f0f4;border-color:#d4ceda;color:#83788c}.chain-part:disabled .chain-part-icon{opacity:.5}
.logic-solution{padding:17px 19px;border-radius:18px;border:2px solid var(--logic-edge);background:#fff;margin-top:19px;font-size:14px;line-height:1.6}.logic-solution h4{margin:0 0 9px;font-size:17px}.logic-solution p{margin:8px 0}.logic-solution summary{cursor:pointer;font-weight:750}.logic-earned{font-weight:850;color:#237c4c}.logic-not-yet{font-weight:700;color:#7a6233}
@keyframes logic-pop{from{opacity:0;transform:translateY(7px) scale(.94)}to{opacity:1;transform:none}}
@media(min-width:701px){.is-logic-room .game-arena{grid-template-columns:minmax(210px,270px) minmax(0,1fr);gap:22px}.is-logic-room .game-console{position:sticky;top:20px}}
@media(max-width:1000px){.game-kind-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.logic-board{padding:18px}.logic-heading h3{font-size:22px}.logic-heading img{width:58px;height:58px}.logic-steps li{padding:9px 8px;gap:7px;font-size:11px}.machine-robot img{width:110px;height:110px}}
@media(max-width:600px){.logic-board{padding:15px 12px;border-radius:23px}.logic-intro{padding:20px}.logic-intro-art{width:100px;height:100px;margin-left:9px}.logic-heading{gap:7px;flex-wrap:wrap}.logic-heading h3{font-size:21px}.logic-heading img{width:48px;height:48px}.logic-heading .logic-eyebrow{font-size:9px}.logic-round{font-size:10px;padding:6px 8px;margin-left:auto}.logic-steps{gap:6px}.logic-steps li{display:block;padding:8px;font-size:10px}.logic-steps b{width:21px;height:21px;margin-bottom:6px;font-size:11px}.logic-guide{padding:12px}.logic-guide-title{font-size:15px}.logic-guide-copy{font-size:12px}.machine-stage{padding:10px;gap:8px;min-height:117px}.machine-number{width:76px;min-height:80px;border-width:2px;border-radius:16px}.machine-number strong{font-size:32px}.machine-number small{font-size:10px}.machine-robot{gap:4px}.machine-robot img{width:79px;height:79px}.machine-robot>span{font-size:17px}.machine-rules{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.logic-answer-bar{padding:12px}.logic-answer-bar button{width:100%}.detective-clues{grid-template-columns:1fr;gap:6px}.detective-clues li{padding:9px 11px;align-items:center}.detective-clues .is-locked{padding:6px 11px}.detective-mission-caption{padding:18px 13px}.logic-field .detective-story-copy{font-size:13px}.detective-suspects{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.detective-portrait{width:130px;height:130px}.detective-animal{font-size:66px}.detective-hat{top:19px;left:42px;width:46px;height:26px}.detective-portrait--rabbit .detective-hat{top:31px}.detective-portrait--frog .detective-hat{top:18px}.detective-bag{right:0;bottom:5px;width:32px;height:35px;font-size:22px}.detective-friend>strong{font-size:14px}.chain-mission{padding:10px;gap:6px}.chain-mission span{padding:8px;font-size:12px}.chain-mission b{font-size:16px}.chain-assembly{gap:15px;padding:10px}.chain-slot,.chain-empty{flex-basis:calc(33.333% - 10px);min-width:77px}.chain-piece strong{font-size:10px}.chain-output{font-size:10px}.chain-empty span{font-size:10px}.chain-empty small{font-size:9px}.chain-tray{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.chain-part strong{font-size:12px}.chain-part small{font-size:10px}}
@media(max-width:440px){.game-kind-picker{grid-template-columns:1fr}.logic-heading>div{max-width:calc(100% - 60px)}.logic-heading>.logic-round{margin-left:55px;margin-top:-3px}.machine-number-button{width:46px;height:45px}.logic-intro-art{width:85px;height:85px}.logic-intro h3{font-size:25px}}
@media(prefers-reduced-motion:reduce){.logic-board *{animation:none!important;transition:none!important}}
