.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-top: 40px;
    align-items: start;
    padding: 40px 20px;
}

.quiz-main {
    min-width: 0;
}

.start-screen,
.quiz-box,
.ranking-box {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, .05),
            rgba(255, 255, 255, .02));

    border:
        1px solid rgba(255, 255, 255, .08);

    border-radius: 28px;

    backdrop-filter:
        blur(18px) saturate(180%);

    box-shadow:
        0 10px 40px rgba(0, 0, 0, .35);

    position: relative;
}

.start-screen {
    overflow: visible;
}

.quiz-top-bar {
    position: relative;
    z-index: 200;
}

.start-screen::before,
.quiz-box::before,
.ranking-box::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(circle at top left,
            rgba(123, 44, 255, .18),
            transparent 40%);

    pointer-events: none;
}

.start-screen {
    padding: 50px 40px;
    text-align: center;
}

.quiz-header {
    margin-bottom: 30px;
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 16px;

    border-radius: 999px;

    background:
        rgba(123, 44, 255, .18);

    border:
        1px solid rgba(123, 44, 255, .35);

    font-size: 14px;
    font-weight: 600;

    margin-bottom: 20px;
}

.quiz-header h2 {
    font-size: 42px;
    font-weight: 800;

    margin-bottom: 10px;

    color: #fff;
}

.quiz-header p {
    color: rgba(255, 255, 255, .65);

    font-size: 16px;
    line-height: 1.6;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.quiz-actions button,
.modal-box button {
    padding: 14px 24px;

    border: none;
    border-radius: 16px;

    background:
        linear-gradient(90deg,
            #7b2cff,
            #00d4ff);

    color: #fff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform .2s ease,
        opacity .2s ease;
}

.quiz-actions button:hover,
.modal-box button:hover {
    transform: translateY(-2px);
    opacity: .92;
}

.quiz-box {
    padding: 30px;
}

.quiz-top {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 25px;
    gap: 15px;
}

.quiz-mini-badge {
    padding: 8px 14px;

    border-radius: 999px;

    background:
        rgba(0, 212, 255, .12);

    border:
        1px solid rgba(0, 212, 255, .25);

    font-size: 14px;
    font-weight: 600;
}

#quiz-progress {
    color: rgba(255, 255, 255, .65);
    font-size: 14px;
}

#quiz-question {
    font-size: 30px;
    line-height: 1.3;

    margin-bottom: 30px;

    color: #fff;
}

#quiz-options {
    display: grid;
    gap: 14px;
}

.quiz-option {
    width: 100%;

    padding: 18px 20px;

    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .08);

    background:
        rgba(255, 255, 255, .04);

    color: #fff;

    text-align: left;

    font-size: 16px;
    font-weight: 500;

    cursor: pointer;

    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease;
}

.quiz-option:hover {
    transform: translateY(-2px);

    border-color:
        rgba(123, 44, 255, .45);

    background:
        rgba(123, 44, 255, .12);
}

.quiz-option.correct {
    background:
        rgba(34, 197, 94, .18);

    border-color:
        rgba(34, 197, 94, .5);
}

.quiz-option.wrong {
    background:
        rgba(239, 68, 68, .18);

    border-color:
        rgba(239, 68, 68, .5);
}

.ranking-box {
    padding: 24px;
    position: sticky;
    top: 20px;
}

.ranking-title {
    font-size: 24px;
    font-weight: 800;

    margin-bottom: 20px;
}

#ranking {
    list-style: none;
    padding: 0;
    margin: 0;
}

#ranking li {
    padding: 12px 14px;

    border-radius: 14px;

    margin-bottom: 10px;

    background:
        rgba(255, 255, 255, .04);

    color: rgba(255, 255, 255, .85);

    border:
        1px solid rgba(255, 255, 255, .05);
}

.modal-overlay {
    position: fixed;
    inset: 0;

    background:
        rgba(0, 0, 0, .7);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    width: 90%;
    max-width: 460px;

    padding: 35px;

    text-align: center;

    background:
        linear-gradient(180deg,
            rgba(20, 0, 40, .98),
            rgba(10, 0, 20, .98));

    border:
        1px solid rgba(123, 44, 255, .25);

    border-radius: 28px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .45);
}

.modal-box h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.modal-box p {
    color: rgba(255, 255, 255, .72);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}


.quiz-top-bar {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 16px;

    flex-wrap: wrap;

    margin-top: 30px;

    position: relative;
    z-index: 20;
}

.quiz-top-bar .custom-select {
    position: relative;

    width: 220px;

    user-select: none;

    z-index: 100;
}

