:root {
    --primary-hue: 250;
    --primary-color: hsl(var(--primary-hue), 80%, 60%);
    --secondary-color: hsl(320, 80%, 60%);
    --accent-color: hsl(160, 80%, 50%);
    --bg-dark: hsl(240, 20%, 10%);
    --text-light: hsl(0, 0%, 95%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --font-main: "Outfit", sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
}

/* Background Animations */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(20px, 40px) scale(1.1);
    }
}

/* Glassmorphism Container */
.game-container {
    width: 90%;
    max-width: 450px;
    min-height: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    aspect-ratio: 9 / 16;
}

/* Screens */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    transition: opacity 0.5s ease,
    transform 0.5s ease;
}

.screen.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Typography & Elements */
.game-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
        background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.game-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
        font-weight: 300;
}

.btn-primary {
    background: linear-gradient(
            135deg,
            var(--primary-color),
            var(--secondary-color)
    );
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s,
    box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-family: var(--font-main);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Game Interface */
.header-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    }

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.question-area {
    }

.question-card {
    font-size: 4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    }

.operator {
    color: var(--secondary-color);
}

.equals {
    font-size: 2rem;
    opacity: 0.5;
    }

.answer-wrapper input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    padding: 1rem;
    font-size: 2.5rem;
    color: white;
    width: 120px;
    text-align: center;
    font-family: var(--font-main);
    font-weight: 700;
    outline: none;
    transition: border-color 0.3s,
    background 0.3s;
}

.answer-wrapper input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

/* Feedback */
.feedback {
    font-size: 1.5rem;
    font-weight: 600;
    min-height: 2rem;
        transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.feedback.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.feedback.correct {
    color: #4ade80;
}

.feedback.wrong {
    color: #f87171;
}

/* Game Over */
.final-score-container {
        display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.final-score-value {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 480px) {
    .game-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        aspect-ratio: auto;
    }

    .game-title {
        font-size: 3rem;
    }
}

/* Virtual Keypad */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
        width: 100%;
    max-width: 300px;
}

.key-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.key-btn:active {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(1px);
}

.action-btn {
    background: rgba(248, 113, 113, 0.2);
    font-size: 1.5rem;
}

.action-btn:hover {
    background: rgba(248, 113, 113, 0.3);
}

.submit-btn {
    background: rgba(74, 222, 128, 0.2);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background: rgba(74, 222, 128, 0.3);
}

.answer-wrapper input[readonly] {
    cursor: default;
    caret-color: transparent;
}

/* Results Summary */
.results-summary {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
        background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 10px;
    font-size: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.results-summary::-webkit-scrollbar {
    width: 6px;
}

.results-summary::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item:last-child {
    border-bottom: none;
}

.result-question {
    font-weight: 600;
}

.result-answer {
    font-weight: 400;
}

.result-item.correct {
    color: #4ade80;
}

.result-item.wrong {
    color: #f87171;
}

