/* VARIABLES */

:root {
    --fontl: 2.8rem;
    --fontm: 2rem;
    --fonts: 1.5rem;
    --cprimary: #c5e2f0;
    --csecundary: #219EBC;
    --cdarck: #023047;
    --cimportant: #f3ce72;
    --cimportant2: #f8bb20;
    --cbluebrand: #7292de;
    --cwhite: #ffffff;
    --cblack: #000000;
}


/* CSS INIT */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

html {
    font-size: 62.5%;
    box-sizing: border-box;
}

button {
    cursor: pointer;
}


/* UTILITIES */

.flexcenter {
    display: flex;
    justify-content: center;
    align-items: center;
}

.textcenter {
    text-align: center;
}

.d-none {
    display: none!important;
}

.w-100 {
    width: 100%;
}


/* BODY */

body {
    display: grid;
    grid-template-rows: 5rem 1fr 4rem;
    height: 100vh;
    width: 100vw;
    background-color: #219EBC;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25'%3E%3Cdefs%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='0' x2='0' y1='0' y2='100%25' gradientTransform='rotate(253,960,456)'%3E%3Cstop offset='0' stop-color='%23219EBC'/%3E%3Cstop offset='1' stop-color='%231D8CA7'/%3E%3C/linearGradient%3E%3Cpattern patternUnits='userSpaceOnUse' id='b' width='540' height='450' x='0' y='0' viewBox='0 0 1080 900'%3E%3Cg fill-opacity='0.06'%3E%3Cpolygon fill='%23444' points='90 150 0 300 180 300'/%3E%3Cpolygon points='90 150 180 0 0 0'/%3E%3Cpolygon fill='%23AAA' points='270 150 360 0 180 0'/%3E%3Cpolygon fill='%23DDD' points='450 150 360 300 540 300'/%3E%3Cpolygon fill='%23999' points='450 150 540 0 360 0'/%3E%3Cpolygon points='630 150 540 300 720 300'/%3E%3Cpolygon fill='%23DDD' points='630 150 720 0 540 0'/%3E%3Cpolygon fill='%23444' points='810 150 720 300 900 300'/%3E%3Cpolygon fill='%23FFF' points='810 150 900 0 720 0'/%3E%3Cpolygon fill='%23DDD' points='990 150 900 300 1080 300'/%3E%3Cpolygon fill='%23444' points='990 150 1080 0 900 0'/%3E%3Cpolygon fill='%23DDD' points='90 450 0 600 180 600'/%3E%3Cpolygon points='90 450 180 300 0 300'/%3E%3Cpolygon fill='%23666' points='270 450 180 600 360 600'/%3E%3Cpolygon fill='%23AAA' points='270 450 360 300 180 300'/%3E%3Cpolygon fill='%23DDD' points='450 450 360 600 540 600'/%3E%3Cpolygon fill='%23999' points='450 450 540 300 360 300'/%3E%3Cpolygon fill='%23999' points='630 450 540 600 720 600'/%3E%3Cpolygon fill='%23FFF' points='630 450 720 300 540 300'/%3E%3Cpolygon points='810 450 720 600 900 600'/%3E%3Cpolygon fill='%23DDD' points='810 450 900 300 720 300'/%3E%3Cpolygon fill='%23AAA' points='990 450 900 600 1080 600'/%3E%3Cpolygon fill='%23444' points='990 450 1080 300 900 300'/%3E%3Cpolygon fill='%23222' points='90 750 0 900 180 900'/%3E%3Cpolygon points='270 750 180 900 360 900'/%3E%3Cpolygon fill='%23DDD' points='270 750 360 600 180 600'/%3E%3Cpolygon points='450 750 540 600 360 600'/%3E%3Cpolygon points='630 750 540 900 720 900'/%3E%3Cpolygon fill='%23444' points='630 750 720 600 540 600'/%3E%3Cpolygon fill='%23AAA' points='810 750 720 900 900 900'/%3E%3Cpolygon fill='%23666' points='810 750 900 600 720 600'/%3E%3Cpolygon fill='%23999' points='990 750 900 900 1080 900'/%3E%3Cpolygon fill='%23999' points='180 0 90 150 270 150'/%3E%3Cpolygon fill='%23444' points='360 0 270 150 450 150'/%3E%3Cpolygon fill='%23FFF' points='540 0 450 150 630 150'/%3E%3Cpolygon points='900 0 810 150 990 150'/%3E%3Cpolygon fill='%23222' points='0 300 -90 450 90 450'/%3E%3Cpolygon fill='%23FFF' points='0 300 90 150 -90 150'/%3E%3Cpolygon fill='%23FFF' points='180 300 90 450 270 450'/%3E%3Cpolygon fill='%23666' points='180 300 270 150 90 150'/%3E%3Cpolygon fill='%23222' points='360 300 270 450 450 450'/%3E%3Cpolygon fill='%23FFF' points='360 300 450 150 270 150'/%3E%3Cpolygon fill='%23444' points='540 300 450 450 630 450'/%3E%3Cpolygon fill='%23222' points='540 300 630 150 450 150'/%3E%3Cpolygon fill='%23AAA' points='720 300 630 450 810 450'/%3E%3Cpolygon fill='%23666' points='720 300 810 150 630 150'/%3E%3Cpolygon fill='%23FFF' points='900 300 810 450 990 450'/%3E%3Cpolygon fill='%23999' points='900 300 990 150 810 150'/%3E%3Cpolygon points='0 600 -90 750 90 750'/%3E%3Cpolygon fill='%23666' points='0 600 90 450 -90 450'/%3E%3Cpolygon fill='%23AAA' points='180 600 90 750 270 750'/%3E%3Cpolygon fill='%23444' points='180 600 270 450 90 450'/%3E%3Cpolygon fill='%23444' points='360 600 270 750 450 750'/%3E%3Cpolygon fill='%23999' points='360 600 450 450 270 450'/%3E%3Cpolygon fill='%23666' points='540 600 630 450 450 450'/%3E%3Cpolygon fill='%23222' points='720 600 630 750 810 750'/%3E%3Cpolygon fill='%23FFF' points='900 600 810 750 990 750'/%3E%3Cpolygon fill='%23222' points='900 600 990 450 810 450'/%3E%3Cpolygon fill='%23DDD' points='0 900 90 750 -90 750'/%3E%3Cpolygon fill='%23444' points='180 900 270 750 90 750'/%3E%3Cpolygon fill='%23FFF' points='360 900 450 750 270 750'/%3E%3Cpolygon fill='%23AAA' points='540 900 630 750 450 750'/%3E%3Cpolygon fill='%23FFF' points='720 900 810 750 630 750'/%3E%3Cpolygon fill='%23222' points='900 900 990 750 810 750'/%3E%3Cpolygon fill='%23222' points='1080 300 990 450 1170 450'/%3E%3Cpolygon fill='%23FFF' points='1080 300 1170 150 990 150'/%3E%3Cpolygon points='1080 600 990 750 1170 750'/%3E%3Cpolygon fill='%23666' points='1080 600 1170 450 990 450'/%3E%3Cpolygon fill='%23DDD' points='1080 900 1170 750 990 750'/%3E%3C/g%3E%3C/pattern%3E%3C/defs%3E%3Crect x='0' y='0' fill='url(%23a)' width='100%25' height='100%25'/%3E%3Crect x='0' y='0' fill='url(%23b)' width='100%25' height='100%25'/%3E%3C/svg%3E");
    background-attachment: fixed;
    background-size: cover;
    box-shadow: inset 0px 0px 50px 13px rgba(0, 0, 0, 0.95);
}