.quiz-top-bar .select-selected {
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 18px;

    border-radius: 16px;

    background:
        linear-gradient(90deg,
            #7b2cff,
            #00d4ff);

    color: #fff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 0 20px rgba(123, 44, 255, .35);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.quiz-top-bar .select-selected:hover {
    transform: translateY(-2px);

    box-shadow:
        0 0 30px rgba(0, 212, 255, .45);
}

.quiz-top-bar .select-items {
    position: absolute;

    top: calc(100% + 10px);
    left: 0;
    right: 0;

    display: flex;
    flex-direction: column;

    gap: 6px;

    padding: 10px;

    border-radius: 18px;

    background:
        rgba(10, 0, 30, .98);

    border:
        1px solid rgba(123, 44, 255, .25);

    backdrop-filter:
        blur(20px);

    box-shadow:
        0 20px 40px rgba(0, 0, 0, .45);

    z-index: 300;

    animation:
        dropdownFade .18s ease;
}

.quiz-top-bar .select-items div {
    display: flex;
    align-items: center;

    min-height: 46px;

    padding: 12px 14px;

    border-radius: 14px;

    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.quiz-top-bar .select-items div:hover {
    background:
        rgba(123, 44, 255, .18);

    transform: translateX(2px);
}

.quiz-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quiz-actions button {
    min-width: 160px;
    height: 52px;

    border-radius: 16px;

    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 600px) {

    .quiz-top-bar {
        flex-direction: column;
        align-items: center;
    }

    .quiz-top-bar .custom-select {
        width: 100%;
    }

    .quiz-actions {
        width: 100%;
    }

    .quiz-actions button {
        width: 100%;
    }
}


@media (max-width: 980px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .ranking-box {
        position: relative;
        top: 0;
    }
}

@media (max-width: 600px) {

    .start-screen,
    .quiz-box,
    .ranking-box {
        padding: 20px;
        border-radius: 22px;
    }

    .quiz-header h2 {
        font-size: 30px;
    }

    #quiz-question {
        font-size: 22px;
    }

    .quiz-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {

    .quiz-layout {
        display: flex;
        flex-direction: column;

        gap: 18px;

        margin-top: 20px;
    }

    .quiz-main {
        width: 100%;
    }

    .start-screen,
    .quiz-box,
    .ranking-box {
        width: 100%;

        padding: 18px;

        border-radius: 22px;
    }

    .start-screen {
        overflow: visible;
    }

    .quiz-header {
        margin-bottom: 22px;
    }

    .quiz-header h2 {
        font-size: 34px;

        line-height: 1.1;

        margin-bottom: 12px;
    }

    .quiz-header p {
        font-size: 14px;
        line-height: 1.5;
    }

    .quiz-badge {
        font-size: 12px;
        padding: 7px 12px;
    }

    .quiz-top-bar {
        flex-direction: column;

        align-items: stretch;

        gap: 14px;

        margin-top: 20px;
    }

    .quiz-top-bar .custom-select {
        width: 100%;
        z-index: auto;
    }

    .quiz-top-bar .select-selected {
        width: 100%;
        height: 50px;

        font-size: 15px;
    }

    .quiz-top-bar .select-items {
        position: relative;

        top: 10px;
        left: 0;
        right: 0;

        margin-bottom: 10px;

        z-index: auto;
    }

    .quiz-actions {
        width: 100%;

        display: flex;
        flex-direction: column;

        gap: 12px;
    }

    .quiz-actions button {
        width: 100%;
        min-width: unset;

        height: 50px;

        font-size: 15px;
    }

    .quiz-box {
        padding: 20px;
    }

    .quiz-top {
        flex-direction: column;
        align-items: flex-start;

        gap: 12px;

        margin-bottom: 20px;
    }

    #quiz-question {
        font-size: 24px;

        line-height: 1.35;

        margin-bottom: 20px;
    }

    #quiz-options {
        gap: 10px;
    }

    .quiz-option {
        padding: 16px;

        border-radius: 16px;

        font-size: 15px;

        line-height: 1.4;
    }

    .ranking-box {
        position: relative;

        top: 0;

        padding: 18px;
    }

    .ranking-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    #ranking li {
        padding: 12px;

        border-radius: 14px;

        font-size: 13px;
    }

    .modal-box {
        width: calc(100% - 20px);

        padding: 24px;

        border-radius: 24px;
    }

    .modal-box h2 {
        font-size: 26px;
    }

    .modal-box p {
        font-size: 14px;
    }

}

.container h1 {
    padding-top: 70px;
}

@media (max-width: 768px) {
    .container h1 {
        --header-height: 70px;
    }
}