#gomoku-view { width: 100%; }
#gomoku-view [hidden] { display: none !important; }
.gomoku-online-panel { margin: 18px 0 24px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--button-bg); }
.gomoku-join-form, .gomoku-room-actions, .gomoku-offer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.gomoku-join-form label, .gomoku-room-actions span, .gomoku-offer span { font-size: 13px; color: var(--secondary); }
.gomoku-join-form input { width: 225px; max-width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); font: inherit; font-size: 13px; }
.gomoku-room-actions { margin-top: 12px; }
#gomoku-room-code { font-family: monospace; color: var(--text); overflow-wrap: anywhere; }
.gomoku-online-help { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 12px 0 0; }
.gomoku-invitation { display: block; margin-top: 12px; overflow-wrap: anywhere; font-size: 13px; }
.gomoku-offer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.gomoku-options { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 22px; }
.gomoku-label, .gomoku-speed-label { color: var(--secondary); font-size: 13px; }
.gomoku-speed-label { display: flex; align-items: center; gap: 8px; }
.gomoku-speed-label select { padding: 7px 28px 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.gomoku-ai-toggle[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.gomoku-budget { font-size: 12px; color: var(--muted); }
.gomoku-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(155px, 1fr); gap: 30px; align-items: start; max-width: 960px; margin: 0 auto; }
.gomoku-board { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); aspect-ratio: 1; padding: 3%; border: 1px solid #b69059; border-radius: 12px; background: #e5c58e; box-shadow: 0 8px 28px #4b351315; overflow: hidden; }
.gomoku-cell { position: relative; display: block; min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: linear-gradient(#8c6b41, #8c6b41) center / 1px 100% no-repeat, linear-gradient(#8c6b41, #8c6b41) center / 100% 1px no-repeat; cursor: default; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.gomoku-cell:nth-child(-n+15) { background-size: 1px 50%, 100% 1px; background-position: center bottom, center; }
.gomoku-cell:nth-last-child(-n+15) { background-size: 1px 50%, 100% 1px; background-position: center top, center; }
.gomoku-cell:nth-child(15n+1) { background-size: 1px 100%, 50% 1px; background-position: center, right center; }
.gomoku-cell:nth-child(15n) { background-size: 1px 100%, 50% 1px; background-position: center, left center; }
.gomoku-cell:first-child { background-size: 1px 50%, 50% 1px; background-position: center bottom, right center; }
.gomoku-cell:nth-child(15) { background-size: 1px 50%, 50% 1px; background-position: center bottom, left center; }
.gomoku-cell:nth-last-child(15) { background-size: 1px 50%, 50% 1px; background-position: center top, right center; }
.gomoku-cell:last-child { background-size: 1px 50%, 50% 1px; background-position: center top, left center; }
.gomoku-cell.star::before { content: ''; position: absolute; width: 15%; height: 15%; border-radius: 50%; background: #755431; left: 42.5%; top: 42.5%; }
.gomoku-cell::after { position: absolute; inset: 7%; border-radius: 50%; }
.gomoku-cell.black::after { content: ''; background: radial-gradient(circle at 35% 28%, #565656, #181818 65%); box-shadow: 0 2px 3px #0005; }
.gomoku-cell.white::after { content: ''; background: radial-gradient(circle at 35% 28%, #fff, #e4e2de 70%); box-shadow: 0 2px 3px #0005, inset 0 0 0 1px #0002; }
.gomoku-cell.last::before { content: ''; position: absolute; z-index: 1; width: 18%; height: 18%; top: 41%; left: 41%; border-radius: 2px; background: #d8563e; }
.gomoku-cell.winning::after { outline: 2px solid #b7442d; outline-offset: 1px; }
.gomoku-cell.preview::after { content: ''; box-sizing: border-box; border: 2px dashed #292929; background: #20202015; animation: gomoku-preview-spin 2.4s linear infinite; }
.gomoku-board.human-white .gomoku-cell.preview::after { border-color: #fff; background: #ffffff40; box-shadow: 0 0 0 1px #0002; }
@keyframes gomoku-preview-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gomoku-cell.preview::after { animation: none; } }
.gomoku-cell:focus-visible { outline: 2px solid #704e28; outline-offset: -2px; z-index: 2; }
.gomoku-board.playable .gomoku-cell[aria-disabled="false"] { cursor: pointer; }
@media (hover: hover) {
    .gomoku-board.playable .gomoku-cell[aria-disabled="false"]:hover::after { content: ''; background: #20202060; }
    .gomoku-board.playable.human-white .gomoku-cell[aria-disabled="false"]:hover::after { background: #ffffffa0; }
}
.gomoku-info { padding-top: 8px; }
.gomoku-kicker { color: var(--accent-strong); font-size: 11px; letter-spacing: .13em; margin: 0 0 14px; }
.gomoku-info h3 { color: var(--text); font-size: 23px; font-weight: 550; line-height: 1.5; margin: 0 0 18px; }
.gomoku-info p { font-size: 13px; line-height: 1.8; color: var(--secondary); }
#gomoku-detail { min-height: 24px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gomoku-proof { margin: 14px 0; padding: 12px; border-left: 3px solid var(--accent); background: var(--button-bg); border-radius: 0 8px 8px 0; }
.gomoku-proof strong { display: block; font-size: 14px; line-height: 1.7; color: var(--accent-strong); }
.gomoku-info .gomoku-proof p { display: block; font-size: 12px; margin: 7px 0 0; }
#gomoku-retry[hidden] { display: none; }
#gomoku-view .game-tips { margin-top: 22px; line-height: 1.8; }
@media (max-width: 680px) {
    .gomoku-layout { display: flex; flex-direction: column; gap: 16px; }
    .gomoku-board { width: 100%; box-sizing: border-box; }
    .gomoku-info { width: 100%; padding: 0; }
    .gomoku-info h3 { font-size: 20px; margin-bottom: 6px; }
    .gomoku-info p { display: inline-block; margin: 0 16px 5px 0; }
    .gomoku-info .gomoku-kicker { display: none; }
    .gomoku-options { gap: 10px 14px; margin-bottom: 16px; }
    .gomoku-budget { flex-basis: 100%; }
}