/* NAV */

.header {
    width: 100%;
    background-color: var(--cdarck);
}

.header__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: 100%;
}

.nav__brand {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav__brand img {
    height: 4rem;
}

.nav__brand h1 {
    font-size: var(--fontl);
    margin: 0;
    color: var(--cbluebrand);
}

.nav__brand h1 span {
    font-weight: 100;
}

.nav__items {
    display: flex;
    gap: 2rem;
}

.nav__link {
    padding: .5rem 1rem;
    font-size: var(--fonts);
    width: 15rem;
    border: 1px solid var(--cprimary);
    border-radius: .5rem;
    background: none;
    color: var(--cwhite);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.nav__link span {
    color: var(--cprimary);
    transition: .5s;
    z-index: 2;
}

.nav__link::after {
    position: absolute;
    content: "";
    width: 0;
    height: 0;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    background-color: var(--cprimary);
    transform: translate(-50%, -50%);
    transition: .5s;
    z-index: 1;
}

.nav__link:hover::after {
    width: 20rem;
    height: 20rem;
}

.nav__link:hover span {
    color: var(--cdarck);
}

.nav__link--active {
    background-color: var(--cprimary);
    color: var(--cdarck);
}


/* MAIN CONTENT */

main>* {
    width: min(90vw, 106rem);
    margin: 0 auto;
    height: 90%;
    background-color: var(--cprimary);
    border-radius: 1rem;
    padding: clamp(1rem, 5vw, 5rem);
    overflow: hidden;
}


/* FOOTER */

.footer {
    justify-content: flex-end;
    background-color: var(--cdarck);
    gap: 2rem;
    padding: 0 2.5rem;
}

.footer__item a {
    display: flex;
    background-color: var(--cprimary);
    gap: .5rem;
    font-size: var(--fonts);
    align-items: center;
    padding: .2rem .5rem;
    color: var(--cdarck);
    border-radius: .2rem;
    opacity: 1;
    /* Aquí hay que poner la transicion para el hover */
}

@media (max-width: 615px) {
    .nav__link {
        width: 7rem;
    }
    .nav__link span:nth-child(2) {
        display: none;
    }
}


/* VIEWS */


/* MAIN PAGE */

.main__wellcome {
    flex-direction: column;
    gap: 2rem;
}

.main__wellcome img {
    width: max(16rem, 35%);
}

.main__wellcome h2 {
    font-size: clamp( 2.4rem, 5.1vw, 5rem);
}

.main__wellcome p {
    font-size: clamp( 2.4rem, 5.1vw, 5rem);
}

.main__wellcome button {
    padding: .5rem 1rem;
    font-size: var(--fontl);
    width: 15rem;
    border: 1px solid var(--cdarck);
    border-radius: .5rem;
    background: none;
    color: var(--cblack);
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* START PAGE */

.start__form {
    width: min(100%, 59rem);
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 3rem;
}

.form__name {
    width: 100%;
    height: 9rem;
    position: relative;
    font-size: 5rem;
}

.name__label {
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    transition: .2s;
}

.form__name input {
    font-size: 5rem;
    width: 100%;
    height: 100%;
    background-color: transparent;
    outline: none;
    border: none;
    border-bottom: 3px solid var(--cdarck);
}

.name__label--styled {
    font-size: 1.5rem;
    top: 0%;
    left: 52%;
}

#submit-btn {
    width: 70%;
    font-size: 4rem;
    padding: 2rem;
    border: var(--cdarck) 1px solid;
    background-color: transparent;
    border-radius: 2rem;
    color: var(--cdarck);
    position: relative;
    overflow: hidden;
}

#submit-btn span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: .5s;
    outline: none;
}

#submit-btn span:nth-child(2) {
    left: -3rem;
    font-size: 3rem;
    color: var(--cprimary);
    z-index: 2;
}

