:root {
    --max-content-width: 768px;
    --ui-background-default: #ffffff;
    --ui-background-highlight: #dddddd;
    --ui-highlight-color: #07f;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("/background.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -1000;
}

html {
    font-family: "Lora", "Times New Roman", Times, serif;
    font-size: 14px;
}

body {
    margin: 0;
}

header {
    box-sizing: border-box;
    background: var(--ui-background-default);
    padding: 8px;
    z-index: 1500;
    height: 48px;
    position: relative;
}

header.fixed {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 100000;
}

h1, h2, h3, h4, h5, h6, strong, th {
    font-family: "Cinzel";
}

img {
    width: 100%;
}

header > h1 {
    margin: 0;
    line-height: 32px;
}

h1 > a {
    text-decoration: none;
    color: black;
    outline: none;
}

.form-wrapper {
    max-width: 256px;
    margin: auto;
    margin-top: 32px;
    margin-bottom: 32px;
    box-shadow: 0 0 8px black;
}

.content {
    border-bottom: 1px solid var(--ui-background-default);
}

form > div {
    margin-top: 1em;
    margin-bottom: 1em;
}

.form-wrapper > h2:first-child,
.content > h2:first-child {
    margin-top: 0;
}

.error {
    color: darkred;
}

input:not([type="checkbox"]):not([type="radio"]),
button,
select,
a.button,
summary {
    width: 100%;
    box-sizing: border-box;
    border: none;
    padding: 8px;
    background: white;
    display: inline-block;
    text-align: left;
    text-decoration: none;
    color: black;
    font-family: "Lora", "Times New Roman", Times, serif;
    font-size: 12px;
    position: relative;
    outline: none;
    margin-top: 2px;
    margin-bottom: 2px;
}

input[type="range"] {
    padding: 2px !important;
}

/*
input:not([type=checkbox]):not([type=radio]):focus, button:focus, select:focus, a.button:focus, summary:focus {
}
*/

button,
select,
a.button,
summary {
    cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
button:hover,
select:hover,
a.button:hover,
summary:hover {
    background: #eee;
}

input:not([type="checkbox"]):not([type="radio"]):active,
button:active,
select:active,
a.button:active,
summary:active {
    background: #ddd;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
button:focus,
select:focus,
a.button:focus,
summary:focus {
    outline: 1px solid var(--ui-highlight-color);
    z-index: 10000;
}


button,
a.button,
input[type="submit"] {
    text-align: center !important;
}

input:disabled,
button:disabled,
select:disabled,
a.button.disabled {
    color: gray;
}

select {
    text-align: left;
}

main {
    max-width: 768px;
    margin: auto;
    margin-bottom: 32px;
}

header {
    text-align: center;
    box-shadow: 0 8px 8px -8px black;
    z-index: 500;
    position: relative;
}

.hidden {
    height: 0 !important;
    visibility: hidden;
}

.list,
#chat .togglable,
#history .togglable,
.form-wrapper,
.content {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.content,
.form-wrapper {
    padding: 16px;
}

.dwarf .dwarf-image {
    width: 128px;
    flex-grow: 0;
}

.item-contents {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

#chat,
#history {
    max-width: 384px;
    position: fixed;
    bottom: 0;
    z-index: 2000;
    height: 32px;
    box-shadow: 0 -8px 8px -8px black;
}

#chat button,
#history button,
#chat input,
#history input {
    height: 32px;
    margin: 0;
}

#chat {
    right: 0;
}

#chat-submit {
    display: none;
}

#history {
    left: 0;
}

#chat.visible,
#history.visible {
    z-index: 3000;
    height: auto;
}

#chat.visible > button,
#history.visible > button {
    position: relative;
    z-index: 3500;
}

@media only screen and (max-width: 768px) {
    #chat {
        max-width: 50vw;
        width: 50vw;
    }

    #chat.visible {
        max-width: 100vw;
        width: 100vw;
    }

    #history {
        max-width: 50vw;
        width: 50vw;
    }

    #history.visible {
        max-width: 100vw;
        width: 100vw;
    }

    .messages {
        max-height: 256px;
    }
}

.message {
    margin: 8px;
}

.messages {
    overflow-y: auto;
    max-height: 384px;
    border-top: 1px solid var(--ui-background-default);
    overflow-wrap: anywhere;
}

