/* Sudoku Game - Orange/Yellow Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --secondary-color: #10B981;
    --error-color: #EF4444;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
    --cell-bg: #FFFFFF;
    --cell-given: #FEF3C7;
    --cell-selected: #FED7AA;
    --cell-highlight: #FEF3C7;
    --shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 25px rgba(245, 158, 11, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 650px;
    margin: 0 auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 728px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

header {
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.new-game-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.new-game-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.game-info {
    display: flex;
    justify-content: space-around;
    background: var(--surface);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-left: 8px;
}

.instructions {
    background: var(--surface);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background: var(--border-color);
    border: 3px solid var(--primary-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 1;
}

.sudoku-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sudoku-cell:hover:not(.given) {
    background: var(--cell-highlight);
}

.sudoku-cell.selected {
    background: var(--cell-selected);
    border: 2px solid var(--primary-color);
}

.sudoku-cell.given {
    background: var(--cell-given);
    color: var(--text-primary);
    font-weight: 700;
    cursor: default;
}

.sudoku-cell.user-input {
    color: var(--primary-color);
}

.sudoku-cell.error {
    background: #FEE2E2;
    color: var(--error-color);
}

.sudoku-cell.correct {
    background: #D1FAE5;
    color: var(--secondary-color);
}

.sudoku-cell:nth-child(3n) {
    border-right: 2px solid var(--primary-dark);
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--primary-dark);
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.number-btn, .erase-btn {
    padding: 15px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.number-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.erase-btn {
    font-size: 1rem;
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.erase-btn:hover {
    background: #DC2626;
    border-color: #DC2626;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    border: 3px solid var(--primary-color);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.completion-time {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.overlay-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.tips {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.tips h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
}

.tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 650px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .difficulty-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .difficulty-btn {
        flex: 1;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .new-game-btn {
        width: 100%;
    }
    
    .sudoku-cell {
        font-size: 1.2rem;
    }
    
    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .number-btn, .erase-btn {
        padding: 12px;
        font-size: 1.1rem;
    }
}