:root {
    font-size: 62.5%;/* Make rems be multiples of 10px for default browser settings */
    --light-background: hsl(200, 18%, 26%);
    --dark-background: hsl(200, 18%, 12%);
    --shadow-background: hsl(0, 0%, 46%);
    --money-color: hsl(120, 61%, 50%);
    
    --rarity-legendary: rgb(168, 0, 168);
    --rarity-epic: hsl(180, 100%, 50%);
    --rarity-uncommon: hsl(65, 100%, 60%);
    --rarity-common: white;
    
    height: 100%;
    width: 100vw;
    font-family: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    font-size: inherit;
    font-family: inherit;
}

body {
    color: white;
    margin: 0;
    height: 100%;
    width: 100%;
    background-color: var(--dark-background);
}

#content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/*Headings*/
h2 {
    all: unset;
    
    font-size: 1.2em;
    font-weight: bold;
    
    padding: 0.1em;
}

h3 {
    all: unset;
    
    font-size: 1em;
    font-weight: bold;
    
    padding: 0.1em;
}

/*Utility Classes*/
.clickable {
    display: inline;
    margin-left: 0.5em;
    margin-right: 0.5em;
    color: hsl(200, 89%, 68%);
    text-decoration: underline;
    cursor: pointer;
}

.visible_on_hover {
    filter: blur(0.5em);
    transition: filter 0.15s ease-in-out;
}

.visible_on_hover:hover {
    filter: none;
}

.red_text {
    color: hsl(355, 63%, 56%);
}

.blue_text {
    color: hsl(250, 63%, 65%);
}

.grouped {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
}

.grouped.grow > * {
    flex-grow: 1;
}

/*Options*/
#options_button {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 5rem;
    height: 5rem;
    
    background-image: url("/resources/options.svg");
    background-size: cover;
    filter: invert(100%) sepia(100%) saturate(2%) hue-rotate(228deg) brightness(101%) contrast(101%);/*Colors the SVG White*/
    
    cursor: pointer;
    
    z-index: 10;
}

#options_wrapper {
    display: flex;
    position: fixed;
    inset: 0;
    visibility: hidden;
    
    background-color: hsla(0, 0%, 50%, 0.5);
}

#options_wrapper.open {
    visibility: visible;
}

#options_menu {
    font-size: 3rem;
    
    display: flex;
    flex-direction: column;
    
    gap: 0.3em;
    
    position: absolute;
    top: 4.5rem;
    right: 9rem;
    min-width: min(70%, 70rem);
    height: 50%;
    
    background-color: var(--dark-background);
    border: 3px solid hsl(195, 100%, 50%);
    
    overflow-x: hidden;
    overflow-y: auto;
    
    user-select: none;
}

#options_menu > *:first-child {
    text-align: center;
}

#options_menu > section {
    border-top: 1px solid white;
    padding-top: 0.3em;
    flex-grow: 0;
}

#options_menu > section:has(.dynamic_menu.hidden) {
    display: none;
}

@supports not selector(:has(a, b)) {
    #options_menu > section .dynamic_menu.hidden {
        display: none;
    }
}

.dynamic_menu {
    flex-shrink: 0;
    overflow: auto;
    
    gap: 0.2em;
}

.dynamic_menu > .entry {
    display: flex;
    
    align-items: center;
    
    padding-inline: 0.4em;
    
    & > :nth-child(2) {
        margin-left: auto;
    }
}

.dynamic_menu > .entry > * {
    max-width: 12em;
    
    padding-block: 0.01em;
}

#options_menu > .menu_bar {
    margin-top: auto;
    
    padding: 0.25em;
}

#game_options_game_code {
    overflow-x: auto;
    
    user-select: all;
}


/*Menu Bar*/

.menu_bar {
    display: flex;
    
    flex-wrap: wrap;
    
    align-items: center;
}

.menu_bar > button {
    --buttonColor: black;
    --buttonBgColor: white;
    
    color: var(--buttonColor);
    
    background-color: var(--buttonBgColor);
    border: 1px solid black;
    
    cursor: pointer;
}

