/* Gomoku: Regler, Swap2 och strategi */
.guide-content a,.guide-content a:hover{text-decoration:none}
.gm-figure{margin:20px 0;max-width:100%}
.gm-figure figcaption{font-size:14px;color:#535c70;margin-top:8px}
.gm-figure.good figcaption{color:#155c34}.gm-figure.bad figcaption{color:#9b2b1d}

/* Brädet: ljus neutral yta, tunna mörkgrå linjer, stenar på skärningspunkterna */
.gm-board{display:grid;grid-template-columns:22px repeat(9,minmax(0,1fr));width:100%;max-width:460px;background:#f1ece0;border-radius:10px;padding:10px 12px 4px 4px;margin:12px 0;box-sizing:border-box;user-select:none;touch-action:manipulation}
.gm-cols-15{grid-template-columns:20px repeat(15,minmax(0,1fr));max-width:540px}
.gm-cols-7{grid-template-columns:20px repeat(7,minmax(0,1fr));max-width:330px}
.gm-pt{position:relative;aspect-ratio:1;display:block;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;min-width:0}
.gm-pt::before{content:'';position:absolute;left:-1px;right:-1px;top:calc(50% - .5px);height:1px;background:#4a4f5c}
.gm-pt::after{content:'';position:absolute;top:-1px;bottom:-1px;left:calc(50% - .5px);width:1px;background:#4a4f5c}
.gm-edge-l::before{left:50%}.gm-edge-r::before{right:50%}.gm-edge-t::after{top:50%}.gm-edge-b::after{bottom:50%}
.gm-center{background:radial-gradient(circle,#2e323b 0 3px,transparent 3.5px)}
button.gm-pt{cursor:pointer}
button.gm-pt:hover{background-color:rgba(37,75,255,.08);border-radius:50%}
button.gm-pt:focus-visible{outline:3px solid #254bff;outline-offset:-2px;border-radius:50%;z-index:3}
.gm-label{display:grid;place-items:center;font:700 12px/1 Nunito,Arial,sans-serif;color:#4c5569}
.gm-col-label{height:22px}
.gm-stone{position:absolute;inset:9%;border-radius:50%;z-index:1;display:block}
.gm-black{background:radial-gradient(circle at 40% 35%,#3a3d44,#16181c 70%)}
.gm-white{background:#fbfbf8;box-shadow:inset 0 0 0 2px #7d8492}
.gm-last::after{content:'';position:absolute;inset:36%;border-radius:50%;background:#f1ece0}
.gm-white.gm-last::after{background:#4a4f5c}
.gm-ghost{opacity:.6;outline:2px dashed #254bff;outline-offset:1px}
.gm-hit::before,.gm-hit::after{background:#4a4f5c}
.gm-hit-exact{background:radial-gradient(circle,rgba(31,122,69,.28) 0 62%,transparent 64%)}
.gm-hit-exact .gm-stone{box-shadow:0 0 0 3px #1f7a45}
.gm-hit-over{background:radial-gradient(circle,rgba(83,92,112,.22) 0 62%,transparent 64%)}
.gm-hit-over .gm-stone{box-shadow:0 0 0 3px #6b7280;outline:2px dashed #3d4250;outline-offset:3px}
.gm-hit-none .gm-stone{box-shadow:0 0 0 3px #254bff}
.gm-mark{position:absolute;inset:14%;border:2px dashed #254bff;border-radius:50%;display:grid;place-items:center;font:800 11px/1 Nunito,Arial,sans-serif;color:#1c3bd1;background:rgba(255,255,255,.75);z-index:2}

/* Stenrader i löptexten */
.gm-line{display:flex;width:max-content;max-width:100%;background:#f1ece0;border-radius:10px;padding:4px 8px}
.gm-line .gm-pt{width:46px;flex:none}
.gm-line .gm-pt::after{top:28%;bottom:28%}

.gm-example{display:flex;flex-wrap:wrap;gap:12px 28px;align-items:center}
.gm-example .gm-board{margin:0}
.gm-notation{list-style:none;margin:0;padding:0;display:grid;gap:10px;font-size:17px}
.gm-notation li{display:flex;align-items:center;gap:10px}
.gm-notation .gm-stone{position:static;width:24px;height:24px;flex:none}

/* Swap2-guide */
.gm-names{display:flex;flex-wrap:wrap;gap:12px 20px;margin:12px 0}
.gm-names label{display:grid;gap:4px;font-weight:700;font-size:14px}
.gm-names input{min-height:44px;padding:8px 12px;border:1px solid #9aa6bd;border-radius:8px;font:inherit;width:200px;max-width:100%}
.gm-screens{list-style:none;padding:0;margin:12px 0;display:flex;flex-wrap:wrap;gap:8px;counter-reset:screen}
.gm-screens li{counter-increment:screen;padding:6px 12px;border-radius:999px;background:#e8edf7;font-size:14px;font-weight:700;color:#303a52}
.gm-screens li::before{content:counter(screen) '. '}
.gm-screens li[aria-current]{background:#171d33;color:#fff}
.gm-screens li.gm-done{background:#d9f0e1;color:#155c34}
.gm-screens li.gm-skipped{background:#f1f2f6;color:#535c70;text-decoration:line-through}
.gm-owner{margin:8px 0 4px;padding:10px 14px;border-left:4px solid #254bff;background:#eef2ff;border-radius:8px;font-weight:800}
.gm-instruction{min-height:26px;font-weight:600}
.gm-caption{font-size:14px;color:#535c70}
.gm-panel{margin-top:8px}
.gm-choices{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.gm-big .button{min-height:56px;flex:1 1 150px;font-size:16px;justify-content:center}
.gm-status{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px;margin:0}
.gm-status div{padding:10px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}
.gm-status dt{font-size:13px;color:#535c70;font-weight:700}
.gm-status dd{margin:2px 0 0;font-weight:800}
.gm-history{margin-top:12px}
.gm-history summary{cursor:pointer;font-weight:700;min-height:44px;display:flex;align-items:center;gap:8px;list-style:none}
.gm-history summary::-webkit-details-marker{display:none}
.gm-history summary::before{content:'';width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg)}
.gm-history[open] summary::before{transform:rotate(45deg)}
.gm-history-text{white-space:pre-wrap;background:#171d33;color:#fff;border-radius:10px;padding:12px 14px;font:600 14px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;margin:4px 0 0}
.gm-count-line{color:#303a52}

/* Swap jämfört med Swap2 */
.gm-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:12px}
.gm-compare-col{padding:14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;min-width:0}
.gm-compare-col h4{margin:0 0 4px;font-size:18px}
.gm-compare-col .gm-board{max-width:300px}
.gm-step-owner{font-weight:800;margin:4px 0}
.gm-step-text{margin:0;min-height:44px}
.gm-step-count{font-weight:700;margin-top:12px}

/* Exakt fem-varning */
.gm-result{min-height:52px;font-weight:700;color:#302584}
.gm-result[data-result=exact],.gm-result[data-result=exact-other]{color:#155c34}
.gm-result[data-result=overline]{color:#4a4f5c}

/* Färgvalsövning */
.gm-analysis{margin-top:12px;padding:14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff}
.gm-facts{display:grid;gap:8px;margin:0}
.gm-facts div{display:grid;grid-template-columns:180px 1fr;gap:4px 14px}
.gm-facts dt{font-weight:800}.gm-facts dd{margin:0}
.gm-expert{margin-top:12px;padding:12px 14px;border-left:4px solid #7a3fc2;background:#f5f0fb;border-radius:8px}
.gm-label-note{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#5b2d94;margin:0 0 6px}
.gm-expert p{margin:6px 0}
.learning-widget .button[aria-pressed=true]{background:#171d33;color:#fff}

@media(max-width:700px){
 .gm-board{padding:8px 8px 2px 2px}
 .guide-content table{min-width:0;font-size:14px}
 .guide-content th,.guide-content td{padding:10px 8px;vertical-align:top}
 .gm-cols-15{grid-template-columns:16px repeat(15,minmax(0,1fr))}
 .gm-cols-15 .gm-label{font-size:9px}
 .gm-compare-grid{grid-template-columns:1fr}
 .gm-compare-col .gm-board{max-width:none}
 .gm-big{flex-direction:column}
 .gm-big .button{flex:none;width:100%}
 .gm-facts div{grid-template-columns:1fr}
 .gm-line .gm-pt{width:clamp(30px,10.5vw,46px)}
 .gm-names input{width:100%}
 .gm-names label{flex:1 1 140px}
}
@media(prefers-reduced-motion:reduce){.gm-pt,.gm-stone{transition:none}}
