* {
    box-sizing: border-box;
}

html,
body {

    margin: 0;
    padding: 0;

    min-height: 100%;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #0b0b12;

    color: white;
}


/* =====================================
   START SCREEN
===================================== */

#startScreen {

    position: fixed;

    inset: 0;

    width: 100vw;
    height: 100vh;

    display: flex;

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

    text-align: center;

    background:
        radial-gradient(
            circle at center,
            #292941,
            #0b0b12 70%
        );

    z-index: 999999;

    transition:
        opacity .6s ease,
        transform .6s ease;
}


.startContent h1 {

    margin: 0;

    font-size:
        clamp(
            50px,
            9vw,
            90px
        );

    letter-spacing: -4px;
}


.startContent p {

    color: #888;

    margin:
        15px 0 35px;
}


#startButton {

    border: none;

    padding:
        18px 65px;

    border-radius: 14px;

    background: white;

    color: #111;

    font-size: 18px;

    font-weight: 800;

    cursor: pointer;

    transition: .2s;
}


#startButton:hover {

    transform:
        translateY(-4px)
        scale(1.03);
}


/* =====================================
   APP
===================================== */

#app {

    display: none;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #24243a,
            #0b0b12 70%
        );
}


#app.active {

    display: block;
}


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

header {

    height: 75px;

    padding:
        0 30px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid
        rgba(255,255,255,.08);
}


.logo {

    font-size: 22px;

    font-weight: 800;
}


.headerButtons {

    display: flex;

    gap: 10px;
}


.headerButton {

    border:
        1px solid
        rgba(255,255,255,.1);

    background:
        rgba(255,255,255,.06);

    color: white;

    padding:
        10px 14px;

    border-radius: 10px;

    cursor: pointer;

    transition: .2s;
}


.headerButton:hover {

    background:
        rgba(255,255,255,.12);

    transform: translateY(-1px);
}


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

main {

    max-width: 800px;

    margin:
        65px auto;

    padding:
        20px;

    text-align: center;
}


.counter {

    color: #777;

    font-size: 14px;

    margin-bottom: 15px;
}


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

.questionCard {

    padding:
        55px 45px;

    border-radius: 25px;

    background:
        rgba(255,255,255,.055);

    border:
        1px solid
        rgba(255,255,255,.1);

    box-shadow:
        0 25px 80px
        rgba(0,0,0,.3);
}


.category {

    display: inline-block;

    padding:
        7px 13px;

    border-radius: 50px;

    background:
        rgba(120,90,255,.18);

    color: #a995ff;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 1px;

    margin-bottom: 25px;
}


#question {

    font-size:
        clamp(
            28px,
            5vw,
            46px
        );

    line-height: 1.15;

    margin:
        0 auto 45px;
}


/* =====================================
   VOTE BUTTONS
===================================== */

.voteButtons {

    display: flex;

    gap: 15px;
}


.vote {

    flex: 1;

    padding: 18px;

    border: none;

    border-radius: 14px;

    color: white;

    font-size: 16px;

    font-weight: bold;

    cursor: pointer;

    transition:
        transform .2s ease,
        opacity .2s ease;
}


.vote:hover {

    transform:
        translateY(-3px);
}


.vote:disabled {

    opacity: .4;

    transform: none;

    cursor: default;
}


.agree {

    background: #20a464;
}


.disagree {

    background: #d84848;
}


/* =====================================
   RESULTS
===================================== */

.results {

    margin-top: 35px;

    animation:
        resultAppear .6s ease;
}


