/* Sudoku Game Styles */

/* Stat Boxes */
.sudoku-stat-box {
    background: #6c757d;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: #fff;
}

.sudoku-stat-box.stat-time {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

.sudoku-stat-box.stat-mistakes {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #000;
}

.sudoku-stat-box.stat-mistakes.danger {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
    color: #fff;
}

.sudoku-stat-box.stat-progress {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.sudoku-stat-box .stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.sudoku-stat-box .stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Sudoku Container */
.sudoku-container {
    max-width: 450px;
    margin: 0 auto;
    position: relative;
}

/* Sudoku Board */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #333;
    border: 3px solid #333;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

[data-bs-theme="dark"] .sudoku-board {
    background: #555;
    border-color: #555;
}

/* Sudoku Cell */
.sudoku-cell {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    position: relative;
    user-select: none;
    aspect-ratio: 1;
}

[data-bs-theme="dark"] .sudoku-cell {
    background: #2d3239;
    color: #f8f9fa;
}

/* 3x3 Box borders */
.sudoku-cell.box-left {
    border-left: 2px solid #333;
}

.sudoku-cell.box-top {
    border-top: 2px solid #333;
}

[data-bs-theme="dark"] .sudoku-cell.box-left {
    border-left-color: #555;
}

[data-bs-theme="dark"] .sudoku-cell.box-top {
    border-top-color: #555;
}

/* Cell States */
.sudoku-cell.initial {
    color: #333;
    font-weight: 700;
}

[data-bs-theme="dark"] .sudoku-cell.initial {
    color: #e9ecef;
}

.sudoku-cell.user-input {
    color: #0d6efd;
}

[data-bs-theme="dark"] .sudoku-cell.user-input {
    color: #6ea8fe;
}

.sudoku-cell.error {
    color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1);
}

[data-bs-theme="dark"] .sudoku-cell.error {
    background-color: rgba(220, 53, 69, 0.2);
}

.sudoku-cell.selected {
    background-color: #cfe2ff !important;
}

[data-bs-theme="dark"] .sudoku-cell.selected {
    background-color: #1a3a5c !important;
}

.sudoku-cell.highlighted {
    background-color: #e9ecef;
}

[data-bs-theme="dark"] .sudoku-cell.highlighted {
    background-color: #3d444d;
}

.sudoku-cell.same-number {
    background-color: #d1e7dd;
}

[data-bs-theme="dark"] .sudoku-cell.same-number {
    background-color: #1a4d2e;
}

.sudoku-cell:hover {
    background-color: #f0f0f0;
}

[data-bs-theme="dark"] .sudoku-cell:hover {
    background-color: #3d444d;
}

.sudoku-cell.selected:hover {
    background-color: #cfe2ff;
}

[data-bs-theme="dark"] .sudoku-cell.selected:hover {
    background-color: #1a3a5c;
}

/* Notes */
.sudoku-cell.has-notes {
    padding: 2px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    gap: 0;
}

.note-num {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(8px, 1.5vw, 11px);
    font-weight: 500;
    color: #6c757d;
    line-height: 1;
}

[data-bs-theme="dark"] .note-num {
    color: #adb5bd;
}

/* Number Pad */
.sudoku-numpad {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 8px;
    max-width: 450px;
    margin: 0 auto;
}

.numpad-btn {
    aspect-ratio: 1;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .numpad-btn {
    background: #2d3239;
    border-color: #495057;
    color: #f8f9fa;
}

.numpad-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

[data-bs-theme="dark"] .numpad-btn:hover {
    background: #3d444d;
    border-color: #6c757d;
}

.numpad-btn:active {
    transform: scale(0.95);
}

.numpad-btn.completed {
    opacity: 0.4;
    background: #e9ecef;
}

[data-bs-theme="dark"] .numpad-btn.completed {
    background: #1a1d20;
}

.numpad-btn.numpad-erase {
    background: #f8d7da;
    border-color: #f5c2c7;
}

[data-bs-theme="dark"] .numpad-btn.numpad-erase {
    background: #4a2c2f;
    border-color: #6a3b3e;
}

.numpad-btn.numpad-notes {
    background: #fff3cd;
    border-color: #ffe69c;
}

[data-bs-theme="dark"] .numpad-btn.numpad-notes {
    background: #4a4220;
    border-color: #6a5f2e;
}

.numpad-btn.numpad-notes.active {
    background: #ffc107;
    border-color: #e0a800;
    color: #000;
}

/* Game Overlay */
.sudoku-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: overlayAppear 0.3s ease-in-out;
}

[data-bs-theme="dark"] .sudoku-overlay {
    background: rgba(45, 50, 57, 0.95);
}

@keyframes overlayAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sudoku-overlay .overlay-content {
    text-align: center;
    padding: 30px;
}

.sudoku-overlay .overlay-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: iconBounce 0.5s ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.sudoku-overlay .overlay-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

[data-bs-theme="dark"] .sudoku-overlay .overlay-title {
    color: #f8f9fa;
}

.sudoku-overlay .overlay-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

[data-bs-theme="dark"] .sudoku-overlay .overlay-message {
    color: #adb5bd;
}

.sudoku-overlay .overlay-stats {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

[data-bs-theme="dark"] .sudoku-overlay .overlay-stats {
    background: rgba(255, 255, 255, 0.05);
}

/* Instructions */
.instruction-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    height: 100%;
}

[data-bs-theme="dark"] .instruction-item {
    background: #2d3239;
    border-left-color: #6ea8fe;
}

/* Statistics Cards */
.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .stat-card {
    background: #2d3239;
    border-color: #495057;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

[data-bs-theme="dark"] .stat-card .stat-label {
    color: #adb5bd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sudoku-container {
        max-width: 100%;
    }

    .sudoku-numpad {
        max-width: 100%;
        gap: 5px;
    }

    .numpad-btn {
        font-size: 18px;
    }

    .sudoku-stat-box .stat-value {
        font-size: 20px;
    }

    .sudoku-stat-box {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .sudoku-cell {
        font-size: 16px;
    }

    .note-num {
        font-size: 7px;
    }

    .numpad-btn {
        font-size: 16px;
        border-radius: 6px;
    }

    .sudoku-overlay .overlay-title {
        font-size: 22px;
    }

    .sudoku-overlay .overlay-icon {
        font-size: 50px;
    }
}

/* Animation for correct number */
@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sudoku-cell.just-correct {
    animation: correctPulse 0.3s ease-in-out;
}
