* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        "Manrope",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f8fafc;
    color: #0f172a;

    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

@font-face {
    font-family: "Manrope";
    src: url("/fonts/manrope-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/fonts/manrope-medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/fonts/manrope-semiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/fonts/manrope-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/fonts/manrope-extrabold.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


/* ========================================
   HEADER
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;

    background: rgba(255, 255, 255, 0.9);

    border-bottom: 1px solid #e2e8f0;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    max-width: 1050px;
    min-height: 70px;

    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    color: #0f172a;

    text-decoration: none;

    font-size: 22px;
    font-weight: 800;

    letter-spacing: -0.04em;
}

.logo span {
    color: #2563eb;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ========================================
   HEADER BUTTONS
======================================== */

.header-button,
.header-login-button {
    padding: 9px 15px;

    border: 1px solid #dbe3ef;
    border-radius: 9px;

    background: white;
    color: #475569;

    font-size: 13px;
    font-weight: 700;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.header-button:hover,
.header-login-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}


/* ========================================
   AUTH
======================================== */

#logged-out {
    display: flex;
    align-items: center;
}

#login-form {
    position: absolute;

    top: 62px;
    right: 24px;

    width: 360px;

    z-index: 200;
}

.auth-card {
    padding: 24px;

    background: white;

    border: 1px solid #e2e8f0;
    border-radius: 18px;

    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.13);
}

.auth-card-header h2 {
    margin: 0 0 6px;

    font-size: 20px;
    letter-spacing: -0.03em;
}

.auth-card-header p {
    margin: 0 0 20px;

    color: #64748b;

    font-size: 13px;
    line-height: 1.6;
}

#logged-out input {
    width: 100%;

    margin-bottom: 10px;
    padding: 12px 14px;

    border: 1px solid #dbe3ef;
    border-radius: 10px;

    background: #f8fafc;
    color: #0f172a;

    outline: none;
}

#logged-out input:focus {
    border-color: #2563eb;
    background: white;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 18px 0;

    color: #94a3b8;

    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #e2e8f0;
}

.google-button {
    width: 100%;

    padding: 11px 14px;

    border: 1px solid #dbe3ef;
    border-radius: 10px;

    background: white;
    color: #0f172a;

    font-size: 14px;
    font-weight: 700;
}

.google-button:hover {
    background: #f8fafc;
}

#auth-error {
    margin: 12px 0 0;

    color: #dc2626;

    font-size: 13px;
}

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

.account-email {
    max-width: 220px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #64748b;

    font-size: 13px;
}

.logout-button {
    padding: 8px 13px;

    border: 1px solid #dbe3ef;
    border-radius: 9px;

    background: white;
    color: #475569;

    font-size: 13px;
    font-weight: 700;
}

.logout-button:hover {
    background: #f8fafc;
}


/* ========================================
   MAIN
======================================== */

main {
    width: 100%;
    max-width: 1050px;

    margin: 0 auto;

    padding: 70px 24px 100px;
}


/* ========================================
   TYPOGRAPHY
======================================== */

.eyebrow {
    margin: 0 0 8px;

    color: #2563eb;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* ========================================
   PRACTICE
======================================== */

#game {
     width: 100%;
    margin: 0 auto;
    padding: 24px 36px 22px;
    border-radius: 20px;
    border-radius: 24px;

    background: white;

    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.06);
}

#game h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

#game > p {
    margin-top: 0;
    margin-bottom: 18px;
}

#question {
    margin: 20px 0;
    font-size: 2rem;
}

.answers {
    gap: 10px;
}

.answers button {
    padding: 11px 18px;
}

.practice-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 45px;
}

.practice-top h1 {
    margin: 0 0 8px;

    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;

    letter-spacing: -0.045em;
}

.practice-description {
    margin: 0;

    color: #64748b;

    font-size: 14px;
}

.level-control {
    display: flex;
    align-items: center;
    gap: 9px;

    flex-shrink: 0;
}

.level-control label {
    color: #64748b;

    font-size: 12px;
    font-weight: 700;
}

.level-control select {
    padding: 9px 30px 9px 11px;

    border: 1px solid #dbe3ef;
    border-radius: 9px;

    background: white;
    color: #0f172a;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}


/* ========================================
   PRACTICE PROGRESS
======================================== */

.practice-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 13px;

    border-bottom: 1px solid #eef2f7;

    color: #94a3b8;

    font-size: 12px;
    font-weight: 600;
}

#score {
    margin: 0;

    color: #2563eb;

    font-weight: 800;
}


/* ========================================
   QUESTION
======================================== */

.game-question {
    padding: 30px 0 52px;

    text-align: center;
}

