body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #406db1;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 20px;
    font-size: 18px;
    font-weight: bold;
}

.timer, .score {
    background-color: #ecf0f1;
    padding: 8px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-controls {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

button, select {
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

select {
    background-color: white;
}

button {
    background-color: #3498db;
    color: white;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button:active {
    transform: translateY(0);
}

#check-solution {
    background-color: #2ecc71;
}

#check-solution:hover {
    background-color: #27ae60;
}

#hint {
    background-color: #f39c12;
}

#hint:hover {
    background-color: #e67e22;
}

.kakuro-board {
    display: inline-block;
    border: 3px solid #2c3e50;
    background-color: #fff;
    margin: 0 auto;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.row {
    display: flex;
}

.cell {
    width: 50px;
    height: 50px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    position: relative;
    box-sizing: border-box;
}

.clue-cell {
    background-color: #2c3e50;
    color: white;
    font-size: 10px;
    flex-direction: column;
}

.clue-cell .down-clue {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.8em;
}

.clue-cell .across-clue {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.8em;
}

.clue-cell .clue-separator {
    position: absolute;
    width: 80%;
    height: 1px;
    background-color: rgba(255,255,255,0.5);
    top: 50%;
    left: 10%;
}

.input-cell {
    background-color: #fff;
}

.input-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 20px;
    background-color: transparent;
    color: #2c3e50;
}

.input-cell input:focus {
    outline: 2px solid #3498db;
    background-color: #ebf5fb;
}

.input-cell input.fixed {
    color: #16a085;
    font-weight: bold;
}

.input-cell input.error {
    background-color: #ffdddd;
    color: #e74c3c;
}

.status {
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    min-height: 27px;
    padding: 10px;
    border-radius: 6px;
    background-color: #3498db;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cell.highlight {
    animation: pulse 1s infinite;
}

.cell.correct {
    background-color: #d4edda;
    transition: background-color 0.5s;
}

.cell.error {
    background-color: #f8d7da;
    transition: background-color 0.5s;
}

@media (max-width: 768px) {
    .cell {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    button, select {
        width: 100%;
        margin-bottom: 5px;
    }
}