:root {
    --background-0: #17132A;
    --background-1: #272046;
    --background-2: #372C63;
    --background-3: #4F3F8D;
    --primary-0: #501A89;
    --primary-1: #6E24BC;
    --text: #F5F2FF;
    --text-faded: #c8c4d6;
    --accent: #ff80f1;
    --big-radius: 20px;
    --small-radius: 10px;
    --disabled: #3b3655;
    --disabled-shade: #29253f;
    --error: #862537;
    --error-shade: #a94545;
}

html {
    height: 100%;
}

body {
    background-color: var(--background-0);
    margin: 0;
    min-height: 100%;
    font-family: 'Nunito', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 10px;
    background-color: var(--background-1);
    margin-bottom: 10px;
    box-sizing: border-box;
}

.header img {
    height: 30px;
}

.version {
    padding-right: 10px;
    height: 100%;
    color: var(--text-faded);
    display: flex;
    flex-direction: column;
    justify-content: end;
    text-align: right;
    font-size: 0.7em;
}

.container {
    user-select: none;
    max-width: 100vw;
    width: 100%;
    min-width: 300px;
    min-height: calc(100dvh - 10px);
    margin: 0 10px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: var(--text);
}

p {
    color: var(--text);
}

label {
    color: var(--text);
}

/* ========================================== INPUTS ========================================== */


.container button, .popup button {
    background: var(--background-2);
    color: var(--text);
    border: 3px solid var(--background-3);
    box-shadow: 0 6px 0 var(--background-3);
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
}

.container button:enabled:active, .popup button:active {
    transform: translateY(4px); 
    box-shadow: 0 2px 0 var(--background-3);
}

.container button:disabled {
    transform: translateY(4px); 
    background: var(--disabled-shade);
    border: 3px solid var(--disabled);
    box-shadow: 0 2px 0 var(--disabled);
    cursor: default;
}

.big-button {
    border-radius: var(--big-radius);
    width: 100%;
    max-width: 500px;
    height: 40px;
}

.container .selected:enabled {
    background: var(--primary-1);
    transform: translateY(3px); 
    border: 3px solid var(--primary-0);
    box-shadow: 0 3px 0 var(--primary-0);
}

.container .selected:enabled:active {
    transform: translateY(4px); 
    box-shadow: 0 2px 0 var(--primary-0);
}

input[type="text"], input[type="number"] {
    border: 1px solid var(--background-3);
    border-radius: var(--small-radius);
    background-color: var(--background-0);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    padding: 0.3rem;
    width: 230px;
    height: 25px;
}

input[type="number"] {
    width: 60px;
    height: 25px;
}

input[type="range"] {
    width: 230px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-1);
}

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

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.contact-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.contact-entry {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hide-at-small-width {
    display: none;
}

.contact-entry p {
    margin: 0;
}

.contact-entry a {
    text-decoration: none;
}

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

.menu-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.menu-title {
    width: 100%;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.menu-title img {
    width: 600px;
    max-width: 90%;
}

.menu-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 10px;
    margin-bottom: 60px;
}

.menu-button {
    width: 94%;
    height: 50px;
    font-size: large;
    font-weight: 600;
    border-radius: var(--small-radius);
}

/* ======================================= OPTIONS PAGE ======================================= */

.options-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 540px;
}

.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.title button {
    padding: 10px;
    border-radius: var(--big-radius);
}

.options {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    width: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--background-1);
    border-radius: var(--big-radius);
}

.options button {
    border-radius: var(--small-radius);
}

