body {
    margin: 0;
}

body {
    text-align: center;
    padding-top: 32px;
}

a:link, a:visited {
    text-decoration: none;
    color: #FFF;
}

h1 {
    margin: 0;
    line-height: 0.8em;
}

form {
    position: relative;
}
form label,
.form-label {
    display: inline-block;
    position: relative;
    margin-top: 24px;
}
form label input,
.form-label input {
    position: relative;
    z-index: 1;
    padding: 4px 6px;
}
form label span,
.form-label span {
    position: absolute;
    z-index: 2;
    left: 8px;
    top: 6px;
    pointer-events: none;
    font-size: 14px;
    color: #777;
    transition: all 0.2s linear;
}
form label input:focus + span,
form label input:-webkit-autofill + span,
form label input.filled + span,
.form-label input:focus + span,
.form-label input:-webkit-autofill + span,
.form-label input.filled + span {
    top: -18px;
    font-size: 10px;
}
input, button {
    padding: 4px;
    border: 1px solid #666;
    background-color: #EEE;
    box-shadow: none;
    transition: box-shadow 0.2s;
    border-radius: 1px;
}
input[type="submit"],
input[type="button"],
button {
    min-width: 96px;
    border-radius: 3px;
    box-shadow: 1px 1px 0 #EEE inset, 2px 2px 0 #FFF inset;
}
input:focus, select:focus, textarea:focus, button:focus {
    outline: none;
    border-color: #1870F0;
    box-shadow: 0 0 0 3px rgba(0, 144, 237, 0.4);
}
input.active, button.active {
    border-color: #1870F0;
    box-shadow: 0 0 0 3px rgba(0, 144, 237, 0.8);
}
input:not([type="checkbox"]):not([type="radio"]), textarea, select, button {
    min-width: 160px;
    padding: 8px;
    border-radius: 3px;
}
input[type="color"] {
    padding: 2px !important;
}

input[type="submit"],
input[type="button"],
button {
    background-color: #EEE;
    box-shadow: -2px -2px 1px rgba(0, 0, 0, 0.2) inset, 2px 2px 1px rgba(255, 255, 255, 0.2) inset;
}

input[type="submit"]:active,
input[type="button"]:active,
button:active {
    box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.2) inset, -2px -2px 1px rgba(255, 255, 255, 0.2) inset;
}

input[type="text"]:read-only,
input[type="date"]:read-only,
input[type="text"]:disabled,
input[type="date"]:disabled {
    background-color: #BBB;
}

button {
    min-width: 32px;
    cursor: pointer;
}
button img {
    filter: brightness(0);
}
button img.grayscale {
    filter: grayscale(0.75) opacity(0.75);
}
button:hover img,
button img:hover {
    filter: brightness(1);
}
input[type="submit"]:disabled,
input[type="button"]:disabled,
button:disabled {
    box-shadow: none;
    cursor: auto;
}
button:disabled img {
    filter: grayscale(1);
    opacity: 0.5;
}
button .small-icon { width: 14px; }


.form {
    display: inline-flex;
    flex-direction: column;
}

.pixelated {
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -o-crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}

.non-pixelated {
    image-rendering: initial;
    -ms-interpolation-mode: initial;
}

