/* ==========================================================================
   DAMAS - ESTILO INTEGRADO NOWEY JUEGOS (misma base que Solitario Clásico)
   ========================================================================= */

:root {
  --color-neon-blue: #00b7ff;
  --color-neon-green: #39ff14;
  --color-neon-orange: #ff6c00;
  --bg-dark-box: rgba(10, 21, 32, 0.85);
  --border-neon: 1px solid rgba(0, 183, 255, 0.2);
}

body {
  background-color: #050a0e;
  color: #e2e8f0;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar e Interfaz superior fija */
.logo-header {
    width: 100%;
    text-align: center;
    padding: 8px 0;
}

/* MESA DE JUEGO COMPACTA */
.mesa {
  background: var(--bg-dark-box);
  border: var(--border-neon);
  border-radius: 16px;
  max-width: 420px;
  width: calc(100% - 24px);
  margin: 0 auto;
  padding: 15px;
  box-sizing: border-box;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 10, 14, 0.6);
  border: 1px solid rgba(57, 255, 20, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: var(--color-neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-neon-green);
  flex-shrink: 0;
}

.titulo-juego {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 5px 0;
  background: linear-gradient(90deg, var(--color-neon-orange), var(--color-neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.instrucciones-juego {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 12px 0;
}

/* CONTENEDOR RELATIVO DEL TABLERO */
.board-relative {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #04080c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
}

#checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
}

/* Celdas del tablero */
.d-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 1;
}
.d-cell.white { background-color: #1a2233; }
.d-cell.black { background-color: #07090e; }

.d-cell.selected {
    background-color: rgba(255, 108, 0, 0.2) !important;
    box-shadow: inset 0 0 12px rgba(255, 108, 0, 0.5);
}
.d-cell.valid-dest::after {
    content: '';
    width: 24%; height: 24%;
    background-color: var(--color-neon-green);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 10px var(--color-neon-green);
}

/* Fichas */
.piece {
    width: 78%; height: 78%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    background: #111520;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}
.piece.player { border: 2px solid var(--color-neon-orange); color: transparent; }
.piece.cpu { border: 2px solid var(--color-neon-blue); color: transparent; }

.piece.king {
    color: #ffffff !important;
    font-family: 'Chakra Petch', 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.piece.player.king { border-color: var(--color-neon-green); box-shadow: 0 0 12px rgba(57, 255, 20, 0.6); }
.piece.cpu.king { border-color: var(--color-neon-orange); box-shadow: 0 0 12px rgba(255, 108, 0, 0.6); }

/* Animación de error al mover ficha */
.shake-active {
    animation: side-shake 0.25s ease-in-out;
}
@keyframes side-shake {
    0%, 100% { transform: translate(0, 0); }
    20%, 60% { transform: translate(-3px, 0); }
    40%, 80% { transform: translate(3px, 0); }
}

/* PANTALLA COMPLETA — el tamaño se calcula según el alto/ancho real
   de la pantalla (vh/vw) en vez de valores fijos, para que nunca
   se corte nada ni haga falta hacer scroll lateral. */
.mesa:fullscreen,
.mesa:-webkit-full-screen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 4px;
}
/* En pantalla completa el texto explicativo no hace falta —
   le da todo ese espacio al tablero y al marcador de abajo */
.mesa:fullscreen .instrucciones-juego,
.mesa:-webkit-full-screen .instrucciones-juego {
    display: none;
}
.mesa:fullscreen .titulo-juego,
.mesa:-webkit-full-screen .titulo-juego {
    font-size: 1rem;
    margin: 2px 0;
}
.mesa:fullscreen .status-pill,
.mesa:-webkit-full-screen .status-pill {
    margin-bottom: 2px;
}
.mesa:fullscreen .board-relative,
.mesa:-webkit-full-screen .board-relative {
    width: min(48vh, 82vw, 520px);
    height: min(48vh, 82vw, 520px);
    max-width: none;
}
.mesa:fullscreen .arcade-dashboard,
.mesa:-webkit-full-screen .arcade-dashboard {
    width: min(94vw, 520px);
    margin-top: 6px;
}

/* DASHBOARD INFERIOR DE CONTROLES (idéntico patrón a clasico) */
.arcade-dashboard {
  margin-top: 15px;
  width: 100%;
}

.marcador-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid rgba(0, 183, 255, 0.15);
  border-radius: 8px;
  padding: 8px 5px;
  margin-bottom: 12px;
}
.marcador-box.dos-col { grid-template-columns: repeat(2, 1fr); }
.marcador-box small { font-size: 0.6rem; color: #64748b; letter-spacing: 1px; }
.marcador-box b { font-size: 1.1rem; color: var(--color-neon-green); }

/* Panel de estado táctico (texto libre) */
.panel-estado {
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid rgba(0, 183, 255, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 0.7rem;
  color: #e2e8f0;
  text-align: left;
  line-height: 1.3;
}
.panel-estado strong {
  display: block;
  font-size: 0.6rem;
  color: var(--color-neon-green);
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.zona-botones-arcade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-action {
  width: 100%;
  background: transparent;
  padding: 10px;
  border-radius: 6px;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-sizing: border-box;
}

.btn-orange { border: 1px solid var(--color-neon-orange); color: var(--color-neon-orange); }
.btn-orange:hover { background: rgba(255, 108, 0, 0.1); }

.btn-blue { border: 1px solid var(--color-neon-blue); color: var(--color-neon-blue); }
.btn-blue:hover { background: rgba(0, 183, 255, 0.1); }

.btn-green { border: 1px solid var(--color-neon-green); color: var(--color-neon-green); }
.btn-green:hover { background: rgba(57, 255, 20, 0.1); }

.btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-mini {
  flex: 1;
  padding: 6px 0;
  font-size: 0.65rem;
}

/* OVERLAYS INTERNOS (menú de modo, resultado, etc.) */
.overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 10, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay.oculto { display: none !important; }

.mensaje-alerta {
  padding: 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.mensaje-alerta h2 {
  color: var(--color-neon-green);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 16px 0;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
  letter-spacing: 1px;
}
.mensaje-alerta p { color: #94a3b8; font-size: 0.85rem; margin-bottom: 15px; }
.mensaje-alerta .btn-action { max-width: 220px; margin: 0 auto 10px auto; }

/* Panel Online: crear/unirse a sala */
.panel-online {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0, 183, 255, 0.2);
}
.panel-online-input {
  background: #000;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  font-size: 0.75rem;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  box-sizing: border-box;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.panel-online-input:focus { outline: none; border-color: var(--color-neon-blue); }

.inline-input-group { display: flex; gap: 6px; }

.codigo-sala-activa {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 4px;
  color: var(--color-neon-green);
  font-weight: 900;
  margin: 6px 0;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
.code-lbl { font-size: 0.65rem; color: #64748b; letter-spacing: 1px; }

.share-flex {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.mini-share-btn {
  flex: 1;
  font-size: 0.65rem;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  padding: 7px 0;
  border-radius: 6px;
  text-align: center;
}
.mini-share-btn.wa { background: #128C7E; }
.mini-share-btn.fb { background: #006AFF; }

.staff-footer-note {
  margin-top: 15px;
  font-size: 0.85rem;
}
.staff-footer-note a { color: var(--color-neon-blue); text-decoration: none; font-weight: bold; }

/* FOOTER GLOBAL (idéntico a clasico) */
.site-footer {
    background-color: #020508;
    padding: 25px 0;
    text-align: center;
    font-family: 'Chakra Petch', 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    border-top: 1px solid rgba(0, 183, 255, 0.2);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.8);
}@media (max-width: 480px) {
  .zona-botones-arcade { grid-template-columns: 1fr; }
}
