@font-face {
    font-family: "Archivo";
    src: url("../assets/Archivo.ttf");
}

* {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;

    --primary: #ffde59;
    --light: #ffffff;
    --light-dark: #464646;
    --dark: #262626;
    --gray: #bababa;
    --green: #7ed957;
    --orange: #ffbd59;
    --red: #df5453;
    --pink: #ff64c4;
    --purple: #8c52ff;
}

body {
    background-color: var(--dark);
    color: var(--light);

    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

.page-wrapper {
    width: 1000px;
    margin: 0 auto;
    transform: scale(1);
    transform-origin: top center;
}

.main-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 4rem;
}

.logo {
    color: var(--primary);
    font-size: 5rem;
}

.menu {
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

.menu a {
    background-color: var(--light-dark);
    padding: 1rem 3rem;
    border-radius: 10rem;
}

.menu a img {
    width: 4rem;
    height: auto;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0rem 4rem;
    gap: 3rem;
    flex: 1;
}

.elo {
    width: 100%;
    border: solid 0.2rem var(--primary);
    border-radius: 3rem;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: left;
    gap: 3rem;
}

.elo h2 {
    font-size: 2.3rem;
}

.elo h1 {
    font-size: 6rem;
    color: var(--primary);
}

.elo-options {
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

.elo-options button {
    background-color: var(--light-dark);
    padding: 1rem 3rem;
    border-radius: 10rem;
    color: var(--light);
    font-size: 2rem;
    border: none;
    cursor: pointer;
}

.elo-options button.active-elo-option {
    background-color: var(--primary);
    color: var(--dark);
}

.ongoing {
    width: 100%;
    border: solid 0.2rem var(--gray);
    border-radius: 3rem;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: left;
    gap: 3rem;
}

.ongoing-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
}

.ongoing-header h2 {
    font-size: 2.3rem;
}

.ongoing-header a {
    font-size: 2.3rem;
    border: none;
    background-color: transparent;
    color: var(--primary);
    text-decoration: none;
}

.ongoing-games {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.no-game {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 1.5rem;
    border: dotted 4px var(--light-dark);
    height: 8rem;
}

.no-game.hidden {
    display: none;
}

.no-game p {
    font-size: 2rem;
    color: var(--light-dark);
}

.game-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 1.5rem;
    background-color: var(--light-dark);
    text-decoration: none;
    height: 8rem;
}

.left-game-container {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 2rem;
}

.tiles-left {
    font-size: 5.2rem;
    color: var(--primary);
}

.game-description {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.game-description h2 {
    font-size: 2rem;
    color: var(--light);
}

.game-description p {
    font-size: 1.8rem;
    color: var(--gray);
}

.game-container img {
    width: 4rem;
    height: 4rem;
}

.played {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

.played-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.played-header h2 {
    font-size: 2.3rem;
}

.played-header p {
    font-size: 2.3rem;
    color: var(--gray);
}

.played-header p b {
    color: var(--light);
}

.no-played-game {
    display: flex;
    padding: 5rem 0;
    align-items: center;
    justify-content: center;
}

.no-played-game.hidden {
    display: none;
}

.no-played-game p {
    font-size: 2.5rem;
    color: var(--light-dark);
}

.played-game-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 6rem;
}

.left-played-game-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.profile-box {
    background-color: #3b3b3b;
    border-radius: 1rem;
    padding: 1.2rem;
}

.profile-box img {
    width: 3rem;
    height: 3rem;
}

.played-game-description {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.played-game-description h2 {
    font-size: 2.1rem;
    color: var(--light);
}

.played-game-description p {
    font-size: 1.9rem;
    color: var(--gray);
}

.elo-gain {
    font-size: 2.5rem;
}

.elo-gain.positive {
    color: var(--green);
}

.elo-gain.negative {
    color: var(--red);
}

.divider {
    background-color: var(--light-dark);
    height: 2px;
    border: 0;
}

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 1rem;
    padding: 4rem 0;
    position: relative;
    bottom: 0;
}

footer p {
    font-size: 2rem;
}

footer p a {
    color: var(--gray);
    text-underline-offset: 0.3rem;
}

/* The game */

.board-menu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5rem;
    padding-bottom: 3rem;
}

.back {
    position: absolute;
    left: 3rem;
}

.back img {
    width: 5rem;
    height: 5rem;
}

.board-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.board-info h2 {
    font-size: 2.4rem;
}

.board-info p {
    font-size: 1.7rem;
}

.turn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 5rem;
}