.background-blur p {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.background-blur h1, 
.background-blur h2 {
    text-shadow: 0 0 4px #FFF;
}

.header {
    display: block;
    width: 100%;
    color: #FFF;
    background: transparent url('../img/background/grass_side.png') repeat-x left top/32px 32px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    border-bottom: 2px solid #000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    position: relative;
}
.menu-mobile-button {
    display: none;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    background: transparent url('../img/ui/icon-menu.png') no-repeat center/contain;

    image-rendering: initial;
    -ms-interpolation-mode: initial;
}
.menu-mobile-button:active {
    transform: scale(1.1);
}
.menu-mobile-fade {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100dvw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 6;
    animation: anim-fade-in 0.4s;
}
.menu-mobile-fade.hide {
    opacity: 0;
    animation: anim-fade-out 0.4s;
}
.menu-items {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 1360px;
    height: 32px;
    position: relative;
    padding: 0 8px;
    margin: 0 auto;
    box-sizing: border-box;
}
.header .logo,
.header .menu {
    filter: drop-shadow(2px 2px 0 #000);
}
.header a:link, .header a:visited {
    color: #FFF;
}
.header a:hover {
    text-decoration: none;
}
.header .logo {
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    left: 8px;
    top: auto;
    user-select: none;
}
.header .menu {
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    margin-right: 8px;
}

.header .cookies {
    user-select: none;
    cursor: help;
}
.header .no-line, .header a.no-line:link {
    text-decoration: none;
}

#languageSelect {
    font-size: 12px;
}
#languageSelect .selected-text {
    margin-right: 4px;
}

.container {
    display: block;
    width: 100%;
    max-width: 1360px;
    height: auto;
    margin: 0 auto;
}

.content {
    display: block;
    height: auto;
    padding: 16px 32px;
    box-sizing: border-box;
    position: relative;
    text-align: left;
}
.content:after {
    content: "";
    display: block;
    width: 100%;
    max-width: 1296px;
    margin: 0 auto;
    position: relative;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    border-bottom: 2px solid #000;
    margin-top: 24px;
}

/** ? **/
.list-container {
    display: inline-block;
    position: relative;
    width: auto;
    height: 26px;
    border: 1px solid #000;
    background-color: transparent;
    color: #000;
    cursor: default;
    user-select: none;
    font-size: 12px;
}
.list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: auto;
    min-width: 80px;
    position: absolute;
    right: 0;
    top: 26px;
    background-color: transparent;
}
.list-container.open .list {
    display: inline-flex;
}
.list-element {
    margin-top: 2px;
    cursor: pointer;
}
.list-element-selected {
    padding: 0 4px;
}
.list-container.open .list-element-selected .caret {
    transform: rotate(180deg);
}
.list-element-selected:hover {
    box-shadow: -1px -1px 0 #BBB inset;
}
.list-element-selected,
.list-element {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: 24px;
    background-color: #FFF;
    border: 1px solid #000;
}
.list-element-selected img,
.list-element img {
    height: 14px;
    padding: 0 4px;
    width: auto;
}
.list-element .text {
    transform: scaleX(0.9);
}
/** ? **/

.footer {
    padding: 0 32px;
    margin-bottom: 32px;
}
.footer a:link, .footer a:visited {
    font-weight: bold;
    color: #333;
    text-decoration: none;
    text-shadow: none;
    margin: 0 8px;
}

