:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --accent-color: #4a90e2;
    --shadow-color: rgba(0,0,0,0.1);
    --card-colors: #FF6B6B, #4ECDC4, #45B7D1, #FDCB6E, #6C5CE7;
}

* {
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.game-container {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    padding: 30px;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.settings-panel {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.range-control, .time-control, .count-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

input[type="range"] {
    width: 100%;
    margin-top: 10px;
    appearance: none;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.game-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.number-display {
    margin-bottom: 20px;
}

.number-card {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 250px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    font-family: 'Caveat', cursive;
    font-size: 5rem;
    color: white;
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.3s ease;
}

.start-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(74,144,226,0.4);
    transition: all 0.3s ease;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(74,144,226,0.5);
}

.input-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

#sumInput {
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: 5px;
    width: 150px;
}

#submitSum {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.score-panel {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    font-weight: bold;
}

.hidden {
    display: none;
}

.result-tracker {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.result-block {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.result-block.correct {
    background-color: #2ecc71;
    animation: pop-in 0.5s ease;
}

.result-block.incorrect {
    background-color: #e74c3c;
    animation: shake 0.5s ease;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

.modal-close-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-close-btn:hover {
    background-color: #3a7bd5;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }
    
    .number-card {
        width: 150px;
        height: 200px;
        font-size: 4rem;
    }
}