@keyframes resultAppear {

    from {

        opacity: 0;

        transform:
            translateY(15px)
            scale(.97);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


.hidden {

    display: none !important;
}


.resultTitle {

    color: #888;

    margin-bottom: 30px;
}


/* =====================================
   DONUT RESULT
===================================== */

.donutResult {

    display: grid;

    grid-template-columns:
        1fr
        180px
        1fr;

    align-items: center;

    gap: 25px;

    max-width: 600px;

    margin:
        0 auto;
}


/* =====================================
   SIDE PERCENTAGES
===================================== */

.sidePercentage {

    display: flex;

    flex-direction: column;

    gap: 7px;
}


.sidePercentage strong {

    font-size: 34px;

    line-height: 1;

}


.sidePercentage span {

    color: #888;

    font-size: 13px;

}


.leftPercentage {

    text-align: right;
}


.rightPercentage {

    text-align: left;
}


/* =====================================
   DONUT
===================================== */

.donutWrapper {

    width: 180px;

    height: 180px;

    display: flex;

    align-items: center;

    justify-content: center;
}


.donut {

    width: 180px;

    height: 180px;

    border-radius: 50%;

    /*
       The JS changes this dynamically.
    */

    background:
        conic-gradient(
            from 0deg,
            #20a464 0deg,
            #20a464 180deg,
            #d84848 180deg,
            #d84848 360deg
        );

    display: flex;

    align-items: center;

    justify-content: center;

    position: relative;

    transform: rotate(0deg);

    transition:
        background 1.2s
        cubic-bezier(.22,1,.36,1);

    box-shadow:
        0 0 45px
        rgba(255,255,255,.06);
}


/* EMPTY CENTER */

.donut::before {

    content: "";

    position: absolute;

    width: 125px;

    height: 125px;

    border-radius: 50%;

    background: #191923;

}


.donutCenter {

    position: relative;

    z-index: 2;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;
}


.donutCenter span {

    font-size: 10px;

    letter-spacing: 1.5px;

    color: #777;

}


.donutCenter strong {

    font-size: 28px;

    margin-top: 3px;
}


/* =====================================
   VOTE COUNT
===================================== */

.voteCount {

    color: #777;

    font-size: 13px;

    margin-top: 25px;
}


.resultMessage {

    color: #aaa;

    min-height: 20px;
}


/* =====================================
   NEXT
===================================== */

.nextButton {

    margin-top: 25px;

    padding:
        15px 25px;

    border: none;

    border-radius: 12px;

    background: white;

    color: #111;

    font-weight: bold;

    cursor: pointer;

    transition: .2s;
}


.nextButton:hover {

    transform:
        translateY(-2px)
        scale(1.02);
}


/* =====================================
   MODALS
===================================== */

.modal {

    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(0,0,0,.75);

    z-index: 10000;

    padding: 20px;
}


.modalBox,
.leaderboardBox {

    position: relative;

    width:
        min(430px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    padding: 35px;

    border-radius: 22px;

    background: #191923;

    border:
        1px solid
        rgba(255,255,255,.1);
}


.leaderboardBox {

    width:
        min(550px, 100%);
}


.closeButton {

    position: absolute;

    right: 15px;

    top: 12px;

    border: none;

    background: none;

    color: #888;

    font-size: 28px;

    cursor: pointer;
}


.closeButton:hover {

    color: white;
}


.modalDescription {

    color: #888;

    margin-bottom: 25px;
}


/* =====================================
   GOOGLE
===================================== */

.googleButton {

    width: 100%;

    padding: 15px;

    border: none;

    border-radius: 12px;

    background: white;

    color: #111;

    font-weight: bold;

    font-size: 15px;

    cursor: pointer;
}


.googleIcon {

    margin-right: 8px;

    font-weight: 900;
}


/* =====================================
   USERNAME
===================================== */

#usernameInput {

    width: 100%;

    padding: 14px;

    border:
        1px solid #333;

    border-radius: 10px;

    background: #101018;

    color: white;

    outline: none;

    font-size: 16px;

    margin-bottom: 12px;
}


.continueButton {

    width: 100%;

    padding: 14px;

    border: none;

    border-radius: 10px;

    background: white;

    color: #111;

    font-weight: bold;

    cursor: pointer;
}


.error {

    color: #ff6464;

    font-size: 13px;
}


/* =====================================
   LEADERBOARD
===================================== */

.leaderboardList {

    display: flex;

    flex-direction: column;

    gap: 8px;
}


.leaderboardItem {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        13px 15px;

    border-radius: 10px;

    background:
        rgba(255,255,255,.05);
}


.rank {

    width: 40px;

    color: #888;
}


.player {

    flex: 1;

    text-align: left;

    font-weight: bold;
}


.score {

    color: #aaa;
}


/* =====================================
   USER
===================================== */

.userStats {

    padding: 25px;

    text-align: center;

    background:
        rgba(255,255,255,.05);

    border-radius: 15px;

    margin:
        20px 0;
}


.userStats strong {

    display: block;

    font-size: 40px;
}


.userStats span {

    color: #888;

    font-size: 13px;
}


.logoutButton {

    width: 100%;

    padding: 13px;

    border: none;

    border-radius: 10px;

    background: #d84848;

    color: white;

    font-weight: bold;

    cursor: pointer;
}


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

footer {

    text-align: center;

    color: #444;

    padding: 20px;

    font-size: 13px;
}


/* =====================================
   MOBILE
===================================== */

@media (max-width: 600px) {

    header {

        padding: 0 15px;

    }


    .logo {

        font-size: 18px;

    }


    .headerButton {

        padding:
            8px 10px;

        font-size: 12px;

    }


    main {

        margin-top: 35px;

    }


    .questionCard {

        padding:
            40px 20px;

    }


    .voteButtons {

        flex-direction: column;

    }


    .donutResult {

        grid-template-columns:
            1fr
            180px
            1fr;

        gap: 15px;

    }


    .leftPercentage {

        text-align: center;

        order: 1;

    }


    .donutWrapper {

        order: 2;

        margin: auto;

    }


    .rightPercentage {

        text-align: center;

        order: 3;

    }

}