.rows {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}
.cols {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}
.cols-rows {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.cell-asc {
    align-self: center;
}

.info {
    display: block;
    width: 40%;
    margin: 0 auto;
    text-align: center;
}

.icon-button {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    user-select: none;
}
.icon-button:hover {
    transform: scale(1.1);
}
.icon-button:active {
    transform: scale(1.2);
}
.icon-button.icon-button-auto {
    width: auto;
    height: auto;
}

.info-btn {
    background-image: url('../img/icons/info.png');
    transform-origin: center bottom;
}

.new-tags-container {
    border: 2px dashed #888;
    display: inline-block;
    width: calc(100% - 8px);
    margin-top: 8px;
}
.new-tags-container .tag {
    display: inline-block;
    border: 2px solid #666;
    margin: 4px;
    padding: 2px;
}
.tags-autocomplete-list {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    width: calc(100% - 4px);
    max-width: min(90vw, 400px);
    min-height: 4px;
    height: auto;
    max-height: 190px;
    padding: 6px 10px;
    border: 1px solid rgba(64, 64, 64, 0.8);
    background-color: rgba(128, 128, 128, 0.9);
    z-index: 4;
    padding: 1px;
    border-radius: 2px;
    overflow: auto;
}
.tags-autocomplete-list .option {
    position: relative;
    left: 0;
    top: 0;
    padding: 2px;
    margin: 2px;
    box-sizing: border-box;
    border: 1px solid rgba(128, 128, 128, 0.8);
    background-color: rgba(230, 230, 230, 0.9);
    border-radius: 2px;
    cursor: pointer;
    color: #333;
}
.tags-autocomplete-list .option:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.world-tags-input:focus + .tags-autocomplete-list,
.world-tags-input:active + .tags-autocomplete-list,
.world-tags-input + .tags-autocomplete-list:focus,
.world-tags-input + .tags-autocomplete-list:active {
    display: block;
}

.creator-flag {
    display: inline-block;
    width: 14px;
    height: 14px;
    outline: 2px solid #006;
}

.error-403 {
    display: flex;
    flex-direction: column;
}
.error-403 a:link,
.error-403 a:visited {
    color: #000;
}
.forbidden-403 {
    display: inline-block;
    margin: 32px auto;
    padding: 8px;
    font-size: 56px;
    font-weight: normal;
    letter-spacing: 8px;
    background: -webkit-linear-gradient(top, #F44 0%,#300 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-stroke: 8px transparent;
}
.error-403 a.forbidden-403:link,
.error-403 a.forbidden-403:visited {
    color: #FFF;
}

/* --- mainpage start --- */
body.mainpage {
    min-height: calc(100vh - 32px);
    margin-top: 32px;
    padding: 16px 0;
    box-sizing: border-box;
    max-width: 100vw;
    background: url('../img/background/bg.jpg') no-repeat center top/cover;
    background-attachment: fixed;
}
/*body.mainpage.landing {
    overflow-x: hidden;
}*/
body.mainpage .error-container {
    display: block;
    margin: 0;
    margin-top: 4px;
    text-align: center;
    color: #F00;
}
body.mainpage .error-container span {
    display: block;
    font-size: 80%;
}
body.mainpage .global-error-container {
    display: block;
    margin: 16px;
    padding: 4px;
    border-left: 16px solid #F00;
    background-color: #FFADAD;
    color: #000;
}
body.mainpage .global-warning-container {
    display: block;
    margin: 16px;
    padding: 4px;
    border-left: 16px solid #F80;
    background-color: #ffe0ad;
    color: #000;
}

body.mainpage .info-modal .global-error-container {
    text-shadow: none;
}
body.mainpage .info-container {
    display: block;
    margin: 16px;
    padding: 8px;
    padding-left: 16px;
    border-left: 16px solid #ACCD9B;
    background-color: #D6FFBA;
}
body.mainpage .info-container span {
    font-size: 75%;
}
@media (max-width: 800px) {
    body.mainpage .global-error-container,
    body.mainpage .info-container {
        padding-right: 16px;
        background-size: 16px 128px;
    }

    .info { width: auto; text-align: justify; }
}

.info-modal-container {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    top: 0;
    width: 100dvw;
    height: 100dvh;
    z-index: 3;
}
.info-modal-container.visible {
    display: flex;
}
.info-modal-container:before {
    content: "";
    z-index: 4;
    position: fixed;
    left: 0;
    top: 0;
    width: 100dvw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.5);
}
.info-modal {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    background-color: #FFF;
    margin: 5vh 10vw;
    padding: 16px;
    width: 800px;
    max-height: 70vh;
    overflow: auto;
    position: relative;
    left: 0;
    top: 0;
    z-index: 5;
    border-radius: 4px;
    padding: 6px 10px;
    outline: 4px solid rgba(42, 25, 53, 0.9);
    background-color: rgba(17, 17, 17, 0.95);
    color: #AAA;
    text-shadow: 1px 1px 0 #000;
    box-shadow: -1px -1px 0 rgba(17, 17, 17, 0.9), 1px -1px 0 rgba(17, 17, 17, 0.9), -1px 1px 0 rgba(17, 17, 17, 0.9), 1px 1px 0 rgba(17, 17, 17, 0.9);
    line-height: 1.3em;
}
.info-modal .info-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 2px;
    color: #FFF;
    text-align: center;
    flex-shrink: 0;
    word-break: break-word;
}
.info-modal .info-modal-content {
    margin: 12px 0;
    flex-shrink: 1;
    overflow-y: auto;
}
.info-modal .info-modal-footer {
    flex-shrink: 0;
}
/* --- mainpage end --- */


