* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-mode-selector {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    color: #666;
}

.mode-btn.active {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
    border-color: #FF6B6B;
    transform: scale(1.05);
}

.mode-btn:hover {
    border-color: #FF6B6B;
    transform: translateY(-1px);
}

.language-switcher {
    margin-bottom: 20px;
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    color: #666;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.lang-btn:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.difficulty-btn.easy { background: #4CAF50; color: white; }
.difficulty-btn.medium { background: #FF9800; color: white; }
.difficulty-btn.hard { background: #F44336; color: white; }
.difficulty-btn.active { transform: scale(1.1); }

.timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    background: #333;
    border-radius: 10px;
    padding: 10px;
    margin: 20px 0;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 1;
}

.cell {
    background: white;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
}

.cell.killer-cage {
    border: 3px dashed #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.cell .cage-sum {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: #FF6B6B;
    font-weight: bold;
    background: white;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
}

.cell:hover {
    background: #e3f2fd;
    transform: scale(1.05);
}

.cell.selected {
    background: #2196F3 !important;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

.cell.given {
    background: #f5f5f5;
    color: #333;
    font-weight: 900;
}

.cell.given:hover {
    background: #f5f5f5;
    transform: none;
}

.cell.error {
    background: #ffebee !important;
    color: #d32f2f;
    animation: shake 0.5s ease-in-out;
}

.cell.highlight-same {
    background: #fff3e0 !important;
}

.cell.highlight-row-col {
    background: #f3e5f5 !important;
}

.cell.highlight-cage {
    background: #ffe0e6 !important;
    border-color: #ff6b6b !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 3x3 box borders */
.cell:nth-child(3n) { border-right: 3px solid #333; }
.cell:nth-child(n+19):nth-child(-n+27) { border-bottom: 3px solid #333; }
.cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid #333; }

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.number-btn, .action-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.number-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.number-btn:hover, .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.action-btn.erase {
    background: #FF5722;
    color: white;
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.control-btn.new-game {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.control-btn.hint {
    background: linear-gradient(135deg, #FF9800, #f57c00);
    color: white;
}

.control-btn.solve {
    background: linear-gradient(135deg, #9C27B0, #7b1fa2);
    color: white;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.status {
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.status.win {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    animation: celebration 0.6s ease-in-out;
}

@keyframes celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .sudoku-grid {
        font-size: 1rem;
        max-width: 350px;
    }
    
    .cell {
        font-size: 1rem;
    }
    
    .number-pad {
        grid-template-columns: repeat(3, 1fr);
        max-width: 250px;
    }
    
    .number-btn, .action-btn {
        padding: 12px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .game-container {
        padding: 15px;
        margin: 5px;
    }
    
    .sudoku-grid {
        max-width: 300px;
        padding: 8px;
    }
    
    .cell {
        font-size: 0.9rem;
    }
}
