/* --- Reset y Estética General --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #21201d; /* Fondo oscuro profesional */
    color: #ffffff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h2 { 
    margin: 15px 0; 
    font-weight: 300; 
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.2rem;
}

#turno-texto {
    font-weight: bold;
    color: #95bb4a; /* Color acento verde */
}

/* --- Contenedor Principal --- */
.contenedor-juego { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 100%;
}

/* --- Cementerios Modernos --- */
.cementerio { 
    width: 98vw; 
    max-width: 450px;
    background: rgba(255, 255, 255, 0.05); 
    padding: 12px; 
    border-radius: 12px; 
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cementerio h5 {
    width: 100%;
    font-size: 0.6rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.pieza-muerta { 
    width: 22px; 
    height: auto; 
    margin: 2px; 
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

/* --- EL TABLERO PRO --- */
table { 
    border-collapse: separate; /* Permite bordes redondeados en la tabla */
    border-spacing: 0;
    border: 4px solid #312e2b; 
    border-radius: 8px;
    overflow: hidden;
    width: 98vw;       
    max-width: 450px;  
    table-layout: fixed; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.casilla { 
    padding: 0;
    text-align: center; 
    vertical-align: middle;
    position: relative;
    height: 11.5vw; /* Altura fija para evitar colapsos */
}

@media (min-width: 460px) { .casilla { height: 52px; } }

/* Colores estilo "Wood/Forest" */
.blanca { background-color: #ebecd0; }
.negra { background-color: #779556; }

.pieza { 
    width: 90%; 
    height: 90%; 
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,0.3));
    transition: transform 0.1s;
}

.pieza:active { transform: scale(1.1); }

/* --- COORDENADAS DISCRETAS --- */
.coordenada {
    font-size: 9px;
    font-weight: bold;
    color: rgba(255,255,255,0.4);
    text-align: center;
    background-color: #21201d;
    width: 18px;
}

/* --- SUGERENCIAS TIPO CARD --- */
.sugerencias-container { width: 98vw; max-width: 450px; margin-top: 20px; }
.sugerencias-container h4 { font-size: 0.8rem; margin-bottom: 10px; color: #888; }

.sug-bloque { 
    padding: 15px; 
    margin: 8px 0; 
    border-radius: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: #2b2925;
    border-left: 5px solid #95bb4a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.prio-1 { border-left-color: #95bb4a; }
.prio-2 { border-left-color: #4a90e2; }

/* --- SELECCION Y AYUDA --- */
.casilla-seleccionada { 
    background-color: rgba(247, 236, 116, 0.8) !important; 
}

/* Punto de movimiento posible tipo Lichess */
.casilla-ayuda::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- BOTÓN REDONDEADO --- */
#btn-reiniciar {
    background-color: #312e2b;
    color: #fff;
    border: 1px solid #45423f;
    padding: 16px;
    border-radius: 12px;
    width: 90%;
    max-width: 300px;
    font-size: 1rem;
    font-weight: bold;
    margin: 25px 0;
    cursor: pointer;
}

#btn-reiniciar:active { background-color: #45423f; }