:root {
    --navy-950: #07152f;
    --navy-900: #0b1f44;
    --navy-800: #123365;
    --blue-600: #1f65e6;
    --blue-500: #347cff;
    --cyan-400: #38d4f2;
    --gold-400: #ffd45a;
    --white: #ffffff;
    --surface: #f4f7fc;
    --surface-blue: #eaf1ff;
    --text: #14213d;
    --muted: #65728b;
    --border: #dce4f1;
    --shadow: 0 18px 45px rgba(7, 21, 47, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--text);
    font-family: "Nunito", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(7, 21, 47, 0.96);
    color: var(--white);
    backdrop-filter: blur(14px);
}

.header-content {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.logo {
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.logo span {
    color: var(--gold-400);
}

.main-navigation,
.account-navigation {
    display: flex;
    align-items: center;
    gap: 22px;
}

.main-navigation a,
.account-navigation a {
    color: #dbe7ff;
    font-size: 0.94rem;
    font-weight: 800;
}

.main-navigation a:hover,
.account-navigation a:hover {
    color: var(--gold-400);
}

.register-link,
.account-navigation .register-link {
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--gold-400);
    color: var(--navy-950);
}

#logoutButton {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: transparent;
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
}

/* Hero */
.quiz-hero {
    position: relative;
    overflow: hidden;
    padding: 86px 0 92px;
    background:
        radial-gradient(circle at 82% 16%, rgba(56, 212, 242, 0.2), transparent 28%),
        radial-gradient(circle at 12% 90%, rgba(52, 124, 255, 0.26), transparent 34%),
        linear-gradient(135deg, var(--navy-950), var(--navy-800));
    color: var(--white);
}

.quiz-hero::after {
    position: absolute;
    right: -120px;
    bottom: -190px;
    width: 440px;
    height: 440px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, 0.025),
        0 0 0 110px rgba(255, 255, 255, 0.018);
    content: "";
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
    align-items: center;
    gap: 70px;
}

.eyebrow,
.daily-label {
    margin: 0 0 12px;
    color: var(--cyan-400);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.hero-copy h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.7rem, 6vw, 5.2rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.hero-description {
    max-width: 680px;
    margin: 26px 0 0;
    color: #c9d8f4;
    font-size: 1.12rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 32px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 11px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
    background: var(--gold-400);
    color: var(--navy-950);
    box-shadow: 0 12px 25px rgba(255, 212, 90, 0.22);
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.hero-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
    margin-top: 42px;
}

.hero-statistics div {
    display: flex;
    flex-direction: column;
}

.hero-statistics strong {
    color: var(--white);
    font-size: 1.65rem;
    line-height: 1.1;
}

.hero-statistics span {
    margin-top: 5px;
    color: #aebfdf;
    font-size: 0.85rem;
    font-weight: 700;
}

.daily-challenge-card {
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
}

.daily-icon {
    display: grid;
    width: 74px;
    height: 74px;
    margin-bottom: 22px;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--gold-400), #ffad3d);
    font-size: 2.5rem;
    box-shadow: 0 12px 30px rgba(255, 188, 61, 0.25);
}

.daily-challenge-card h2 {
    margin: 0 0 12px;
    font-size: 1.8rem;
}

.daily-challenge-card > p:not(.daily-label) {
    margin: 0 0 24px;
    color: #d1dff7;
}

.daily-challenge-card > a {
    display: inline-flex;
    color: var(--gold-400);
    font-weight: 900;
}

/* Featured categories */
.featured-section {
    padding: 78px 0 88px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.section-heading h2,
.competition-section h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.featured-section .eyebrow,
.competition-section .eyebrow {
    color: var(--blue-600);
}

.view-all-link {
    color: var(--blue-600);
    font-weight: 900;
}

.featured-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 155px;
    align-items: center;
    gap: 17px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(7, 21, 47, 0.06);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: #a9c4ff;
    box-shadow: var(--shadow);
}

.category-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 16px;
    background: var(--surface-blue);
    font-size: 1.8rem;
}

.category-card h3 {
    margin: 0 0 7px;
    color: var(--navy-950);
    font-size: 1.08rem;
}

.category-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.category-arrow {
    color: var(--blue-600);
    font-size: 1.4rem;
    font-weight: 900;
}

/* Competition */
.competition-section {
    padding: 72px 0;
    background: var(--white);
}

.competition-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 55px;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #f7faff, #edf4ff);
}

.competition-layout > div:first-child {
    max-width: 680px;
}

.competition-layout p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
}

.competition-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    flex-direction: column;
    gap: 14px;
}

.competition-actions .primary-button {
    background: var(--blue-600);
    color: var(--white);
    box-shadow: 0 12px 25px rgba(31, 101, 230, 0.2);
}

.text-link {
    color: var(--blue-600);
    font-size: 0.9rem;
    font-weight: 900;
}

/* Footer */
.main-footer {
    padding: 58px 0 20px;
    background: var(--navy-950);
    color: #c4d1e8;
}

.footer-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 55px;
}

.footer-logo {
    display: inline-block;
    color: var(--white);
}

.footer-layout p {
    color: #93a6c8;
}