.question-label {
    display: block;

    margin-bottom: 15px;

    color: #94a3b8;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#question {
    min-height: 80px;

    margin: 0;

    color: #0f172a;

    font-size: clamp(52px, 9vw, 78px);
    font-weight: 800;

    letter-spacing: -0.06em;
}


/* ========================================
   ANSWERS
======================================== */

.answers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

     gap: 14px;
    max-width: 720px;
    margin: 20px auto 0;
}

.answers button {
    min-height: 82px;

    border: 1px solid #dbe3ef;
    border-radius: 15px;

    background: #f8fafc;
    color: #0f172a;

    font-size: 21px;
    font-weight: 800;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.answers button:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #eff6ff;

    transform: translateY(-3px);

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.1);
}

.answers button:active:not(:disabled) {
    transform: translateY(0);
}

.answers button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.answers button.correct {
    border-color: #22c55e;

    background: #22c55e;
    color: white;
}

.answers button.incorrect {
    border-color: #ef4444;

    background: #ef4444;
    color: white;
}

#question.correct {
    color: #16a34a;
}

#question.incorrect {
    color: #dc2626;
}

.game-hint {
    margin: 24px 0 0;

    color: #94a3b8;

    text-align: center;

    font-size: 12px;
}


/* ========================================
   MODAL
======================================== */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 500;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0.45);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.stats-modal {
    width: 100%;
    max-width: 510px;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    padding: 28px;

    border: 1px solid #e2e8f0;
    border-radius: 20px;

    background: white;

    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.2);

    animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0;

    font-size: 25px;
    letter-spacing: -0.04em;
}

.close-button {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 9px;

    background: #f8fafc;
    color: #64748b;

    font-size: 22px;
    line-height: 1;
}

.close-button:hover {
    background: #f1f5f9;
    color: #0f172a;
}


/* ========================================
   MODAL STATS
======================================== */

.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-bottom: 30px;
}

.modal-stat {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 15px;

    border: 1px solid #eef2f7;
    border-radius: 13px;

    background: #f8fafc;
}

.modal-stat-icon {
    width: 35px;
    height: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    font-size: 14px;
}

.purple-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.modal-stat strong {
    display: block;

    font-size: 20px;
    font-weight: 800;

    line-height: 1.1;
}

.modal-stat div span {
    display: block;

    margin-top: 3px;

    color: #64748b;

    font-size: 11px;
    font-weight: 600;
}


/* ========================================
   MODAL PROGRESS
======================================== */

.stats-progress {
    width: 100%;
    padding-top: 25px;
    border-top: 1px solid #eef2f7;
}

.stats-progress-header {
    margin-bottom: 22px;
}

.stats-progress-header h3 {
    margin: 0;

    font-size: 16px;
}

.stats-level {
    margin-bottom: 19px;
}

.stats-level:last-child {
    margin-bottom: 0;
}

.stats-level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;

    font-size: 12px;
}

.stats-level-header span {
    color: #64748b;
}

.progress-bar {
    width: 100%;
    height: 8px;

    overflow: hidden;

    border-radius: 999px;

    background: #e2e8f0;
}

.progress-fill {
    width: 0%;
    height: 100%;

    border-radius: 999px;

    background: #2563eb;

    transition: width 0.5s ease;
}


/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 700px) {

    .header-inner {
        padding: 0 18px;
    }

    .account-email {
        display: none;
    }

    main {
        padding: 35px 16px 60px;
    }

  #game {
    width: 100%;
    margin: 0 auto;
    padding: 20px 18px 20px;
    border-radius: 20px;
}

    .practice-top {
    gap: 12px;
    margin-bottom: 20px;
}

.level-control {
    width: auto;
    justify-content: flex-start;
}

.level-control select {
    flex: none;
}

   .game-question {
    padding: 20px 0 100px;
}

.question-label {
    margin-bottom: 10px;
}

#question {
    min-height: 70px;
}

   .answers {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.answers button {
    min-height: 60px;
    padding: 10px 5px;
    font-size: 18px;
}

    #login-form {
        position: fixed;

        top: 70px;
        left: 14px;
        right: 14px;

        width: auto;
    }

}


@media (max-width: 450px) {

    .header-button,
    .header-login-button {
        padding: 8px 11px;
    }

    .logo {
        font-size: 19px;
    }

    .modal-stats {
        grid-template-columns: 1fr;
    }

    .stats-modal {
        padding: 22px;
    }

    .auth-buttons {
        grid-template-columns: 1fr;
    }

}


.header-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-streak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.modal-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.modal-stat-link:hover {
    transform: translateY(-1px);
}

/* ========================================
   REVIEW PAGE
======================================== */