.menu_bar > button:disabled {
    color: white;
    background-color: hsl(0, 0%, 74%);
    box-shadow: 0px 1px 5px var(--shadow-color);
    cursor: not-allowed;
}

.menu_bar > button.critical {
    --buttonColor: white;
    --buttonBgColor: hsl(0, 90%, 54%);
}

/*

Combo List

*/

#combo_list_wrapper {
    font-size: 3rem;
    
    position: absolute;
    
    display: flex;
    
    inset: 0;
    
    overflow: hidden;
    
    visibility: hidden;
    
    z-index: 11;
    
    user-select: none;
}

#combo_list_wrapper.open {
    visibility: visible;
}

#combo_list {
    display: flex;
    flex-direction: column;
    
    padding-inline: 2rem;
    padding-block-end: 2rem;
    
    overflow-x: hidden;
    overflow-y: scroll;
    
    background-color: rgba(0, 0, 0, 0.9);
    
    margin-left: auto;
}

#combo_list > * {
    display: grid;
    grid-template-areas:
        "title title title title title"
        "card card card card card"
    ;
    grid-auto-columns: 1fr;
    
    column-gap: 1.25rem;
    
    place-items: center;
}

#combo_list > * > h3 {
    grid-area: title;
    
    padding-block: 0.75rem;
}

#combo_list .card_spot {
    --size: 1.8rem;
}



/*Lobby*/
#lobby_wrapper {
    display: flex;
    flex-direction: row;
    gap: 3em;
    font-size: 2rem;
    height: 100%;
    margin: 7rem;
    overflow-y: hidden;
    user-select: none;
}

#lobby_wrapper > * {
    flex-basis: 100%;
}

#lobby {
    display: flex;
    font-size: 3.5rem;
    flex-direction: column;
    gap: 1em;
    padding: 0.2em;
    flex-shrink: 3;
    background-color: var(--light-background);
}

#lobby > .title {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    color: hsl(51, 100%, 50%);
}

#lobby_player_list {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    flex-grow: 1;
    overflow-y: auto;
}

#lobby_player_list > * {
    margin-left: 0.5em;
}

#lobby_player_list > *:first-child {
    position: relative;
}

#lobby_player_list > *:first-child::after {
    content: url("/resources/crown.png");
    position: absolute;
    top: 0;
    bottom: 0;
    transform: translateY(-25%);
}

#lobby_code {
    text-align: center;
    margin-top: auto;
}

#lobby_code_value {
    overflow-x: auto;
    max-width: 11em;
    user-select: all;
}

#settings {
    position: relative;
    display: flex;
    font-size: 3.5rem;
    flex-direction: column;
    gap: 0.5em;
    padding: 0.2em;
    flex-shrink: 1;
    background-color: var(--light-background);
    overflow-y: auto;
}

#settings > #ping {
    position: absolute;
    top: 0.25em;
    right: 0.25em;
    font-size: 0.9em;
}

#settings > .title {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
}

#settings_list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding-left: 1em;
    padding-right: 1em;
}

.settings_list_item {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
}

.settings_list_item > * {
    flex-basis: 100%;
    white-space: nowrap;
}

.settings_list_item > *:first-child {
    flex-shrink: 3;
}

.customize_list {
    display: flex;
    flex-direction: row;
    gap: 2em;
    justify-content: center;
}

.customize_list_item {
    width: 5em;
    height: 5em;
    background-size: cover;
}

.customize_list_item.selected {
    outline: 0.2em solid hsl(51, 100%, 50%);;
}

@media (max-width: 1300px) {
    #lobby_wrapper {
        flex-direction: column;
        margin: 1rem;
    }
    
    #lobby {
        flex-shrink: 1;
    }
    
    #settings > #ping {
        position: unset;
        top: unset;
        right: unset;
        font-size: 0.9em;
    }
    
    .settings_list_item {
        flex-direction: column;
    }
    
    .settings_list_item > *:first-child {
        flex-shrink: 1;
    }
}
#start_button {
    font-size: 5rem;
    font-weight: bold;
    
    position: fixed;
    color: var(--dark-background);
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    background-color: hsl(1, 83%, 63%);
    
    border: none;
    padding: 0.3em;
    
    box-shadow: 0px 1px 5px var(--shadow-background);
    transition: box-shadow 200ms ease-in-out;
    
    cursor: pointer;
}

