.m3-toolbar{display:flex;gap:25px;align-items:center;margin-bottom:12px}.m3-toolbar span{display:block;font-size:12px;color:#536551}.m3-toolbar strong{font-size:24px}.m3-toolbar button{margin-left:auto}.m3-settings{display:flex;gap:8px;align-items:end}.m3-settings label{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;font-size:12px}.m3-settings button:disabled{opacity:.45;cursor:default}.m3-goal{margin:14px 0 10px;font-size:13px}.m3-goal progress{display:block;width:100%;height:10px;margin-top:6px;accent-color:#58804e}.m3-board{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(7,minmax(0,1fr));gap:4px;aspect-ratio:1;width:100%;padding:7px;border:1px solid #71866a;border-radius:12px;background:#c7d5bc;box-sizing:border-box;touch-action:none;user-select:none;overflow:hidden}.m3-cell{display:flex;align-items:center;justify-content:center;position:relative;min-width:0;min-height:0;margin:0;padding:0;border:1px solid #d7dfcc;border-radius:8px;background:#f8faf2;cursor:pointer;touch-action:none}.m3-piece{display:block;width:65%;height:65%;position:relative;transition:transform 100ms ease;filter:drop-shadow(0 2px 1px #203c2222);pointer-events:none}.m3-piece-0{background:#ce736b;border-radius:50%;box-shadow:inset 2px 3px 0 #ffffff40}.m3-piece-1{background:#448c7a;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.m3-piece-2{background:#c79d3c;clip-path:polygon(50% 0,100% 100%,0 100%)}.m3-piece-3{background:#618cae;border-radius:18%;box-shadow:inset 2px 3px 0 #ffffff40}.m3-piece-4{background:#9676ae;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%);width:75%;height:75%}.m3-cell.m3-selected{background:#ffedb7;border-color:#b99232;z-index:3}.m3-cell.m3-hint{outline:3px solid #b99232;outline-offset:-2px;background:#ffedb7}.m3-cell:focus-visible{outline:3px solid #276990;outline-offset:-3px;z-index:2}.m3-clear .m3-piece{animation:m3-clear 90ms ease-in forwards}.m3-falling{animation:m3-fall 130ms ease-out}.m3-result-actions{flex-wrap:wrap}.block-final-actions #m3Next{background:#315d45;color:white}
@media(max-width:400px){.m3-toolbar{gap:20px}.m3-board{gap:3px;padding:5px}.m3-cell{border-radius:6px}.m3-toolbar button,.m3-settings button{font-size:12px;padding-inline:10px}}
@media(prefers-reduced-motion:reduce){.m3-piece{transition:none}.m3-clear .m3-piece,.m3-falling{animation:none}}

/* Match-3 piece styles are cosmetic; all keep the same five underlying piece IDs. */
.m3-settings{flex-wrap:wrap}.m3-settings .m3-pieces-setting{flex:0 1 112px}.m3-piece-0{--m3-soft:#fbe8e3;--m3-tone:#943c34}.m3-piece-1{--m3-soft:#e0f1e6;--m3-tone:#24654f}.m3-piece-2{--m3-soft:#fff1ca;--m3-tone:#76540b}.m3-piece-3{--m3-soft:#e2edf8;--m3-tone:#315c88}.m3-piece-4{--m3-soft:#eee4f6;--m3-tone:#68468c}
.m3-board:is([data-skin="fruit"],[data-skin="flowers"],[data-skin="numbers"]) .m3-piece{display:grid;place-items:center;box-sizing:border-box;width:86%;height:86%;background:var(--m3-soft);border:1px solid #274c2814;border-radius:50%;clip-path:none;box-shadow:none;color:var(--m3-tone);font-size:clamp(20px,6vw,36px);line-height:1;filter:none}
.m3-board:is([data-skin="fruit"],[data-skin="flowers"]) .m3-piece{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-weight:400}
.m3-board[data-skin="numbers"] .m3-piece{font-family:inherit;font-weight:800;border:2px solid var(--m3-tone)}
@media(max-width:400px){.m3-settings .m3-pieces-setting{flex-basis:100px}}

.m3-settings>label:first-child{min-width:120px}
/* Match-3: a brighter tabletop game inside Mind Playroom's quiet shared shell. */
.m3-game .m3-toolbar{gap:14px;margin-bottom:14px;padding:12px 14px;background:linear-gradient(120deg,#e5efdd,#f0f4e7);border-radius:14px;border:1px solid #d3dfc8}
.m3-toolbar>div{min-width:0}.m3-toolbar .m3-score-value{display:flex;align-items:baseline;gap:5px;white-space:nowrap}.m3-toolbar strong{font-size:30px;line-height:1.15;color:#194e40;font-variant-numeric:tabular-nums}.m3-toolbar .m3-score-value span{font-size:15px;color:#4d665a}.m3-toolbar>div>span{font-size:11px;letter-spacing:.15px;margin-bottom:4px}.m3-toolbar #m3New{font-size:12px;padding:8px 10px;background:#f8faf3;border-color:#b0c2aa}
.m3-game .m3-settings{gap:8px}.m3-settings #m3Hint{background:#315d45;color:#fff;border-color:#315d45;font-weight:650}.m3-settings #m3Results{background:#eaf0df;font-weight:650}
.m3-game .m3-goal{margin:14px 0 12px}.m3-goal-line{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#315543}.m3-goal-line>span{font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}.m3-goal progress{height:12px;border:0;border-radius:999px;overflow:hidden;background:#dce6d5;appearance:none}.m3-goal progress::-webkit-progress-bar{background:#dce6d5;border-radius:999px}.m3-goal progress::-webkit-progress-value{background:linear-gradient(90deg,#3b7956,#76a85c);border-radius:999px}.m3-goal progress::-moz-progress-bar{background:#4f8a58;border-radius:999px}
.m3-game .m3-board{background:linear-gradient(145deg,#28594e,#163f38);border:1px solid #174038;padding:8px;gap:4px;border-radius:16px;box-shadow:0 5px 0 #12372f,0 9px 18px #173e2e14;margin-bottom:8px}
.m3-board .m3-cell{background:#396b5e;border:1px solid #518172;border-radius:9px;box-shadow:inset 0 1px 1px #ffffff0b}.m3-board .m3-cell.m3-selected{background:#678348;border-color:#f8d778;box-shadow:inset 0 0 0 2px #f8d778;z-index:3}.m3-board .m3-cell.m3-hint{outline:3px solid #ffe29a;outline-offset:-3px;background:#557952}.m3-board .m3-cell:focus-visible{outline:3px solid #f5f1ce;outline-offset:-3px}
.m3-board[data-skin="shapes"] .m3-piece{width:72%;height:72%;filter:drop-shadow(0 2px 1px #102e3255)}.m3-board[data-skin="shapes"] .m3-piece-0{background:#ef8179}.m3-board[data-skin="shapes"] .m3-piece-1{background:#83d4b6}.m3-board[data-skin="shapes"] .m3-piece-2{background:#f0c551}.m3-board[data-skin="shapes"] .m3-piece-3{background:#86bce6}.m3-board[data-skin="shapes"] .m3-piece-4{background:#c29ee0;width:80%;height:80%}
.m3-board[data-skin="fruit"] .m3-piece{width:92%;height:92%;border:0;border-radius:0;background-color:transparent;background-repeat:no-repeat;background-size:contain;background-position:center;box-shadow:none;clip-path:none;filter:drop-shadow(0 2px 1px #123b3c55)}
.m3-board[data-skin="fruit"] .m3-piece-0{background-image:url('/assets/match3/cherries-v1.svg')}.m3-board[data-skin="fruit"] .m3-piece-1{background-image:url('/assets/match3/pear-v1.svg')}.m3-board[data-skin="fruit"] .m3-piece-2{background-image:url('/assets/match3/lemon-v1.svg')}.m3-board[data-skin="fruit"] .m3-piece-3{background-image:url('/assets/match3/orange-v1.svg')}.m3-board[data-skin="fruit"] .m3-piece-4{background-image:url('/assets/match3/grapes-v1.svg')}
@media(max-width:400px){.m3-game .m3-toolbar{gap:12px;padding:10px}.m3-toolbar strong{font-size:27px}.m3-toolbar .m3-score-value span{font-size:13px}.m3-game .m3-board{padding:6px;gap:3px}.m3-board .m3-cell{border-radius:7px}}
@media(max-width:360px){.m3-game .m3-toolbar{gap:8px}.m3-toolbar strong{font-size:24px}.m3-toolbar #m3New{font-size:11px;padding-inline:8px}}
/* New-round flower collections use the same illustrated treatment as fruit. */
.m3-board[data-skin="flowers"][data-flower-art="vector"] .m3-piece{width:92%;height:92%;border:0;border-radius:0;background-color:transparent;background-repeat:no-repeat;background-size:contain;background-position:center;box-shadow:none;clip-path:none;filter:drop-shadow(0 2px 1px #123b3c55)}

/* Preset dimensions; keep square tiles at every board size. */
.m3-board{grid-template-columns:repeat(var(--m3-size,7),minmax(0,1fr));grid-template-rows:repeat(var(--m3-size,7),minmax(0,1fr))}
.m3-piece-5{background:#f0a353;--m3-soft:#fff0de;--m3-tone:#8b4e14;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.m3-piece-6{background:#f4a5c2;--m3-soft:#ffe6ef;--m3-tone:#913e60;clip-path:polygon(35% 0,65% 0,65% 35%,100% 35%,100% 65%,65% 65%,65% 100%,35% 100%,35% 65%,0 65%,0 35%,35% 35%)}
@media(max-width:400px){.m3-board[data-skin="numbers"] .m3-piece{font-size:clamp(16px,5vw,24px)}}

/* Stripes remain visible across fruit, flowers, shapes and numbers. */
.m3-stripe-mark{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;transition:transform 100ms ease;z-index:1}
.m3-stripe-mark::after{content:"";width:78%;height:18%;min-height:5px;border-block:2px solid #fff6d5;border-radius:2px;background:#e9b742;box-shadow:0 0 0 1px #254b40,0 1px 3px #102e32bb}
.m3-stripe-mark[data-axis="column"]::after{width:18%;height:78%;min-width:5px;min-height:0;border-block:0;border-inline:2px solid #fff6d5}
.m3-clear .m3-stripe-mark{animation:m3-clear 130ms ease-in forwards}
.m3-cell:is(.m3-blast-row,.m3-blast-column)::after{content:"";position:absolute;inset:-3px;z-index:4;pointer-events:none;animation:m3-beam 260ms ease-out both;background:linear-gradient(transparent 32%,#f8d66a 43%,#fffbea 50%,#f8d66a 57%,transparent 68%)}
.m3-cell.m3-blast-column::after{background:linear-gradient(90deg,transparent 32%,#f8d66a 43%,#fffbea 50%,#f8d66a 57%,transparent 68%)}
.m3-cell.m3-blast-row.m3-blast-column::after{background:linear-gradient(90deg,transparent 35%,#fff0b1 48%,transparent 65%),linear-gradient(transparent 35%,#fff0b1 48%,transparent 65%)}
.m3-stripe-tip{margin:12px 0;padding:12px;border:1px solid #bda45b;border-radius:10px;background:#fff7dc;color:#344c37;font-size:13px;line-height:1.5}
.m3-stripe-tip p{margin:0 0 8px}.m3-stripe-tip button{min-height:36px;border:1px solid #8b9f7e;border-radius:7px;background:#f8faf2;color:#294534;padding:6px 12px;font:inherit;cursor:pointer}
@media(prefers-reduced-motion:reduce){.m3-stripe-mark,.m3-cell:is(.m3-blast-row,.m3-blast-column)::after{transition:none;animation:none}}
/* Number specials keep the digit clear: gold rails sit along the tile edges. */
.m3-board[data-skin="numbers"] .m3-stripe-mark::after{width:78%;height:calc(100% - 4px);min-height:0;border:0;border-block:2px solid #f7d578;border-radius:3px;background:none;box-shadow:none}
.m3-board[data-skin="numbers"] .m3-stripe-mark[data-axis="column"]::after{width:calc(100% - 4px);height:78%;min-width:0;border:0;border-inline:2px solid #f7d578}

/* Rainbow specials replace the type completely; no digit or fruit is concealed. */
.m3-board[data-skin] .m3-piece.m3-rainbow{display:grid;place-items:center;width:82%;height:82%;background:conic-gradient(#f17c80,#f6ca59,#8bce80,#6ecbc4,#85b7ef,#b796e7,#f17c80);background-size:auto;border:2px solid #fff4c9;border-radius:50%;clip-path:none;box-shadow:0 0 0 1px #244c40,inset 0 0 5px #fff9;color:white;font-family:system-ui,sans-serif;font-size:clamp(17px,5vw,30px);font-weight:800;text-shadow:0 1px 3px #183f38;filter:none;line-height:1}
.m3-cell.m3-rainbow-clear::after{content:"";position:absolute;inset:-2px;z-index:4;pointer-events:none;border-radius:8px;background:radial-gradient(circle,#fff8d8 5%,#f6ce6a99 45%,transparent 75%);animation:m3-beam 260ms ease-out both}
@media(prefers-reduced-motion:reduce){.m3-cell.m3-rainbow-clear::after{animation:none}}

/* Match-3: difficulty, piece style and Hint share one compact row. */
#m3Page .m3-settings{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 96px;gap:8px;align-items:end}
#m3Page .m3-settings>label{min-width:0;gap:0}
#m3Page .m3-settings #m3Hint{min-width:0;min-height:44px;font-size:14px}
@media(max-width:480px){#m3Page .m3-settings{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 76px}}
@media(max-width:360px){#m3Page .m3-settings{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 68px;gap:6px}}
.m3-game.framed-game{--play-width:460px}
#m3Page .game-action-panel .m3-toolbar{padding:0;background:transparent;border:0;border-radius:0}
#m3Page .game-action-panel .m3-goal{margin-bottom:0}
@media(min-width:901px){
 #m3Page .m3-goal,#m3Page .m3-goal-line>span{font-size:16px;line-height:26px}
 #m3Page .m3-stripe-tip p,#m3Page .m3-stripe-tip button,#m3Results{font-size:16px;line-height:26px}}
@media(min-width:901px){#m3Page .m3-settings #m3Hint{min-height:46px;font-size:16px}}

/* Share Match-3 beside New board, including compact phone layouts. */
#m3Page .m3-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) auto auto;gap:12px}
#m3Page .m3-toolbar button{margin-left:0}
#m3Page .m3-toolbar #m3ShareGame{font-size:12px;padding:8px 10px;background:#f8faf3;border-color:#b0c2aa}
@media(min-width:901px){#m3Page .m3-toolbar #m3ShareGame{font-family:inherit;font-size:16px;font-weight:600;min-height:46px}}
@media(max-width:600px){#m3Page .m3-toolbar{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr) repeat(2,minmax(0,1fr));gap:6px}#m3Page .m3-toolbar :is(#m3New,#m3ShareGame){font-size:12px;padding:8px 5px;white-space:normal;min-height:44px}#m3Page .m3-score-value{gap:3px}#m3Page .m3-toolbar strong{font-size:24px}#m3Page .m3-score-value span{font-size:11px}}
