/* Estilos específicos para Knister */
:root {
    --knister-cell-size: clamp(40px, 12vw, 50px);
    --knister-gap: 5px;
}

.scoresheet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Grilla 7x6 (5x5 juego + indicadores) */
#grid-container {
    display: grid;
    grid-template-columns: auto repeat(5, var(--knister-cell-size)) auto;
    grid-template-rows: auto repeat(5, var(--knister-cell-size));
    gap: var(--knister-gap);
    background-color: var(--section-deep);
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    justify-content: center;
}

/* Celdas de puntuación */
.score-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color-light);
    min-width: 1.5rem;
    min-height: 1.5rem;
}
.score-cell.has-score {
    color: var(--text-color);
}
.score-cell.empty-corner {
    visibility: hidden;
}
.score-cell.diag-score {
    color: var(--info-color);
}
.score-cell.diag-score.has-score {
    color: var(--info-color-light);
    font-weight: 900;
}

.cell {
    width: 100%;
    height: 100%;
    background-color: var(--bg-light); 
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
    color: var(--text-color);
    position: relative;
}

.cell:hover:not(.filled) {
    background-color: var(--bg-lightest);
}

.cell.filled {
    background-color: var(--front-light);
    color: var(--bg-darkest);
    font-weight: 800;
}

/* Diagonales */
.cell.diagonal {
    border-color: var(--info-color-dark);
}
.cell.diagonal.filled {
    background-color: var(--info-color-light);
    color: var(--bg-darkest);
}

/* Puntuación y Turno */
.total-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--section-deep);
    border-radius: var(--border-radius-lg);
    width: 100%;
}
.total-score.finished {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color-light);
}
.total-score .score-info,
.total-score .turn-info {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color-light);
    margin: 0;
}
#score {
    color: var(--info-color-light);
}

/* Sección de Dados (Compacta como Splitter) */
.dice-section {
    padding: var(--base-padding);
    background-color: var(--section-deep);
    border-radius: var(--border-radius-lg);
    width: 100%;
    margin-bottom: 0; /* Eliminar margen extra si existe */
}
.dice-section h2 {
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    font-size: 1.1rem;
    text-align: center;
    border: none;
}
.dice-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 0;
}
.dice-section .dice {
    --dice-size: 3rem; /* Igual a Splitter */
}
.operator {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color-light);
}
.dice-sum {
    font-size: 2rem;
    font-weight: 900;
    color: var(--info-color);
    margin-left: 0.5rem;
    min-width: 1.5ch;
}
/* Game Over */
body.game-over .cell, 
body.game-over #btn-roll {
    opacity: 0.5;
    pointer-events: none;
}
body.game-over #btn-roll {
    background-color: var(--disabled-bg-color);
    color: var(--disabled-text-color);
}

.diagonal-row td {
    color: var(--info-color-light);
    font-weight: bold;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }

.modal-content {
    background: var(--section-bg);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-md);
    text-align: center;
    min-width: 250px;
}
.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Manual Input Grid */
.manual-input-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}
.btn-die-input {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px;
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-die-input:hover {
    background-color: var(--primary-color-light);
    color: var(--bg-darkest);
}