/* --- in-game page start --- */
body.in-game {
    min-height: calc(100vh - 96px);
    margin: 64px 0 32px 0;
    padding: 0 16px;
    box-sizing: border-box;
    /*background: #FFF url('../img/mainpage_background.jpg') no-repeat fixed center top / cover;*/
    max-width: 100vw;
}
body.in-game .game-container {
    display: inline-block;
    /*background: transparent url('../gfx/gui/canvas_frame.png') center 10px/100% auto no-repeat;*/
    padding: 10px;
    margin-bottom: 8px;
    max-width: calc(100vw - 32px);
    user-select: none;
}
body.in-game #game {
    border: none;
    background-color: #999;
    margin: 10px 0;
    max-width: calc(100vw - 54px);
    /*background-image: url('../gfx/tiles/background_grass.jpg');*/
}
/* --- in-game page end --- */


.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-gap-8 { gap: 8px; }
.flex-gap-16 { gap: 16px; }
.flex-auto { flex: auto; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end { justify-content: end; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.line-height-15 { line-height: 1.5em; }
.t-shadow { text-shadow: 1px 1px 0 #000; }
.t-shadow-strong { text-shadow: 1px 1px 0 #000, 0 0 12px rgba(0, 0, 0, 0.8); }
.t-left { text-align: left; }
.t-center { text-align: center; }
.t-bold { font-weight: bold; }
.t-small { font-size: 80%; }
.t-small-12 { font-size: 12px; }
.t-small-10 { font-size: 10px; }
.t-label { font-size: 80%; color: #333; }
.t-label-small { font-size: 60%; color: #333; }
.t-warning { color: #B00; font-weight: bold; }
.c-normal { color: #420; }
.c-orange { color: #D80; }
.c-red { color: #B00; }
.c-green { color: #090; }
.c-label { color: #777; }
.c-premium {
    background: -webkit-linear-gradient(top, #FE0 0%,#E00 100%);
    -moz-background-clip: text;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 5px transparent;
    padding: 5px;
    color: #000;
}
a.c-premium:link,
a.c-premium:visited {
    color: #000 !important;
}
.pn { padding: 0; }
.p-8 { padding: 8px; }
.mn { margin: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-64 { margin-top: 64px; }
.mv-8 { margin-top: 8px; margin-bottom: 8px; }
.mv-12 { margin-top: 12px; margin-bottom: 12px; }
.mv-24 { margin-top: 24px; margin-bottom: 24px; }
.ml-8 { margin-left: 8px; }
.ml-16 { margin-left: 16px; }
.mr-16 { margin-right: 16px; }
.mh-12 { margin-left: 12px; margin-right: 12px; }
.d-flex { display: flex; justify-content: center; align-items: baseline; }
.f-0 { flex: 0; }
.no-scroll, .menu-no-scroll { overflow: hidden !important; }
.no-min-width { min-width: auto; }
.word-break { word-break: break-word; }
.no-white-space { white-space: nowrap; }
.transform-bottom { transform-origin: center bottom; }
.inline-center { margin-left: auto; margin-right: auto; }

@media (max-width: 1024px) {
    .rows {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }
    .cols-rows {
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
    }
    .background-blur p {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body.mainpage .global-warning-container {
        font-size: 80%;
        text-align: justify;
    }
}

@keyframes anim-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes anim-fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
