/* Asterisk wildcard selector to override default styles added by the browser */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --main-font-family: "Inter Tight", sans-serif;
    --element-off: rgb(140, 140, 140);
    --main-color: rgb(202, 204, 144);
    --main-color-transparent: rgba(202, 204, 144, 0.5);
    --body-background: rgb(244, 235, 190);
    --block-background: #d6d3f0;
    --text: rgb(9, 9, 9);
    --highted-text: rgb(222, 63, 23);
    --secondary-text: rgb(62, 61, 61);
}

body {
    font-family: var(--main-font-family);
    color: var(--text);
    background-color: var(--body-background);
    overflow-x: hidden;
    height: 100dvh;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
}

.hidden-hider {
    display: none;
}

/* Style for header element */
header {
    padding: 0px 20px;
    background-color: var(--main-color);
}

#navigation {
    gap: 20px;
}

.nav-active {
    box-shadow: inset 0 -3px 5px rgb(0, 0, 0, 0.5);
}

#navigation img {
    height: 60px;
    width: 60px;
}

#outer-links {
    gap: 30px;
    font-size: 30px;
}

.wave {
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 20px;
}

.wave .shape-fill {
    fill: var(--body-background);
}

.relative {
    position: relative;
}

.disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Global style for links */
a {
    text-decoration: none;
    color: inherit;
}

/* General classes */
.main-background {
    background-color: var(--main-color);
}

.run-button {
    height: 70px;
    background-color: var(--block-background);
    box-shadow: 0px -3px 5px rgb(0, 0, 0, 0.5);
    font-family: var(--main-font-family);
}

/* Bubble pattern */

.bubble {
    position: relative;
    --bubble-height: 2rem;
}

.bubble::after {
    content: "";
    border-top-left-radius: 50% 100%;
    border-top-right-radius: 50% 100%;
    position: absolute;
    width: 100%;
    bottom: calc(-1 * var(--bubble-height));
    left: 0;
    background-color: inherit;
    height: var(--bubble-height);
    transform: rotate(180deg);
}

.bubble.flip::after {
    top: calc(-1 * var(--bubble-height));
    transform: none;
}

/* Flex classes */
.flex-container {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: start;
}

.align-stretch {
    align-items: stretch;
}

.justify-center {
    justify-content: center;
}

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

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

.justify-start {
    justify-content: start;
}

/* Content style */
#content {
    flex: 1;
    height: 100px;
}

/* STYLE FOR index.html */
/* logo style */
#rules-section {
    display: none;
}

#logo-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-top: 10dvh;
}

#logo {
    text-align: center;
    font-size: 40px;
    letter-spacing: -2px;
    font-weight: 800;
    padding-bottom: 4px;
}

/* Options style */
#options {
    padding-bottom: 30px;
    width: 100%;
    background-color: var(--block-background);
    height: 250px;
}

.option-item {
    height: 50px;
    width: 200px;
    border-radius: 25px;
    margin-top: 30px;
    background-color: var(--main-color);
    box-shadow: unset;
}

/* STYLE FOR teams.html */
.team-container {
    padding: 20px;
}

.team-container:not(:last-child) {
    border-bottom: 2px solid var(--text);
}

#add-team {
    height: 60px;
    font-size: 25px;
    background-color: var(--main-color);
    box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
}

/* STYLE FOR setting.html */
.setting-container {
    border-bottom: 2px solid var(--text);
    padding: 20px 15px 20px 15px;
    box-shadow: inset 0px -2px 10px rgb(0, 0, 0, 0.3);
}

.setting-description {
    font-size: 15px;
    font-weight: 600;
    color: var(--element-off);
}

.setting-value {
    padding-top: 3px;
}

/* Style for range input */
.range-input {
    /* Removing default appearance */
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    cursor: pointer;
    height: 5px;
    margin: 15px auto 15px auto;
    border-radius: 3px;
    max-width: 300px;
    outline: none;
    background: var(--text);
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--main-color);
    border-radius: 50%;
    box-shadow: 1px 1px 1px rgb(0, 0, 0, 0.5);
}

/* Style for checkbox input */

/* This class increases clickable area for checkbox input */
.checkbox-label {
    display: block;
    height: 25px;
    width: 30px;
    cursor: pointer;
    align-self: center;
    margin-right: 15px;
}

