:root{--navy:#073b78;--blue:#0877f9;--aqua:#10c8d4;--green:#18a95c;--gold:#f5c558;--ink:#17304f;--muted:#61728a;--line:#d8e3f0;--paper:#f4f7fb;--white:#fff;--shadow:0 18px 45px #173b7015}
*{box-sizing:border-box}
body{margin:0;background:radial-gradient(circle at 5% 0,#dff9f7,transparent 25%),var(--paper);color:var(--ink);font-family:Inter,ui-rounded,"SF Pro Rounded",system-ui,sans-serif;font-size:16px}
button,select{font:inherit}
button{cursor:pointer}
.play-head{min-height:76px;display:flex;align-items:center;gap:18px;padding:12px max(18px,calc((100vw - 1180px)/2));background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}
.play-head img{width:150px}
.play-head>div{display:grid}
.play-head span{font-size:.78rem;color:var(--muted)}
.back{margin-left:auto;order:3;text-decoration:none;color:var(--navy);font-weight:850;border:1px solid var(--line);border-radius:12px;padding:10px 13px}
main{width:min(1180px,calc(100% - 32px));margin:24px auto 70px}
.play-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:28px;border-radius:26px;background:linear-gradient(125deg,#073b78,#0877f9 62%,#10c8d4);color:#fff;box-shadow:var(--shadow)}
.eyebrow,.game-kicker{font-size:.72rem;font-weight:900;letter-spacing:.12em}
.play-intro h1{font-size:clamp(1.8rem,4vw,2.7rem);margin:8px 0}
.play-intro p{margin:0;line-height:1.55}
.sparkles{font-size:clamp(2.2rem,6vw,4.2rem);letter-spacing:.12em;white-space:nowrap}
.game-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:18px 0}
.game-tabs button{border:1px solid var(--line);border-radius:16px;background:#fff;color:var(--ink);min-height:58px;font-weight:850}
.game-tabs button.active{color:#fff;border-color:transparent;background:linear-gradient(135deg,var(--navy),var(--blue));box-shadow:0 10px 24px #0877f929}
.game-panel{display:none;background:#fff;border:1px solid var(--line);border-radius:25px;padding:clamp(18px,3vw,30px);box-shadow:var(--shadow)}
.game-panel.active{display:block}
.game-copy h2{font-size:1.6rem;margin:6px 0}
.game-copy p{color:var(--muted);line-height:1.55;margin:0}
.game-kicker{color:var(--blue)}
.controls{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:22px 0}
.controls label{display:grid;gap:6px;font-size:.8rem;font-weight:850;color:#52637b}
.controls select,.controls button,.game-panel aside button,.command-buttons button,.program-actions button{border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);padding:11px 14px;font-weight:850;min-height:44px}
.controls button,#checkSudoku,#runRobot{background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff;border:0}
.sudoku-wrap,.chess-wrap,.robot-wrap,.learning-wrap{display:grid;grid-template-columns:minmax(280px,620px) minmax(220px,1fr);gap:24px;align-items:start}
.game-panel aside{border-radius:20px;background:#f7faff;border:1px solid var(--line);padding:18px}
.game-panel aside h3{margin-top:0}
.game-panel aside>button{width:100%;margin-top:9px}
.soft{background:#edf4ff!important;color:var(--navy)!important;border:1px solid #cbdcf4!important}
.sudoku-board{display:grid;gap:7px;width:min(100%,560px);aspect-ratio:1;padding:10px;background:linear-gradient(145deg,#dff9f7,#e8efff);border-radius:24px}
.sudoku-cell{border:2px solid #c8d8e9;background:#fff;border-radius:13px;font-size:clamp(1.5rem,5vw,2.7rem);display:grid;place-items:center;padding:0}
.sudoku-cell.given{background:#fff4c9;border-color:#f1cf60;cursor:default}
.sudoku-cell.wrong{background:#ffe9e9;border-color:#dc6666}
.sudoku-cell.selected{outline:4px solid #10c8d4;outline-offset:-3px}
.symbol-legend{display:flex;gap:7px;flex-wrap:wrap}
.symbol-legend button{width:48px!important;height:48px;padding:0!important;font-size:1.45rem;margin:0!important}
.chess-board{display:grid;grid-template-columns:repeat(8,1fr);width:min(100%,620px);aspect-ratio:1;border:8px solid #193f6d;border-radius:16px;overflow:hidden}
.chess-square{border:0;border-radius:0;padding:0;display:grid;place-items:center;font-size:clamp(1.5rem,5vw,3.25rem);background:#e8f0d0}
.chess-square.dark{background:#65a0a0}
.chess-square.selected{box-shadow:inset 0 0 0 5px #f5c558}
.chess-square.target{box-shadow:inset 0 0 0 5px #18c94c}
.move-list{max-height:310px;overflow:auto;padding-left:24px;color:#4b5d75;line-height:1.55}
.robot-grid{display:grid;width:min(100%,600px);aspect-ratio:1;border:8px solid #173f70;border-radius:20px;overflow:hidden;background:#eaf6ff}
.robot-cell{display:grid;place-items:center;border:1px solid #c7dded;font-size:clamp(1.35rem,4vw,2.5rem);background:#fff}
.robot-cell.path{background:#eefaf4}
.robot-cell.obstacle{background:#dfe5ec}
.robot-key{display:flex;gap:12px;flex-wrap:wrap;margin-top:10px;font-size:.82rem;color:var(--muted)}
.memory-board{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;width:min(100%,620px)}
.memory-card{aspect-ratio:1;border:2px solid #bdd2e8;border-radius:16px;background:linear-gradient(145deg,#eaf2ff,#fff);color:transparent;font-size:clamp(1.7rem,5vw,3rem);display:grid;place-items:center;transition:transform .18s,background .18s}
.memory-card.open,.memory-card.matched{color:inherit;transform:rotateY(180deg);background:#fff3bd;border-color:#e8c54d}
.memory-card.matched{background:#ddf7e8;border-color:#49b77b}
.pattern-sequence{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap;min-height:150px;padding:22px;border-radius:22px;background:linear-gradient(145deg,#e8f8ff,#fff4d6);font-size:clamp(2rem,6vw,4rem)}
.pattern-sequence span{display:grid;place-items:center;width:74px;height:74px;border-radius:18px;background:#fff;border:2px solid #cbdced}
.pattern-sequence .missing{color:#0877f9;background:#e8f1ff;border-style:dashed}
.pattern-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}
.pattern-choices button{min-height:70px;border:1px solid var(--line);border-radius:16px;background:#fff;font-size:2rem}
.pattern-choices button:hover{background:#eaf4ff}
.detective-board{display:grid;gap:9px;width:min(100%,620px)}
.detective-board button{aspect-ratio:1;border:1px solid #c8d8e9;border-radius:15px;background:#fff;font-size:clamp(1.5rem,5vw,2.8rem)}
.detective-board button:hover{background:#eaf4ff;transform:scale(1.03)}
.prompt-card{min-height:330px;padding:24px;border-radius:22px;background:linear-gradient(145deg,#eef8ff,#fff8da);border:1px solid var(--line);text-align:center}
.prompt-card>p{font-size:1.15rem;line-height:1.55}
.big-emoji{font-size:4.5rem}.word-choices,.shape-choices{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:18px}
.word-choices button,.shape-choices button{min-height:62px;border:1px solid #c7d8ea;border-radius:15px;background:#fff;color:var(--navy);font-weight:850;padding:12px}
.shape-target{font-size:5rem;min-height:110px;display:grid;place-items:center}.shape-choices button{font-size:2.7rem}.target-label{font-size:.8rem!important;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.sound-pads{display:grid;grid-template-columns:repeat(2,minmax(0,220px));gap:14px;justify-content:center;padding:24px;border-radius:22px;background:#edf5ff}
.sound-pad{min-width:44px;min-height:44px;aspect-ratio:1;border:5px solid #fff;border-radius:28px;font-size:2.5rem;box-shadow:0 10px 22px #173b7022;transition:.15s}.sound-pad.active{transform:scale(.93);filter:brightness(1.25);box-shadow:0 0 0 6px #f5c558}
.sound-pad:nth-child(1){background:#ff7474}.sound-pad:nth-child(2){background:#5db7ff}.sound-pad:nth-child(3){background:#ffe16c}.sound-pad:nth-child(4){background:#67d68b}
.story-cards,.story-order{display:grid;gap:10px;min-height:100px;padding:14px;border-radius:18px;background:#edf5ff;border:2px dashed #b8cbe1}.story-order{background:#fff8dc}
.story-card{display:flex;align-items:center;gap:12px;text-align:left;border:1px solid #c9d9e9;border-radius:14px;background:#fff;padding:13px;font-weight:750;color:var(--ink)}.story-card span{font-size:1.7rem}.story-card.chosen{opacity:.35}.story-order .story-card:before{content:attr(data-order);display:grid;place-items:center;min-width:28px;height:28px;border-radius:50%;background:var(--navy);color:#fff}
.command-buttons{display:grid;grid-template-columns:1fr;gap:8px}
.program{display:flex;gap:7px;flex-wrap:wrap;min-height:72px;margin:14px 0;padding:10px;border:2px dashed #b9cbe0;border-radius:13px;background:#fff}
.program span{align-self:center;color:var(--muted);font-size:.85rem}
.program b{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:#e8f1ff;color:var(--navy);font-size:1.2rem}
.program-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.program-actions #runRobot{grid-column:1/-1}
.game-panel [role=status]{line-height:1.5;color:#52637b;min-height:3em}
button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid var(--aqua);outline-offset:3px}
@media(max-width:760px){.play-head>div{display:none}
.play-head img{width:128px}
.play-intro{padding:22px}
.sparkles{font-size:2rem}
.game-tabs{grid-template-columns:1fr}
.sudoku-wrap,.chess-wrap,.robot-wrap,.learning-wrap{grid-template-columns:1fr}
.game-panel aside{padding:14px}
.controls{align-items:stretch}
.controls label{flex:1;min-width:120px}
.controls button{width:100%}
.chess-board{border-width:5px}
.chess-square{font-size:clamp(1.35rem,9vw,2.5rem)}
}
.chess-points{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}.chess-points span{background:#eef5ff;border:1px solid #cbdcf3;border-radius:12px;padding:8px 11px;color:#163f8f}.score-help{font-size:.82rem;color:#68738a}

#memory .memory-card.open,#memory .memory-card.matched{transform:none}
#memory .memory-card:disabled{opacity:1}
#memoryBoard>p{grid-column:1 / -1;font-size:1rem}