.messages .username,
.messages .time {
    font-weight: bold;
}

ul {
    padding-left: 20px;
    margin: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding-left: 4px;
    padding-right: 4px;
    border-bottom: 1px solid var(--ui-background-default);
    border-top: 1px solid var(--ui-background-default);
    background: rgba(255, 255, 255, 0.5);
    position: relative;
}

input[type="checkbox"] {
    width: auto;
}

.health-bar-wrapper {
    width: 100%;
    height: 20px;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
}

.health-bar-curr {
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(200, 0, 0, 0.3);
}

.health-bar-overlay {
    width: 100%;
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    text-align: center;
}

.score-bar-wrapper {
    width: 100%;
    height: 20px;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
}

.score-bar-curr {
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 100, 100, 0.3);
}

.score-bar-marker {
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    background: none;
    border-right: 1px solid rgb(0, 100, 100);
}

.score-bar-overlay {
    width: 100%;
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
    text-align: center;
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 2px;
    margin-right: 2px;
    cursor: pointer;
    font-weight: bold;
    color: black;
}

.tooltip .tooltiptext {
    visibility: hidden;
    position: absolute;
    width: 128px;
    bottom: 16px;
    left: calc(50% - 64px);
    z-index: 10000;
    background: white;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 8px;
    box-shadow: 0 0 8px;
    padding: 8px;
    font-family: "Lora", "Times New Roman", Times, serif;
    font-weight: normal;
    color: black;
}

.tooltip:hover .tooltiptext,
.tooltip:active .tooltiptext {
    visibility: visible;
}

#server-info {
    position: fixed;
    bottom: 35px;
    left: 0;
    text-align: center;
    width: 100vw;
}

#server-info > * {
    background-color: black;
    color: white;
    font-family: "Courier New", Courier, monospace;
    font-size: 10px;
}

.online {
    color: green;
}

.offline {
    color: red;
}

.clickable-item {
    cursor: pointer;
}

.clickable-item .unavailable {
    text-decoration: line-through;
}

.loading {
    margin-top: 30vw;
    text-shadow: 0 0 32px black;
    color: white;
    font-size: 16px;
    text-align: center;
}

.button-row {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}

.button-row > * {
    width: auto;
    flex-grow: 0;
    margin: 0;
    padding: 8px;
}

.occupations {
    display: flex;
    align-items: stretch;
    align-content: stretch;
    flex-wrap: wrap;
}

.occupations > * {
    flex-grow: 1;
}

.list {
    width: 100%;
    border-collapse: collapse;
}

.list td {
    border-bottom: 1px solid white;
    border-top: 1px solid white;
    padding: 0;
    vertical-align: top;
}

.list td.grow {
    width: 100%;
}

.list td.list-item-content > *:first-child {
    margin-top: 0;
}

.list td.list-item-content > *:last-child {
    margin-bottom: 0;
}

.list td.list-item-content {
    padding: 8px;
}

.list td .list-item-image {
    width: 128px;
    height: 128px;
    flex-grow: 0;
}

.list td .placeholder {
    background: rgba(0, 0, 0, 0.3);
    flex-grow: 0;
}

h4,
.title {
    margin-bottom: 0;
}

.subtitle {
    margin-top: 0;
}

#received-item-popup {
    position: fixed;
    left: 0;
    bottom: 32px;
    width: 96px;
    z-index: 1000;
}

.received-item {
    width: 96px;
    height: 48px;
    display: flex;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.received-item-image {
    width: 48px;
    height: 48px;
}

.received-item-content {
    font-size: 16px;
    text-align: center;
    vertical-align: middle;
    line-height: 48px;
    width: 48px;
    height: 48px;
}

@media screen and (max-width: 768px) {
    #received-item-popup {
        width: 64px;
    }

    .received-item {
        width: 64px;
        height: 32px;
    }

    .received-item-image {
        width: 32px;
        height: 32px;
    }

    .received-item-content {
        font-size: 12px;
        line-height: 32px;
        width: 32px;
        height: 32px;
    }
    
}

.item-common {
    background: rgba(255, 255, 255, 0.2);
}
.item-uncommon {
    background: rgba(0, 175, 9, 0.2);
}
.item-rare {
    background: rgba(4, 101, 211, 0.2);
}
.item-epic {
    background: rgba(192, 0, 199, 0.2);
}
.item-legendary {
    background: rgba(194, 110, 0, 0.2);
}

