/* 盤の色見本（チップ） */
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.chip.b { background: #111; border: 1px solid #666; } .chip.w { background: #eee7d8; }

/* ===== リバーシ ===== */
.rv-grid { display: grid; grid-template-columns: repeat(8, 1fr); width: min(560px, 92vw); aspect-ratio: 1; padding: 10px; gap: 2px; background: linear-gradient(145deg, #1d2a22, #0d1511); border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000, inset 0 0 0 4px #0a0909; }
.rv-grid .cell { position: relative; background: #13221a; border: none; padding: 0; cursor: default; }
.rv-grid .cell.can { cursor: pointer; }
.rv-grid .cell.can::before { content: ""; position: absolute; left: 50%; top: 50%; width: 16%; height: 16%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(227, 200, 142, .45); }
.rv-grid .cell.can:hover::before { width: 70%; height: 70%; background: rgba(227, 200, 142, .18); border: 1px solid var(--gold); }
.rv-grid .stone { animation: drop .3s ease-out; }
@keyframes drop { from { transform: scale(1.25); opacity: .4; } }
.reversi { position: relative; }
.rv-pass { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; background: rgba(10, 9, 9, .6); }
.rv-pass p { margin: 0; }

/* ===== ノット・アンド・クロス ===== */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); width: min(420px, 86vw); aspect-ratio: 1; }
.ttt .cell { position: relative; background: transparent; border: 0 solid var(--gold-dim); padding: 8%; cursor: pointer; }
.ttt .cell:nth-child(-n+6) { border-bottom-width: 1px; } .ttt .cell:not(:nth-child(3n)) { border-right-width: 1px; }
.ttt .cell:hover:empty { background: rgba(198, 161, 91, .05); }
.ttt svg { width: 100%; height: 100%; fill: none; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 200; animation: pen .5s ease-out both; }
.ttt circle { stroke: var(--ivory); } .ttt path { stroke: var(--gold-2); }
.ttt .won { background: rgba(198, 161, 91, .12); }
@keyframes pen { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }

/* ===== マンカラ ===== */
.mc-board { position: relative; display: grid; grid-template-columns: 1fr 6fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; width: min(760px, 94vw); padding: 34px 16px; background: linear-gradient(160deg, #2a1d14, #120c08); border: 1px solid var(--gold); border-radius: 60px; box-shadow: 0 30px 60px -30px #000, inset 0 2px 0 rgba(255, 230, 190, .08); }
.mc-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mc-row.top { grid-column: 2; grid-row: 1; } .mc-row.bot { grid-column: 2; grid-row: 2; }
.mc-store.top { grid-column: 1; grid-row: 1 / 3; } .mc-store.bot { grid-column: 3; grid-row: 1 / 3; }
.pit, .mc-store { position: relative; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #0b0806, #22170f 70%); border: 1px solid rgba(198, 161, 91, .25); padding: 0; box-shadow: inset 0 6px 12px rgba(0, 0, 0, .8); }
.mc-store { aspect-ratio: auto; border-radius: 40px; }
.pit.can { cursor: pointer; border-color: var(--gold); }
.pit.can:hover { box-shadow: inset 0 6px 12px rgba(0, 0, 0, .8), 0 0 0 2px var(--gold-2); }
.pit.last { border-color: var(--gold-2); }
.pit b, .mc-store b { position: absolute; bottom: -2px; right: 4px; font-family: var(--serif-en); font-weight: 500; font-size: .9rem; color: var(--gold-2); text-shadow: 0 1px 2px #000; }
.mc-store b { left: 0; right: 0; bottom: 30px; text-align: center; font-size: 1.4rem; }
.mc-store small { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: .62rem; color: var(--ivory-2); letter-spacing: .1em; }
.seeds { position: absolute; inset: 12%; }
.seeds i { position: absolute; width: 16%; height: 16%; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 35% 30%, #fff, hsl(var(--h) 25% 72%) 55%, hsl(var(--h) 20% 40%)); box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.mc-store .seeds i { width: 22%; height: 9%; }
.mc-lbl { position: absolute; left: 0; right: 0; margin: 0; text-align: center; font-size: .66rem; letter-spacing: .15em; color: var(--ivory-2); }
.mc-lbl.t { top: 10px; } .mc-lbl.b { bottom: 10px; }

/* ===== 五目並べ・連珠（碁盤） ===== */
.gm-board { position: relative; width: min(620px, 94vw); aspect-ratio: 1; background: linear-gradient(135deg, #c99a5b, #b07f45 60%, #a6743c); border: 1px solid #5b3d1c; box-shadow: 0 30px 60px -30px #000, inset 0 0 40px rgba(80, 45, 10, .35); }
.gm-lines { position: absolute; inset: calc(50% / var(--n)); background-image: linear-gradient(#3b2610 1px, transparent 1px), linear-gradient(90deg, #3b2610 1px, transparent 1px); background-size: calc(100% / (var(--n) - 1) - .01px) calc(100% / (var(--n) - 1) - .01px); border-right: 1px solid #3b2610; border-bottom: 1px solid #3b2610; }
.gm-board .pt { position: absolute; width: calc(100% / var(--n)); height: calc(100% / var(--n)); transform: translate(-50%, -50%); background: none; border: none; padding: 0; cursor: pointer; }
.gm-board .pt.star::before { content: ""; position: absolute; left: 50%; top: 50%; width: 16%; height: 16%; transform: translate(-50%, -50%); border-radius: 50%; background: #3b2610; }
.gm-board .pt:not(:has(.stone)):hover::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: rgba(10, 9, 9, .25); }
.gm-board .pt .stone { inset: 5%; }
.gm-board .pt.forb::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #7a1010; font-weight: 700; font-size: .9rem; }
.gm-board .pt.forb { cursor: not-allowed; }
.forb-key { color: #c55; font-weight: 700; }

/* ===== チェッカー ===== */
.ck-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(560px, 92vw); aspect-ratio: 1; border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000; }
.ck-board .sq { position: relative; background: #e6dcc6; }
.ck-board .sq.d { background: #2b2420; }
.ck-board .sq.mv { cursor: pointer; }
.ck-board .sq.mv .piece { box-shadow: 0 0 0 2px rgba(227, 200, 142, .5), 0 4px 6px rgba(0, 0, 0, .6); }
.ck-board .sq.sel { background: #4a3a22; }
.ck-board .sq.tg { cursor: pointer; }
.ck-board .sq.tg::before { content: ""; position: absolute; inset: 35%; border-radius: 50%; background: rgba(227, 200, 142, .6); }
.ck-board .sq.lp { background: #3a2f22; }
.piece { position: absolute; inset: 12%; border-radius: 50%; }
.piece.b { background: radial-gradient(circle at 50% 45%, #2a2725 40%, #0d0c0b 42%, #1d1b1a 58%, #050404); box-shadow: 0 4px 6px rgba(0, 0, 0, .6); border: 1px solid #555; }
.piece.w { background: radial-gradient(circle at 50% 45%, #f4efe3 40%, #cfc6b3 42%, #ece5d6 58%, #b3aa95); box-shadow: 0 4px 6px rgba(0, 0, 0, .6); }
.piece.k::after { content: "♛"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.3rem; color: var(--gold); }

/* ===== クアルト ===== */
.qt-wrap { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-items: flex-start; }
.qt-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(420px, 90vw); aspect-ratio: 1; padding: 18px; border-radius: 50%; background: radial-gradient(circle, #1f1b18, #0c0b0a 70%); border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000; }
.qt-cell { position: relative; border-radius: 50%; background: #15120f; border: 1px solid rgba(198, 161, 91, .25); padding: 6%; }
.qt-cell.can { cursor: pointer; border-color: var(--gold-dim); }
.qt-cell.can:hover { border-color: var(--gold); background: #211b15; }
.qt-cell.won { box-shadow: 0 0 0 2px var(--gold-2); }
.qt-cell.last { border-color: var(--gold-2); }
.qt-side { width: min(300px, 90vw); }
.qt-lbl { font-size: .8rem; color: var(--gold); letter-spacing: .1em; margin: 0 0 8px; min-height: 1.4em; }
.qt-hand { height: 90px; width: 90px; margin: 0 0 16px; border: 1px dashed var(--gold-dim); padding: 6px; }
.qt-tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qt-pc { position: relative; aspect-ratio: 1; background: #12100e; border: 1px solid rgba(198, 161, 91, .2); padding: 4px; }
.qt-pc.can { cursor: pointer; } .qt-pc.can:hover { border-color: var(--gold); background: #211b15; }
.qp { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.qt-undo { margin-top: 12px; }
.qt-board { grid-template-rows: repeat(4, 1fr); border-radius: 28px; padding: 16px; }
.qt-cell { min-height: 0; aspect-ratio: 1; }

/* ===== コリドール ===== */
.qd-board { position: relative; width: min(560px, 92vw); aspect-ratio: 1; padding: 0; margin: 12px; }
.qd-board::before { content: ""; position: absolute; inset: -12px; background: linear-gradient(145deg, #2b211a, #120d0a); border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000; }
.qd-cell { position: absolute; background: #3a2c22; border: none; padding: 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); }
.qd-cell.goal0 { background: #43352a; } .qd-cell.goal1 { background: #43352a; }
.qd-cell.can { cursor: pointer; background: #5a4532; }
.qd-cell.can:hover { background: #7a5d40; }
.pawn { position: absolute; inset: 14%; border-radius: 50% 50% 46% 46%; }
.pawn.b { background: radial-gradient(circle at 40% 30%, #555, #0b0a0a 65%); box-shadow: 0 4px 6px rgba(0, 0, 0, .7); }
.pawn.w { background: radial-gradient(circle at 40% 30%, #fff, #d8cfbc 65%); box-shadow: 0 4px 6px rgba(0, 0, 0, .7); }
.qd-wall { position: absolute; z-index: 2; background: linear-gradient(180deg, #e3c88e, #a8823f); border-radius: 2px; box-shadow: 0 2px 4px rgba(0, 0, 0, .7); }
.qd-wall.last { background: linear-gradient(180deg, #fff2cf, #e3c88e); }
.qd-wall.ghost { background: rgba(227, 200, 142, .55); animation: hint 1.2s ease-in-out infinite; }
.qd-slot { position: absolute; z-index: 3; background: none; border: none; padding: 0; cursor: pointer; }
.qd-slot i { position: absolute; background: rgba(227, 200, 142, 0); border-radius: 2px; transition: background .15s; }
.qd-slot:hover i { background: rgba(227, 200, 142, .75); }
.qd-slot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(227, 200, 142, .35); }
.qd-modes { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.qd-modes button { padding: 8px 14px; background: #0f0d0c; border: 1px solid rgba(198, 161, 91, .35); cursor: pointer; font-size: .8rem; }
.qd-modes button[aria-pressed="true"] { background: var(--gold); color: #0a0909; }
.qd-modes button:disabled { opacity: .35; cursor: not-allowed; }
.quoridor { display: flex; flex-direction: column; align-items: center; }

/* ===== チェス ===== */
.cs-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(560px, 92vw); aspect-ratio: 1; border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000; }
.cs-board .sq { position: relative; display: grid; place-items: center; }
.cs-board .sq.l { background: #e8dfcc; } .cs-board .sq.d { background: #8c6d4c; }
.cs-board .sq.mv { cursor: pointer; }
.cs-board .sq.sel { box-shadow: inset 0 0 0 3px var(--gold); }
.cs-board .sq.lp::before { content: ""; position: absolute; inset: 0; background: rgba(198, 161, 91, .35); }
.cs-board .sq.chk { background: radial-gradient(circle, #c33, #8c1d1d 70%); }
.cs-board .sq.tg { cursor: pointer; }
.cs-board .sq.tg::after { content: ""; position: absolute; width: 26%; height: 26%; border-radius: 50%; background: rgba(40, 30, 20, .35); }
.cs-board .sq.tg.cap::after { width: 86%; height: 86%; background: none; border: 4px solid rgba(40, 30, 20, .35); }
.cs-board .pc { position: relative; z-index: 1; font-size: min(52px, 8.6vw); line-height: 1; font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif; }
.cs-board .pc.w { color: #fbf7ee; -webkit-text-stroke: 1.2px #2a2018; text-shadow: 0 2px 3px rgba(0, 0, 0, .45); }
.cs-board .pc.b { color: #1a1614; -webkit-text-stroke: .6px #000; text-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.cs-board em { position: absolute; font-style: normal; font-size: .62rem; color: rgba(40, 30, 20, .6); font-family: var(--serif-en); }
.cs-board .rk { top: 2px; left: 4px; } .cs-board .fl { bottom: 1px; right: 4px; }
.g-info .cap { font-size: 1.15rem; letter-spacing: 0; font-family: "Apple Symbols", "Segoe UI Symbol", serif; }
.g-info .cap.w { color: #fbf7ee; } .g-info .cap.b { color: #888; }
.cs-board, .ck-board, .rv-grid { grid-template-rows: repeat(8, 1fr); }
.ttt { grid-template-rows: repeat(3, 1fr); }
.cs-board .sq, .ck-board .sq, .rv-grid .cell { min-height: 0; min-width: 0; }

/* ===== 囲碁 ===== */
.go-b { width: min(560px, 92vw); }
.go-b .pt.ng { cursor: not-allowed; }
.go-b .pt.ng:hover::before { display: none; }
.go-pass { text-align: center; margin: 16px 0 0; }
.go { display: flex; flex-direction: column; align-items: center; }

/* ===== バックギャモン ===== */
.bg-wrap { display: flex; gap: 10px; align-items: stretch; width: min(820px, 96vw); }
.bg-board { flex: 1; display: grid; grid-template-rows: 1fr auto 1fr; padding: 12px; background: linear-gradient(160deg, #2a1d14, #120c08); border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px #000; aspect-ratio: 13 / 10; }
.bg-half { display: grid; grid-template-columns: repeat(6, 1fr) .8fr repeat(6, 1fr); min-height: 0; }
.bg-pt { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bg-pt.bot { flex-direction: column-reverse; }
.bg-pt .tri { position: absolute; left: 4%; right: 4%; top: 0; bottom: 8%; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #6e5134; }
.bg-pt.bot .tri { top: 8%; bottom: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bg-pt.e .tri { background: #d9cbb0; }
.bg-pt .stack { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
.bg-pt.bot .stack { flex-direction: column-reverse; }
.ck { display: block; width: 86%; aspect-ratio: 1; border-radius: 50%; margin: -2px 0; }
.ck.b { background: radial-gradient(circle at 40% 35%, #4a4643, #0b0a0a 65%); border: 1px solid #555; box-shadow: 0 2px 3px rgba(0, 0, 0, .7); }
.ck.w { background: radial-gradient(circle at 40% 35%, #fffdf6, #d9cfbb 65%); border: 1px solid #a99f88; box-shadow: 0 2px 3px rgba(0, 0, 0, .6); }
.bg-pt .more, .bg-bar .more { position: relative; z-index: 2; font-family: var(--serif-en); font-size: .8rem; color: var(--gold-2); text-shadow: 0 1px 2px #000; }
.bg-pt em { position: absolute; z-index: 2; font-style: normal; font-size: .55rem; color: rgba(227, 200, 142, .55); }
.bg-pt.top em { bottom: -2px; } .bg-pt.bot em { top: -2px; }
.bg-pt.from, .bg-bar.from { cursor: pointer; }
.bg-pt.from .stack .ck:last-child, .bg-pt.bot.from .stack .ck:last-child { box-shadow: 0 0 0 2px var(--gold-2); }
.bg-pt.sel .tri { background: #c6a15b; }
.bg-pt.to { cursor: pointer; } .bg-pt.to .tri { background: rgba(227, 200, 142, .85); animation: hint 1.2s ease-in-out infinite; }
.bg-pt.lt .tri { filter: brightness(1.25); }
.bg-bar { display: flex; flex-direction: column; align-items: center; background: #0a0706; border-left: 1px solid rgba(198, 161, 91, .3); border-right: 1px solid rgba(198, 161, 91, .3); padding-top: 4px; }
.bg-bar.bot { flex-direction: column-reverse; padding: 0 0 4px; }
.bg-bar.from .ck { box-shadow: 0 0 0 2px var(--gold-2); }
.bg-bar.sel { background: #3a2c1a; }
.bg-mid { display: flex; justify-content: center; padding: 8px 0; }
.dice { display: flex; gap: 8px; }
.die { width: 34px; height: 34px; border-radius: 6px; background: #f3ecdc; box-shadow: 0 3px 6px rgba(0, 0, 0, .6); }
.dice.b .die { background: #1b1817; border: 1px solid #555; }
.die svg { width: 100%; height: 100%; } .die circle { fill: #1a1614; } .dice.b .die circle { fill: #eee7d8; }
.die.used { opacity: .3; }
.bg-off { width: 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.tray { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 6px 5px; background: #120c08; border: 1px solid rgba(198, 161, 91, .35); position: relative; }
.tray.b { flex-direction: column-reverse; }
.tray i { display: block; height: 6px; border-radius: 2px; background: #eee7d8; } .tray.b i { background: #2a2624; border: 1px solid #666; }
.tray small { position: absolute; left: 0; right: 0; text-align: center; font-size: .6rem; color: var(--ivory-2); }
.tray.w small { bottom: 4px; } .tray.b small { top: 4px; }
.tray.to { cursor: pointer; border-color: var(--gold-2); animation: hint 1.2s ease-in-out infinite; }
.bg-redo { text-align: center; margin: 12px 0 0; }
.backgammon { display: flex; flex-direction: column; align-items: center; }
.bg-wrap { width: min(740px, 100%); }
.g-main > .g-board { width: 100%; display: flex; flex-direction: column; align-items: center; }