.checkbox-input {
    /* Remove default appearance */
    -webkit-appearance: none;
    appearance: none;

    outline: none;
    position: relative;
    height: 15px;
    width: 5px;
    margin-top: 5px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.5s;
    background-color: var(--main-color-transparent);
}

.checkbox-input::before {
    /* Styles for circle in checkbox input element */
    content: "";
    height: 20px;
    width: 20px;
    background-color: var(--element-off);
    position: absolute;
    margin: auto;
    top: 0;
    left: -1px;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 1px 1px 1px rgb(0, 0, 0, 0.5);
    transition: 0.5s;
    animation: shadow-grow 0.2s linear 0.3s;
}

/* Animation to change box-shadow */
@keyframes shadow-grow {
    0% {
        box-shadow: 0px 0px 0px 0px rgba(224, 116, 226, 0.3),
            1px 1px 1px rgb(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0px 0px 0px 5px rgba(224, 116, 226, 0.3),
            1px 1px 1px rgb(0, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0px 0px 0px 0px rgba(224, 116, 226, 0.3),
            1px 1px 1px rgb(0, 0, 0, 0.5);
    }
}
.checkbox-input:checked {
    width: 40px;
}

.checkbox-input:checked::before {
    background-color: var(--main-color);
    left: 18px;

    /* Disable animation when element is checked */
    animation: none;
}

/* STYLE FOR categories.html */
.category-image {
    width: 70px;
    height: 70px;
}

.categories {
    height: 100%;
}

.category-container {
    width: 100%;
    padding: 15px;
    border-top: 2px solid var(--text);
    box-shadow: inset 0px -2px 10px rgb(0, 0, 0, 0.3);
}

.game-difficulty {
    text-align: center;
    font-size: 20px;
    margin: 0 auto;
    background-color: var(--body-background);
    padding: 10px;
    border-radius: 10px;
}

.category-container > img {
    margin-left: 10%;
    margin-right: 5%;
}

.category-container:last-child {
    border-bottom: 2px solid var(--text);
}

.category-description {
    margin-top: 3px;
    font-size: 15px;
    font-weight: 600;
    color: var(--element-off);
}

/* STYLE FOR game.html */
/* before-round section */
.game-state {
    height: 100%;
}

#stat-container {
    background-color: var(--main-color);
    padding: 20px 20px 10px 20px;
}

.stat-info-container {
    margin-bottom: 10px;
    padding: 0px 10px 10px 0px;
}

.team-stat-item {
    padding: 5px 0px;
    font-size: 17px;
}

.second-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-text);
}

#round-info {
    gap: 15px;
}

#prepared-team {
    color: rgb(222, 63, 23);
}

#run-round {
    font-size: 20px;
    font-weight: 800;
}

/* round section */
.help-text {
    position: absolute;
    top: 15%;
    color: var(--element-off);
}

#pc-controls {
    display: none;
}

#guessed-words,
#missed-words {
    width: 100%;
    gap: 10px;
}

.team-name {
    color: var(--secondary-text);
}

#count-guessed,
#count-missed {
    font-size: 30px;
}

#guessed-words {
    background-color: var(--main-color);
    padding: 20px 0 0 0;
}

#missed-words {
    background-color: var(--element-off);
    padding: 0 0 20px 0;
    color: var(--body-background);
}

#round-timer {
    background-color: var(--body-background);
    padding: 3px 5px 3px 5px;
    border-radius: 20px;
    color: var(--text);
}

#control {
    width: 200px;
    height: 200px;
    background-color: var(--block-background);
    border-radius: 50%;
    font-size: 30px;
    font-weight: 800;
    position: relative;
    box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
}

#swipe-area {
    position: relative;
    width: 100%;
    height: 100%;
}

#control.word-control {
    background-color: var(--main-color);
}

#who-guessed {
    display: none;
    position: absolute;
    font-size: 20px;
    font-weight: 500;
    width: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--main-color);
    border-radius: 10px;
}

#who-guessed div:first-child {
    padding: 15px 15px 10px 15px;
}

#who-guessed .team {
    font-weight: 600;
    padding: 10px 15px;
}

#who-guessed .team:not(:last-child) {
    border-bottom: 2px solid black;
}

/* style after-round section */
.info {
    background-color: var(--main-color);
    padding: 20px 20px 0px 20px;
}

.points {
    background-color: var(--body-background);
    padding: 5px 10px;
    border-radius: 15px;
}

#words-list {
    overflow: auto;
    flex: 1;
    padding: 40px 20px 10px 20px;
}