.footer-layout h3 {
    margin: 0 0 15px;
    color: var(--white);
}

.footer-layout > div > a:not(.logo) {
    display: block;
    margin: 9px 0;
    color: #aebddb;
}

.footer-layout > div > a:hover {
    color: var(--gold-400);
}

.copyright {
    margin: 42px 0 0;
    padding-top: 19px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #8295b8;
    font-size: 0.88rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 980px) {
    .header-content {
        padding: 13px 0;
        flex-wrap: wrap;
    }

    .main-navigation {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding: 8px 0 2px;
    }

    .main-navigation a {
        white-space: nowrap;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .daily-challenge-card {
        max-width: 650px;
    }

    .featured-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 26px, 1180px);
    }

    .main-header {
        position: static;
    }

    .account-navigation {
        gap: 11px;
    }

    .account-navigation a {
        font-size: 0.88rem;
    }

    .quiz-hero {
        padding: 58px 0 64px;
    }

    .hero-copy h1 {
        font-size: clamp(2.55rem, 14vw, 4rem);
    }

    .hero-actions,
    .hero-actions a {
        width: 100%;
    }

    .hero-statistics {
        justify-content: space-between;
        gap: 15px;
    }

    .daily-challenge-card {
        padding: 26px;
    }

    .featured-section,
    .competition-section {
        padding: 58px 0;
    }

    .section-heading,
    .competition-layout {
        align-items: flex-start;
        flex-direction: column;
    }

    .featured-category-grid,
    .footer-layout {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 135px;
        padding: 19px;
    }

    .competition-layout {
        padding: 27px 22px;
    }

    .competition-actions,
    .competition-actions .primary-button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .header-content {
        gap: 15px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .register-link,
    .account-navigation .register-link {
        padding: 8px 12px;
    }

    .hero-statistics strong {
        font-size: 1.4rem;
    }

    .hero-statistics span {
        font-size: 0.75rem;
    }

    .category-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .category-arrow {
        display: none;
    }
}


/* =====================================================
   QUIZ TIMER PROGRESS BAR
===================================================== */

#questionTimer {
    display: flex;
    min-width: 230px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #d8e2f1;
    border-radius: 16px;
    background: #ffffff;
    color: var(--navy-950);
    flex-wrap: wrap;
    box-shadow: 0 7px 20px rgba(7, 21, 47, 0.08);
}

#questionTimer > div:first-of-type {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#timerLabel {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

#timerValue {
    color: var(--blue-600);
    font-size: 1.25rem;
    line-height: 1;
}

.quiz-timer-progress {
    position: relative;
    overflow: hidden;
    flex: 0 0 100%;
    width: 100%;
    min-width: 190px;
    height: 27px;
    margin-top: 9px;
    border: 1px solid #cbd6e7;
    border-radius: 999px;
    background: #dfe6f1;
    box-shadow: inset 0 1px 3px rgba(7, 21, 47, 0.18);
}

.quiz-timer-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #159554, #55d68d);
    transition: width 0.35s linear, background 0.2s ease;
}

.quiz-timer-progress-text {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    place-items: center;
    color: #07152f;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.85);
}

#questionTimer.timer-warning .quiz-timer-progress-fill {
    background: linear-gradient(90deg, #d92828, #ff7373);
}

#questionTimer.timer-warning .quiz-timer-progress-text {
    color: #700b0b;
}

#questionTimer.timer-warning {
    border-color: #ef7777;
    animation: timer-warning-pulse 0.75s ease-in-out infinite alternate;
}

#questionTimer.timer-warning #timerValue {
    color: #c91f1f;
}

@keyframes timer-warning-pulse {
    from { box-shadow: 0 0 0 0 rgba(217, 40, 40, 0.12); }
    to { box-shadow: 0 0 0 7px rgba(217, 40, 40, 0.04); }
}

@media (max-width: 600px) {
    .quiz-timer-progress {
        min-width: 145px;
    }

    #questionTimer {
        width: 100%;
        min-width: 0;
    }
}

/* =====================================================
   CATEGORIES PAGE
===================================================== */

.main-navigation a.active {
    color: var(--gold-400);
}

.categories-page {
    min-height: 70vh;
}

.categories-introduction {
    overflow: hidden;
    padding: 58px 0;
    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(56, 212, 242, 0.18),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            var(--navy-950),
            var(--navy-800)
        );
    color: var(--white);
}

.categories-introduction-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 45px;
}

.categories-introduction-layout > div {
    max-width: 720px;
}

.categories-introduction h1 {
    margin: 5px 0 12px;
    font-size: clamp(2.3rem, 6vw, 4rem);
    line-height: 1.08;
}

.categories-introduction p:not(.eyebrow) {
    max-width: 680px;
    margin: 0;
    color: #d8e5fb;
    font-size: 1.08rem;
}

.daily-category-button {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 14px;
    min-width: 245px;
    padding: 17px 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 900;
    line-height: 1.25;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.daily-category-button:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.19);
}

.daily-category-button > span:first-child {
    font-size: 2.3rem;
}

.daily-category-button small {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-400);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.category-browser {
    padding: 46px 0 80px;
}