.options-pair {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.options-field {
    display: flex;
    flex-direction: column;
    justify-content: left;
    gap: 4px;
    max-width: 100%;
}

.options-finish {
    margin-top: 20px;
}

.options-seasons {
    padding-bottom: 4px;
}

.options-difficulty {
    padding-bottom: 4px;
}

.field-row {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 5px;
    color: var(--text);
}

.space-between {
    justify-content: space-between;
}

.options-difficulty {
    display: flex;
    flex-wrap: nowrap;
}

.season-toggle {
    height: 40px;
    width: 40px;
    max-width: 11.1%;
}

.difficulty-toggle {
    height: 40px;
}

.set-difficulty {
    width: 90px;
    max-width: 20%;
}

.all-difficulty {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-left: 5%;
    width: 132px;
    max-width: 35%;
}

.field-warning {
    background-color: var(--background-0);
    width: 5px;
    height: 100%;
}

.finish-button {
    width: 100%;
    height: 40px;
    margin-top: 20px;
}

/* ======================================= NOTIFICATIONS ======================================= */

.notifications {
    position: fixed;
    top: 0;
    right: 0;
}

.notification {
    width: 250px;
    display: flex;
    padding: 10px;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: var(--small-radius) 0 var(--small-radius) var(--small-radius);
    border: 0.5px solid var(--background-3);
    margin: 10px;
}

.notification p {
    margin: 3px;
}

.notification button {
    box-shadow: none;
    border-radius: 50%;
    width: 24px;
    aspect-ratio: 1;
    color: var(--text);
    background-color: #ffffff20;
    border: none;
}

.notification button:hover {
    background-color: #ffffff30;
}

.info-toast {
    background-color: #372C63;
}

.warn-toast {
    background-color: #74770C;
}

.error-toast {
    background-color: var(--error);
    border-color: var(--error-shade);
}

/* =========================================== POPUP =========================================== */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    z-index: 69;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup {
    position: fixed;
    padding: 20px;
    border-radius: var(--small-radius);
    max-width: 480px;
    width: 90%;
    text-align: center;
    background-color: var(--background-1);
    user-select: none;
}

.popup h2 {
    color: var(--accent);
    margin: 0;
}

.popup p {
    color: var(--text);
}

.popup .close {
    border-radius: var(--small-radius);
    width: 80px;
    height: 40px;
    font-size: 1em;
}

/* ======================================== JOIN LOBBY ======================================== */

.join-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 540px;
}

.join {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    width: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--background-1);
    border-radius: var(--big-radius);
}

.join button {
    border-radius: var(--small-radius);
}

.join p {
    margin: 0;
}

.join-code {
    width: 100%;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 5px;
}

.join-field {
    display: flex;
    flex-direction: column;
    justify-content: left;
    gap: 4px;
    max-width: 100%;
}

.join-code input {
    font-family: monospace;
    font-size: 3em;
    width: 2.2em;
    height: 0.7em;
    padding: 10px;
    text-align: center;
}

.join-finish {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.join-finish button {
    height: 40px;
}

/* ======================================== HOW TO PLAY ======================================== */

.tutorial-container {
    max-width: 700px;
}

.tutorial {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    width: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--background-1);
    border-radius: var(--big-radius);
    user-select: text;
    align-items: center;
}

.tutorial p {
    margin: 0;
}

.tutorial video {
    max-width: 98%;
    aspect-ratio: 16/9; 
}

.tutorial img {
    max-width: 98%;
}

/* ======================================== GAME WINDOW ======================================== */

.game-window {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text);
}

.game-window button {
    border-radius: var(--small-radius);
}

.main-game-window {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    width: 100%;
}

.ready-window {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 12px;
    padding-bottom: 20px;
}

.flex-grow {
    flex-grow: 1;
}

.last-round-result {
    display: flex;
    flex-direction: column;
}

