/* Tablero común: ajedrez, damas y go */
.bgame { max-width: 1100px; margin: 0 auto; padding: 10px 12px 30px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.bside { display: flex; flex-direction: column; gap: 12px; }
.bside .card { margin: 0; padding: 14px; }
.bplayer { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); border: 2px solid transparent; }
.bplayer.turn { border-color: var(--yellow); box-shadow: 0 0 16px rgba(250, 204, 21, .35); }
.bplayer .n { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bplayer .side { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.bplayer .clk { font: 700 24px var(--display); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.bplayer .clk.low { color: var(--red); }
.bplayer .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); }
.bstatus { font-weight: 800; text-align: center; min-height: 22px; color: var(--soft); }
.bstatus.over { color: var(--yellow); font-size: 18px; }
.bactions { display: flex; gap: 8px; flex-wrap: wrap; }
.bmoves { max-height: 240px; overflow: auto; font-size: 14px; display: grid; grid-template-columns: 34px 1fr 1fr; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.bmoves .num { color: var(--muted); }
.bmoves .m.last { color: var(--yellow); font-weight: 800; }
.bwrap { position: relative; width: 100%; max-width: 680px; margin: 0 auto; }
.boardbox { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 16px 44px rgba(0, 0, 0, .5); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.promo { position: absolute; inset: 0; background: rgba(5, 8, 20, .75); display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 5; }
.promo img { width: 72px; height: 72px; background: var(--surface3); border-radius: 12px; cursor: pointer; padding: 6px; }
.promo img:hover { background: var(--p1); }

/* ajedrez y damas: rejilla */
.grid8 { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.light { background: #e9d9b8; } .sq.dark { background: #8a6b45; }
.sq.sel { box-shadow: inset 0 0 0 4px rgba(250, 204, 21, .9); }
.sq.last { background-image: linear-gradient(rgba(250, 204, 21, .35), rgba(250, 204, 21, .35)); }
.sq.check { background-image: radial-gradient(rgba(244, 63, 94, .85), rgba(244, 63, 94, .2) 70%); }
.sq.hint::after { content: ''; width: 28%; height: 28%; border-radius: 50%; background: rgba(20, 20, 20, .28); position: absolute; }
.sq.hint.cap::after { width: 86%; height: 86%; background: transparent; border: 5px solid rgba(20, 20, 20, .28); box-sizing: border-box; }
.sq img { width: 92%; height: 92%; pointer-events: none; }
.sq .coord { position: absolute; font-size: 10px; font-weight: 800; opacity: .55; color: #3b2a12; }
.sq .coord.f { right: 3px; bottom: 1px; } .sq .coord.r { left: 3px; top: 1px; }
.sq.dark .coord { color: #f3e6c8; }

/* damas */
.dsq.light { background: #f1e2c3; } .dsq.dark { background: #7a5230; }
.piece { width: 76%; height: 76%; border-radius: 50%; box-shadow: 0 3px 6px rgba(0, 0, 0, .5), inset 0 -4px 0 rgba(0, 0, 0, .25); position: relative; }
.piece.w { background: radial-gradient(circle at 35% 30%, #fff, #d8d0c0 70%); }
.piece.b { background: radial-gradient(circle at 35% 30%, #666, #111 70%); }
.piece.k::after { content: '♛'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 150%; color: #facc15; text-shadow: 0 1px 2px #000; }
.sq.path { box-shadow: inset 0 0 0 4px rgba(34, 211, 238, .8); }

/* go */
.gocanvas { width: 100%; height: 100%; display: block; touch-action: manipulation; cursor: pointer; }

@media (max-width: 900px) {
  .bgame { grid-template-columns: 1fr; }
  .bmoves { max-height: 140px; }
}

/* cuadro del torneo */
#bbracket h3 { margin: 0 0 8px; }
.bround { margin-bottom: 8px; }
.bround .rname { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.bmatch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 8px; border-radius: 8px; font-size: 14px; border: 1px solid transparent; }
.bmatch.live { border-color: var(--accent, #f472b6); background: rgba(244, 114, 182, .08); }
.bmatch .p { font-weight: 700; }
.bmatch .p.bye { color: var(--muted); font-weight: 500; font-style: italic; }
.bmatch .p.me { text-decoration: underline; text-decoration-color: var(--accent, #f472b6); }
.bmatch.done .p { color: var(--muted); }
.bmatch.done .p.win { color: var(--yellow, #fdd663); }
.bmatch .vs { color: var(--muted); font-size: 12px; }
.bchamp { font-family: var(--display); font-size: 18px; color: var(--yellow, #fdd663); margin-top: 6px; }
.bnext { margin-top: 6px; font-size: 13px; color: var(--muted); }
