body {
    font-family: 'Nunito', sans-serif;
    /* background-color: #f0f4f8; -- Removed, using Tailwind on body */
    /* display: flex; -- Removed, using Tailwind on body */
    /* align-items: center; -- Removed, using Tailwind on body */
    /* justify-content: center; -- Removed, using Tailwind on body */
    /* height: 100vh; -- Removed, using Tailwind on body */
    margin: 0;
    /* overflow: hidden; -- Removed, allowing scroll */
}

.container { /* This is now #game-container, styled with Tailwind in HTML */
    /* width: 90%; */
    /* max-width: 500px; */
    /* background-color: white; */
    /* border-radius: 24px; */
    /* padding: 2rem; */
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
    /* border: 4px solid #1e293b; */
    /* position: relative; */
}

.screen {
    display: none;
    text-align: center;
}

.screen.active {
    display: block;
}

.title { /* Now styled with Tailwind in HTML */
    /* font-size: 2.5rem; */
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.subtitle { /* Now styled with Tailwind in HTML */
    /* font-size: 1.2rem; */
    color: #64748b;
    margin-bottom: 2rem;
}

.operation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.op-btn, .start-btn {
    padding: 1.5rem;
    border-radius: 16px;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-bottom: 6px solid rgba(0,0,0,0.2);
}

.op-btn:hover, .start-btn:hover {
    transform: translateY(-4px);
}
.op-btn:active, .start-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.bg-blue-500 { background-color: #3b82f6; }
.bg-green-500 { background-color: #22c55e; }
.bg-yellow-500 { background-color: #f59e0b; }
.bg-pink-500 { background-color: #ec4899; }

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.setup-form label {
    font-weight: 700;
}

.setup-form input {
    padding: 0.8rem;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    font-size: 1rem;
}

.start-btn {
    margin-top: 1rem;
    background-color: #8b5cf6;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

#timer-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    margin-bottom: 2rem;
}

#timer-bar {
    height: 100%;
    width: 100%;
    background-color: #8b5cf6;
    border-radius: 10px;
    transition: width 0.1s linear;
}

.problem { /* Now styled with Tailwind in HTML */
    /* font-size: 4rem; */
    font-weight: 900;
    margin-bottom: 2rem;
}

.answer-input {
    width: 80%;
    padding: 1rem;
    font-size: 3rem;
    text-align: center;
    border-radius: 16px;
    border: 4px solid #94a3b8;
    -moz-appearance: textfield; /* Firefox */
}
.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.numpad-btn {
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background-color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.numpad-btn:hover {
    background-color: #e2e8f0;
}

.numpad-btn.clear-btn {
    background-color: #fca5a5;
    color: white;
}

.numpad-btn.submit-btn {
    background-color: #818cf8;
    color: white;
}

.numpad-btn.minus-btn {
    background-color: #f8fafc;
    color: #000;
}

.final-score { /* Now styled with Tailwind in HTML */
    /* font-size: 6rem; */
    font-weight: 900;
    color: #8b5cf6;
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 640px) { /* Small screens */
    .op-btn, .start-btn {
        padding: 1rem;
        font-size: 1rem;
    }
    .game-hud {
        font-size: 1.2rem;
    }
    .answer-input {
        font-size: 2rem;
        padding: 0.8rem;
    }
    .numpad-btn {
        padding: 1rem;
        font-size: 1.2rem;
    }
}

/* Effects */
@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.shake {
    animation: screen-shake 0.3s;
}

@keyframes flash-green {
    from { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    to { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.5); }
}

.flash-green {
    animation: flash-green 0.2s;
}

@keyframes flash-red {
    from { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    to { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.5); }
}

.flash-red {
    animation: flash-red 0.2s;
}