.turn-box {
    width: 90%;
    background-color: #3b3b3b;
    border-radius: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.player1, .player2 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    border-radius: 1.2rem;
    padding: 2rem;
    flex: 1;
}

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

.player2 {
    justify-content: flex-end;
}

.player-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
}

.player1 .player-info {
    align-items: flex-start;
}

.player2 .player-info {
    align-items: flex-end;
}

.player-info h3 {
    font-size: 2rem;
}

.player-info h2 {
    font-size: 2.4rem;
    font-weight: bold;
}

.player1 img, .player2 img {
    height: 5.5rem;
    width: 5.5rem;
}

.highlighted {
    background-color: #737373;
    box-shadow: inset 0 -0.5rem 0 var(--primary);
}

.board {
    flex: 1;
    background-color: var(--light-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.grid {
    background-color: #000;
    width: 100vw;
    height: 100vw;
    display: grid;
    grid-template-rows: repeat(15, 1fr);
    grid-template-columns: repeat(15, 1fr);
    gap: 0.2rem;
    padding: 0.2rem;
}

.cell {
    background-color: #3b3b3b;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.cell.c0 {
    background-color: var(--red);
}

.cell.c1 {
    background-color: var(--orange);
}

.cell.c2 {
    background-color: var(--green);
}

.cell.c3 {
    background-color: var(--pink)
}

.cell.c4 {
    background-color: var(--purple);
}

.cell.grid-brick {
    background: linear-gradient(to bottom, #ffffff 0%, #f2f2f2 45%, #dbdbdb 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.15);
    color: #000;
}

.rack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
}

.bricks {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
    align-content: space-between;
}

.brick {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc((100vw - 1rem - 8*1rem) / 7);
    height: calc((100vw - 1rem - 8*1rem) / 7);
    background: linear-gradient(to bottom, #ffffff 0%, #f2f2f2 45%, #dbdbdb 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.15);
    color: #000;
    border-radius: 1rem;
}

.brick.shiny {
    background: linear-gradient(to bottom, var(--primary) 0%, #ffd059 45%, var(--orange) 100%);
    box-shadow: inset 0 1px 0 #ffde59e9, inset 0 -2px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.brick h2 {
    font-size: 3rem;
}

.brick p {
    font-size: 1.8rem;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
}

.rack-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 0.5rem;
    width: 100%;
}

.rack-options button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: #737373;
    padding: 1.5rem 2.5rem;
    border-radius: 10rem;
    border: none;
    flex: 1;
}

.rack-options button:hover {
    background-color: #949494;
}

.rack-options button.gold {
    background-color: var(--orange);
    position: relative;
}

.rack-options button.gold:hover {
    background-color: var(--primary);
}

.rack-options img {
    width: 3rem;
    height: 3rem;
}

.rack-options h2 {
    color: var(--light);
    font-size: 2.5rem;
}

.popup {
    display: none;
    background-color: var(--light-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    padding: 5rem 0;
    border-radius: 3rem;
    box-shadow: 0px 0px 2rem 1rem rgba(0,0,0,0.25);
}

.popup h1 {
    font-size: 5rem;
    white-space: nowrap;
}

.quit-options {
    display: flex;
    flex-direction: row;
    gap: 3rem;
}

.quit-options button {
    background-color: #737373;
    padding: 1.5rem 4rem;
    border-radius: 10rem;
    border: none;
    font-size: 2.5rem;
    color: var(--light);
    font-weight: bold;
}

.quit-options button:hover {
    background-color: #949494;
}

.quit-options button#do-quit {
    background-color: var(--red);
}

.quit-options button#do-quit:hover {
    background-color: #e06f6f;
}

/* New game */

.matchmaking-menu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5rem;
    padding-bottom: 3rem;
}

.matchmaking-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.matchmaking-info h2 {
    font-size: 2.4rem;
}

.matchmaking-info p {
    font-size: 1.7rem;
}

.container-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 4rem 0rem 4rem;
    gap: 3rem;
    flex: 1;
}