.reward-mode-best {
    background: rgba(205, 27, 0, 0.2);
}

.reward-mode-best {
    background: rgba(205, 0, 0, 0.2);
}

.reward-mode-chance {
    background: rgba(205, 205, 0, 0.2);
}

.reward-mode-fair {
    background: rgba(0, 205, 0, 0.2);
}


.list-item-row.selected {
    background: rgba(0, 0, 0, 0.3);
}

.short-info + .short-info::before {
    content: " | ";
}

ul {
    padding: 8px;
}

.image-aside {
    display: flex;
    margin-top: 1em;
    margin-bottom: 1em;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.image-aside > img {
    width: 256px;
    height: 256px;
}

.image-aside.small > img {
    width: 128px;
    height: 128px;
}

.image-aside > div {
    margin-left: 16px;
    width: 100%;
}

.image-aside > div > *:first-child {
    margin-top: 0;
}

@media only screen and (max-width: 768px) {
    .image-aside:not(.small) {
        flex-wrap: wrap;
    }

    .image-aside:not(.small) > img {
        width: 100%;
        height: auto;
    }

    .image-aside:not(.small) > div {
        width: 100%;
        margin-left: 0;
    }

    .image-aside:not(.small) > div > *:first-child {
        margin-top: 1em;
    }
}

.important {
    background: rgba(255, 255, 255, 0.5);
    padding: 16px;
    margin-top: 1em;
    margin-bottom: 1em;
}

.important > *:first-child {
    margin-top: 0;
}

.important > *:last-child {
    margin-bottom: 0;
}

#tutorial-button {
    padding: 0;
    position: fixed;
    z-index: 10000;
    box-shadow: 0 0 8px black;
    top: calc(50vh - 36px);
    left: 0;
    width: 72px;
    height: 72px;
}

#tutorial-button::after {
    content: "!";
    position: absolute;
    top: 6px;
    right: 9px;
    font-size: 36px;
    color: rgb(100, 0, 0);
    animation: quest 2s alternate-reverse infinite;
    text-shadow: 0 0 4px white;
}

#tutorial-button.complete::after {
    color: rgb(0, 100, 0);
    animation: quest 500ms alternate-reverse infinite;
}


@media only screen and (max-width: 768px) {
    #tutorial-button {
        top: calc(50vh - 24px);
        left: 0;
        width: 48px;
        height: 48px;
    }

    #tutorial-button::after {
        top: 4px;
        right: 6px;
        font-size: 24px;
    }
}


@keyframes quest {
    from {
        transform: scale(100%);
    }
    to {
        transform: scale(150%);
    }
}

.panel-wrapper {
    position: fixed;
    z-index: 20000;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel {
    max-width: 384px;
    background-color: var(--ui-background-highlight);
    margin: 32px;
    box-shadow: 0 0 8px black;
}

.panel-content {
    padding: 8px;
}

.next-unlocks {
    overflow-y: auto;
    max-height: 104px;
}

.next-unlock {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
    margin-bottom: 2px;
}

.next-unlock > * {
    margin: 0;
}

.next-unlock > img {
    width: 32px;
    height: 32px;
}

.next-unlock.future > img {
    filter: grayscale(100%);
}

figure {
    margin: 0;
    background: rgba(255, 255, 255, 0.5);
}

figure > figcaption {
    padding: 8px;
}

details > div {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px;
    margin-bottom: 2px;
}

details > summary {
    margin-bottom: 0;
}

summary > * {
    display: inline;
    margin: 0;
}

tr.current-user td {
    background: rgba(255, 255, 255, 0.75);
}

a {
    color: black;
}

.invitation-link {
    font-family: monospace;
}

.formset {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px;
    margin-top: 1em;
    margin-bottom: 1em;
}

.formset > *:first-child {
    margin-top: 0;
}

.formset > *:last-child {
    margin-bottom: 0;
}

.list-item-image-col {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.list-item-image-col > * {
    width: 32px;
    height: 32px;
    outline: 1px solid rgba(255, 255, 255, 0.5);
}

.list-item-image-corner {
    width: 48px;
    height: 48px;
    position: absolute;
    top: 80px;
    left: 80px;
    outline: 1px solid rgba(255, 255, 255, 0.5);
}

.list-item-image-corner.consumable {
    top: 0px;
    left: 80px;
}

.slider {
    display: flex;
    flex-wrap: nowrap;
}

.slider button, .slider a.button, .slider input {
    flex-grow: 0;
    flex-shrink: 1;
    width: auto;
}

.slider input.slider-range {
    flex-grow: 1;
    flex-shrink: 1;
    max-width: 96px;
}

.slider input.slider-number {
    width: 64px;
}

@media screen and (max-width: 768px) {
    .slider {
        flex-wrap: wrap;
    }

    .slider input.slider-range {
        width: 100%;
    }
}

[inert], [inert] * {
    pointer-events: none;
    cursor: default;
    user-select: none;
}


nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    text-align: center;
    background: var(--ui-background-default);
    box-shadow: 0 8px 8px -8px black;
}

nav .nav-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: end;
}

