/* Mesa — estilos de la plataforma multijugador de Arena */
.mesa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .mesa-grid { grid-template-columns: 1fr; } }

/* Regla `hide` genérica: mesa.js la usa para ocultar el LOBBY al empezar la
   partida, el contador de la sala, etc. Faltaba en esta hoja (el dominó ya la
   tenía en domino.css), así que ocultar el lobby no hacía nada y la parrilla de
   "Elige juego" quedaba visible debajo del tablero. */
.hide { display: none !important; }

.card { background: #101827; border: 1px solid #1d2740; border-radius: 14px; padding: 16px; }
.card h2 { margin: 0 0 10px; font-size: 1.05rem; }

.jg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.jg-b { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0;
  position: relative;
  background: #0c1424; border: 1px solid #1d2740; border-radius: 12px; color: #e7ecf5;
  cursor: pointer; text-align: left; overflow: hidden; transition: border-color .15s, transform .1s; }
.jg-b:hover { border-color: #2f4470; }
.jg-b.on { border-color: #f5b301; box-shadow: 0 0 0 1px #f5b301 inset; }
/* Juego del día: ligero realce + chapa ⭐ (la preselección del lobby). */
.jg-b.destacado { border-color: rgba(245,179,1,.5); }
.jg-b .jg-badge { position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(12,20,36,.82); border: 1px solid rgba(245,179,1,.55);
  border-radius: 999px; padding: 1px 7px; font-size: .85rem; line-height: 1.5; }
/* Chapa "N en vivo" por juego (prueba social en el punto de decisión del lobby). */
.jg-b .jg-live { position: absolute; top: 8px; left: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(12,20,36,.85); border: 1px solid rgba(80,220,140,.55);
  color: #7df0b0; border-radius: 999px; padding: 1px 8px;
  font-size: .78rem; font-weight: 700; line-height: 1.6; }
.jg-b .jg-live .punto { width: 7px; height: 7px; margin: 0; }
#dest-hint b { color: #f6e4b0; }
.juego-sel { margin: 10px 0 2px; padding: 9px 12px; border-radius: 10px; font-size: .9rem;
  background: rgba(245,179,1,.12); border: 1px solid rgba(245,179,1,.45); color: #f6e4b0; }
.juego-sel.hide { display: none; }
.nivel-sel { margin: 8px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nivel-sel.hide { display: none; }
.nivel-sel .nv-lbl { font-size: .82rem; color: #9db0d6; text-transform: uppercase;
  letter-spacing: .06em; margin-right: 2px; }
.nivel-b { padding: 6px 14px; border-radius: 999px; font-size: .85rem; cursor: pointer;
  background: #16233f; border: 1px solid #2f4470; color: #cfe0ff; }
.nivel-b:hover { border-color: #f5b301; }
.nivel-b.on { background: rgba(245,179,1,.16); border-color: #f5b301; color: #ffe9b0;
  font-weight: 700; }
.audio-aviso { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: .88rem;
  background: rgba(245,179,1,.14); border: 1px solid rgba(245,179,1,.45); color: #f6e4b0; }
.audio-aviso.hide { display: none; }
.emote-menu { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.emote-menu.hide { display: none; }
.emote-b { border: 1px solid #2f4470; background: transparent; color: #dbe6ff; border-radius: 999px;
  padding: 5px 11px; font-size: .84rem; cursor: pointer; }
.emote-b:hover { border-color: #f5b301; color: #fff; }
/* Reacciones del ESPECTADOR (también el anónimo): emoji de la lista blanca que
   sube por el tablero. Emisor: reaccion() en mesa/sala.py; lista: REACCIONES. */
.reacciones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.reac-lbl { font-size: .82rem; color: #8ea0c0; }
.reac-b { border: 1px solid #2f4470; background: transparent; border-radius: 999px;
  padding: 3px 9px; font-size: 1.05rem; line-height: 1.25; cursor: pointer; }
.reac-b:hover, .reac-b:active { border-color: #f5b301; background: rgba(245,179,1,.12); }
.reac-strip { font-size: .82rem; color: #cdd7ea; margin-left: 4px; }
.reac-float { position: absolute; bottom: 8%; font-size: 1.9rem; pointer-events: none;
  z-index: 6; animation: reacSube 2.5s ease-out forwards; }
@keyframes reacSube {
  0% { opacity: 0; transform: translateY(10px) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-150px) scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .reac-float { animation: none; opacity: .95; }
}
.jg-b .jg-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  transition: transform .3s ease; }
.jg-b:hover .jg-img { transform: scale(1.05); }
.jg-b .jg-i { font-size: 1.5rem; padding: 10px 12px 0; }
.jg-b .jg-n { font-weight: 700; padding: 10px 12px 0; }
.jg-b .jg-d { font-size: .78rem; padding: 0 12px 12px; }
.jg-b.no-img .jg-n { padding-top: 12px; }
.jg-b.no-img .jg-d { padding-bottom: 12px; }

.lista { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.fila { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #0c1424; border: 1px solid #1d2740; border-radius: 10px; }
.fila .grow { flex: 1; display: flex; flex-direction: column; }
.fila .fi { font-size: 1.2rem; }
/* La FILA no es un enlace: el nombre abre la guía y el ▶ (enlace estirado)
   abre el tablero final. El ▶ cubre toda la fila para conservar el área táctil. */
.fila .fila-guia { position: relative; z-index: 1; }
.fila-ver { position: relative; color: #cdd7e8; font-weight: 700; text-decoration: none; }
.fila-ver::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.av-b { width: 34px; height: 34px; border-radius: 50%; background: #1d2740; color: #cdd7e8;
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.chk { display: flex; align-items: center; gap: 6px; color: #a9b6cf; font-size: .9rem; }

/* overlay de sala de espera */
.overlay { position: fixed; inset: 0; background: rgba(6,10,20,.72); display: flex;
  align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.overlay.hide { display: none; }
.ov-card { max-width: 460px; width: 100%; }
.espera-jg { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.espera-j { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0c1424;
  border: 1px solid #1d2740; border-radius: 10px; }
.espera-j.listo { border-color: #37d67a; }
.espera-j b { flex: 1; }

/* juego */
.mesa-juego { margin-top: 14px; }
.jd-tit { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 1.02rem; }
.jd-tit b { font-family: Outfit, Inter, system-ui, sans-serif; font-weight: 800;
  letter-spacing: .2px; }
.jd-tit .mut { font-size: .84rem; }
.oponentes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.op { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px;
  background: #0c1424; border: 1px solid #1d2740; border-radius: 12px; min-width: 96px; }
.op.turno { border-color: #f5b301; box-shadow: 0 0 0 1px #f5b301 inset; }
.op.yo { background: #16223a; }
.op .nm { font-size: .86rem; font-weight: 600; }
.op .mut { font-size: .72rem; }

.tablero-wrap { display: flex; justify-content: center; width: 100%; margin: 6px 0 10px; }
.board { position: relative; width: 100%; max-width: 600px; margin: 0 auto; }
/* La Mesa usa todo el ancho en móvil: el tablero llega casi a los bordes (≈6px).
   Se anula el padding lateral de `main` (16px) solo cuando hay partida en marcha. */
@media (max-width: 700px) {
  .mesa-juego { margin-left: -16px; margin-right: -16px; padding-left: 6px; padding-right: 6px; }
}
.board.b-tresenraya { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px;
  aspect-ratio: 1 / 1; width: 100%; max-width: 420px; margin: 0 auto; padding: 8px;
  background: linear-gradient(160deg, #16203a, #0a1020); border: 3px solid #0c1322; border-radius: 14px;
  box-shadow: 0 16px 38px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.05); }
.c3 { width: 100%; height: 100%; background: linear-gradient(180deg, #101a2e, #0b1220);
  border: 1px solid #22304e; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: clamp(2rem, 13vw, 3.4rem); font-weight: 800; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 3px 10px -6px #000; }
.c3.jugable:hover { border-color: #f5b301; background: #16223a; }
.c3.f0 { color: #5ca0ff; text-shadow: 0 0 12px rgba(79,140,255,.6); }
.c3.f1 { color: #ff8a8a; text-shadow: 0 0 12px rgba(255,122,122,.55); }
.c3.ult { box-shadow: inset 0 0 0 3px rgba(245,179,1,.55), 0 3px 10px -6px #000; }

/* Ajedrez / Damas: tablero a todo el ancho disponible (hasta 600px) y cuadrado. */
.board.b-chess8, .board.b-checkers8 { display: grid; grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr); aspect-ratio: 1 / 1; width: 100%; max-width: 600px; margin: 0 auto;
  border: 3px solid #0c1322; border-radius: 12px; overflow: hidden;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.05); }
.c8 { display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.c8.light { background: linear-gradient(160deg, #e7ecf5, #c3ccdd); }
.c8.dark { background: linear-gradient(160deg, #68789c, #49577a); }
.c8.sel { box-shadow: inset 0 0 0 3px #f5b301; }
/* PISTA DE TURNO (ajedrez/damas): las fichas que SÍ se pueden mover llevan un
   anillo dorado DISCONTINUO en su casilla — distinto de la SELECCIÓN (dorado
   sólido y grueso) y del DESTINO (punto). Solo lo trae la vista de quien tiene
   el turno. Se apaga en la ficha ya seleccionada para no superponer anillos. */
.c8.puede { outline: 2px dashed rgba(245,179,1,.85); outline-offset: -3px; }
.c8.sel.puede { outline: none; }
.c8.dst::after { content: ""; position: absolute; width: 24%; height: 24%; border-radius: 50%;
  background: rgba(245,179,1,.72); box-shadow: 0 0 10px rgba(245,179,1,.6); }
.c8.ult::before { content: ""; position: absolute; inset: 0; background: rgba(245,179,1,.17);
  pointer-events: none; }
.c8.paso-fx::before { content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  background: rgba(245,179,1,.34); animation: pasoFx .5s ease-out forwards; }
@keyframes pasoFx { 0% { opacity: 0; transform: scale(.5); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
/* Piezas vectoriales de ajedrez. Las reglas de aspecto van SIN ámbito para que
   el clon que vuela (fuera del tablero) se vea igual que la ficha real. */
.pz { display: flex; align-items: center; justify-content: center; }
.c8 .pz { width: 100%; height: 100%; }
.pz-svg { width: 86%; height: 86%; display: block; filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.45)); }
.pz .cb { stroke: #0e1118; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.pz .cd { fill: none; stroke: #0e1118; stroke-width: 2.4; stroke-linecap: round; }
.pz.w .cb { fill: url(#gzW); } .pz.w .cd { stroke: #566277; }
.pz.b .cb { fill: url(#gzB); } .pz.b .cd { stroke: #0b0d13; }
/* Fichas de DAMAS: puck 3D con anillos concéntricos (aspecto clásico). */
.ficha { width: 78%; height: 78%; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.15rem; line-height: 1;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.5), inset 0 3px 5px rgba(255,255,255,.35), 0 3px 7px rgba(0,0,0,.55); }
.ficha::after { content: ""; position: absolute; width: 52%; height: 52%; border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.45), inset 0 -1px 2px rgba(255,255,255,.35); }
.c8 .pz.ficha { position: relative; }
.ficha.wP, .ficha.wK { background: radial-gradient(circle at 34% 26%, #ffffff, #e6ebf3 55%, #b3bECD); color: #6b7788; }
.ficha.bP, .ficha.bK { background: radial-gradient(circle at 34% 26%, #6b7788, #2a3346 55%, #0c1018); color: #d3dae7; }
.ficha.wK, .ficha.bK { box-shadow: inset 0 -3px 6px rgba(0,0,0,.5), inset 0 3px 5px rgba(255,255,255,.35),
  0 0 0 2px rgba(245,179,1,.75), 0 3px 7px rgba(0,0,0,.55); }
.c8 .pz.ficha { width: 78%; height: 78%; }

/* Conecta 4: panel azul con HUECOS bien legibles y discos 3D dentro. */
.board.b-grid76 { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr);
  grid-gap: 6px; aspect-ratio: 7 / 6; width: 100%; max-width: 540px; margin: 0 auto; padding: 10px;
  background: linear-gradient(180deg, #2a4a8f, #17306b); border: 3px solid #0c1322; border-radius: 16px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.10); }
.c76 { position: relative; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, #0a1224, #04060c);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.95), inset 0 -2px 4px rgba(130,170,255,.28),
    0 1px 0 rgba(255,255,255,.14); }
.c76 .f76 { position: absolute; inset: 5%; border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #9db6ff, #4f8cff 58%, #2a5fd0);
  box-shadow: inset 0 -4px 7px rgba(0,0,0,.35), inset 0 3px 5px rgba(255,255,255,.4), 0 2px 5px rgba(0,0,0,.5); }
.c76.f1 .f76 { background: radial-gradient(circle at 34% 26%, #ffc6c6, #ff7a7a 58%, #cf4a4a); }
.c76.jugable:hover { box-shadow: inset 0 0 0 3px rgba(245,179,1,.8); }
.c76.ult { box-shadow: inset 0 0 0 3px rgba(245,247,251,.85); }
.c76.win { box-shadow: inset 0 0 0 4px #37d67a, 0 0 14px rgba(55,214,122,.6); }

/* Reversi (Othello) — tablero verde 8x8 con fichas blancas/negras. */
.board.b-reversi8 { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  grid-gap: 2px; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 6px;
  background: linear-gradient(160deg, #1a7a4c, #0e5734); border: 3px solid #0a1322; border-radius: 14px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.06); }
.rv { position: relative; display: flex; align-items: center; justify-content: center;
  background: #2f8f5b; border-radius: 6px; cursor: default; }
.rv.dark { background: #25714a; }
.rv.jugable { cursor: pointer; }
.rv.jugable::after { content: ""; position: absolute; width: 34%; height: 34%; border-radius: 50%;
  background: rgba(245,179,1,.5); border: 1px solid rgba(245,179,1,.9); }
.rv.jugable:hover::after { background: rgba(245,179,1,.95); }
.rv .rv-ficha { width: 82%; height: 82%; border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.3), 0 2px 4px rgba(0,0,0,.6); }
.rv .rv-ficha.f0 { background: radial-gradient(circle at 35% 30%, #6b7484, #11151f); }
.rv .rv-ficha.f1 { background: radial-gradient(circle at 35% 30%, #ffffff, #c8d0dd); }
.rv.ult { box-shadow: inset 0 0 0 3px #f5b301; }
.rv.vol .rv-ficha { animation: rvvol .38s ease; }
@keyframes rvvol { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }

/* Cinco en raya (gomoku) — tablero de MADERA con líneas de retícula. */
.board.b-gomoku15 { display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr);
  width: 100%; max-width: 540px; aspect-ratio: 1 / 1; margin: 0 auto; box-sizing: border-box;
  background: url("/static/img/textura-madera-clara.webp") center / cover no-repeat;
  border: 3px solid #0a1322; border-radius: 14px;
  padding: 5px; gap: 0;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.2); }
.gk { position: relative; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid rgba(80,54,20,.55); border-bottom: 1px solid rgba(80,54,20,.55);
  cursor: pointer; }
.gk:nth-child(15n) { border-right: none; }
.gk:nth-last-child(-n+15) { border-bottom: none; }
.gk .gk-f { width: 84%; height: 84%; border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.28), 0 1px 2px rgba(0,0,0,.45); }
.gk.f0 .gk-f { background: radial-gradient(circle at 35% 30%, #5a6472, #0b0e14); }
.gk.f1 .gk-f { background: radial-gradient(circle at 35% 30%, #ffffff, #b9c2cf); }
.gk .gk-f.ghost { opacity: 0; transition: opacity .1s; }
.gk:hover .gk-f.ghost { opacity: .38; }
.gk.ult { box-shadow: inset 0 0 0 2px #f5b301; }
.gk.win { background: rgba(55,214,122,.4); }
.gk:hover { background: rgba(245,179,1,.22); }

.star-svg { width: 100%; max-width: 560px; height: auto; touch-action: manipulation;
  background: radial-gradient(120% 120% at 50% 0%, #16233f, #0b1220 70%);
  border: 1px solid #24314f; border-radius: 16px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.04); }
.star-red line { stroke: #3a4a72; stroke-width: .1; pointer-events: none; }
.star-meta circle { fill: rgba(245,179,1,.13); stroke: rgba(255,255,255,.07); stroke-width: .04; pointer-events: none; }
.star-meta.m0 circle { fill: rgba(79,140,255,.17); }
.star-meta.m1 circle { fill: rgba(255,122,122,.17); }
.star-meta.m2 circle { fill: rgba(55,214,122,.17); }
.star-meta.m3 circle { fill: rgba(245,179,1,.20); }
.star-meta.m4 circle { fill: rgba(185,139,255,.17); }
.star-meta.m5 circle { fill: rgba(65,211,221,.17); }
.star-meta.mia circle { stroke: #f5f7fb; stroke-opacity: .75; stroke-width: .1; }
/* Leyenda de colores de la dama china (jugador y espectador) */
.star-ley { display: flex; gap: 8px 12px; flex-wrap: wrap; justify-content: center;
  align-items: center; margin: 4px auto 0; max-width: 460px; font-size: .8rem; color: #c9d4e6; }
.star-ley .sl-tt { color: #8a97ad; font-size: .78rem; }
.star-ley .sl { display: inline-flex; align-items: center; gap: 5px; }
.star-ley .sl i { width: 12px; height: 12px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset; }
.star-ley .sl.f0 i { background: #4f8cff; }
.star-ley .sl.f1 i { background: #ff7a7a; }
.star-ley .sl.f2 i { background: #37d67a; }
.star-ley .sl.f3 i { background: #f5b301; }
.star-ley .sl.f4 i { background: #b98bff; }
.star-ley .sl.f5 i { background: #41d3dd; }
.star-ley .sl.mia { color: #fff; font-weight: 600; }
.star-ley .sl.mia i { box-shadow: 0 0 0 2px #f5f7fb; }
.star-ultima circle { fill: none; stroke: #f59e0b; stroke-width: .16; stroke-dasharray: .5 .35;
  stroke-opacity: .85; pointer-events: none; }
/* Piezas planas del tablero = hoyos VACÍOS: se dibujan con un aro legible para
   que la estrella se lea aunque no haya fichas. */
.star-h { cursor: pointer; fill: #1d2842; stroke: #4a5c88; stroke-width: .12; }
.star-h:hover { stroke: #f5b301; stroke-width: .8; }
.star-h.f0 { fill: #4f8cff; } .star-h.f1 { fill: #ff7a7a; } .star-h.f2 { fill: #37d67a; }
.star-h.f3 { fill: #f5b301; } .star-h.f4 { fill: #b98bff; } .star-h.f5 { fill: #41d3dd; }
.star-h.mia { stroke: #f5f7fb; stroke-width: .3; }
.star-h.sel { stroke: #f5b301; stroke-width: .95; }
.star-h.dst { stroke: #37d67a; stroke-width: .8; }
.star-h.dst.salto { stroke-dasharray: .55 .4; }
/* Pista de turno: anillo fino dorado discontinuo en las fichas que SÍ pueden
   moverse (dama china tiene 121 hoyos y no se ve cuál elegir). Fino y punteado
   para no confundirse con la SELECCIÓN (dorado sólido y grueso) ni con el
   DESTINO (verde). Solo la trae la vista del jugador al que le toca. */
.star-h.puede { stroke: #f5b301; stroke-width: .26; stroke-dasharray: .3 .24; }
.star-h.puede.mia { stroke: #f5b301; }
.star-ruta-p { fill: none; stroke: #f5b301; stroke-width: .34; stroke-linecap: round;
  stroke-opacity: .9; pointer-events: none; }
/* Ruta de la ÚLTIMA jugada (salto en cadena): mismo trazo pero punteado y algo
   más tenue, para distinguirla de la previsualización interactiva. */
.star-ultima-ruta path { stroke-dasharray: .55 .4; stroke-opacity: .65; }
.star-paso { fill: #f5b301; fill-opacity: .55; pointer-events: none; }

/* MOLINO (Nine Men's Morris) — 3 cuadrados concéntricos + 24 puntos. */
.board.b-molino { display: block; width: 100%; }
.ml-svg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto;
  touch-action: manipulation; }
.ml-linea { fill: none; stroke: #3a4a72; stroke-width: .9; stroke-linejoin: round;
  stroke-linecap: round; pointer-events: none; }
.ml-h { fill: #1d2842; stroke: #4a5c88; stroke-width: .9; cursor: pointer;
  transition: stroke .12s ease; }
.ml-h:hover { stroke: #f5b301; stroke-width: 1.8; }
.ml-h.ml-f0 { fill: #dfe7f5; stroke: #9fb0cd; }
.ml-h.ml-f1 { fill: #f5b301; stroke: #b17d00; }
.ml-h.ml-f2 { fill: #37d67a; stroke: #1f8f4d; }
.ml-h.ml-f3 { fill: #b98bff; stroke: #7d54c8; }
.ml-h.mia { stroke: #ffffff; stroke-width: 1.5; }
.ml-h.jug { stroke: #37d67a; stroke-width: 1.5; stroke-dasharray: 1 .8; }
.ml-h.cap { stroke: #ff5252; stroke-width: 1.8; }
.ml-h.sel { stroke: #f5b301; stroke-width: 2.3; }
.ml-h.dst { stroke: #37d67a; stroke-width: 2.1; }
.ml-ultima circle { fill: none; stroke: #f5b301; stroke-width: .9; stroke-dasharray: 1.3 .9;
  pointer-events: none; }
@media (max-width: 420px) { .board.b-molino { max-width: 100%; } }

/* dominó dentro de la Mesa — mesa de paño + fichas con pips reales */
.dom-ext { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: .8rem; color: #a9b6cf; margin-bottom: 8px; flex-wrap: wrap; }
.dom-ext b { color: #e7ecf5; font-size: 1rem; }
.dom-end { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font: inherit;
  font-size: .8rem; border-radius: 999px; background: #0c1424; border: 1px solid #1d2740;
  color: #e7ecf5; }
.dom-end .v { font-weight: 800; font-size: 1.05rem; }
.dom-end.can { cursor: pointer; border-color: #f5b301; box-shadow: 0 0 0 1px rgba(245,179,1,.45); }
.dom-end.can:hover { background: #241d04; }
.dom-cem { color: #a9b6cf; }
.dom-mesa { display: flex; flex-direction: column; gap: 10px; }
.dom-cad { display: flex; align-items: center; gap: 6px; min-height: 84px; width: 100%;
  overflow-x: auto; background: radial-gradient(120% 140% at 50% 35%, #14472a, #0a2415);
  border: 1px solid #1f3b2b; border-radius: 12px; padding: 10px; }
.dom-cad-in { display: flex; align-items: center; gap: 5px; margin: 0 auto; }
.dom-vacio { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; color: #9fb0c9; font-size: .85rem; }
.dom-vacio.mio { cursor: pointer; border: 1px dashed #3a6a49; border-radius: 10px; padding: 10px 18px; }
.dom-vacio.mio:hover { background: rgba(55,214,122,.06); }
.dom-vacio .slot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.4rem; background: #0c1424; border: 1px solid #2f4470; color: #f5b301; }
/* ficha real: dos caras 3x3 de pips */
.dtile { display: flex; flex-direction: column; flex: 0 0 auto; gap: 2px; padding: 3px;
  border-radius: 8px; background: linear-gradient(160deg, #fdfcf7, #e9e4d3);
  border: 1px solid #cfc8b0; box-shadow: 0 5px 12px -7px rgba(0,0,0,.9); }
.dtile.v { width: 40px; height: 64px; }
.dtile.h { width: 64px; height: 40px; flex-direction: row; }
.dface { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr); place-items: center; }
.dface span { width: 5px; height: 5px; border-radius: 50%; }
.dface .dpip { background: #1a1a1a; }
.dface .dmt { background: transparent; }
.dl { flex: 0 0 auto; background: #c9c2aa; }
.dtile.v .dl { height: 1px; margin: 0 4px; }
.dtile.h .dl { width: 1px; margin: 4px 0; }
.dtile.endL, .dtile.endR { box-shadow: 0 0 0 2px rgba(55,214,122,.28), 0 5px 12px -7px #000; }
.dtile.live { box-shadow: 0 0 0 2px #f5b301, 0 6px 14px -6px #000; }
.dtile.nuevo { animation: ficha-nueva .45s ease-out; }
@keyframes ficha-nueva { from { transform: translateY(-8px); opacity: .2; } }
.dtile.mia { cursor: pointer; transition: transform .12s; }
.dtile.mia.jugable:hover { transform: translateY(-6px); }
.dtile.mia.jugable { box-shadow: 0 0 0 2px rgba(55,214,122,.55), 0 6px 14px -8px #000; }
.dtile.sel { outline: 3px solid #f5b301; transform: translateY(-6px); }
.dtile.nojugable { opacity: .62; filter: grayscale(.55) brightness(.92); }
.dom-mano-cap { text-align: center; color: #a9b6cf; font-size: .82rem; margin-top: 10px; }
.dom-mano { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; padding: 12px;
  background: #0c1424; border: 1px solid #1d2740; border-radius: 12px; margin-top: 8px; }
.dom-sides { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 10px; }
.dom-sides.hide { display: none; }
.ds-lbl { color: #a9b6cf; font-size: .82rem; }

.barra-turno { text-align: center; margin: 8px 0; }
.dom-turno { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #0c1424;
  border: 1px solid #1d2740; font-weight: 700; }
.dom-turno.mio { background: #1c2e1f; border-color: #37d67a; color: #b6f0c9; }

.chat-box { margin-top: 16px; }
.chat { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px;
  padding: 8px; background: #0a1120; border-radius: 10px; }
.chat-m { font-size: .9rem; }
.chat-m.sis { color: #8ea0c0; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid #1d2740;
  background: #0c1424; color: #e7ecf5; }

/* en vivo */
.vivo-cab { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: #37d67a; display: inline-block;
  box-shadow: 0 0 8px #37d67a; animation: pulso 1.6s infinite; }
.punto.gris { background: #6b7794; box-shadow: none; animation: none; }
@keyframes pulso { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.vivo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.vivo-card { display: flex; flex-direction: column; padding: 0; background: #101827;
  border: 1px solid #1d2740; border-radius: 12px; color: #e7ecf5; text-decoration: none;
  overflow: hidden; position: relative; transition: border-color .15s, transform .1s; }
.vivo-card:hover { border-color: #2f4470; transform: translateY(-2px); }
.vivo-card.fin { opacity: .72; }
.vivo-card .vc-img { width: 100%; aspect-ratio: 16/7; object-fit: cover; object-position: center;
  display: block; }
.vivo-card .vc-ico { width: 100%; aspect-ratio: 16/7; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; background: #0c1424; }
.vivo-card .vc-cuerpo { padding: 10px 12px; min-width: 0; }
.vc-top { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.vc-tag { font-size: .7rem; color: #8ea0c0; border: 1px solid #24314f; border-radius: 6px; padding: 1px 6px; }
.vc-estado { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; align-items: center;
  gap: 5px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 99px; background: rgba(10,15,29,.82); border: 1px solid #24314f;
  color: #a9b6cf; backdrop-filter: blur(6px); }
.vc-estado.on { color: #7ee2a4; border-color: rgba(55,214,122,.5); }
.vc-estado .punto { width: 7px; height: 7px; }
.vc-n { margin-left: auto; font-size: .82rem; color: #a9b6cf; }
.vc-jugs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vc-j { font-size: .82rem; background: #0c1424; border: 1px solid #1d2740; border-radius: 999px;
  padding: 2px 8px; }
.vc-bot { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: #a9b6cf; }
.vc-izq { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.vc-ult { color: #9ad9b0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-cab { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; flex-wrap: wrap; row-gap: 6px; }
.ver-estado { display: inline-flex; align-items: center; gap: 6px; }
.ver-cta { margin-top: 12px; }
.ver-cta b { font-size: 1.05rem; }

/* toasts (compartidos con el dominó) */
.toasts { position: fixed; right: 14px; bottom: 74px; display: flex; flex-direction: column; gap: 8px;
  z-index: 80; }
.dom-toast { background: #16223a; border: 1px solid #2f4470; border-radius: 10px; padding: 9px 13px;
  color: #e7ecf5; font-size: .9rem; max-width: 300px; }
.dom-toast.err { border-color: #85404a; background: #2a1418; }
.dom-toast.ok { border-color: #2f6b45; background: #14251b; }

/* panel de movimientos (jugador y espectador) */
.hist { margin-top: 12px; }
.hist h2 { margin: 0 0 6px; font-size: 1rem; }
.hist-lista { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  font-variant-numeric: tabular-nums; }
.hist-m { font-size: .88rem; color: #cdd7ea; padding: 3px 6px; border-radius: 6px; }
.hist-m:nth-child(odd) { background: #0d1626; }
.hist-m .hm-n { color: #7b8aa8; margin-right: 4px; }
.hist-m.bot b { color: #9fb4d8; }
.hist-m b { color: #e7ecf5; }
@media (max-width: 560px) {
  .hist-lista { max-height: 150px; }
}

/* recompensa XP al terminar una partida real */
.xp-tag { display: inline-flex; align-items: center; gap: 4px; align-self: center;
  font-size: .86rem; font-weight: 700; color: #ffcf5c; background: #2a2310;
  border: 1px solid #6b571f; border-radius: 999px; padding: 4px 11px; }

/* Timbiriche (puntos y cajas) — tablero de puntos con aristas y cuadritos. */
.board.b-dots { display: block; width: 100%; }
.board.b-dots .dots-score { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 10px; }
.board.b-dots .dots-score .ds { display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--borde, #2a3550);
  background: rgba(255,255,255,.04); font-size: .9rem; font-weight: 700; color: #e7ecf5; }
.board.b-dots .dots-score .ds .sw { width: 13px; height: 13px; border-radius: 4px; }
.board.b-dots .dots-score .ds.f0 .sw { background: #5a6472; box-shadow: inset 0 0 0 1px #8b95a6; }
.board.b-dots .dots-score .ds.f1 .sw { background: #e8edf4; box-shadow: inset 0 0 0 1px #aab4c4; }
.board.b-dots .dots-score .ds.lid { border-color: #f5b301; box-shadow: 0 0 0 1px #f5b301 inset; }
.board.b-dots .dots-svg { display: block; margin: 0 auto; width: 100%; height: auto;
  max-width: 560px; background: #0d1524; border: 1px solid #22304e;
  border-radius: 12px; padding: 8px; box-sizing: border-box; touch-action: manipulation; }
.board.b-dots .dot { fill: #0a1120; stroke: #46557a; stroke-width: .05; pointer-events: none; }
.board.b-dots .edge-vacia { stroke: #26314c; stroke-width: .09; stroke-linecap: round;
  pointer-events: none; }
.board.b-dots .edge { stroke-linecap: round; stroke-width: .16; pointer-events: none; }
.board.b-dots .edge.f0 { stroke: #5a6472; }
.board.b-dots .edge.f1 { stroke: #e8edf4; }
.board.b-dots .edge.ult { stroke: #f5b301; stroke-width: .2; }
.board.b-dots .hit { stroke: transparent; stroke-width: .34; cursor: pointer; }
.board.b-dots .hit:hover { stroke: rgba(245,179,1,.45); }
.board.b-dots .box { pointer-events: none; }
.board.b-dots .box.f0 { fill: #5a6472; opacity: .30; }
.board.b-dots .box.f1 { fill: #e8edf4; opacity: .26; }
.board.b-dots .box.ult { opacity: .62; }
@media (max-width: 560px) {
  .board.b-dots .dots-score .ds { font-size: .82rem; padding: 3px 9px; }
}

/* TANTEO en vivo (jugador y espectador): marcador normalizado por el servidor. */
.tanteo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.tanteo .t-lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: #8a97ad; display: inline-flex; align-items: baseline; gap: 5px; }
.tanteo .t-lbl .t-un { font-size: .72rem; color: #6f7d95; text-transform: none; letter-spacing: 0; }
.tanteo .t-ck { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px;
  background: #0c1424; border: 1px solid #1d2740; border-radius: 999px; font-size: .88rem; }
.tanteo .t-ck b { font-weight: 600; color: #cdd7e8; }
.tanteo .t-ck.yo { border-color: #f5b301; background: rgba(245,179,1,.10); }
.tanteo .t-ck.yo b { color: #f6e4b0; }
.tanteo .t-v { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums;
  min-width: 1.4em; text-align: right; }

/* Cartel de FIN de partida: queda fijo (el aviso emergente se va, esto no). */
.mesa-fin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px;
  padding: 10px 14px; border-radius: 12px; font-size: .95rem;
  background: rgba(255,255,255,.04); border: 1px solid #1d2740; color: #cdd7e8; }
.mesa-fin.hay { background: rgba(245,179,1,.12); border-color: rgba(245,179,1,.55); color: #f6e4b0; }
.mesa-fin .mf-ico { font-size: 1.15rem; }
.mesa-fin .mf-t { font-weight: 700; }
.mesa-fin .mf-m { color: #9db0d6; font-size: .85rem; }

/* =====================================================================
   FX — piezas y ANIMACIÓN DE MOVIMIENTO (jugador y espectador).
   Todo se anima con transform/opacity (GPU): barato en móvil.
   ===================================================================== */
/* capa donde vuela el clon de una ficha (fuera del tablero: un repintado no la borra) */
.fx-vuelo { position: fixed; z-index: 78; margin: 0; pointer-events: none;
  filter: drop-shadow(0 9px 10px rgba(0,0,0,.55)); will-change: transform; }
.fx-vuelo .pz { width: 100%; height: 100%; }
/* tres en raya: la marca entra con un pop */
.c3.fx-pop { animation: fxPop .28s cubic-bezier(.3,1.5,.55,1); }
@keyframes fxPop { from { transform: scale(.35); opacity: .1; } 70% { transform: scale(1.12); } }
/* reversi / cinco en raya: la ficha cae */
.rv .rv-ficha.fx-drop, .gk .gk-f.fx-drop { animation: fxDrop .32s cubic-bezier(.3,1.4,.55,1); }
@keyframes fxDrop { from { transform: translateY(-44%) scale(.75); opacity: .25; } }
/* conecta 4: el disco cae con rebote */
.c76 .f76.fx-cae { animation: fxCae .42s cubic-bezier(.3,1.5,.5,1); }
@keyframes fxCae { 0% { transform: translateY(-330%) scale(.92); opacity: .3; }
  68% { transform: translateY(7%) scale(1.03); } 100% { transform: translateY(0) scale(1); } }
/* timbiriche: la arista se traza */
.board.b-dots .edge.fx-dibuja { animation: fxDraw .38s ease-out; }
@keyframes fxDraw { from { stroke-width: .46; opacity: .15; } }
/* dama china: los hoyos por los que pasa el salto destellan */
.star-h.fx-paso { animation: fxPaso .55s ease-out forwards; }
@keyframes fxPaso { 0% { stroke: #f5b301; stroke-width: 1.05; stroke-opacity: 1; }
  100% { stroke: #f5b301; stroke-width: .3; stroke-opacity: 0; } }
/* dama china: la ficha que vuela */
.star-vuelo { pointer-events: none; }
.star-vuelo.f0 { fill: #4f8cff; } .star-vuelo.f1 { fill: #ff7a7a; } .star-vuelo.f2 { fill: #37d67a; }
.star-vuelo.f3 { fill: #f5b301; } .star-vuelo.f4 { fill: #b98bff; } .star-vuelo.f5 { fill: #41d3dd; }
.star-vuelo.mia { stroke: #f5f7fb; stroke-width: .3; }
/* ===================== MANCALA (Kalah) ===================== */
/* Dos filas de 6 casas + un depósito a cada lado. El depósito del jugador
   (abajo) va a la derecha; el del rival (arriba) a la izquierda. */
.board.b-mancala { display: block; width: 100%; }
.mn-wrap { display: flex; align-items: stretch; gap: 7px; }
.mn-col { display: flex; flex-direction: column; justify-content: center; }
.mn-mid { flex: 1 1 auto; gap: 8px; }
.mn-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mn-h, .mn-store {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--borde);
  background: radial-gradient(circle at 38% 32%, #16223a, #0b1220 72%);
  box-shadow: inset 0 2px 8px -6px #000, 0 3px 10px -8px #000;
  min-height: 46px; user-select: none;
}
.mn-h { cursor: default; }
.mn-h.vacia { opacity: .42; }
.mn-h .mn-n, .mn-store .mn-n {
  font-family: Outfit, Inter, system-ui, sans-serif; font-weight: 800;
  font-size: 1.28rem; color: #cfd9ec; line-height: 1;
}
.mn-h.jugable {
  cursor: pointer; border-color: #f5b301;
  background: radial-gradient(circle at 38% 32%, #23304d, #121a2e 72%);
  box-shadow: inset 0 2px 8px -6px #000, 0 0 0 1px rgba(245,179,1,.35);
}
.mn-h.jugable:hover { background: #1b2740; border-color: #ffd166; }
.mn-h.jugable .mn-n { color: #ffd166; }
.mn-h.ult { box-shadow: inset 0 0 0 2px rgba(245,179,1,.7), 0 3px 10px -6px #000; }
.mn-h.nuevo .mn-n { animation: mnPop .38s cubic-bezier(.3,1.5,.5,1); }
@keyframes mnPop { 0% { transform: scale(.4); opacity: .2; } 100% { transform: scale(1); } }
.mn-store {
  min-width: 52px; min-height: 100%;
  border-radius: 16px; background: linear-gradient(180deg, #182238, #0b1220);
  border-color: var(--borde2);
}
.mn-store .mn-n { font-size: 1.6rem; color: #ffd166; }
.mn-store.arriba { border-top-left-radius: 22px; border-bottom-left-radius: 22px; }
.mn-store.abajo { border-top-right-radius: 22px; border-bottom-right-radius: 22px; }
@media (max-width: 420px) {
  .mn-wrap { gap: 5px; }
  .mn-row { gap: 4px; }
  .mn-h { min-height: 40px; border-radius: 10px; }
  .mn-h .mn-n { font-size: 1.15rem; }
  .mn-store { min-width: 40px; }
  .mn-store .mn-n { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .c3.fx-pop, .rv-ficha.fx-drop, .gk-f.fx-drop, .f76.fx-cae, .edge.fx-dibuja, .star-h.fx-paso { animation: none; }
  .mn-h.nuevo .mn-n { animation: none; }
}

/* Enlace "Cómo se juega" (guía del juego): en el lobby (juego elegido) y en la
   cabecera EN JUEGO. Mismo tratamiento en ambos sitios para que se reconozca. */
.guia-link { color: #ffd166; text-decoration: underline; text-underline-offset: 2px;
  font-weight: 600; white-space: nowrap; }
.guia-link:hover { color: #ffe6a3; }
.juego-sel .guia-link { color: #fff3cf; }