.queue {
    width: 100%;
    border: solid 0.2rem var(--gray);
    border-radius: 3rem;
    padding: 4rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.queue h2 {
    font-size: 2rem;
}

.queue button {
    padding: 1rem 3rem;
    border-radius: 10rem;
    background-color: var(--primary);
    color: var(--dark);
    font-size: 2rem;
    border: solid 0.2rem var(--primary);
}

.queue button.pressed {
    background-color: var(--dark);
    color: var(--primary);
}

.friend {
    width: 100%;
    border: solid 0.2rem var(--gray);
    border-radius: 3rem;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.friend h2 {
    font-size: 2rem;
}

.friend form {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    position: relative;
    align-items: center;
}

.friend form h1 {
    color: var(--primary);
    font-size: 5rem;
}

.friend form input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    font-size: 5rem;
    border-bottom: 0.4rem solid var(--primary);
    outline: none;
    color: var(--primary);
}

.friend form button {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
}

.friend form button img {
    height: 3.5rem;
    width: 3.5rem;
}

.room {
    width: 100%;
    border: solid 0.2rem var(--gray);
    border-radius: 3rem;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.room h2 {
    font-size: 2rem;
}

.room-code {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.room-code h1 {
    color: var(--primary);
    font-size: 5rem;
    text-transform: uppercase;
}

.room-code button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
}

.room-code button img {
    width: 2.6rem;
    height: auto;
}

/* Leaderboard */

.leaderboard-menu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5rem;
    padding-bottom: 3rem;
}

.leaderboard-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.leaderboard-info h2 {
    font-size: 2.4rem;
}

.leaderboard-info p {
    font-size: 1.7rem;
}

.container-leaderboard {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.soon {
    font-size: 3rem;
}

/* Account */

.account-menu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5rem;
    padding-bottom: 3rem;
}

.account-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.account-info h2 {
    font-size: 2.4rem;
}

.account-info p {
    font-size: 1.7rem;
}

.container-account {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5rem;
    flex: 1;
}

.soon-options {
    font-size: 3.5rem;
    text-align: center;
}

.account-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.account-options a {
    background-color: #737373;
    padding: 1.5rem 4rem;
    border-radius: 10rem;
    border: none;
    font-size: 2.5rem;
    color: var(--light);
    font-weight: bold;
    text-decoration: none;
    width: max-content;
}

.account-options a.dangerous {
    background-color: var(--red);
}

.account-options a:hover {
    background-color: #949494;
}

.account-options a.dangerous:hover {
    background-color: #e06f6f;
}

/* Desktop */

.page-wrapper {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    flex: 1;
}

@media screen and (min-width: 1000px) {
    .main-menu {
        padding: 1.5rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .menu {
        gap: 1rem;
    }

    .menu a {
        padding: 0.6rem 1.5rem;
        border-radius: 5rem;
    }

    .menu a img {
        width: 2rem;
    }

    .container,
    .container-new {
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }

    .elo {
        padding: 2rem;
        gap: 1.5rem;
        border-radius: 2rem;
    }

    .elo h1 {
        font-size: 3rem;
    }

    .elo h2 {
        font-size: 1.5rem;
    }

    .elo-options button {
        font-size: 1.2rem;
        padding: 0.5rem 1.5rem;
    }

    .ongoing {
        border-radius: 2rem;
    }

    .ongoing,
    .played,
    .queue,
    .friend,
    .room {
        padding: 2rem;
        gap: 1.5rem;
    }

    .ongoing-header h2,
    .ongoing-header a,
    .played-header h2,
    .played-header p {
        font-size: 1.5rem;
    }

    .game-container {
        height: 5rem;
        padding: 0.5rem 1rem;
        border-radius: 1.2rem;
    }

    .tiles-left {
        font-size: 3rem;
    }

    .game-description h2 {
        font-size: 1.4rem;
    }

    .game-description p {
        font-size: 1.2rem;
    }

    .played {
        margin: 0rem;
        padding: 1rem;
    }
    
    .played-game-container {
        height: 4rem;
    }

    .played-game-description h2 {
        font-size: 1.4rem;
    }

    .played-game-description p {
        font-size: 1.2rem;
    }

    .elo-gain {
        font-size: 1.5rem;
    }

    footer {
        padding: 2rem;
    }

    footer p {
        font-size: 1rem;
    }

    .desktop-restricted {
        height: 100vh;
        overflow: hidden;
    }

    .desktop-restricted::after {
        content: "Not available on large screens :(";
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--dark);
        height: 100%;
        width: 100%;
        position: absolute;
        inset: 0;
    }
}