.active {
    color: var(--highted-text);
}

#after-round-info {
    margin-top: 15px;
    font-size: 17px;
}

.team-info {
    padding: 5px 0px;
}

.team-info .name {
    color: var(--highted-text);
}

.words-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 15px;
}

.words-item i {
    font-size: 25px;
}

/* STYLE FOR win.html */

.winner-container {
    padding: 50px 0px 20px 0px;
}

#winner {
    background-color: var(--block-background);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
}

#winner-score-container {
    color: var(--highted-text);
    text-align: center;
    font-size: 13px;
    line-height: 20px;
    margin-bottom: 10px;
}

#winner-score {
    font-size: 30px;
    letter-spacing: 5px;
    font-weight: 700;
}

#winner-name {
    font-size: 30px;
    text-align: center;
    padding: 0 20px;
    line-height: 30px;
    margin-bottom: 20px;
}

#winner > div:last-child {
    padding: 3px 5px;
    font-size: 15px;
    background-color: var(--highted-text);
    color: var(--body-background);
    border-radius: 10px;
}

.winner-teams-info {
    overflow: auto;
    flex: 1;
    padding: 40px 20px 10px 20px;
}

/* STYLE FOR win.html */
.intro-text {
    max-width: 75%;
    margin: 40px auto 20px auto;
    padding: 20px 20px 20px 20px;
    text-align: center;
    background-color: var(--block-background);
    border-radius: 20px;
}

#rules-container {
    font-size: 15px;
    font-weight: 500;
    margin-top: 20%;
    padding: 20px 20px 20px 20px;
}

.rule-item {
    margin-bottom: 10%;
}

.rule-icon {
    font-size: 40px;
    color: var(--highted-text);
}

.rule-text {
    padding-left: 10px;
}

