/* ============================================
   Serpientes y Escaleras - Estilos personalizados
   ============================================ */

body {
    min-height: 100vh;
}

/* --- Fichas de color (indicadores) --- */
.ficha-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.leyenda-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 3px;
}
.casilla-escalera-color { background-color: #d4edda; border: 1px solid #2ecc71; }
.casilla-serpiente-color { background-color: #f8d7da; border: 1px solid #e74c3c; }
.casilla-meta-color { background-color: #fff3cd; border: 1px solid #f1c40f; }

/* ============================================
   TABLERO
   ============================================ */
.tablero {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background-color: #343a40;
    padding: 2px;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.casilla {
    position: relative;
    background-color: #ffffff;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2px;
    font-size: 0.7rem;
    overflow: hidden;
    min-height: 0;
}

.casilla-numero {
    font-size: 0.65rem;
    color: #888;
    font-weight: 600;
    line-height: 1;
}

.casilla-evento {
    font-size: 0.55rem;
    font-weight: bold;
    line-height: 1;
    margin-top: 1px;
}

.casilla-escalera {
    background-color: #d4edda;
}
.casilla-escalera .casilla-evento {
    color: #1e7e34;
}

.casilla-serpiente {
    background-color: #f8d7da;
}
.casilla-serpiente .casilla-evento {
    color: #c82333;
}

.casilla-meta {
    background-color: #fff3cd;
    font-weight: bold;
}

.casilla-inicio {
    background-color: #cce5ff;
}

/* Contenedor de fichas dentro de la casilla */
.fichas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.ficha {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

/* Ficha destacada cuando se mueve */
.ficha-activa {
    transform: scale(1.4);
    z-index: 10;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* ============================================
   DADO
   ============================================ */
.dado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background-color: #ffffff;
    border: 3px solid #343a40;
    border-radius: 12px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #343a40;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Animación de tirada */
.dado-girando {
    animation: girar 0.6s ease-in-out;
}

@keyframes girar {
    0%   { transform: rotate(0deg)   scale(1); }
    25%  { transform: rotate(90deg)  scale(1.1); }
    50%  { transform: rotate(180deg) scale(1.2); }
    75%  { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ============================================
   Jugador en turno (resaltado)
   ============================================ */
.jugador-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.jugador-item.en-turno {
    background-color: #d4edda;
    border-left: 4px solid #2ecc71;
    font-weight: 600;
}

.jugador-item .posicion-badge {
    margin-left: auto;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 575.98px) {
    .casilla-numero { font-size: 0.55rem; }
    .casilla-evento { font-size: 0.45rem; }
    .ficha { width: 9px; height: 9px; }
    .dado { width: 64px; height: 64px; font-size: 2rem; }
}