#start_button:hover {
    box-shadow: 0px 1px 15px var(--shadow-background);
}


#start_button:disabled {
    background-color: hsl(0, 0%, 74%);
    box-shadow: 0px 1px 5px var(--shadow-color);
    cursor: not-allowed;
}

/*Game*/
@keyframes turn_start {
    0%,
    100% {
      transform: translateX(0%);
      transform-origin: 50% 50%;
    }
  
    15% {
      transform: translateX(-30px) rotate(-6deg);
    }
  
    30% {
      transform: translateX(15px) rotate(6deg);
    }
  
    45% {
      transform: translateX(-15px) rotate(-3.6deg);
    }
  
    60% {
      transform: translateX(9px) rotate(2.4deg);
    }
  
    75% {
      transform: translateX(-6px) rotate(-1.2deg);
    }
}

#game_wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    
    font-size: 1rem;
    height: 100%;
    margin: 1.5rem;
    overflow: hidden;
}

#game_wrapper > * {
    flex-basis: 100%;
    width: 100%;
    
    overflow-y: hidden;
}

#game_player_list {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    align-items: center;
    font-size: 3rem;
    overflow-x: auto;
    user-select: none;
    padding-inline: 3rem;
    padding-block: 0.2rem;
}

#game_player_list > * {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background-color: var(--light-background);
    flex-basis: 35rem;
    flex-shrink: 0;
    align-items: center;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

#game_player_list > .out {
    background-color: hsl(0, 0%, 40%);
}

#game_player_list > .turn {
    outline: 3px solid hsl(195, 100%, 50%);
    animation: turn_start 2s ease 0s 1 normal forwards;
}

#game_player_list .player_name {
    font-size: 1.2em;
    white-space: nowrap;
}

#game_player_list .player_card_container {
    display: flex;
    flex-direction: row;
    gap: 0.3em;
}

#game_table {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    user-select: none;
}

#card_container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    overflow-x: auto;
}

#pot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--light-background);
    border: 5px solid gold;
    font-size: 5rem;
    flex-grow: 1;
    padding-block: 2rem;
}

#pot_bet {
    white-space: nowrap;
}

#game_player_list .player_money,
#pot_content,
#self_money {
    color: var(--money-color);
    font-weight: bold;
}

#player_bar {
    display: grid;
    grid-template-columns: 3fr 5fr 4fr;
    gap: 4rem;
    
    overflow-x: auto;
    overflow-y: hidden;
}

#hand {
    position: relative;
    
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    overflow-x: auto;
    user-select: none;
}

#player_bar.hide_critical #hand .playing_card {
    background-image: none !important;
    background-color: white;
}


#toggle_visibility_button {
    position: absolute;
    
    width: 4.5em;
    aspect-ratio: 1 / 1;
    
    bottom: 1rem;
    left: 1rem;
    
    border: none;
    
    border-radius: 0.5em;
    
    background-color: rgba(128, 128, 128, 0.6);
    background-image: url("/resources/unhide.svg");
    background-size: cover;
    
    cursor: pointer;
    
    z-index: 10;
}

#player_bar.hide_critical #toggle_visibility_button {
    background-image: url("/resources/hide.svg");
}

#controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6em;
    font-size: 2.25rem;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

#self {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

#self_name {
    font-size: 1.5em;
    font-weight: bold;
}

#self_money {
    font-size: 1.5em;
    font-weight: bold;
}

#self_combo {
    position: relative;
    
    font-size: 1.5em;
    font-weight: bold;
    margin-left: auto;
    white-space: nowrap;
}

#player_bar.hide_critical #self_combo {
    color: var(--dark-background) !important;
    
    pointer-events: none;
}

#player_bar.hide_critical #self_combo::after {
    position: absolute;
    
    content: '???';
    
    right: 0;
    
    color: white;
}