/* Media query: tablets and larger (768 and up) */
@media screen and (min-width: 768px) {
    /* STYLE FOR rules.html */
    .intro-text {
        width: 50%;
        max-width: 400px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    #rules-container {
        padding: 40px 20px 40px 20px;
        background-color: var(--block-background);
        margin: 50px auto 0 auto;
        width: 70%;
        max-width: 550px;
        border-radius: 5%;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .rule-item {
        margin: 0;
        flex-basis: 13dvh;
    }
}

/* Media query: laptops and larger (992 and up) */
@media screen and (min-width: 992px) {
    header {
        background-color: var(--block-background);
    }

    #navigation > div,
    #outer-links > div {
        transition: 0.3s;
    }

    #navigation > div:hover,
    #outer-links > div:hover {
        transform: scale(1.1);
    }

    .hoverable {
        transition: 0.5s;
    }

    .hoverable:hover {
        filter: brightness(80%);
    }

    .run-button {
        transition: 0.5s;
        width: 200px;
        height: 200px;
        margin-right: 10dvw;
        border-radius: 50%;
        font-size: 30px;
        text-align: center;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
        background-color: var(--block-background);
    }

    .run-button:hover {
        filter: brightness(80%);
        transform: scale(1.1);
    }

    #content {
        flex-direction: row;
        align-items: center;
        height: unset;
        padding-top: 30px;
    }

    /* Custom scrollbar*/
    *::-webkit-scrollbar {
        width: 5px;
    }

    *::-webkit-scrollbar-track {
        background: var(--element-off);
    }

    *::-webkit-scrollbar-thumb {
        background: var(--secondary-text);
        border-radius: 2px;
    }

    /* STYLE FOR index.html */
    .outer-container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 40dvw;
        height: 70%;
        min-height: 400px;
        margin-left: 10dvw;
        overflow-y: auto;
    }

    .inner-container {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding: 10px;
    }

    #rules-section {
        padding: 10px;
        display: flex;
    }

    #rules-section > #rules-container {
        margin: auto 0;
        padding: 20px;
        width: 100%;
        background-color: var(--main-color);
    }

    #game-name {
        font-size: 50px;
        font-weight: 800;
        margin-bottom: 10px;
        text-align: center;
        background-color: var(--body-background);
        padding: 10px;
        border-radius: 20px;
    }

    .rule-item {
        flex-basis: unset;
        margin-bottom: 19px;
        font-size: 15px;
    }

    #logo-container,
    #options > *:not(#start-game) {
        display: none;
    }

    #options {
        padding: 0;
        width: auto;
        background: none;
    }

    /* STYLE FOR teams.html */
    .left-settings {
        margin-left: 5dvw;
        padding: 40px;
        width: 35%;
        border-radius: 20px;
        background-color: var(--main-color);
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    #teams-container {
        height: 75dvh;
    }

    #teams {
        height: 100%;
    }

    .team-container {
        padding: 15px;
        background-color: var(--block-background);
        border-radius: 15px;
        border: none !important;
        margin-bottom: 10px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .delete-team {
        background-color: var(--body-background);
        padding: 3px;
        border-radius: 5px;
    }

    #add-team {
        height: 50px;
        min-height: 50px;
        background-color: var(--body-background);
        border-radius: 15px;
    }

    /* STYLE FOR settings.html */
    #settings-container {
        height: 75dvh;
    }
    .setting-container {
        margin-bottom: 20px;
        padding: 10px;
        background-color: var(--block-background);
        border-radius: 15px;
        border: none !important;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .setting-description {
        color: var(--secondary-text);
    }

    .range-input::-webkit-slider-thumb:hover {
        transition: 0.5s;
        filter: brightness(80%);
    }

    .checkbox-input:hover {
        filter: brightness(80%);
    }

    /* STYLE FOR categories.html */
    #categories-container {
        height: 75dvh;
        width: 50%;
        max-width: 500px;
    }
    .categories {
        justify-content: normal;
        margin: auto 0;
        height: unset;
    }

    .game-difficulty {
        text-align: center;
        margin: 0 auto 20px;
        background-color: var(--body-background);
        padding: 10px;
        border-radius: 10px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .category-container {
        padding: 0;
        margin-bottom: 30px;
        background-color: var(--block-background);
        border-radius: 15px;
        border: none !important;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .category-description {
        color: var(--secondary-text);
    }

    .centered {
        margin: 0 auto;
    }

    /* STYLE FOR game.html */
    .help-text {
        display: none;
    }

    .team-name {
        text-align: center;
    }

    .game-state {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .info,
    #stat-container,
    #guessed-words,
    #missed-words {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 30%;
        height: 70%;
    }

    #stat-container {
        padding: 20px 50px 20px 20px;
    }

    #control:hover {
        transform: scale(1.1);
    }

    .right-border {
        border-top-right-radius: 50% !important;
        border-bottom-right-radius: 50% !important;
    }

    .left-border {
        border-top-left-radius: 50% !important;
        border-bottom-left-radius: 50% !important;
    }

    .bubble::after {
        display: none;
    }

    #run-round {
        border: none;
    }

    /* Style for pc-controls */
    #swipe-area {
        flex-direction: column;
        justify-content: center;
        gap: 50px;
    }

    #pc-controls {
        display: flex;
        justify-content: space-between;
        gap: 40px;
    }

    #pc-controls > div {
        text-align: center;
        width: 100px;
        padding: 10px;
        font-size: 25px;
        border-radius: 10px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    #add-guess {
        background-color: var(--main-color);
    }
    #add-miss {
        background-color: var(--secondary-text);
        color: var(--body-background);
    }

    /* style for #who-guessed element */
    #who-guessed {
        width: 40%;
        text-align: center;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    #who-guessed > .team {
        background-color: var(--block-background);
        width: 60%;
        margin: 20px auto;
        border: none !important;
        border-radius: 15px;
        transition: 0.5s;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    #who-guessed > .team:hover {
        filter: brightness(80%);
    }

    /* style for after-round */
    #words-list {
        margin: 0;
        height: 80dvh;
        max-width: 40%;
        background-color: var(--main-color);
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .words-item {
        margin: 10px auto;
        background-color: var(--block-background);
        align-items: center;
        padding: 10px;
        width: 60%;
        border-radius: 10px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }

    .words-item i:hover {
        filter: brightness(80%);
    }

    .info {
        width: 17%;
    }

    .team-info {
        align-items: center;
    }

    /* STYLE FOR win.html */
    .winner-container {
        height: 100%;
        align-items: center;
    }

    #winner {
        height: 70%;
        border-radius: unset;
    }

    .winner-teams-info {
        background-color: var(--main-color);
        max-width: 40%;
        border-radius: 20px;
        padding: 20px;
    }

    .winner-team-info {
        margin: 20px auto;
        background-color: var(--block-background);
        align-items: center;
        padding: 10px;
        width: 60%;
        border-radius: 10px;
        box-shadow: 0px 3px 5px rgb(0, 0, 0, 0.5);
    }
}