.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.category-search {
    display: flex;
    width: min(540px, 100%);
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 0 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow:
        0 8px 24px
        rgba(7, 21, 47, 0.06);
}

.category-search span {
    color: var(--blue-600);
    font-size: 1.6rem;
    font-weight: 900;
}

.category-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.category-search input::placeholder {
    color: #8995aa;
}

.category-search:focus-within {
    border-color: var(--blue-500);
    box-shadow:
        0 0 0 4px
        rgba(52, 124, 255, 0.12);
}

.category-count {
    color: var(--muted);
    white-space: nowrap;
}

.category-count strong {
    color: var(--navy-900);
    font-size: 1.2rem;
}

.category-filter-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}
/* =====================================================
   CATEGORY CARD GRID
===================================================== */

.all-category-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.quiz-category-card {
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr);
    gap: 17px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--white);
    box-shadow:
        0 9px 28px
        rgba(7, 21, 47, 0.07);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.quiz-category-card:hover {
    transform: translateY(-4px);
    border-color: #b8cae8;
    box-shadow:
        0 16px 35px
        rgba(7, 21, 47, 0.12);
}

.quiz-category-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 15px;
    background: var(--surface-blue);
    font-size: 1.85rem;
}

.quiz-category-content {
    min-width: 0;
}

.quiz-category-group {
    color: var(--blue-600);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.quiz-category-content h2 {
    margin: 3px 0 6px;
    color: var(--navy-900);
    font-size: 1.2rem;
    line-height: 1.25;
}

.quiz-category-content > p {
    min-height: 48px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.5;
}


/* =====================================================
   CATEGORY PROGRESS
===================================================== */

.category-progress-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
}

.category-progress-row strong {
    color: var(--navy-800);
}

.category-progress-track {
    overflow: hidden;
    height: 7px;
    margin-bottom: 17px;
    border-radius: 999px;
    background: #e6ebf4;
}

.category-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            var(--blue-600),
            var(--cyan-400)
        );
}

/* =====================================================
   WORLD QUIZ IMAGE LOGO
===================================================== */

.image-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.image-logo img {
    display: block;
    width: 210px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.main-header .image-logo img {
    width: 190px;
}

.main-footer .image-logo img {
    width: 200px;
}

@media (max-width: 768px) {
    .main-header .image-logo img {
        width: 155px;
    }

    .main-footer .image-logo img {
        width: 170px;
    }
}
/* =====================================================
   CATEGORY PLAY BUTTON
===================================================== */

.category-play-button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 13px;
    border-radius: 9px;
    background: var(--navy-900);
    color: var(--white);
    font-size: 0.87rem;
    font-weight: 900;
    transition:
        background 0.2s ease;
}

.category-play-button:hover {
    background: var(--blue-600);
}


/* =====================================================
   CATEGORY ROUND SELECTOR
===================================================== */

.category-round-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-round-button {
    display: flex;
    min-height: 53px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--navy-900);
    color: var(--white);
    text-align: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.category-round-button:hover {
    transform: translateY(-2px);
    background: var(--blue-600);
}

.category-round-button strong {
    font-size: 0.82rem;
}

.category-round-button small {
    font-size: 0.68rem;
    font-weight: 800;
}

.category-round-button.completed {
    border-color: #9ad6b4;
    background: #147a43;
}

.category-round-button.replay {
    border-color: #f2bd55;
    background: #9a5b00;
}

.category-round-button.locked {
    cursor: not-allowed;
    border-color: #d9dee8;
    background: #edf0f5;
    color: #788397;
    opacity: 0.82;
}

.category-round-button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}


/* =====================================================
   LOADING AND EMPTY STATES
===================================================== */

.category-empty-state,
.category-loading {
    grid-column: 1 / -1;
    padding: 55px 20px;
    border: 1px dashed #b9c7dc;
    border-radius: 16px;
    background: var(--white);
    color: var(--muted);
    text-align: center;
}

.category-empty-state span {
    font-size: 3rem;
}

.category-empty-state h2 {
    margin: 8px 0 3px;
    color: var(--navy-900);
}

.category-empty-state p {
    margin: 0;
}


/* =====================================================
   TABLET CATEGORIES
===================================================== */

@media (max-width: 1040px) {

    .all-category-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =====================================================
   MOBILE CATEGORIES
===================================================== */

@media (max-width: 760px) {

    .categories-introduction {
        padding: 42px 0;
    }

    .categories-introduction-layout,
    .category-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-category-button,
    .category-search {
        width: 100%;
    }

    .category-count {
        white-space: normal;
    }

    .all-category-grid {
        grid-template-columns: 1fr;
    }

}


/* =====================================================
   SMALL MOBILE CATEGORIES
===================================================== */

@media (max-width: 430px) {

    .category-browser {
        padding: 32px 0 58px;
    }

    .quiz-category-card {
        gap: 13px;
        padding: 17px;
    }

    .quiz-category-icon {
        width: 46px;
        height: 46px;
        font-size: 1.55rem;
    }

    .quiz-category-content > p {
        min-height: 0;
    }

}    