#submit-btn::after {
    content: "";
    background-color: var(--cdarck);
    width: 5rem;
    height: 6rem;
    position: absolute;
    top: -1rem;
    left: -6rem;
    z-index: 1;
    transition: .5s;
}

#submit-btn:hover::after {
    width: 150%;
}

#submit-btn:hover span {
    color: var(--cprimary);
}

#submit-btn:hover span:nth-child(1) {
    left: 20%;
}

#submit-btn:hover span:nth-child(2) {
    left: 91%;
}


/* QUESTION PAGE */

.main__question {
    padding-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.question__hero {
    background-color: var(--cbluebrand);
    background-image: url(../assets/logo_noBackground2.png);
    background-size: 7rem;
    height: 15rem;
    margin: 0 -5rem 0 -5rem;
}

.question__hero p {
    font-size: 7rem;
}

.question__hero span {
    font-weight: 700;
}

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

#question-form {
    height: 100%;
}

#question-form fieldset {
    height: 89%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    border: none;
}

.question__option {
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.question__option--selected .option__deco {
    width: 10rem;
    height: 10rem;
    left: 0;
    bottom: 0;
    background-color: var(--cimportant2);
}

.question__option input {
    position: absolute;
    opacity: 0;
}

.question__option label {
    font-size: 2rem;
    text-align: center;
    z-index: 2;
}

.option__deco {
    background-color: var(--cimportant);
    position: absolute;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    left: -12rem;
    bottom: -6rem;
    z-index: 1;
    transition: .5s;
}

.option__deco p {
    font-size: 4rem;
    font-weight: 800;
}

.question__option:hover .option__deco {
    width: 10rem;
    height: 10rem;
    left: 0;
    bottom: 0;
}

.form__submit {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.form__submit,
.form__submit button {
    height: 3.2rem;
}

.form__submit button {
    width: 50%;
    font-size: 4rem;
    padding: 2rem;
    border: var(--cdarck) 1px solid;
    background-color: transparent;
    border-radius: 2rem;
    color: var(--cdarck);
    position: relative;
    overflow: hidden;
}

.form__submit button span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: .5s;
    outline: none;
}

.form__submit button span:nth-child(2) {
    left: -3rem;
    font-size: 3rem;
    color: var(--cprimary);
    z-index: 2;
}

.form__submit button::after {
    content: "";
    background-color: var(--cdarck);
    width: 5rem;
    height: 6rem;
    position: absolute;
    top: -1rem;
    left: -6rem;
    z-index: 1;
    transition: .5s;
}

#countDown {
    color: var(--cdarck);
}

