.mg-shell{--sky:#eaf5ff;--ink:#20394a;--blue:#136b9a;--coral:#d85845;color:var(--ink);background:linear-gradient(135deg,#f6fbff,#fff9f4);border:1px solid #d5e6ee;border-radius:24px;padding:clamp(12px,3vw,26px);margin:30px 0;box-shadow:0 14px 45px #2045650c;font:16px/1.45 system-ui,sans-serif;isolation:isolate}.mg-shell *{box-sizing:border-box}.mg-shell h2{font:700 26px/1.2 system-ui;margin:0 0 10px;color:var(--ink)}.mg-shell button,.mg-shell select{font:600 14px/1.2 system-ui;min-height:44px;border-radius:12px;padding:10px 12px;border:1px solid #c6dae5;background:white;color:var(--ink);cursor:pointer;box-shadow:none}.mg-shell button:focus-visible,.mg-shell select:focus-visible{outline:3px solid var(--coral);outline-offset:2px}.mg-shell button:hover{background:#e7f4fc}.mg-shell button:disabled{cursor:default;opacity:.5}.mg-shell .mg-primary,.mg-shell .mg-start{background:var(--blue);color:white;border-color:var(--blue)}.mg-toolbar,.mg-actions{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0;align-items:center}.mg-status{min-height:46px;font-size:14px;margin:8px 0}.mg-meta{display:flex;justify-content:space-between;gap:8px;font-variant-numeric:tabular-nums;font-size:14px}.mg-board{margin:15px auto;max-width:480px}.mg-sudoku{display:grid;grid-template-columns:repeat(9,1fr);border:2px solid #496b82;border-radius:6px;overflow:hidden;background:white;aspect-ratio:1}.mg-shell .mg-cell{border:0;border-right:1px solid #dbe5eb;border-bottom:1px solid #dbe5eb;border-radius:0;min-height:0;padding:0;font:500 clamp(18px,5vw,28px)/1 system-ui;aspect-ratio:1;background:#fff;color:#086b9c;position:relative}.mg-shell .mg-cell:nth-child(3n){border-right:2px solid #496b82}.mg-shell .mg-cell:nth-child(9n){border-right:0}.mg-shell .mg-cell:nth-child(n+19):nth-child(-n+27),.mg-shell .mg-cell:nth-child(n+46):nth-child(-n+54){border-bottom:2px solid #496b82}.mg-shell .mg-cell.fixed{font-weight:750;color:#263c4c;background:#f3f7fa}.mg-shell .mg-cell.peer{background:#edf6fc}.mg-shell .mg-cell.selected{background:#bee7fa;box-shadow:inset 0 0 0 2px #0878ac}.mg-shell .mg-cell.error{color:#b82f20;background:#ffded7}.mg-notes{display:grid;grid-template-columns:repeat(3,1fr);height:100%;align-items:center;font:10px/1 system-ui}.mg-keypad{display:grid;grid-template-columns:repeat(9,1fr);gap:4px}.mg-shell .mg-keypad button{padding:4px;font-size:20px}.mg-shell [aria-pressed=true]{background:#c3e8fb;border-color:#1176a3}.mg-mahjong-wrap{overflow:auto;padding:8px 2px 16px}.mg-mahjong{position:relative;width:100%;aspect-ratio:16/13;min-width:260px;background:radial-gradient(ellipse,#dfedf4,#f4faff);border-radius:16px}.mg-mahjong.large{min-width:520px}.mg-shell .mg-tile{position:absolute;width:12%;height:14.5%;min-height:0;padding:0;border-radius:5px;border:1px solid #a9b8bd;border-bottom:4px solid #9cacb2;background:linear-gradient(120deg,#fffefa,#f5f1e5);box-shadow:1px 2px 3px #324d5c38;font-family:system-ui;color:#165881;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0}.mg-tile .symbol{font-size:clamp(18px,5vw,30px);line-height:1.1}.mg-tile small{font-size:9px;line-height:1.1}.mg-shell .mg-tile.locked{filter:saturate(.45);background:#e4e5df;color:#536676}.mg-shell .mg-tile.selected{background:#ffe2d5;outline:2px solid var(--coral)}.mg-shell .mg-tile.hint{background:#cbf0ff;outline:2px solid #0878ac}.mg-win{padding:20px;background:#e8f7ef;border:1px solid #b6dfc8;border-radius:16px;margin:12px 0}.mg-win h3{font-size:24px;margin:0 0 8px}.mg-small{font-size:12px;color:#5f707b}.mg-shell [hidden]{display:none!important}.mg-shell .mg-toggle{margin-left:auto}.mg-article-intro{max-width:720px}.mg-shell .mg-danger{color:#ac3b2d}.mg-shell .mg-body{max-width:640px;margin:auto}@media(prefers-reduced-motion:no-preference){.mg-cell,.mg-tile{transition:background .15s}}@media(max-width:380px){.mg-shell{padding:10px;border-radius:18px}.mg-shell button,.mg-shell select{padding:9px 7px}.mg-toolbar{gap:5px}.mg-notes{font-size:9px}.mg-tile small{font-size:8px}}

@media(max-width:500px){.mg-keypad{grid-template-columns:repeat(5,1fr)}.mg-shell .mg-keypad button{min-height:44px}}
/* 1.1: original ivory tiles and a quiet felt table. */
.mg-shell[data-game=mahjong]{background:linear-gradient(145deg,#f9faf3,#ecf1e9);border-color:#d9e2d2}
.mg-shell .mg-mode{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:12px 0;font-size:14px}
.mg-shell .mg-mode select{max-width:100%;font-size:13px}
.mg-shell[data-game=mahjong] .mg-board{max-width:800px}
.mg-mahjong-wrap{border-radius:18px;background:radial-gradient(ellipse at 40% 25%,#507c70,#244c43);border:5px solid #d9c8a6;box-shadow:inset 0 0 24px #102e3666,0 8px 22px #223f3c22;padding:12px 4px 20px;overscroll-behavior:contain}
.mg-mahjong{min-width:0;background:transparent;border-radius:0}
.mg-mahjong.large{min-width:900px}
.mg-shell .mg-tile{border:1px solid #d7cbb1;border-bottom:4px solid #b4a17c;border-right:2px solid #c2ae87;border-radius:5px;background:linear-gradient(135deg,#fffef2 0%,#f5edd6 70%,#e8dcbe 100%);box-shadow:1px 3px 3px #091e3277,inset 1px 1px 1px #fff;font-size:0;overflow:hidden}
.mg-shell .mg-tile svg{width:92%;height:94%;display:block;pointer-events:none;filter:drop-shadow(0 1px 0 #ffffffbb)}
.mg-shell .mg-tile.locked{filter:brightness(.94);background:linear-gradient(135deg,#f4efdd,#e6d9b9);color:inherit}
.mg-shell .mg-tile:hover{background:#fffbe3}
.mg-shell .mg-tile.selected{background:#ffe6c3;outline:3px solid #dc8856;outline-offset:1px}
.mg-shell .mg-tile.hint{background:#f5ffff;outline:3px solid #73c4df;outline-offset:1px}
.mg-shell:fullscreen,.mg-shell.mg-fullscreen-fallback{background:#f3f6ef;width:100%;height:100%;max-width:none;border:0;border-radius:0;margin:0;padding:16px;overflow:auto}
.mg-shell.mg-fullscreen-fallback{position:fixed;inset:0;z-index:2147483000}
.mg-shell:fullscreen .mg-body,.mg-shell.mg-fullscreen-fallback .mg-body{max-width:1100px}
.mg-shell:fullscreen .mg-board,.mg-shell.mg-fullscreen-fallback .mg-board{max-width:1000px}
.mg-shell:fullscreen>h2,.mg-shell:fullscreen>p,.mg-shell.mg-fullscreen-fallback>h2,.mg-shell.mg-fullscreen-fallback>p{display:none}
@media(max-width:500px){.mg-shell .mg-tile{border-bottom-width:3px;border-right-width:1px;border-radius:4px}.mg-mahjong-wrap{border-width:3px;padding:10px 2px 16px}.mg-shell[data-game=mahjong]{padding:10px}.mg-shell .mg-actions button{flex-grow:1}.mg-shell .mg-status{min-height:42px}}

/* Final prelaunch: aligned controls and original editorial cards. */
.mg-shell{padding:0;overflow:hidden;background:#f5f9fc}.mg-shell .mg-body{padding:20px;max-width:800px}.mg-shell .mg-body[hidden]{display:none!important}
.mg-preview{display:grid;grid-template-columns:1fr;overflow:hidden}.mg-preview-art{width:100%;height:auto;display:block!important;margin:0!important;max-width:none!important;border-radius:0!important}.mg-preview-copy{padding:22px 24px 26px}.mg-shell .mg-eyebrow{display:block;color:#5c7986;font:700 11px/1.4 system-ui;letter-spacing:.13em;margin:0 0 10px}.mg-preview h2{font-size:26px;letter-spacing:-.5px;margin:0 0 10px}.mg-preview p{font:16px/1.5 system-ui;margin:0 0 18px}.mg-shell .mg-start{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;background:#166d92;border:0;color:#fff;font-size:16px;padding:15px 18px;border-radius:12px;min-height:52px;box-shadow:0 6px 15px #16547720}.mg-shell[data-game=mahjong]{padding:0}.mg-shell[data-game=mahjong] .mg-start{background:#285c4c}.mg-shell .mg-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:8px}.mg-toolbar>label{grid-column:1/-1;display:grid;gap:5px;font-size:13px}.mg-shell .mg-toolbar select{width:100%;height:46px}.mg-toolbar .mg-toggle{margin-left:0}.mg-shell[data-game=sudoku] .mg-toolbar [data-do=collapse]{grid-column:1/-1}.mg-shell .mg-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mg-shell .mg-actions button{width:100%;min-width:0;height:46px;padding:8px 5px;font-size:13px}.mg-shell[data-game=sudoku] .mg-actions [data-do=hint]{grid-column:1/-1}.mg-shell .mg-mode{display:grid;gap:5px;grid-template-columns:1fr;align-items:stretch}.mg-mode select{width:100%}.mg-shell .mg-keypad button{min-width:0}.mg-shell .mg-toggle{width:100%}.mg-shell .mg-game-heading{font-size:24px;margin-bottom:14px}.mg-shell .mg-small button{display:block;width:100%;margin-top:10px}
.mg-mahjong-wrap{background:radial-gradient(ellipse at 25% 20%,#416e64,#193c35 85%);border:3px solid #bda47e;box-shadow:inset 0 0 32px #102e3677,0 10px 24px #223f3c22}
.mg-shell .mg-tile{background:linear-gradient(120deg,#fffdf0,#f3e6c9 75%,#e6d2a5);border:1px solid #cbb98f;border-bottom:5px solid #b59c66;border-right:3px solid #c3ad79;box-shadow:2px 4px 3px #071c2877,inset 1px 1px 2px #fffdf7;overflow:visible}.mg-shell .mg-tile svg{width:92%;height:92%;filter:drop-shadow(0 .6px 0 #fff)}.mg-shell .mg-tile.locked{background:linear-gradient(120deg,#f8efdb,#eadaba);filter:brightness(.96)}.mg-mahjong.large{min-width:850px}.mg-shell:fullscreen,.mg-shell.mg-fullscreen-fallback{overflow:auto}.mg-shell:fullscreen .mg-body,.mg-shell.mg-fullscreen-fallback .mg-body{padding:16px}
@media(min-width:700px){.mg-preview{grid-template-columns:1.15fr 1fr;align-items:center}.mg-preview-art{height:100%;object-fit:cover}.mg-shell[data-game=sudoku] .mg-toolbar{grid-template-columns:2fr 1fr 1fr 1fr}.mg-shell[data-game=sudoku] .mg-toolbar>label,.mg-shell[data-game=sudoku] .mg-toolbar [data-do=collapse]{grid-column:auto}}
@media(max-width:500px){.mg-shell .mg-body{padding:12px}.mg-preview-copy{padding:18px}.mg-preview h2{font-size:24px}.mg-shell .mg-tile{border-bottom-width:3px;border-right-width:2px}.mg-mahjong-wrap{padding:10px 2px 16px}.mg-shell .mg-notes{font-size:8px}}

/* Mobile review 1.3: clear states, generous controls, no global zoom. */
.mg-shell{border-color:#cbdde8;box-shadow:0 8px 30px #193a5110}.mg-body{background:linear-gradient(#f3faff,#fff 260px)}
.mg-shell .mg-cell.same-number{background:#d0eaf8;color:#12466a;font-weight:750}.mg-shell .mg-cell.selected{background:#235f85!important;color:white!important;box-shadow:inset 0 0 0 2px #174361}.mg-shell .mg-cell.error{color:#a01825;background:#ffe6e7}.mg-shell .mg-cell.selected.error{background:#922b3a!important}
.mg-feedback{animation:mg-feedback .45s ease-out}.mg-complete .mg-win{animation:mg-celebrate .55s ease-out;border:1px solid #9ed9bb;background:#e9faf0;border-radius:16px;padding:16px}
@keyframes mg-feedback{50%{box-shadow:inset 0 0 0 3px #e3a87e}}@keyframes mg-celebrate{from{transform:translateY(8px);opacity:.3}to{transform:none;opacity:1}}
.mg-mode{font-size:13px;display:flex;align-items:center;gap:8px}.mg-mode select{flex:1;min-width:0;min-height:44px}.mg-toolbar label{font-size:13px}.mg-toolbar button,.mg-actions button,.mg-keypad button{min-height:44px}
.mg-mahjong-wrap{max-width:100%;overscroll-behavior-x:contain}.mg-mahjong{background:radial-gradient(ellipse at 35% 15%,#527b70,#264c45);border-radius:14px}
.mg-shell .mg-tile{box-shadow:1px 3px 0 #b6aa91,2px 6px 0 #8c826e,3px 8px 6px #102b3655;border:1px solid #e9dfc8}.mg-shell .mg-tile.locked{filter:none;opacity:1;background:#d9d4c6;border-color:#aaa898;box-shadow:1px 2px 0 #89877c,2px 4px 3px #142d3655}.mg-shell .mg-tile.locked svg{opacity:.72}.mg-shell .mg-tile.open-left{border-left:3px solid #eaffd8}.mg-shell .mg-tile.open-right{border-right:3px solid #eaffd8}.mg-shell .mg-tile.selected,.mg-shell .mg-tile.hint{outline:3px solid #66c6f0;outline-offset:0}
.mg-tutorial{border:1px solid #bdd6e6;background:#f1f8fc;padding:12px;border-radius:12px;margin:12px 0}.mg-tutorial[hidden]{display:none}.mg-tutorial p{font-size:14px;line-height:1.5;margin:8px 0}.mg-tutorial-head{display:flex;gap:8px;align-items:center;justify-content:space-between;font-size:14px}.mg-tutorial-close{min-width:44px;min-height:44px}.mg-demo{display:flex;gap:8px;justify-content:center}.mg-demo-tile{width:58px;height:75px;padding:4px;background:#fff5dc;border:1px solid #bbaa87;border-radius:7px;box-shadow:1px 3px 0 #b6aa91}.mg-demo-tile svg{width:100%;height:100%}.mg-demo-tile.selected{outline:3px solid #4199be}.mg-tutorial-status:empty{display:none}
@media(prefers-reduced-motion:reduce){.mg-feedback,.mg-complete .mg-win{animation:none}}

.mg-shell[data-game=sudoku] .mg-toolbar>label{grid-column:auto;margin:0;min-width:0}.mg-shell[data-game=sudoku] .mg-toolbar .mg-mode{display:grid;font-size:13px}.mg-shell .mg-demo-tile{padding:4px}.mg-shell .mg-demo-tile svg{max-width:100%;max-height:100%}

/* Stage 22: completion replaces the board, including restored wins. */
.mg-complete>.mg-game-heading,.mg-complete>.mg-toolbar,.mg-complete>.mg-tutorial,.mg-complete>.mg-confirm,.mg-complete .mg-play>.mg-meta,.mg-complete .mg-play>.mg-status,.mg-complete .mg-play>.mg-board,.mg-complete .mg-play>.mg-keypad,.mg-complete .mg-play>.mg-actions,.mg-complete .mg-play>.mg-small{display:none!important}
.mg-shell .mg-win{box-sizing:border-box;width:100%;max-width:440px;margin:0 auto;padding:22px 16px;text-align:center;border:1px solid #b9dbec;border-radius:20px;background:linear-gradient(155deg,#f5fbff,#e5f5f4);box-shadow:0 12px 30px #143a5310;outline-offset:3px}
.mg-shell .mg-win[hidden]{display:none!important}.mg-win-mark{display:grid;place-items:center;width:54px;height:54px;margin:0 auto 10px;border-radius:50%;background:#d5eee3;color:#216950;font-size:32px;font-weight:700}
.mg-shell .mg-win h3{margin:0 0 8px;font-size:30px;color:#183e57}.mg-shell .mg-win p{margin:8px 0;font-size:15px;line-height:1.4}.mg-shell .mg-win .mg-primary{display:block;width:100%;min-height:50px;margin:16px 0 8px;background:#23668c;color:#fff;font-size:18px;border-radius:12px}.mg-shell .mg-win-share{display:block;margin:0 auto;min-height:44px;font-size:14px}.mg-shell .mg-win-collapse{min-height:44px;border:0;background:transparent;font-size:13px}.mg-win-stats{color:#486471}.mg-share-status:empty{display:none}.mg-complete .mg-play{padding-top:0}