.review-page {
    max-width: 820px;
    padding-top: 65px;
}


/* ----------------------------------------
   REVIEW HEADING
---------------------------------------- */

.review-heading {
    margin-bottom: 35px;
}

.review-heading h1 {
    margin: 0 0 8px;

    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;

    letter-spacing: -0.045em;
}

.review-heading #status {
    margin: 0;

    color: #64748b;

    font-size: 14px;
}


/* ----------------------------------------
   REVIEW CARD
---------------------------------------- */

.review-card {
    width: 100%;

    padding: 24px 36px 30px;

    border: 1px solid #eef2f7;
    border-radius: 24px;

    background: white;

    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.06);
}


/* ----------------------------------------
   CARD HEADER
---------------------------------------- */

.review-card-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding-bottom: 13px;

    border-bottom: 1px solid #eef2f7;

    color: #94a3b8;

    font-size: 12px;
    font-weight: 700;
}

.review-card-header #progress {
    color: #2563eb;
}


/* ----------------------------------------
   REVIEW QUESTION
---------------------------------------- */

.review-question {
    padding: 60px 0 50px;

    text-align: center;
}

.review-question .question-label {
    display: block;

    margin-bottom: 15px;

    color: #94a3b8;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#word {
    min-height: 80px;

    margin: 0;

    color: #0f172a;

    font-size: clamp(52px, 9vw, 78px);
    font-weight: 800;

    letter-spacing: -0.06em;
}


/* ----------------------------------------
   REVIEW ANSWERS
---------------------------------------- */

.answer-buttons {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 14px;

    max-width: 720px;

    margin: 0 auto;
}

.answer-buttons button {
    min-height: 82px;

    border: 1px solid #dbe3ef;
    border-radius: 15px;

    background: #f8fafc;
    color: #0f172a;

    font-size: 21px;
    font-weight: 800;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.answer-buttons button:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #eff6ff;

    transform: translateY(-3px);

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.1);
}

.answer-buttons button:active:not(:disabled) {
    transform: translateY(0);
}

.answer-buttons button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}


/* ----------------------------------------
   FEEDBACK
---------------------------------------- */

.review-feedback {
    min-height: 22px;

    margin: 22px 0 0;

    text-align: center;

    color: #64748b;

    font-size: 13px;
    font-weight: 700;
}


/* ----------------------------------------
   COMPLETE STATE
---------------------------------------- */

.review-complete {
    padding: 65px 30px;

    border: 1px solid #eef2f7;
    border-radius: 24px;

    background: white;

    text-align: center;

    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.06);
}

.complete-icon {
    width: 52px;
    height: 52px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #f0fdf4;
    color: #16a34a;

    font-size: 24px;
    font-weight: 800;
}

.review-complete h2 {
    margin: 0 0 8px;

    font-size: 30px;

    letter-spacing: -0.04em;
}

.review-complete > p:not(.eyebrow) {
    margin: 0 0 25px;

    color: #64748b;

    font-size: 14px;
}

.review-home-button {
    display: inline-block;

    padding: 11px 17px;

    border-radius: 9px;

    background: #2563eb;
    color: white;

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.review-home-button:hover {
    background: #1d4ed8;

    transform: translateY(-1px);
}


/* ----------------------------------------
   REVIEW RESPONSIVE
---------------------------------------- */

@media (max-width: 700px) {

    .review-page {
        padding-top: 35px;
    }

    .review-heading {
        margin-bottom: 25px;
    }

    .review-card {
        padding: 20px 20px 25px;

        border-radius: 20px;
    }

    .review-question {
        padding: 50px 0 40px;
    }

    .answer-buttons {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .answer-buttons button {
        min-height: 64px;
    }

    .review-complete {
        padding: 50px 20px;
    }

}

.header-button.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.logo {
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #0f172a;
    text-decoration: none;
}

.logo span {
    font-family: inherit;
    font-weight: 800;
    color: #2563eb;
}

.primary-button,
.secondary-button {
    padding: 11px 14px;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.primary-button {
    border: 1px solid #2563eb;

    background: #2563eb;
    color: white;
}

.primary-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;

    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid #dbe3ef;

    background: white;
    color: #475569;
}

.secondary-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;

    transform: translateY(-1px);
}

/* ========================================
   FOOTER
======================================== */

.site-footer {
    width: 100%;
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.site-footer-inner {
    max-width: 1050px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    color: #94a3b8;
    font-size: 12px;
}

.site-footer a {
    color: #64748b;
    text-decoration: none;
}

.site-footer a:hover {
    color: #2563eb;
}

@media (max-width: 450px) {
    .site-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}