.form__submit button:hover::after {
    width: 150%;
}

.form__submit button:hover span {
    color: var(--cprimary)
}

.form__submit button:hover span:nth-child(1) {
    left: 20%;
}

.form__submit button:hover span:nth-child(2) {
    left: 91%;
}


/* 


#submit-btn:hover span:nth-child(2) {
    left: 91%;
} 

*/

@media (max-width: 850px) {
    #question-form fieldset {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


/* STATS PAGE */

.main__stats {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.stats__score {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 23rem;
    gap: 2rem;
}

.stats__score h2 {
    font-size: 10rem;
    color: var(--cdarck);
}

@media (max-width: 800px) {
    .stats__score {
        flex-direction: column;
        height: 23rem;
    }
    .stats__score h2 {
        font-size: min(10vw, 4rem);
    }
}

.score__graph {
    position: relative;
    width: 20rem;
    height: 16rem;
    overflow: hidden;
}

.score__graph canvas {
    position: absolute;
    top: -3.3rem;
}

.score__graph p {
    position: absolute;
    font-size: 6rem;
    font-weight: 700;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--cdarck);
}

.stats__position {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stats__position h2 {
    text-align: center;
    font-size: min(8vw, 4rem);
    margin: 0 5rem;
}

.position__medal {
    height: 30rem;
    width: 30rem;
    border-radius: 50%;
    padding: 5rem;
    background-color: var(--cdarck);
}

.position__medal h3 {
    color: var(--cbluebrand);
    font-size: 14rem;
}

@media (max-width: 800px) {
    .position__medal {
        height: 20rem;
        width: 20rem;
    }
    .position__medal h3 {
        font-size: 12rem;
    }
    .stats__position h2 {
        margin: 0;
    }
}

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

.stats__nav input {
    font-size: 2rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    background-color: transparent;
    border: var(--cdarck) 1px solid;
    color: var(--cdarck);
}

@media (max-width: 725px) {
    .stats__nav {
        flex-direction: column;
        gap: 1rem;
    }
}


/* LEADERBOARD PAGE */

.main__leaderboard {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main__leaderboard h2 {
    font-size: min(10vw, 11rem);
    font-weight: 700;
    margin-bottom: clamp(1rem, 5vw, 5rem);
}

.main__leaderboard h2 span {
    font-weight: 400;
}

.leaderboard__table {
    width: min(100%, 59rem);
    height: 100%;
    border-collapse: collapse;
    font-size: 1.7rem;
    text-align: center;
}

.leaderboard__table tr:nth-child(odd) {
    background-color: #f2f2f2;
}

.table__position {
    width: 12rem;
    text-align: center;
}

.table__position i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.table__position--first i {
    color: #dcc168;
}

.table__position--second i {
    color: #858791;
}

.table__position--third i {
    color: #a67f58;
}

.table__score {
    width: 12rem;
}

.table__name {
    font-size: 2.4rem;
}

.form__timer {
    width: 100%;
    height: 2rem;
    background-color: var(--csecundary);
    display: flex;
    justify-content: flex-start;
    border-radius: 20rem;
    overflow: hidden;
}

.timer__complete {
    width: 100%;
    height: 100%;
    background-color: var(--cdarck);
}

@keyframes timeBar {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}