:root{--bg:#f6f1e7;--card:#fff;--ink:#2b2a28;--muted:#77706a;--accent:#2f6f6a;--accent2:#e2724a;--line:#e3dccf;--p1:#2f6fd0;--p2:#e2724a}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:"Pretendard","Apple SD Gothic Neo","Malgun Gothic",system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--ink);-webkit-tap-highlight-color:transparent}
a{color:inherit}
.top{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;max-width:1100px;margin:0 auto}
.logo{font-weight:800;font-size:21px;text-decoration:none;letter-spacing:-.5px}
.logo span{color:var(--accent2)}
.back{text-decoration:none;color:var(--muted);font-size:14px}
.back:hover{color:var(--ink)}
.wrap{max-width:1100px;margin:0 auto;padding:0 20px 40px}
.hero{padding:28px 0 8px}
.hero h1{font-size:clamp(26px,5vw,40px);margin:0 0 10px;letter-spacing:-1px}
.hero p{color:var(--muted);margin:0;line-height:1.6}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;margin-top:24px}
.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px;text-decoration:none;display:flex;flex-direction:column;gap:8px;transition:transform .15s,box-shadow .15s}
.card:hover{transform:translateY(-3px);box-shadow:0 10px 24px rgba(0,0,0,.08)}
.card .thumb{border-radius:12px;overflow:hidden;aspect-ratio:16/10;background:#f3eee4;display:flex;align-items:center;justify-content:center}
.card .thumb svg{width:100%;height:100%;display:block}
.card h3{margin:4px 0 0;font-size:18px}
.card p{margin:0;color:var(--muted);font-size:14px;line-height:1.5}
.tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;padding-top:4px}
.tag{font-size:12px;background:#e8f0ee;color:var(--accent);padding:3px 9px;border-radius:99px}
.soon{margin-top:36px;color:var(--muted);font-size:14px}
/* game page */
.gamehead{display:flex;flex-wrap:wrap;align-items:center;gap:12px;justify-content:space-between;margin:8px 0 14px}
.gamehead h1{margin:0;font-size:26px;letter-spacing:-.5px}
.controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
select,button{font:inherit;font-size:14px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer}
button.primary{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:700}
.pvp .ai-only{display:none!important}
.status{background:#fff;border:1px solid var(--line);border-radius:12px;padding:11px 14px;margin-bottom:16px;font-weight:700;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;min-height:46px}
#status-side{font-weight:600;color:var(--muted)}
.chip{display:inline-block;width:14px;height:14px;border-radius:50%;vertical-align:-2px;margin:0 3px;border:1px solid rgba(0,0,0,.25)}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:22px;align-items:start}
@media(max-width:860px){.layout{grid-template-columns:1fr}}
.side{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;font-size:14px;line-height:1.65}
.side h2{font-size:16px;margin:0 0 6px}
.side h2:not(:first-child){margin-top:14px}
.side ul{padding-left:18px;margin:4px 0}
.score{display:flex;gap:8px;margin-bottom:6px}
.score div{flex:1;text-align:center;background:#f7f4ee;border-radius:10px;padding:8px;font-size:13px;color:var(--muted)}
.score b{display:block;font-size:20px;color:var(--ink)}
.boardbox{display:flex;justify-content:center;min-width:0}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;align-items:center;justify-content:center;z-index:50;padding:20px}
.overlay.show{display:flex}
.modal{background:#fff;border-radius:18px;padding:26px 28px;text-align:center;max-width:340px;width:100%;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.modal h2{margin:0 0 8px;font-size:24px}
.modal p{color:var(--muted);margin:0 0 18px}
footer{text-align:center;color:var(--muted);font-size:13px;padding:24px 20px 40px}

/* tic-tac-toe */
#board.ttt{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:min(380px,92vw);aspect-ratio:1;background:var(--ink);padding:8px;border-radius:18px}
.ttt-cell{border:0;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;padding:16%;cursor:pointer}
.ttt-cell:disabled{cursor:default}
.ttt-cell svg{width:100%;height:100%}
.ttt-cell.win{background:#ffe7c2}

/* connect four */
#board.c4{display:flex;gap:6px;background:#2d5fa8;padding:10px;border-radius:18px;width:min(540px,94vw);overflow:hidden}
.c4-col{flex:1;display:flex;flex-direction:column;gap:6px;cursor:pointer;border-radius:12px;padding:2px}
.c4-col:hover{background:rgba(255,255,255,.14)}
.c4-cell{aspect-ratio:1;border-radius:50%;background:var(--bg);box-shadow:inset 0 3px 6px rgba(0,0,0,.28)}
.c4-cell.p1{background:radial-gradient(circle at 35% 30%,#ff7a7a,#d63a3a)}
.c4-cell.p2{background:radial-gradient(circle at 35% 30%,#ffe27a,#f0b90b)}
.c4-cell.drop{animation:c4drop .35s cubic-bezier(.5,0,1,1)}
@keyframes c4drop{from{transform:translateY(-500%)}to{transform:none}}
.c4-cell.win{box-shadow:0 0 0 4px #fff inset,0 0 10px #fff}

/* omok */
#board.omok{display:block;max-width:100%;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.18);cursor:pointer;touch-action:manipulation}

/* othello */
#board.oth{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;background:#1b4a31;padding:6px;border-radius:14px;width:min(540px,94vw);aspect-ratio:1}
.oth-cell{background:#2e8b57;border:0;padding:0;border-radius:3px;display:flex;align-items:center;justify-content:center;cursor:default;position:relative}
.oth-cell .disc{width:80%;height:80%;border-radius:50%}
.disc.b{background:radial-gradient(circle at 35% 30%,#666,#111)}
.disc.w{background:radial-gradient(circle at 35% 30%,#fff,#cfcfcf)}
.oth-cell.hint{cursor:pointer}
.oth-cell.hint::after{content:"";width:24%;height:24%;border-radius:50%;background:rgba(0,0,0,.28)}
.oth-cell.hint:hover::after{background:rgba(255,255,255,.55)}
.oth-cell.last .disc{box-shadow:0 0 0 3px #f4c430}
.disc.flip{animation:othflip .45s}
@keyframes othflip{0%{transform:scaleX(1)}50%{transform:scaleX(0)}100%{transform:scaleX(1)}}

/* dots and boxes */
#board.dots{width:min(480px,94vw);background:#fff;border-radius:16px;border:1px solid var(--line);display:block}
.dots .hit{stroke:transparent;stroke-width:18;stroke-linecap:round;cursor:pointer}
.dots .ln{stroke:#ece6da;stroke-width:6;stroke-linecap:round}
.dots g.free:hover .ln{stroke:#c9c0ae}
.dots .ln.o1{stroke:var(--p1)}
.dots .ln.o2{stroke:var(--p2)}
.dots .ln.last{stroke-width:8}
.dots .bx1{fill:var(--p1);opacity:.22}
.dots .bx2{fill:var(--p2);opacity:.25}
.dots .dot{fill:var(--ink)}

/* mancala */
#board.mc{display:grid;grid-template-columns:minmax(52px,80px) 1fr minmax(52px,80px);gap:10px;background:linear-gradient(#9a6a3e,#7d5230);padding:14px;border-radius:44px;width:min(760px,96vw);box-shadow:0 8px 24px rgba(0,0,0,.18)}
.mc-store{background:#5f3a1f;border-radius:34px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#fff;font-weight:800;font-size:24px;box-shadow:inset 0 4px 12px rgba(0,0,0,.4)}
.mc-store small{font-size:11px;font-weight:600;opacity:.8}
.mc-rows{display:grid;grid-template-rows:auto auto;gap:12px}
.mc-row{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.mc-pit{aspect-ratio:1;border-radius:50%;background:#5f3a1f;border:0;color:#fff;font:inherit;font-weight:800;font-size:15px;position:relative;box-shadow:inset 0 4px 10px rgba(0,0,0,.4);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;cursor:default;transition:background .15s}
.mc-pit.can{cursor:pointer;box-shadow:inset 0 4px 10px rgba(0,0,0,.4),0 0 0 3px #f4c430}
.mc-pit.can:hover{background:#74492a}
.mc-pit.hl,.mc-store.hl{background:#8a5b35}
.seeds{display:flex;flex-wrap:wrap;justify-content:center;gap:2px;width:72%;max-height:52%;overflow:hidden;margin-bottom:2px}
.seed{width:7px;height:7px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#bfe6ff,#3a8fd0)}
.seed:nth-child(3n){background:radial-gradient(circle at 35% 30%,#ffd1c2,#e2724a)}
.seed:nth-child(4n){background:radial-gradient(circle at 35% 30%,#d9f5c9,#5aa646)}
@media(max-width:520px){.seed{width:5px;height:5px}.mc-pit{font-size:13px}#board.mc{padding:10px;gap:6px;border-radius:30px}.mc-row{gap:5px}.mc-store{font-size:18px}}

/* shared: board + buttons column */
.boardcol{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%}
.btnrow{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
button:disabled{opacity:.45;cursor:default}

/* checkers */
#board.ck{display:grid;grid-template-columns:repeat(8,1fr);width:min(540px,94vw);aspect-ratio:1;border:8px solid #5b3a22;border-radius:10px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.ck-cell{border:0;padding:0;display:flex;align-items:center;justify-content:center;cursor:default;position:relative}
.ck-cell.light{background:#f0dcb4}
.ck-cell.dark{background:#a8774a}
.ck-cell.last{background:#b98d5e}
.ck-cell.can{cursor:pointer}
.ck-cell.can .ck-pc{box-shadow:0 0 0 3px rgba(255,255,255,.55),0 3px 5px rgba(0,0,0,.35)}
.ck-cell.sel .ck-pc{box-shadow:0 0 0 4px #f4c430,0 3px 5px rgba(0,0,0,.35)}
.ck-cell.dest{cursor:pointer}
.ck-cell.dest::after{content:"";width:30%;height:30%;border-radius:50%;background:rgba(244,196,48,.85)}
.ck-pc{width:78%;height:78%;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 5px rgba(0,0,0,.35)}
.ck-pc.r{background:radial-gradient(circle at 35% 30%,#ff7b6e,#c2342a);border:3px solid #9c2a22}
.ck-pc.k{background:radial-gradient(circle at 35% 30%,#666,#151515);border:3px solid #000}
.ck-pc.king::after{content:"\265B";color:#ffd54a;font-size:clamp(14px,3.6vw,26px);line-height:1}

/* gonu */
#board.gn{width:min(460px,100%);background:#e8cf9e;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.15);display:block}
.gn-line{stroke:#6b4a2b;stroke-width:3}
.gn-label{fill:#4d7fa3;font-size:14px;font-weight:700}
.gn-hit{fill:transparent}
.gn-dot{fill:#6b4a2b}
.gn-stone.s1{fill:#1b1b1b;stroke:#000;stroke-width:1}
.gn-stone.s2{fill:#fbfbf7;stroke:#9b8f7c;stroke-width:1.5}
.gn-stone.last{stroke:#e2724a;stroke-width:4}
.gn-stake line{stroke:#a33;stroke-width:4;stroke-linecap:round}
.gn-pt.can,.gn-pt.dest,.gn-pt.cap,.gn-pt.sel{cursor:pointer}
.gn-pt.can .gn-stone{stroke:#f4c430;stroke-width:4}
.gn-pt.sel .gn-stone{stroke:#2f6f6a;stroke-width:6}
.gn-pt.dest .gn-dot{fill:#2f6f6a;r:10}
.gn-pt.dest .gn-hit{fill:rgba(47,111,106,.18)}
.gn-pt.cap .gn-stone{stroke:#e04848;stroke-width:5}
.gn-pt.cap:hover .gn-stone{opacity:.6}

/* yut */
#board.yt{width:min(460px,100%);background:#f3e6c9;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.12);display:block}
.yt-line{stroke:#a07a4c;stroke-width:3}
.yt-node{fill:#fffaf0;stroke:#a07a4c;stroke-width:2.5}
.yt-node.big{fill:#f6d58c}
.yt-node.pv{fill:#bfe3c4;stroke:#2f6f6a;stroke-width:3.5}
.yt-node.lastn{stroke:#e2724a;stroke-width:4}
.yt-lbl{fill:#8a6a43;font-size:12px;font-weight:700}
.yt-pc{filter:drop-shadow(0 2px 2px rgba(0,0,0,.35))}
.yt-pc circle{stroke:#fff;stroke-width:2.5}
.yt-pc.can{cursor:pointer}
.yt-pc.can circle{stroke:#f4c430;stroke-width:4}
.yt-n{fill:#fff;font-size:15px;font-weight:800;pointer-events:none}
.yt-panel{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;max-width:460px}
.yt-tray{background:#fff;border:2px solid var(--line);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:4px;font-size:13px}
.yt-tray.on{border-color:var(--accent)}
.yt-tray.can{cursor:pointer;background:#f1f8f6}
.yt-tray em{font-style:normal;color:var(--accent);font-weight:700}
.yt-toks{display:flex;gap:4px;min-height:16px;align-items:center}
.yt-tok{width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 2px rgba(0,0,0,.3)}
.yt-throwrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:center;width:100%;max-width:460px}
#yut-sticks{display:flex;align-items:center;gap:6px;min-height:64px}
.yt-stick{width:14px;height:60px;border-radius:7px;background:linear-gradient(90deg,#8b5a2b,#c58b4f 50%,#8b5a2b);border:1px solid #6b4220}
.yt-stick.flat{background:#f3d9a8;border-color:#b48a52;background-image:repeating-linear-gradient(0deg,transparent 0 8px,rgba(120,80,40,.25) 8px 10px)}
.yt-big{font-size:28px;margin-left:8px;color:var(--accent2)}
#yut-throw{font-size:16px;padding:10px 20px}
#yut-pending{display:flex;gap:6px;flex-wrap:wrap}
.yt-res{font-weight:800}
.yt-res.on{background:var(--accent2);color:#fff;border-color:var(--accent2)}
.yt-hint{color:var(--muted);font-size:13px}

/* baduk */
#board.bd{display:block;max-width:100%;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.18);cursor:pointer;touch-action:manipulation}

/* embed mode (iframe on blogs) */
.embed .top,.embed .side,.embed footer{display:none}
.embed .wrap{padding:8px 8px 12px}
.embed .layout{grid-template-columns:1fr}
.embed .gamehead{margin:0 0 8px}
.embed .gamehead h1{font-size:20px}
.embed-link{display:block;text-align:center;font-size:13px;margin-top:12px;color:var(--accent);font-weight:700;text-decoration:none}


/* ===== 디자인 G: 같은 탁자, 같은 틀 ===== */
:root{--bg:#f7f3ec;--ink:#262320;--line:#e4dccd;--brand:#d0543a;--cat-k:#c8463b;--cat-s:#2f4f7f;--cat-d:#2f7a55;--cat-p:#c99a2e;
--wood:repeating-linear-gradient(90deg,rgba(120,80,40,.06) 0 2px,transparent 2px 9px),linear-gradient(#ecdcc0,#dfc9a5)}
body{background:var(--bg);color:var(--ink)}
.top{max-width:none;margin:0;padding:14px max(20px,calc(50% - 530px));border-bottom:1px solid var(--line);background:#fbf8f2;gap:12px;flex-wrap:wrap}
.top .hl{display:flex;align-items:center;gap:12px}
.logo span{color:var(--brand)}
.cattag{font-size:12px;font-weight:700;color:#fff;padding:4px 10px;border-radius:99px;white-space:nowrap;text-decoration:none}
.cat-k{background:var(--cat-k)}.cat-s{background:var(--cat-s)}.cat-d{background:var(--cat-d)}.cat-p{background:var(--cat-p)}
.wrap{padding-top:10px}
button.primary{background:var(--ink);border-color:var(--ink)}
.status,.side,select,button{border-color:var(--line)}
.boardbox{background:var(--wood);border-radius:16px;padding:24px 0;box-shadow:inset 0 0 0 1px rgba(120,80,40,.14)}
@media(max-width:600px){.boardbox{padding:12px 0;border-radius:12px}}
.embed .boardbox{padding:10px 0}
/* 메인 */
.hubnav{display:flex;gap:4px;flex-wrap:wrap}
.hubnav button{border:0;background:none;padding:7px 13px;border-radius:99px;font-size:14px;color:#5c554b;display:flex;align-items:center;gap:7px}
.hubnav button i{width:9px;height:9px;border-radius:50%;display:inline-block}
.hubnav button.on{background:var(--ink);color:#fff}
h2.cat{font-size:19px;margin:30px 0 -6px;letter-spacing:-.3px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
h2.cat i{width:12px;height:12px;border-radius:3px;display:inline-block}
h2.cat small{font-size:13px;font-weight:500;color:var(--muted)}
.grid{grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:14px}
.card{padding:0;gap:0;border-radius:12px;border-color:var(--line);overflow:hidden}
.card .lid{height:7px;flex:none}
.card .thumb{margin:10px;border-radius:9px;background:var(--wood);aspect-ratio:16/11;display:flex;align-items:center;justify-content:center;overflow:visible}
.card .thumb svg{width:80%;height:auto;border-radius:6px;box-shadow:0 8px 14px rgba(70,40,10,.28)}
.card h3{margin:4px 14px 2px;font-size:17px}
.card p{margin:0 14px;font-size:13px}
.card .tags{padding:10px 14px 14px}
.tag{background:#f1ebe0;color:#5c554b}
@media(max-width:600px){.grid{grid-template-columns:repeat(2,1fr);gap:10px}.card .tags{display:none}.card h3{font-size:15px;margin:2px 10px}.card p{font-size:12px;margin:0 10px 12px}.card .thumb{margin:7px}h2.cat small{flex-basis:100%;margin-left:20px}}

/* 가볍게 한 판 */
:root{--cat-c:#7a4fc0}.cat-c{background:var(--cat-c)}


/* 언어 전환 */
.top .tr{display:flex;align-items:center;gap:14px}
.langsw{font-size:13px;font-weight:700;color:var(--ink);text-decoration:none;border:1px solid var(--line);border-radius:99px;padding:4px 11px;background:#fff}
.langsw:hover{border-color:var(--ink)}

.langsw{white-space:nowrap;flex-shrink:0}
@media(max-width:600px){.top .tr{align-items:flex-start}}

