
/* ===================================
   MATHBlizt - WHITE AND GREEN THEME
=================================== */

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

:root {
    --purple: #b7dfc5;
    --pink: #ccebd5;
    --blue: #d9f0df;
    --green: #b7dfc5;
    --yellow: #e4f3e8;
    --dark: #174b2b;
    --muted: #66806e;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--dark);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8f1 55%, #e3f2e7 100%);
    background-size: cover;
}

.hidden {
    display: none !important;
}

/* ANIMATIONS */

@keyframes greenGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes greenText {
    0% { color: #238348; }
    20% { color: #4a9a68; }
    40% { color: #2f8f55; }
    60% { color: #5aa875; }
    80% { color: #3c965e; }
    100% { color: #238348; }
}

@keyframes greenBorder {
    0% { border-color: #a9d8b7; }
    25% { border-color: #d5ebdc; }
    50% { border-color: #b7dfc5; }
    75% { border-color: #d9f0df; }
    100% { border-color: #c7e5cf; }
}

/* WELCOME SCREEN */

.welcome-screen,
.result-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, #e3f2e7, #ffffff);
    background-size: cover;
}

.welcome-card,
.result-card {
    width: 100%;
    max-width: 520px;
    padding: 42px 28px;
    text-align: center;
    background: rgba(255,255,255,.94);
    border: 4px solid #a9d8b7;
    border-radius: 30px;
    box-shadow: 0 20px 55px #174b2b18;
    animation: greenBorder 12s linear infinite;
}

.welcome-icon,
.result-icon {
    font-size: 75px;
    margin-bottom: 12px;
}

.welcome-tag {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 30px;
    background: #e8f5eb;
    color: #287a45;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
}

.welcome-card h1 {
    margin: 17px 0;
    font-size: clamp(30px, 7vw, 42px);
    animation: greenText 10s linear infinite;
}

.welcome-text {
    color: var(--muted);
    line-height: 1.7;
    font-size: 16px;
}

.welcome-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.welcome-features span {
    background: linear-gradient(
        120deg,
        #ffe8f0,
        #eee8ff,
        #e2f5ff
    );
    padding: 10px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* BUTTONS */

.main-button {
    border: none;
    border-radius: 16px;
    padding: 16px 25px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    background: linear-gradient(135deg, #238348, #4a9a68);
    background-size: cover;
    box-shadow: 0 6px 18px #174b2b26;
    transition: .2s;
}

.main-button:hover {
    transform: translateY(-3px);
}

.welcome-card .main-button {
    width: 100%;
    max-width: 290px;
}

.secondary-button {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    border: 2px solid #a9d8b7;
    border-radius: 14px;
    color: #287a45;
    background: white;
    font-weight: 800;
    cursor: pointer;
}

.text-button {
    display: block;
    margin: 20px auto 0;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
}

/* MAIN GAME */

.game-screen {
    width: min(100% - 30px, 950px);
    margin: auto;
    padding: 25px 0 35px;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    border-radius: 17px;
    background: #ffffff;
    font-size: 30px;
}

.brand h1 {
    animation: greenText 10s linear infinite;
    font-size: 25px;
}

.brand small {
    color: var(--muted);
}

.stats {
    display: flex;
    gap: 10px;
}

.stat-box {
    min-width: 76px;
    padding: 10px;
    text-align: center;
    background: white;
    border: 2px solid #c7e5cf;
    border-radius: 16px;
    box-shadow: 0 5px 20px #174b2b12;
}

.stat-box span {
    display: block;
    font-size: 19px;
}

.stat-box strong {
    display: block;
    font-size: 18px;
    animation: greenText 10s linear infinite;
}

.stat-box small {
    color: var(--muted);
    font-size: 11px;
}

/* LEVELS */

.level-section {
    margin-bottom: 22px;
}

.level-section h2 {
    font-size: 19px;
    margin-bottom: 13px;
    animation: greenText 10s linear infinite;
}

.level-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 17px 8px;
    border: 3px solid transparent;
    border-radius: 19px;
    color: var(--dark);
    cursor: pointer;
    transition: .2s;
}

.level:nth-child(1) {
    background: linear-gradient(135deg, #e3f2e7, #ffffff);
    border-color: #a9d8b7;
}

.level:nth-child(2) {
    background: linear-gradient(135deg, #f0f8f1, #ffffff);
    border-color: #c7e5cf;
}

.level:nth-child(3) {
    background: linear-gradient(135deg, #e8f5eb, #ffffff);
    border-color: #a9d8b7;
}

.level span {
    font-size: 27px;
}

.level strong {
    font-size: 15px;
}

.level small {
    color: var(--muted);
}

.level:hover {
    transform: translateY(-3px);
}

.level.active {
    border-color: #238348;
    box-shadow: 0 5px 18px #174b2b20;
}

.level:disabled {
    cursor: not-allowed;
}

/* GAME CARD */

.game-card {
    padding: 28px;
    background: rgba(255,255,255,.95);
    border: 3px solid #b7dfc5;
    border-radius: 27px;
    animation: greenBorder 12s linear infinite;
    box-shadow: 0 12px 35px #174b2b15;
}

.game-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.eyebrow {
    color: #287a45;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
}

.game-heading h2 {
    margin-top: 7px;
    font-size: 23px;
    animation: greenText 10s linear infinite;
}

.question-count {
    padding: 12px 15px;
    background: #e8f5eb;
    border-radius: 14px;
    color: #287a45;
}

.question-count strong {
    font-size: 24px;
}

.question-count span {
    color: var(--muted);
}

.progress-track {
    height: 12px;
    margin: 20px 0;
    border-radius: 20px;
    background: #e8f5eb;
    overflow: hidden;
}

.progress-bar {
    width: 5%;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #238348, #8bc99d);
    transition: width .3s;
}

.timer-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border-radius: 14px;
    background: linear-gradient(90deg, #f0f8f1, #e3f2e7);
    color: #287a45;
    font-weight: 800;
}

.timer-area strong {
    font-size: 25px;
}

.timer-area.urgent {
    background: #dff0e4;
    color: #287a45;
    animation: pulse .7s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.025); }
}

/* QUESTIONS */

.question-area {
    text-align: center;
    padding: 35px 10px 25px;
}

.topic-label {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 30px;
    color: #287a45;
    background: #e3f2e7;
    font-size: 13px;
    font-weight: 800;
}

.question-area h1 {
    margin: 20px 0 12px;
    font-size: clamp(35px, 8vw, 55px);
    animation: greenText 10s linear infinite;
    overflow-wrap: anywhere;
}

.question-area p {
    color: var(--muted);
    font-size: 14px;
}

#answerForm {
    display: flex;
    gap: 10px;
    max-width: 550px;
    margin: auto;
}

#answerInput {
    width: 100%;
    min-width: 0;
    padding: 15px;
    border: 2px solid #b7dfc5;
    border-radius: 14px;
    outline: none;
    font-size: 19px;
    text-align: center;
    background: #ffffff;
    transition: .2s;
}

#answerInput:focus {
    border-color: #238348;
    box-shadow: 0 0 12px #23834822;
}

.check-button {
    white-space: nowrap;
    padding: 15px 18px;
    font-size: 14px;
}

.message {
    min-height: 28px;
    margin: 20px 0;
    text-align: center;
    font-weight: 800;
    color: #238348;
}

.message.good {
    color: #238348;
}

.message.bad {
    color: #b04444;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 17px;
    border-top: 2px solid #c7e5cf;
    color: var(--muted);
    font-size: 12px;
}

footer {
    padding: 25px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* RESULTS */

.result-card h1 {
    font-size: 34px;
    animation: greenText 10s linear infinite;
    margin: 12px 0;
}

.result-card > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 25px 0;
}

.result-stats div {
    padding: 15px 5px;
    border-radius: 15px;
    background: linear-gradient(135deg, #e3f2e7, #ffffff);
}

.result-stats strong {
    display: block;
    color: #238348;
    font-size: 23px;
}

.result-stats span {
    color: var(--muted);
    font-size: 12px;
}

.result-card .main-button {
    width: 100%;
}

/* MOBILE */

@media (max-width: 600px) {
    .game-screen {
        width: min(100% - 20px, 950px);
        padding-top: 15px;
    }

    .top-header {
        align-items: flex-start;
    }

    .stats {
        width: 100%;
        justify-content: space-between;
    }

    .stat-box {
        flex: 1;
    }

    .game-card {
        padding: 19px 14px;
    }

    .level {
        padding: 13px 5px;
    }

    .level strong {
        font-size: 13px;
    }

    #answerForm {
        flex-direction: column;
    }

    .check-button {
        width: 100%;
    }

    .welcome-card,
    .result-card {
        padding: 30px 20px;
    }

    .game-footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
