html.gomoku-open{overflow:hidden}#gomokuGame[hidden]{display:none}#gomokuGame{position:fixed;inset:0;z-index:22000;background:radial-gradient(ellipse at top,#e7eee8,transparent 60%),#f8f7f2;color:#303b36;overflow:auto;overscroll-behavior:contain}.gm-shell{max-width:560px;margin:auto;padding:max(20px,env(safe-area-inset-top)) 18px max(28px,env(safe-area-inset-bottom));box-sizing:border-box}#gomokuGame button,#gomokuGame select,#gomokuGame input{font:inherit;color:inherit}#gomokuGame button{border:0;border-radius:18px;background:#ffffffb0;padding:12px 16px;cursor:pointer;transition:transform .2s}#gomokuGame button:active{transform:scale(.95)}#gomokuGame button:disabled{cursor:default}#gomokuGame header{display:flex;align-items:center;justify-content:space-between;gap:12px}#gomokuGame header b{font-size:24px;letter-spacing:-1px}.gm-intro{text-align:center;margin:50px 0}.gm-intro i{font-style:normal;font-size:64px;letter-spacing:-18px;text-shadow:0 8px 12px #424e3d25}.gm-intro h1{font-size:28px}.gm-intro p,.gm-note{font-size:12px;line-height:1.9;color:#808c83}.gm-shell label{font-size:13px}.gm-shell select{display:block;width:100%;margin:12px 0 22px;border:0;border-radius:18px;background:white;padding:16px}#gomokuGame .gm-main{background:#dce7db;width:100%;margin:12px 0}.gm-players{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:28px 0 18px;font-size:12px}.gm-players span{display:flex;align-items:center;gap:6px;max-width:32%;overflow:hidden}.gm-players small{font-size:11px;color:#849180;text-align:center}.gm-players i{width:14px;height:14px;border-radius:50%;flex-shrink:0}.gm-black{background:#282a29}.gm-white{background:white;box-shadow:0 2px 4px #0002}.gm-board{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));aspect-ratio:1;padding:12px;border-radius:22px;background:linear-gradient(130deg,#f2dfba,#e5cca1);box-shadow:0 6px 0 #c6ae86,0 14px 36px #61503920;touch-action:manipulation;isolation:isolate}#gomokuGame .gm-board button{position:relative;padding:0;border-radius:0;background:transparent;aspect-ratio:1;display:grid;place-items:center;min-width:0;transform:none}#gomokuGame .gm-board button:before,#gomokuGame .gm-board button:after{content:'';position:absolute;background:#9c896b90;z-index:-1}.gm-board button:before{width:100%;height:1px}.gm-board button:after{height:100%;width:1px}.gm-board button:nth-child(15n+1):before{width:50%;left:50%}.gm-board button:nth-child(15n):before{width:50%;right:50%}.gm-board button:nth-child(-n+15):after{height:50%;top:50%}.gm-board button:nth-child(n+211):after{height:50%;bottom:50%}.stone{width:86%;height:86%;border-radius:50%;display:block;box-shadow:1px 3px 3px #352d3b45;animation:gm-place .23s ease}.stone.black{background:radial-gradient(circle at 30% 25%,#626562,#151917 72%)}.stone.white{background:radial-gradient(circle at 30% 25%,white,#e4e2d9 75%)}.stone.last:after{content:'';position:absolute;width:15%;height:15%;left:42.5%;top:42.5%;border-radius:50%;background:#bc8264}.gm-actions{display:flex;align-items:center;gap:8px;margin:20px 0;font-size:12px}.gm-actions span{flex:1;color:#8d958a}.gm-conversation{background:#ffffffb0;padding:20px;border-radius:26px;box-shadow:0 10px 30px #32452f08}.gm-conversation h2{font-size:15px;font-weight:500;margin:0 0 15px}.gm-messages{max-height:260px;overflow:auto;overscroll-behavior:contain}.gm-messages p{padding:12px 14px;border-radius:18px;background:#f0f3ed;font-size:13px;line-height:1.75;white-space:pre-wrap;margin:10px 0;max-width:85%;overflow-wrap:anywhere}.gm-messages p.user{margin-left:auto;background:#e5ede1}.gm-messages p.system{font-size:11px;background:transparent;color:#8a9288}.gm-messages small{display:block;font-size:10px;color:#87917f;margin-bottom:4px}#gmForm{display:flex;gap:8px;margin-top:14px}#gmInput{flex:1;min-width:0;border:0;background:#f1f3ef;border-radius:18px;padding:12px;font-size:16px}#gmForm button{background:#dce7d9}#gmStatus{white-space:pre-wrap}.gm-actions button:disabled,#gmForm button:disabled{opacity:.45}@keyframes gm-place{from{transform:translateY(-7px) scale(.85);opacity:.5}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){#gomokuGame *{animation:none!important;transition:none!important}}

.gm-actions{flex-wrap:wrap}.gm-actions button{font-size:12px;padding:10px 12px}.gm-mode{margin:0 0 16px;text-align:center}
/* Update cells in place; only the newly inserted stone animates. */
#gomokuGame{overflow-anchor:none}.gm-board{flex-shrink:0}.gm-auto-setting{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:#889184}.gm-shell .gm-auto-setting select{width:auto;max-width:160px;margin:0;padding:9px 12px;font-size:11px;background:#eef2eb}.stone.winning{box-shadow:0 0 0 2px #d5b86d,0 0 14px #e9cd82;animation:gm-glow 1.2s ease-in-out 3}.gm-celebration{position:fixed;inset:0;z-index:3;display:grid;place-items:center;background:#edf4e755;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);overflow:hidden}.gm-celebration>div{z-index:2;text-align:center;width:min(78vw,340px);padding:30px 22px;border-radius:32px;background:#ffffffdf;box-shadow:0 20px 60px #35482c24;animation:gm-award .7s cubic-bezier(.2,.9,.3,1.2)}.gm-celebration span{font-size:60px;color:#b39a57;display:block}.gm-celebration h2{font-size:22px}.gm-celebration p{font-size:12px;color:#8f9888;line-height:1.8}.gm-celebration>i{position:absolute;left:var(--x);top:-30px;width:7px;height:15px;border-radius:3px;background:#d4b87c;animation:gm-confetti 2.8s calc(var(--i)*.045s) ease-in both}.gm-celebration>i:nth-child(3n){background:#b2c8ac}.gm-celebration>i:nth-child(3n+1){background:#e6ccc2}@keyframes gm-confetti{to{transform:translateY(105vh) rotate(var(--r));opacity:0}}@keyframes gm-award{from{opacity:0;transform:translateY(24px) scale(.85)}to{opacity:1;transform:none}}@keyframes gm-glow{50%{filter:brightness(1.3)}}
@media(prefers-reduced-motion:reduce){.gm-celebration>i{display:none}}
