/* Sudoku (sudoku.html) */

.board-wrap {
    max-width: 480px;
    margin: 10px auto;
    padding: 0 6px;
}

.su-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    aspect-ratio: 1;
    width: 100%;
    background: #333;
    border: 4px solid #333;
    border-radius: 6px;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.su-cell {
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 4.2vw, 24px);
    font-weight: bold;
    color: #1a3f8f;
    cursor: pointer;
    user-select: none;
}

.su-cell:nth-child(9n+3) { border-right: 3px solid #333; }
.su-cell:nth-child(9n+6) { border-right: 3px solid #333; }
.su-cell:nth-child(n+19):nth-child(-n+27) { border-bottom: 3px solid #333; }
.su-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid #333; }

.su-cell.given {
    color: #222;
    background: #eef1f5;
    cursor: default;
}

.su-cell.peer { background: #eaf2ff; }
.su-cell.same-value { background: #cfe3ff; }

.su-cell.selected { background: #fff3b0; }
.su-cell.given.selected { background: #fde8a8; }

.su-cell.error { background: #fde0e0; color: #c62828; }
.su-cell.error.selected { background: #f8c4c4; }

.su-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 2px;
}

.su-note {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(7px, 1.8vw, 10px);
    font-weight: bold;
    color: #6a7a8c;
}

/* Shared page furniture (stat chips, status, difficulty/controls) */
.stat-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 8px auto;
    flex-wrap: wrap;
}

.stat-chip {
    background: white;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 15px;
    font-weight: bold;
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.status-line {
    text-align: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    min-height: 22px;
    margin: 4px 0;
}

.control-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 480px;
    margin: 10px auto;
    flex-wrap: wrap;
}

.digit-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: #5d4037;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.digit-btn:disabled { opacity: 0.3; cursor: default; }

.tool-btn {
    padding: 11px 16px;
    height: 42px;
    box-sizing: border-box;
    border: none;
    border-radius: 8px;
    background: #777;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.tool-btn.active { background: #f9a825; color: #3a2600; }

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.difficulty-options button {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    background: #5d4037;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
}

.difficulty-options button:hover { background: #7b5e57; }

@media (max-width: 700px) {
    .stat-chip { font-size: 13px; padding: 5px 12px; }
    .digit-btn { width: 36px; height: 36px; font-size: 16px; }
    .tool-btn { padding: 9px 12px; height: 36px; font-size: 12px; }
}
