/* Bopuloo V1.4: Gomoku and Mahjong Connect — friendly pastel play surfaces. */
.gm-game,.mc-game{min-width:0;max-width:100%}
.gm-settings,.mc-options{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:9px 0 14px}
.gm-settings label,.mc-options label{display:flex;flex-direction:column;gap:5px;color:#746589;font-size:12px;font-weight:900}
.gm-settings select,.mc-options select{max-width:none;min-height:40px}
.gm-wrap{display:flex;justify-content:center;max-width:100%;margin:13px auto}
.gm-board{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));width:min(100%,590px);aspect-ratio:1;padding:10px;border:3px solid #e0a96e;border-radius:16px;background:#f6ddb0;box-shadow:0 7px 0 #dcb483,0 15px 32px #98754620;touch-action:manipulation;user-select:none;overflow:hidden}
.gm-cell{appearance:none;border:0;border-radius:0;background:linear-gradient(to right,transparent calc(50% - .75px),#ac8359 calc(50% - .75px),#ac8359 calc(50% + .75px),transparent calc(50% + .75px)),linear-gradient(to bottom,transparent calc(50% - .75px),#ac8359 calc(50% - .75px),#ac8359 calc(50% + .75px),transparent calc(50% + .75px));position:relative;min-width:0;aspect-ratio:1;padding:0;display:grid;place-items:center;cursor:pointer;outline-offset:-2px}
.gm-cell:disabled{cursor:default;opacity:1}.gm-cell:focus-visible{outline:3px solid #6d4abb;z-index:3}
.gm-cell:has(.gm-stone:empty):hover:before{content:'';display:block;width:75%;height:75%;border-radius:50%;background:#4a405333;position:absolute}
.gm-stone{position:relative;z-index:1;width:76%;height:76%;border-radius:50%;display:flex;align-items:center;justify-content:center;line-height:1;font-size:clamp(9px,1.5vw,18px)}
.gm-black .gm-stone{background:radial-gradient(circle at 30% 27%,#6a6872,#292639 62%,#161522);box-shadow:0 2px 4px #332e4855}
.gm-white .gm-stone{background:radial-gradient(circle at 32% 25%,#fff,#f4f4f5 65%,#c0bdd2);box-shadow:0 2px 3px #594f5555;border:1px solid #d1cedc}
.gm-last .gm-stone:after{content:'';width:22%;height:22%;background:#ff806a;border-radius:50%;position:absolute;inset:auto}
.gm-line .gm-stone{box-shadow:0 0 0 3px #ffb14b,0 3px 8px #d37636ab}
.gm-hint .gm-stone{color:#7651bd;background:#dbb7f8a8;font-weight:1000}
.gm-notice,.mc-notice{background:#f7f0ff;color:#705aa7;border-radius:12px;margin:12px 0;padding:10px 14px;font-size:13px;font-weight:800;min-height:42px}
.gm-celebrate,.mc-celebrate{margin:12px 0;padding:15px;border-radius:16px;text-align:center;background:linear-gradient(110deg,#ffdfae,#f5cbf9,#c4eedb);color:#614a85;font-size:17px;font-weight:950}
.gm-help,.mc-help{font-size:12px;line-height:1.8;color:#7c728c;margin-top:14px}
.mc-mode-description{font-size:12px;color:#907d9c;margin:0 0 8px}
.mc-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-color:#b6a4e3 #e8e7e9;border-radius:18px;background:linear-gradient(125deg,#e9e0fa,#d8f2e8);border:2px solid #cbb8ea;box-shadow:0 6px 0 #d1c3e6;padding:4px}
.mc-stage{--mc-size:clamp(32px,3vw,45px);--mc-gap:5px;position:relative;padding:20px;width:max-content;min-width:100%;margin:auto;box-sizing:border-box}
.mc-board{display:grid;grid-template-columns:repeat(var(--cols),var(--mc-size));gap:var(--mc-gap);width:max-content;margin:auto;position:relative}
.mc-tile{width:var(--mc-size);height:var(--mc-size);padding:0;border:2px solid #fffbff;border-bottom:4px solid #c0b8da;background:#fffefa;border-radius:9px;box-shadow:0 2px 5px #62518826;cursor:pointer;font-weight:1000;touch-action:manipulation;display:grid;place-items:center;color:#544475;transition:transform .11s,background .11s;position:relative;z-index:1;user-select:none}
.mc-tile:hover{transform:translateY(-1px);background:#fff6e3}.mc-tile:focus-visible{outline:3px solid #7050c6;outline-offset:2px}
.mc-tile[data-kind="0"]{color:#d4516e}.mc-tile[data-kind="1"]{color:#438da8}.mc-tile[data-kind="2"]{color:#7d59bb}.mc-tile[data-kind="3"]{color:#368672}.mc-tile[data-kind="4"]{color:#b17b41}
.mc-glyph{font:950 clamp(18px,2vw,29px) var(--heading,system-ui);line-height:1;display:block}
.mc-selected{outline:3px solid #ff9e49;outline-offset:1px;background:#fff1db;z-index:3}.mc-hint{outline:3px solid #8e69ed;outline-offset:1px;animation:mc-pulse 1s ease-in-out infinite alternate}
.mc-blank{width:var(--mc-size);height:var(--mc-size);border-radius:9px;background:#ffffff1a;border:1px dotted #b9d5ca6d}
.mc-path-layer{position:absolute;inset:0;width:100%;height:100%;z-index:5;pointer-events:none;overflow:visible;filter:drop-shadow(0 1px 2px #c27439)}
.mc-swipe-tip{margin:4px 0 8px;color:#638977;font-size:12px;font-weight:800}
.mc-celebrate h3{margin:0 0 7px;color:#654889}.mc-celebrate p{margin:0 0 12px;font-size:14px;color:#785b86}
.mc-celebrate .tiny-btn{background:#fff;color:#65428b}
@keyframes mc-pulse{to{filter:brightness(1.03);outline-color:#5136b5}}
.ill-gomoku{background:linear-gradient(145deg,#f3e0bb,#e9bc92)}.ill-mahjong{background:linear-gradient(140deg,#cbeedb,#c9d9ff)}
.gm-mini{display:grid;grid-template-columns:repeat(5,1fr);width:145px;height:145px;border:4px solid #a57748;background:#f5d9a1;border-radius:12px;padding:8px;transform:rotate(-9deg);box-shadow:0 12px 22px #755d5426}
.gm-mini span{display:grid;place-items:center;font-size:24px;color:#2e273b}
.mc-mini{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;transform:rotate(-8deg)}.mc-mini span{display:grid;place-items:center;width:49px;height:55px;background:#fffefa;border:3px solid #fefefe;border-bottom:6px solid #b2bac7;border-radius:8px;font-weight:1000;color:#7555ab;font-size:26px;box-shadow:0 3px 5px #53455b26}
@media(max-width:700px){.gm-board{padding:5px;border-radius:12px}.gm-stone{width:77%;height:77%}.mc-stage{--mc-size:35px;--mc-gap:4px;padding:15px}.mc-swipe-tip{font-size:11px}.gm-settings,.mc-options{gap:8px}.gm-game .game-actions,.mc-game .game-actions{gap:5px}}
@media(max-width:380px){.mc-stage{--mc-size:33px;--mc-gap:3px}.gm-board{padding:4px}.mc-options{align-items:start}}
@media(prefers-reduced-motion:reduce){.mc-hint{animation:none}}
/* Grid children must be allowed to shrink; only the tile tray scrolls. */
.game-page-grid>div,.play-panel{min-width:0}
.mc-scroll{min-width:0;box-sizing:border-box}