#combo_list_button {
    height: 2em;
    aspect-ratio: 1 / 1;
    
    align-self: center;
    
    border-radius: 25%;
    
    background: rgba(0, 0, 0, 0.3);
    background-image: url("/resources/combos.svg");
    background-size: cover;
    filter: invert(100%) sepia(100%) saturate(2%) hue-rotate(228deg) brightness(101%) contrast(101%);/*Colors the SVG White*/
    
    cursor: pointer;
}

#controls button {
    padding: 0.4em;
    border: unset;
    cursor: pointer;
}

#controls.disabled button:not(#combo_list_button) {
    opacity: 0.5;
    pointer-events: none;
}

#fold_button {
    color: white;
    font-weight: bold;
    background-color: hsl(0, 90%, 54%);
    flex-grow: 1;
}

#all_in_button {
    color: white;
    font-weight: bold;
    background-color: hsl(288, 90%, 54%);
    flex-grow: 1;
}

#info {
    display: flex;
    flex-direction: column;
    font-size: 5rem;
    overflow: hidden;
    user-select: none;
}

#feed_wrapper {
    position: relative;
    
    font-size: 2.25rem;
    
    flex-grow: 1;
}

#feed {
    position: absolute;
    
    display: flex;
    flex-direction: column;
    justify-content: end;
    
    inset: 0;
    
    overflow-y: hidden;
}

.feed_item {
    transition: background-color 100ms ease-in-out;
}

.feed_item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.feed_item > * {
    display: inline;
    overflow-wrap: anywhere;
}

.feed_item > * + *::before {
    content: " ";
    white-space: pre;
}

.feed_item > .actor, .actor_list {
    color: hsl(210, 70%, 55%);
}

.feed_item > :first-child.actor::after {
    content: ":";
}

.feed_item > .notification {
    color: hsl(44, 85%, 55%);
}

.feed_item > .action {
    color: hsl(60, 90%, 90%);
}

.feed_item > .critical_action {
    color: hsl(0, 85%, 55%);
}

.feed_item > .value {
    color: hsl(0, 40%, 65%);
}

.feed_item > .money {
    color: var(--money-color);
}

.feed_item > .highlighted_value {
    color: hsl(200, 100%, 65%);
}

#info > #ping_wrapper {
    position: relative;
    
    color: var(--dark-background);
    
    font-size: 0.4em;
}

#info > #ping_wrapper > #ping {
    position: absolute;
    
    color: white;
    
    inset: 0;
    
    text-align: right;
}

.popup_wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 2.7rem;
    
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    
    user-select: none;
}

.popup {
    display: grid;
    gap: 0.6em;
    column-gap: 1.5em;
    grid-template-columns: repeat(2, 1fr);
    
    padding: 5rem;
    
    background-color: var(--dark-background);
}

.popup_prompt {
    font-size: 1.2em;
    font-weight: bold;
    grid-column: span 2;
    text-align: center;
}

.popup_message {
    font-size: 0.8em;
    grid-column: span 2;
    text-align: center;
}

.popup > button {
    padding: 0.4em;
    border: none;
    cursor: pointer;
}

.popup > button:first-of-type:last-of-type {
    grid-column: span 2;
}

/*Cards*/
@keyframes card_spawn {
    0% {transform: translateY(-100vh);}
    100% {transform: translateY(0);}
}

@keyframes card_throw {
    0% {transform: translateY(0.00001px);}
    100% {transform: translateY(-100vh);}
}

.playing_card {
    position: absolute;
    animation: card_spawn 500ms cubic-bezier(0, 0.97, 0, 1);
}

.playing_card.disable_animation {
    animation: none;
}

.card_spot {
    position: relative;
    --heightMult: 9;
    --widthMult: 6;
    --size: 2.2rem;
    --border-width: 5px;
}

.playing_card,
.card_spot {
    height: calc(var(--size) * var(--heightMult));
    min-height: calc(var(--size) * var(--heightMult));
    width: calc(var(--size) * var(--widthMult));
    min-width: calc(var(--size) * var(--widthMult));
}

