/* "More games" (shid-moregames): games/<id>.js for the action, puzzles, create, world and language games. */

.mg-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 6px; justify-content: center; margin: 12px auto 0; }
.mg-pad button { border: 0; border-radius: 16px; background: var(--primary-soft); font-size: 26px; cursor: pointer; box-shadow: 0 4px 0 var(--edge-purple); touch-action: manipulation; }
.mg-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge-purple); }
.mg-pad [data-d="up"] { grid-column: 2; }
.mg-pad [data-d="left"] { grid-column: 1; grid-row: 2; }
.mg-pad [data-d="down"] { grid-column: 2; grid-row: 2; }
.mg-pad [data-d="right"] { grid-column: 3; grid-row: 2; }

/* Math Snake */
.ms-q { margin: 0 0 8px; font-size: clamp(32px, 7vw, 48px); }
.ms-wrap { position: relative; width: fit-content; margin: 0 auto; }
.ms-canvas { display: block; border-radius: 18px; box-shadow: 0 6px 0 rgba(10, 19, 48, .08); touch-action: none; }
.ms-hint { position: absolute; inset: auto 0 12px; margin: 0 auto; width: fit-content; background: rgba(10, 19, 48, .8); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.ms-tut .sm-q { font-size: 30px; margin: 0 0 6px; }
.ms-tgrid { display: grid; grid-template-columns: repeat(5, 44px); gap: 3px; justify-content: center; }
.ms-tgrid span { height: 44px; background: var(--tint-green); border-radius: 8px; display: grid; place-items: center; font-size: 24px; }
.ms-tgrid b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #ffd23f; font: 800 20px var(--font-display); color: var(--on-bright); }

/* Fruit Catcher */
.ca-rule { color: var(--ink); font-size: 18px; }
.ca-field { position: relative; height: min(62vh, 440px); max-width: 520px; margin: 0 auto; border-radius: 22px; overflow: hidden; display: flex; background: linear-gradient(var(--tint-blue), var(--tint-yellow)); touch-action: none; user-select: none; }
.ca-lane { flex: 1; border-inline-end: 2px dashed rgba(10, 19, 48, .06); cursor: pointer; }
.ca-lane:last-of-type { border: 0; }
.ca-basket { position: absolute; bottom: 6px; translate: -50% 0; font-size: 54px; transition: left .12s ease-out; pointer-events: none; }
.ca-item { position: absolute; top: 0; font: 800 40px var(--font-display); line-height: 1; pointer-events: none; color: var(--ink); }
.ca-item.yum { animation: mg-pop .35s ease forwards; }
.ca-item.yuck { animation: mg-fade .35s ease forwards; filter: grayscale(1); }
.ca-tut { height: 200px; }
.ca-tut .ca-item { translate: -50% 0; transition: top .5s; }
@keyframes mg-pop { to { scale: 1.6; opacity: 0; } }
@keyframes mg-fade { to { opacity: 0; scale: .5; } }

/* Space Defender */
.sq-sky { position: relative; height: min(60vh, 430px); max-width: 560px; margin: 0 auto; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 30% 20%, #2b3a8f, #0a1330 70%); }
.sq-stars { position: absolute; inset: 0; background-image: radial-gradient(var(--card) 1px, transparent 1.5px), radial-gradient(var(--card) 1px, transparent 1.5px); background-size: 60px 60px, 90px 90px; background-position: 0 0, 30px 45px; opacity: .5; }
.sq-rocks { position: absolute; inset: 0; }
.sq-rock { position: absolute; top: 8px; translate: -50% 0; width: 23%; max-width: 110px; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: #fff; padding: 0; }
.sq-rock span { font-size: 40px; line-height: 1; transform: rotate(200deg); }
.sq-rock b { font: 800 22px var(--font-display); background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .5); border-radius: 12px; padding: 4px 10px; margin-top: -6px; min-width: 52px; }
.sq-rock.fall { top: calc(100% - 160px); transition: top var(--d) linear; }
.sq-rock.right b { background: var(--green); border-color: #fff; }
.sq-rock.wrong b { background: var(--danger); border-color: #fff; }
.sq-rock.boom { animation: mg-pop .4s ease forwards; }
.sq-fuse { position: absolute; top: 0; inset-inline: 0; height: 5px; background: rgba(255, 255, 255, .15); }
.sq-fuse i { display: block; height: 100%; background: var(--yellow); }
.sq-base { position: absolute; bottom: 0; inset-inline: 0; display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; background: linear-gradient(transparent, rgba(255, 255, 255, .12)); }
.sq-ship { font-size: 40px; }
.sq-q { margin: 2px 0 0; background: var(--card); color: var(--ink); border-radius: 14px; padding: 6px 16px; font: 800 clamp(22px, 5vw, 30px) var(--font-display); }
.sq-beam { position: absolute; height: 4px; background: linear-gradient(90deg, #7cf, #fff); transform-origin: 0 50%; border-radius: 4px; box-shadow: 0 0 12px #7cf; }
.sq-tut { height: 220px; }
.sq-tut .sq-rock { top: 30px; }

/* Gate Runner */
.gr-rule { text-align: center; font: 800 clamp(20px, 4.4vw, 28px) var(--font-display); margin: 4px 0 10px; }
.gr-road { position: relative; max-width: 480px; height: min(52vh, 360px); margin: 0 auto; border-radius: 22px; overflow: hidden; background: repeating-linear-gradient(180deg, #9aa3c7 0 26px, #8b94bb 26px 52px); }
.gr-road.moving { animation: gr-scroll .6s linear infinite; }
@keyframes gr-scroll { to { background-position: 0 52px; } }
.gr-gates { position: absolute; top: 14px; inset-inline: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 8px; }
.gr-gate { border: 4px solid #fff; border-bottom-width: 0; border-radius: 16px 16px 0 0; background: rgba(91, 69, 248, .85); color: #fff; height: 96px; cursor: pointer; font: 800 clamp(20px, 5vw, 28px) var(--font-display); }
.gr-gate.right { background: var(--green); }
.gr-gate.wrong { background: var(--danger); }
.gr-track { position: absolute; bottom: 16px; inset-inline: 0; height: 60px; }
.gr-runner { position: absolute; bottom: 0; translate: -50% 0; font-size: 50px; transition: left .25s ease, bottom .5s ease; transform: scaleX(-1); }
.gr-runner.through { bottom: calc(min(52vh, 360px) - 150px); }
.gr-runner.bump { animation: ap-shake .3s ease 2; }
.gr-fuse { position: absolute; bottom: 0; inset-inline: 0; height: 6px; background: rgba(255, 255, 255, .25); }
.gr-fuse i { display: block; height: 100%; background: var(--yellow); }
.gr-tut { height: 220px; }
.gr-tut .gr-runner.through { bottom: 100px; }

/* Picture Logic (nonogram) */
.nn-tools { display: flex; gap: 6px; }
.nn-tool { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--ink); }
.nn-tool.on { border-color: var(--primary); background: var(--primary-soft); }
.nn-board { --cell: min(calc((100vw - 72px - var(--cw, 48px) - var(--n) * 2px) / var(--n)), 44px); display: grid; grid-template-columns: auto repeat(var(--n), var(--cell)); gap: 2px; width: fit-content; margin: 0 auto; touch-action: none; user-select: none; }
.nn-corner { min-width: 20px; }
.nn-rc i, .nn-cc i { font-style: normal; }
.nn-cc { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font: 800 13px var(--font-display); color: var(--muted); padding-bottom: 3px; line-height: 1.15; }
.nn-rc { display: flex; gap: 5px; align-items: center; justify-content: flex-end; padding-inline-end: 6px; font: 800 14px var(--font-display); color: var(--muted); white-space: nowrap; }
.nn-cc.ok, .nn-rc.ok { color: var(--green); }
.nn-cell { width: var(--cell); height: var(--cell); border: 0; border-radius: 5px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; font-size: calc(var(--cell) * .5); color: var(--danger-ink); }
.nn-cell.br { margin-inline-end: 3px; }
.nn-cell.bb { margin-bottom: 3px; }
.nn-cell.on { background: var(--primary); box-shadow: none; }
.nn-cell.x::after { content: '✕'; font-weight: 800; }
.nn-board.solved .nn-cell.on { background: var(--green); animation: kg-pop .4s ease; }
.nn-tut { --cell: 44px; }

/* Lights Out */
.lo-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; width: min(100%, calc(var(--n) * 78px)); margin: 0 auto; background: #1d2b64; padding: 10px; border-radius: 22px; transition: background .4s; }
.lo-grid.dark { background: #0a1330; }
.lo-bulb { aspect-ratio: 1; border: 0; border-radius: 16px; background: #2b3a8f; font-size: clamp(22px, 7vw, 36px); cursor: pointer; filter: grayscale(1) brightness(.6); transition: background .15s, filter .15s, box-shadow .15s; }
.lo-bulb.on { background: #fff3b0; filter: none; box-shadow: 0 0 18px #ffd23f; color: var(--on-bright); }
.lo-tut { width: 200px; }

/* Tower of Hanoi */
.hn-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 560px; margin: 0 auto; }
.hn-peg { position: relative; height: 230px; border: 0; border-radius: 18px; background: var(--tint-purple); cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 4px 10px; }
.hn-peg.goal { background: var(--tint-green); }
.hn-peg.held { outline: 3px solid var(--primary); }
.hn-peg em { position: absolute; top: 6px; font-style: normal; }
.hn-pole { position: absolute; bottom: 10px; width: 10px; height: 190px; border-radius: 6px; background: #b9b2e8; }
.hn-stack { position: relative; display: flex; flex-direction: column-reverse; align-items: center; width: 100%; gap: 3px; }
.hn-disk { width: var(--w); height: 26px; border-radius: 13px; background: var(--c); color: #fff; font: 800 14px/26px var(--font-display); font-style: normal; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); transition: transform .15s; }
.hn-disk.up { transform: translateY(-36px); }
.hn-tut .hn-peg { height: 150px; }
.hn-tut .hn-pole { height: 110px; }

/* Code Breaker */
.cb-legend { text-align: center; color: var(--muted); font-size: 14px; margin: -4px 0 8px; }
.cb-rows { max-width: 360px; margin: 14px auto 0; max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.cb-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; }
.cb-g { font-size: 26px; letter-spacing: 4px; }
.cb-fb { font-size: 16px; min-width: 64px; text-align: end; }
.cb-now { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.cb-slot { width: 56px; height: 56px; border-radius: 50%; border: 3px dashed var(--line); background: var(--card); font-size: 34px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.cb-palette { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.cb-palette button { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 4px 0 var(--line); font-size: 36px; cursor: pointer; padding: 0; }
.cb-palette button:disabled { opacity: .3; cursor: not-allowed; }

/* Picture Jigsaw */
.jg-peek svg { width: 46px; height: 46px; border-radius: 8px; display: block; box-shadow: 0 0 0 2px var(--line); }
.jg-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(100%, 420px); margin: 0 auto; background: var(--line); padding: 3px; border-radius: 16px; transition: gap .4s, padding .4s; }
.jg-tile { aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; border-radius: 6px; overflow: hidden; transition: transform .12s; }
.jg-tile svg { width: 100%; height: 100%; display: block; }
.jg-tile.sel { outline: 4px solid var(--primary); outline-offset: -4px; transform: scale(.94); }
.jg-tile.home { box-shadow: inset 0 0 0 3px rgba(34, 182, 126, .6); }
.jg-grid.solved { gap: 0; padding: 0; }
.jg-grid.solved .jg-tile { border-radius: 0; box-shadow: none; }
.jg-hint { text-align: center; }
.jg-tut { width: 200px; }

/* Color by Number */
.cn-pal { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cn-sw { width: 58px; height: 58px; border-radius: 16px; border: 4px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.cn-sw b { font: 800 22px var(--font-display); color: var(--on-bright); background: rgba(255, 255, 255, .8); border-radius: 50%; padding: 0 7px; }
.cn-sw.on { box-shadow: 0 0 0 4px var(--primary); transform: scale(1.08); }
.cn-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; width: min(100%, 440px); margin: 0 auto; touch-action: none; user-select: none; }
.cn-cell { aspect-ratio: 1; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border-radius: 4px; cursor: pointer; font: 800 clamp(12px, 3.4vw, 18px) var(--font-display); color: var(--muted); padding: 0; }
.cn-cell.on { background: var(--f); box-shadow: none; }
.cn-cell.on span { opacity: .35; color: var(--ink); }
.cn-cell.oops { animation: ap-shake .3s ease; }
.cn-grid.solved { gap: 0; }
.cn-grid.solved .cn-cell { border-radius: 0; }
.cn-grid.solved .cn-cell span { opacity: 0; }
.cn-tut { width: 170px; }

/* Connect the Dots */
.cd-box { max-width: 440px; margin: 0 auto; }
.cd-svg { width: 100%; display: block; background: var(--card); border-radius: 22px; box-shadow: 0 6px 0 rgba(10, 19, 48, .06); }
.cd-fill { fill: var(--c); opacity: 0; transition: opacity .6s; }
.cd-svg.drawn .cd-fill { opacity: .8; }
.cd-line { fill: none; stroke: var(--primary); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.cd-hit { fill: transparent; cursor: pointer; }
.cd-pt { fill: var(--ink); }
.cd-dot text { font: 800 4.6px var(--font-display); fill: var(--muted); pointer-events: none; }
.cd-dot.next .cd-pt { fill: var(--pink); }
.cd-dot.hint .cd-pt { animation: cd-pulse 1s ease infinite; transform-box: fill-box; transform-origin: center; }
.cd-dot.done .cd-pt { fill: var(--primary); }
.cd-dot.done text { fill: var(--primary); }
.cd-dot.shake { animation: ap-shake .3s ease; }
@keyframes cd-pulse { 50% { transform: scale(2); } }
.cd-tut { width: 200px; margin: 0 auto; }
.cd-tut text { font-size: 7px; }

/* Music Pad */
.mp-sheet { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 96px; margin: 0 auto 10px; max-width: 520px; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: 0 4px 0 var(--line); }
.mp-note { width: 44px; height: 44px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff; font: 800 15px var(--font-display); opacity: .55; transition: transform .15s, opacity .15s; }
.mp-note.now { opacity: 1; transform: scale(1.25); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--c); }
.mp-note.past { opacity: .2; }
.mp-staff { width: 100%; height: 90px; }
.mp-staff line { stroke: #8a8fb0; stroke-width: 1.2; }
.mp-staff .mp-ledger { stroke: var(--ink); }
.mp-clef { font-size: 54px; fill: var(--ink); }
.mp-head { fill: #b9bdd6; }
.mp-head.now { fill: var(--primary); }
.mp-head.past { fill: var(--line); }
.mp-bars { display: flex; justify-content: center; align-items: center; gap: 6px; height: 210px; max-width: 560px; margin: 0 auto; touch-action: manipulation; }
.mp-bar { flex: 1; height: var(--h); border: 0; border-radius: 12px; background: var(--c); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); transition: transform .08s, filter .08s; }
.mp-bar b { font: 800 14px var(--font-display); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.mp-bar.hit { transform: translateY(4px); filter: brightness(1.25); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.mp-bar.miss { animation: ap-shake .3s ease; filter: grayscale(.8); }
.mp-tut { height: 120px; max-width: 300px; }

/* Shadow Match */
.sh-show { text-align: center; font-size: 96px; line-height: 1.1; margin: 4px 0 6px; }
.sh-dark { filter: brightness(0); transition: filter .4s; }
.sh-dark.lit { filter: none; }
.sh-choices { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.sh-pic { font-size: 56px; line-height: 1; display: inline-block; }

/* Budget Boss */
.bd-budget { text-align: center; font: 700 20px var(--font-display); margin: 0 0 10px; }
.bd-budget b { color: var(--link); font-size: 26px; }
.bd-shelf { margin: 0 auto 8px; max-width: 560px; }
.bd-cat { font-weight: 800; color: var(--muted); font-size: 14px; }
.bd-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.bd-opt { border: 3px solid var(--line); background: var(--card); border-radius: 16px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; color: var(--ink); }
.bd-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.bd-opt.best { border-color: var(--green); border-style: dashed; }
.bd-e { font-size: 30px; line-height: 1; }
.bd-opt small { color: var(--muted); font-size: 13px; }
.bd-opt b { font: 800 16px var(--font-display); }
.bd-meter { position: relative; max-width: 560px; height: 30px; margin: 10px auto 0; background: var(--tint-purple); border-radius: 999px; overflow: hidden; }
.bd-meter i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--green); transition: width .25s; }
.bd-meter.over i { background: var(--danger); }
.bd-total { position: relative; display: block; text-align: center; font: 800 15px/30px var(--font-display); }
.bd-tut .bd-opts { grid-template-columns: repeat(2, 90px); justify-content: center; }

/* Planet Parade */
.pl-p { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.pl-p i { position: relative; width: 40px; height: 40px; border-radius: 50%; display: block; box-shadow: inset -6px -6px 0 rgba(0, 0, 0, .18); }
.pl-p small { font-weight: 700; font-size: 12px; color: var(--ink); }
.pl-mercury i { background: #a9a4a0; }
.pl-venus i { background: #e8c27a; }
.pl-earth i { background: radial-gradient(circle at 35% 40%, #2fbf71 0 22%, transparent 23%), radial-gradient(circle at 65% 65%, #2fbf71 0 18%, transparent 19%), #3db2ff; }
.pl-mars i { background: #d9573b; }
.pl-jupiter i { background: repeating-linear-gradient(180deg, #e0b483 0 6px, #c98b5a 6px 10px); }
.pl-saturn i { background: #e9d28f; }
.pl-saturn i::after { content: ''; position: absolute; inset: 14px -10px; border: 3px solid #c9a75e; border-radius: 50%; transform: rotate(-18deg); }
.pl-uranus i { background: #8fe3e8; }
.pl-neptune i { background: #3f5fd9; }
.pl-line { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px auto 12px; padding: 8px; border-radius: 18px; background: #0a1330; max-width: 560px; }
.pl-line.ok { box-shadow: 0 0 0 4px var(--green); }
.pl-line.no { box-shadow: 0 0 0 4px var(--danger); }
.pl-start { font-size: 32px; }
.pl-slot { width: 64px; height: 70px; border: 2px dashed rgba(255, 255, 255, .35); border-radius: 14px; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.pl-slot.full { border-style: solid; border-color: transparent; }
.pl-slot .pl-p small, .pl-answer .pl-p small { color: #fff; }
.pl-pool { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pl-tok { border: 3px solid var(--line); background: var(--card); border-radius: 16px; padding: 8px 6px; cursor: pointer; min-width: 72px; }
.pl-tok.used { visibility: hidden; }
.pl-choices .pl-p i { width: 34px; height: 34px; }

/* Food Chain */
.fc-o { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.fc-o b { font-size: 34px; line-height: 1; }
.fc-o small { font-weight: 700; font-size: 12px; color: var(--muted); }
.fc-chain { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; margin: 6px auto 12px; padding: 8px; border-radius: 18px; background: var(--tint-green); max-width: 600px; }
.fc-chain.ok { box-shadow: 0 0 0 4px var(--green); }
.fc-chain.no { box-shadow: 0 0 0 4px var(--danger); }
.fc-arrow { font-style: normal; color: var(--green); font-weight: 800; }
.fc-slot { width: 72px; height: 72px; border: 2px dashed #a6d9bd; border-radius: 14px; background: var(--card); display: grid; place-items: center; padding: 0; cursor: pointer; }
.fc-slot.full { border-style: solid; }
.fc-pool { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.fc-tok { border: 3px solid var(--line); background: var(--card); border-radius: 16px; padding: 8px 6px; min-width: 76px; cursor: pointer; }
.fc-tok.used { visibility: hidden; }
.fc-choices .fc-o b { font-size: 40px; }

/* Launch Lab */
.ln-svg { width: 100%; max-width: 640px; display: block; margin: 0 auto; background: linear-gradient(var(--tint-blue), var(--card)); border-radius: 18px; }
.ln-gl { stroke: rgba(10, 19, 48, .06); stroke-width: .2; }
.ln-ground { stroke: #7ed36f; stroke-width: 1.2; }
.ln-tick { font: 700 2.4px var(--font-display); fill: var(--muted); text-anchor: middle; }
.ln-pad { fill: var(--green); }
.ln-flag { font-size: 5px; text-anchor: middle; }
.ln-wall { fill: #8b5a2b; }
.ln-target.boom .ln-flag { animation: mg-pop .6s ease; }
.ln-cannon rect { fill: var(--ink); }
.ln-base { fill: var(--primary); }
.ln-ball { fill: var(--danger); }
.ln-path { fill: none; stroke: var(--danger); stroke-width: .4; stroke-dasharray: 1 .8; }
.ln-trail { fill: none; stroke: rgba(10, 19, 48, .25); stroke-width: .3; stroke-dasharray: .8 .8; }
.ln-trail.hit { stroke: var(--green); stroke-width: .5; }
.ln-msg { text-align: center; font: 700 17px var(--font-display); min-height: 24px; margin: 8px 0; }
.ln-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; max-width: 640px; margin: 0 auto; align-items: end; }
.ln-ctrl label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--muted); }
.ln-ctrl label b { color: var(--ink); }
.ln-row { display: flex; align-items: center; gap: 6px; }
.ln-row input { flex: 1; accent-color: var(--primary); height: 32px; }
.ln-row button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--primary-soft); font: 800 22px var(--font-display); cursor: pointer; color: var(--ink); }
.ln-fire { grid-column: 1 / -1; font-size: 20px; padding: 12px; }
.ln-tut { max-width: 300px; }
.ln-tut-ctrl { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.ln-tut-ctrl .ln-row button { width: auto; padding: 0 10px; font-size: 16px; }
@media (max-width: 520px) { .ln-ctrl { grid-template-columns: 1fr; } }

/* Arabic Letter Shapes */
.lf-ar { font-family: "IBM Plex Sans Arabic", 'Baloo Bhaijaan 2', sans-serif; }
.lf-big { text-align: center; font: 800 clamp(56px, 14vw, 88px)/1.3 "IBM Plex Sans Arabic", sans-serif; margin: 0 0 6px; color: var(--link); }
.aq-q .lf-ar { color: var(--link); font-size: 1.25em; }
.lf-choices button { font-size: clamp(30px, 8vw, 42px); }

/* Sentence Builder */
.se-line { min-height: 64px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; max-width: 620px; margin: 6px auto 14px; padding: 10px; border-radius: 18px; background: var(--tint-purple); border: 3px dashed var(--edge-purple); }
.se-line.ok { border-color: var(--green); background: var(--tint-green); }
.se-line.no { border-color: var(--danger); background: var(--tint-red); }
.se-empty { color: var(--muted); font-size: 24px; }
.se-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 620px; margin: 0 auto; }
.se-word { border: 3px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; font: 800 clamp(18px, 4vw, 22px) var(--font-display); color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 var(--line); }
.se-word.in { border-color: var(--primary); }
.se-word.used { visibility: hidden; }

/* Same or Opposite */
.sy-kind { text-align: center; font: 800 18px var(--font-display); margin: 4px auto 0; width: fit-content; padding: 4px 14px; border-radius: 999px; }
.sy-syn { background: var(--tint-green); color: #14805a; }
.sy-ant { background: var(--tint-pink); color: #c2185b; }
.sy-word { text-align: center; font: 800 clamp(34px, 8vw, 52px) var(--font-display); margin: 6px 0 4px; }

/* What Comes Next? */
.pk-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; font-size: clamp(30px, 8vw, 44px); margin: 6px auto 4px; background: var(--card); border-radius: 18px; padding: 10px; max-width: 560px; box-shadow: 0 4px 0 var(--line); }
.pk-q { color: var(--link); animation: cd-pulse 1.2s ease infinite; display: inline-block; }
.pk-choices { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.pk-pic { font-size: 44px; line-height: 1; }

/* Sorting Baskets */
.sb-item { text-align: center; font-size: 96px; line-height: 1.1; }
.sb-choices button { min-height: 110px; }
.sb-basket { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 18px; }
.sb-basket b { font-size: 44px; line-height: 1; }

/* Big or Small */
.bs-choices { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); align-items: end; }
.bs-choices button { min-height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.bs-pic { line-height: 1; display: inline-block; }
.bs-tower { display: inline-block; width: 34px; border-radius: 8px 8px 2px 2px; background: repeating-linear-gradient(180deg, #ff9f1c 0 18px, #ffd23f 18px 36px); }
.fa-yum { animation: kg-pop .4s ease; }

/* Colour Mixing */
.cm-eq { display: flex; justify-content: center; align-items: center; gap: 10px; font: 800 30px var(--font-display); margin: 8px 0; }
.cm-blob { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.cm-blob i { width: 56px; height: 56px; border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%; display: grid; place-items: center; font-style: normal; font-size: 26px; box-shadow: inset 0 0 0 2px rgba(10, 19, 48, .12); }
.cm-blob small { font-weight: 700; font-size: 13px; color: var(--muted); }
.cm-q i { background: var(--tint-purple); }
.cm-choices { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }

/* Discount Detective */
.dc-tag { width: fit-content; margin: 4px auto; background: var(--tint-yellow); border: 2px dashed #ffc93c; border-radius: 12px; padding: 6px 14px; font: 800 20px var(--font-display); }
.dc-pack { display: flex; flex-direction: column; gap: 2px; font-size: 17px; }

/* Binary, logic gates, probability */
.bn-show { text-align: center; font: 800 clamp(30px, 8vw, 46px) ui-monospace, Menlo, monospace; margin: 6px 0; letter-spacing: 2px; }
.bn-show sub, .bn-c sub { font-size: .45em; color: var(--muted); letter-spacing: 0; }
.bn-c { font-family: ui-monospace, Menlo, monospace; }
.lg-expr { font-size: clamp(22px, 5vw, 32px); letter-spacing: 0; }
.lg-svg { display: block; width: min(100%, 340px); margin: 0 auto; }
.lg-w { stroke: var(--ink); stroke-width: 3; }
.lg-g { fill: var(--tint-purple); stroke: var(--primary); stroke-width: 3; }
.lg-in { font: 800 16px var(--font-display); text-anchor: middle; }
.lg-in.v1 { fill: var(--green); }
.lg-in.v0 { fill: var(--muted); }
.lg-out { font: 800 22px var(--font-display); fill: var(--primary); }
.lg-name { font: 800 11px var(--font-display); fill: var(--primary); text-anchor: middle; }
.pb-pic { font-size: 64px; }
.pb-bag { text-align: center; font-size: 26px; letter-spacing: 2px; margin: 0; }

/* Minesweeper */
.mn-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(100%, calc(var(--n) * 46px)); margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.mn-cell { aspect-ratio: 1; border: 0; border-radius: 7px; background: var(--mn-cover, #b9b2e8); box-shadow: inset 0 -3px 0 rgba(10, 19, 48, .15); cursor: pointer; font: 800 clamp(14px, 4vw, 20px) var(--font-display); padding: 0; -webkit-touch-callout: none; color: var(--on-bright); }
.mn-cell.start { background: #ffe58a; color: var(--on-bright); }
.mn-cell.start::after { content: '⭐'; font-size: .8em; }
.mn-cell.open { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.mn-cell.open::after, .mn-cell.flag::after { content: none; }
.mn-cell.mine { background: var(--tint-red); }
.mn-cell.k1 { color: var(--mn-k1, #3d7bff); } .mn-cell.k2 { color: var(--mn-k2, #22a06b); } .mn-cell.k3 { color: var(--mn-k3, #e5484d); } .mn-cell.k4 { color: var(--mn-k4, #5b45f8); } .mn-cell.k5, .mn-cell.k6 { color: var(--mn-k5, #a0522d); }
.mn-mode.on { border-color: var(--danger); background: var(--tint-red); }
.mn-tut { width: 150px; }

/* Data Detective, Physics Formulas, Derivatives */
.st-data { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 6px auto 4px; max-width: 560px; }
.st-data span { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; font: 800 20px var(--font-display); }
.st-data .st-add { border-color: var(--green); color: var(--green); }
.fo-eq { text-align: center; font-weight: 700; }
.dv-f { font-size: clamp(22px, 5.4vw, 34px); letter-spacing: 0; font-family: var(--font-display); }
.dv-c { font-size: .85em; }

@media (prefers-reduced-motion: reduce) {
  .gr-road.moving { animation: none; }
  .ca-basket, .gr-runner, .hn-disk, .jg-tile, .mp-note { transition: none; }
  .ca-item.yum, .ca-item.yuck, .sq-rock.boom, .cd-dot.hint .cd-pt, .nn-board.solved .nn-cell.on, .pk-q, .fa-yum { animation: none; }
}

/* Dark theme (docs/theme.md): Minesweeper covers and numbers that read on the dark cells. */
:root[data-theme="dark"] { --mn-cover: #4a44a0; --mn-k1: #8cb4ff; --mn-k2: #6ee0ae; --mn-k3: #ff8e92; --mn-k4: #b8acff; --mn-k5: #ffb27a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --mn-cover: #4a44a0; --mn-k1: #8cb4ff; --mn-k2: #6ee0ae; --mn-k3: #ff8e92; --mn-k4: #b8acff; --mn-k5: #ffb27a; }
}