.last-round-leaderboard {
    width: calc(100% - 20px);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.report-frame {
    width: 100%;
    display: flex;
    justify-content: center;
}

.report-frame button {
    margin-bottom: 6px;
    width: 90%;
    height: 30px;
    background-color: var(--error);
    box-shadow: 0 6px 0 var(--error-shade);
    border-color: var(--error-shade);
}

.ready-window p {
    margin-top: 0;
    margin-bottom: 10px;
}

.ready-button {
    width: 200px;
    height: 50px;
    font-size: 1.3em;
}

.frame {
    aspect-ratio: 16/9;
    width: 100%;
    border: 8px solid var(--background-3);
    border-radius: var(--small-radius);
    box-sizing: border-box;
    object-fit: cover;
}

.game-image {
    display: flex;
    justify-content: left;
    align-items: start;
    width: 100%;
}

.image-zoom {
    display: flex;
    flex-direction: column;
}

.image-zoom button {
    width: 30px;
    height: 30px;
    font-size: 1em;
}

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

.begin-countdown {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

.countdown {
    text-align: center;
}

.countdown-ring {
    stroke: var(--text);
    transition: stroke-dashoffset 200ms linear;
}

.countdown text {
    fill: var(--text);
}

/* ========================================== SLIDER ========================================== */

.slider {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
    position: relative;
}

.slider p {
    margin: 0;
}

.slider-field {
    width: 100%;
    position: relative;
}

.slider-timeline {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-seasons button {
    height: 60px;
    width: 60px;
    max-width: 11.1%;
    position: relative;
}

.button-inside {
    width: 100%;
    position: absolute;
    left: -50%;
    transform: translateX(50%);
    text-align: center;
    overflow: hidden;
    pointer-events: none;
}

.button-answer {
    top: 0;
}

.button-guesses {
    bottom: 0;
}

.button-guess {
    width: 9px;
    height: 9px;
    border: 1px solid var(--text);
    display: inline-block;
    border-radius: 50%;
}

.slider-episodes button {
    height: 60px;
    width: 7.69%;
    position: relative;
}

.guess-button {
    width: 100px;
    height: 40px;
}

.timeline {
    position: relative;
    width: calc(100% - 50px);
    height: 30px;
    background-color: var(--background-2);
    margin-top: 20px;
    margin-bottom: 20px;
    border-left: 1px solid var(--text);
    border-right: 1px solid var(--text);
}

.timeline-start {
    position: absolute;
    color: var(--text-faded);
    bottom: -25px;
    left: 0;
    transform: translateX(-50%);
}

.timeline-end {
    position: absolute;
    color: var(--text-faded);
    bottom: -25px;
    right: 0;
    transform: translateX(50%);
}

.timeline-marker {
    width: 3px;
    height: 30px;
    position: absolute;
    user-select: none;
    background-color: var(--text);
}

.timeline-bubble {
    position: absolute;
    text-align: center;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--background-2);
    padding: 0 5px 0 5px;
    border-radius: 8px;
    z-index: 10;
    text-wrap: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marker-above {
    top: -25px;
}

.marker-below {
    bottom: -25px;
}

.make-guess {
    width: 100px;
    height: 40px;
}

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

.leaderboard {
    width: 450px;
    max-width: 100%;
}

.leaderboard-title {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 10px;
}

.leaderboard-title h2 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-title button {
    padding: 5px 10px 5px 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.leaderboard-buttons {
    display: flex;
    flex-shrink: 0;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    gap: 1px;
    display: flex;
    flex-direction: column;
}

.leaderboard-list li {
    width: calc(100% - 20px);
    height: 30px;
    border-radius: var(--small-radius);
    background-color: var(--background-2);
    display: flex;
    align-items: center;
    gap: 3px;
    padding-left: 10px;
    padding-right: 10px;
}

.self-entry {
    outline: 1px solid var(--text-faded);
}

.leaderboard-list p {
    margin: 0;
}

.lb-status {
    min-width: 25px;
    text-align: center;
    box-sizing: border-box;
    display: block;
}

.lb-color {
    height: 25px;
    padding: 6px;
}

.lb-inner-color {
    height: 12px;
    aspect-ratio: 1;
    border: solid var(--text) 1px;
    border-radius: 50%;
}

.lb-name {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    overflow: hidden;
}

.lb-nickname {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-wrap: nowrap;
}

.lb-score {
    width: 60px;
    text-align: right;
}

/* ======================================== OTHER STUFF ======================================== */

.captcha {
    display: flex;
    justify-content: center;
}

.captcha > div {
    margin-top: 20px;
}

.question-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--background-1);
}

.question-mark:hover .tip {
    display: block;
}

.field-warning {
    background-color: var(--background-0);
    border: 1px solid var(--background-3);
}

.tip {
    position: absolute;
    bottom: 110%;
    right: 50%;
    text-align: center;
    background-color: var(--background-0);
    border: 1px solid var(--background-3);
    border-radius: var(--small-radius);
    padding: 6px;
    width: 160px;
    display: none;
}

.rm {
    display: none;
}

.contact {
    color: var(--accent);
    user-select: text;
}



@media (min-width: 540px) {
    .hide-at-small-width {
        display: inherit;
    }

    .version {
        font-size: 1em;
    }

    .menu-button {
        width: 47%;
    }

    .menu-grid {
        width: 450px;
    }

    .options-pair {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    input[type="range"] {
        width: 200px;
        height: 37px;
    }

    .all-difficulty {
        margin-left: 10px;
    }

    .finish-button {
        width: 180px;
    }

    .join-finish {
        flex-direction: row;
        justify-content: space-between;
        align-items: end;
    }

    .join-finish button {
        width: 100px;
    }

    .notification {
        width: 320px;
    }

    .last-round-result {
        flex-direction: row;
    }

    .last-round-leaderboard {
        width: 280px;
    }

    .rm {
        display: inline;
    }
}

@media (min-width: 900px) {
    .container {
        justify-content: center;
    }

    .game-window {
        flex-direction: row;
        flex-grow: 1;
        align-items: stretch;
    }

    .leaderboard {
        width: 350px;
    }
}