nav .nav-section.ingame {
    font-style: italic;
}

nav.desktop a.button, nav.ingame a.button {
    width: auto;
    margin: 0;
    height: 32px;
}

nav a.button.active {
    background: var(--ui-background-highlight);
}

@media screen and (max-width: 768px) {
    nav .nav-description {
        display: none;
    }

    nav a.active .nav-description {
        display: inline;
    }
    
    nav .nav-section {
        justify-content: space-evenly;
    }
}

nav.mobile {
    position: fixed;
    top: 48px;
    z-index: 100000;
    width: 100%;
}

nav.mobile a.button {
    width: 100%;
    text-align: left !important;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
}

.filter {
    width: 100%;
    position: sticky;
    top: 32px;
    z-index: 1000;
    background: var(--ui-background-highlight);
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 8px 8px -8px black;
    flex-wrap: nowrap;
}

.filter > * {
    display: inline-block;
    flex-grow: 1;
    flex-shrink: 1;
}

.filter > *.no-shrink {
    flex-shrink: 0;
}

span.material-symbols-outlined {
    width: 16px;
    height: 16px;
    font-size: 16px;
    vertical-align: middle;
}

.stars span.material-symbols-outlined {
    font-size: 14px;
}

.nametag {
    margin-left: 2px;
    margin-right: 2px;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 8px;
    background: white;
    color: black;
    font-size: 12px;
    background-size: 200% 100% !important;
    animation: shine 10s ease-in-out infinite alternate-reverse;
}

.nametag.premium {
    background-image: linear-gradient(45deg,#BF953F, #FCF6BA, #BF953F) !important;
}

.nametag.developer {
    background-image: linear-gradient(45deg,#813fbf, #d9bafc, #813fbf) !important;
}

.nametag.veteran {
    background-image: linear-gradient(45deg,#3f63bf, #badafc, #3f63bf) !important;
}

.nametag.guest {
    background-image: linear-gradient(45deg,#45bf3f, #bafcba, #45bf3f) !important;
}

.nametag.winner {
    background-image: linear-gradient(45deg,#bf483f, #fcbbba, #bf483f) !important;
}



.premium-feature {
    background-image: linear-gradient(45deg,#BF953F, #FCF6BA, #BF953F) !important;
    background-size: 200% 100% !important;
    animation: shine 10s ease-in-out infinite alternate-reverse;
}

@keyframes shine {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 0%;
    }
}

#menu-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    padding: 8px;
    z-index: 100000;
    margin: 0;
}

#menu-button > span.material-symbols-outlined {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .mobile {
        display: initial;
    }

    .desktop {
        display: none;
    }
}

audio {
    width: 100%;
}

progress {
    width: 100%;
    height: 16px;
}

#progress-bar-label {
    font-style: italic;
}

.panel-scrollable {
    overflow-y: auto;
    max-height: calc(40vh - 64px);
}

button.inline, .button.inline {
    margin: 0;
    padding: 4px;
}

.table-wrapper {
    overflow-x: auto;
}

/*.ranking td {
    max-width: 128px;
}*/

.hire-dwarf-scrollable {
    max-height: 386px;
    overflow-y: auto;
    /*background: rgba(255, 255, 255, 0.5);
    padding-left: 16px;
    padding-right: 16px;*/
}