.card_spot_small {
    position: relative;
    
    --heightMult: 9;
    --widthMult: 6;
    --size: 0.8rem;
    
    height: calc(var(--size) * var(--heightMult));
    min-height: calc(var(--size) * var(--heightMult));
    width: calc(var(--size) * var(--widthMult));
    min-width: calc(var(--size) * var(--widthMult));
    
    --border-width: 2px;
}

#deck {
    --heightMult: 9;
    --widthMult: 6;
    --size: 2.2rem;
    position: initial;
    animation: none;
}

#deck > * {
    position: absolute;
    background-size: cover;
    background-image: inherit;
    height: inherit;
    min-height: inherit;
    width: inherit;
    min-width: inherit;
    transform: translateY(-100vh);
    animation: card_throw 300ms ease-in;
}

.card_spot,
.card_spot_small,
#deck {
    box-sizing: content-box;
    border: var(--border-width, 5px) solid hsl(48, 100%, 93%);
}

.playing_card,
#deck {
    background-size: cover;
}

/*Start Screen*/
#start_wrapper {
    display: flex;
    flex-direction: column;
    
    align-items: center;
    
    width: 100%;
    height: 100%;
    
    overflow: hidden;
}

h1 {
    font-size: 12rem;
    --text-shadow: hsl(195, 100%, 50%);
    --text-shadow-size: 0.03em;
    --text-shadow-size-neg: calc(-1 * var(--text-shadow-size));
    
    text-shadow:
        var(--text-shadow-size-neg) var(--text-shadow-size-neg) 0 var(--text-shadow),
        var(--text-shadow-size) var(--text-shadow-size-neg) 0 var(--text-shadow),
        var(--text-shadow-size-neg) var(--text-shadow-size) 0 var(--text-shadow),
        var(--text-shadow-size) var(--text-shadow-size) 0 var(--text-shadow);
    
    color: var(--dark-background);
    
    margin: 0;
    
    padding-block-start: 0.25em;
    
    user-select: none;
}

#start_box {
    font-size: 2.5rem;
    
    display: flex;
    flex-direction: column;
    
    background-color: hsl(270, 92%, 45%);
    background-image: linear-gradient(90deg, hsl(270, 92%, 45%), hsl(270, 92%, 55%));
    box-shadow: 0px 1px 5px var(--shadow-color);
    
    width: min(18em, 50%);
    
    padding: 1.5em;
    padding-top: 1.1em;
    
    margin-block: auto;
    
    animation: start_popup 400ms ease-in-out;
    
    user-select: none;
}

@keyframes start_popup {
    0% {transform: scale(0)}
    100% {transform: scale(1)}
}

#start_box > * {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

#start_box > button {
    color: white;
    background-color: hsl(200, 89%, 68%);
    border: 0;
    padding: 0.4em;
    cursor: pointer;
    box-shadow: 0px 1px 5px var(--shadow-background);
    transition: box-shadow 200ms ease-in-out;
}

#start_box > button:hover {
    box-shadow: 0px 1px 15px var(--shadow-background);
}

#start_box > button:disabled {
    background-color: hsl(0, 0%, 74%);
    box-shadow: 0px 1px 5px var(--shadow-color);
    cursor: not-allowed;
}

/*Loading Indicator*/

.loading_wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading {
    font-size: 1rem;
}

.loading_part {
    display: inline-block;
    width: 0.5em;
    height: 4em;
    border-radius: 0.4em;
    margin-left: 0.25em;
    margin-right: 0.25em;
    animation: loading 1s ease-in-out infinite;
}

.loading :nth-child(1) {
    background-color: hsl(288, 70%, 53%);
}

.loading :nth-child(2) {
    background-color: hsl(355, 63%, 46%);
    animation-delay: 0.09s;
}

.loading :nth-child(3) {
    background-color: hsl(41, 89%, 50%);
    animation-delay: 0.18s;
}

.loading :nth-child(4) {
    background-color: hsl(182, 63%, 60%);
    animation-delay: 0.27s;
}

@keyframes loading {
    0% {transform: scale(1)}
    20% {transform: scale(1, 2)}
    40% {transform: scale(1)}
}