:root {
    --yellow: #f4cd0b;
    --light-grey: #e4e4e4;
    --grey: #28282a;
    --grey-transparent: rgba(40, 40, 42, 0.3);
    --treasures-yellow: #fec93d;
}

body,
html {
    margin: 0px;
    height: 100%;
}

* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

#logo {
    width: 335px;
    display: inline-block;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

#logo img {
    width: 100%;
}

#treasureButtons div {
    display: inline-block;
    width: 35px;
}

#treasureButtons div img {
    width: 100%;
}

#treasureButtons div:last-child {
    float: right;
}

#hex_palette {
    width: 335px;
    display: inline-block;
    position: fixed;
    height: calc(100% - 120px);
    top: 120px;
    left: 0;
}

#hex_palette div.palette_tile {
    width: 110px;
    padding: 5px;
    position: relative;
    display: inline-block;
    order: var(--order);
}

#hex_palette #Treasures {
    display: flex;
    padding: 60px 50px;
}

#hex_palette #Treasures .palette_tile:nth-child(even) {
    margin-top: 50px;
}

#hex_palette div:not(#Treasures) .palette_tile:nth-child(odd) {
    margin-top: -50px;
}

#hex_palette div:not(#Treasures) .palette_tile:nth-child(even) {
    /*margin-top: 50px;*/
    margin-left: -25px;
}

#hex_palette #Treasures .palette_tile,
#hex_map .palette_tile {
    height: 55.354px;
    width: 55.354px;

}

/*#hex_palette #Treasures .palette_tile {
    padding: 35px;
}*/

#hex_palette #Treasures .palette_tile div {
    cursor: pointer;
}

#hex_palette #Treasures .palette_tile div,
#hex_map .palette_tile div:first-child,
.tablinks[data-biome="Treasures"] svg {
    background-color: var(--treasures-yellow);
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2),
        /* Top shadow */
        0 10px 20px rgba(0, 0, 0, 0.4),
        /* Side shadow */
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    padding: 0;
    height: 45.354px;
    width: 45.354px;
}

#hex_palette #Treasures .palette_tile div svg,
#hex_map .palette_tile div svg,
.tablinks[data-biome="Treasures"] svg {
    opacity: initial;
    width: initial;
    position: relative;
    top: unset;
    left: unset;
    transform-origin: center;
}

.palette_tile img {
    position: relative;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.palette_tile svg {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 110px;
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
}

#treasureButtons div,
#hex_palette .palette_tile svg polygon {
    pointer-events: auto;
    cursor: pointer;
    z-index: 30;
}

#hex_map {
    position: relative;
    /*margin-top: 0px !important;*/
}

#hex_map .map_tile svg polygon {
    pointer-events: auto;
    cursor: auto;
    z-index: 30;
}

#hex_map.hide_empty img[src$="Tiles/00.png"] {
    visibility: hidden;
}

#hex_map_container {
    margin: 0 0 0 405px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 520px;
}

#hex_map_container #tables {
    display: none;
}

#hex_map_container.map {
    align-items: flex-start;
    flex-grow: 1;
    overflow: hidden;
    width: auto;
}

#hex_map_container.map #hex_map {
    width: auto;
}

#hex_map_container.map>div:not(#hex_map):not(#tables) {
    width: calc(100% - 5px);
    overflow: auto;
    height: 100%;
    display: flex;
    align-items: center;
}

#hex_map_container p {
    margin: 8px 0;
    font-family: sans-serif;
    font-size: 17px;
    text-align: center;
    width: calc(100% - 105px);
}

#hex_map,
#tables {
    min-width: max-content;
    width: 100%;
    margin: auto;
}

/*#hex_map .map_row:not(:first-child) {
    margin-top: -49px;

}

#hex_map .map_row:nth-child(even)::before {
    content: "";
    min-width: 82px;
    display: inline-block;
}

#hex_map .map_tile:not(:last-child) {
    margin-right: 54px;
}*/

#hex_map .map_row:not(:first-child) {
    margin-top: -96px;
}

#hex_map .map_row .map_tile:nth-child(even) {
    margin-top: 96px;
}

#hex_map .map_tile:not(:last-child) {
    margin-right: -28px;
}

#hex_map .map_tile {
    width: 110px;
    margin: 0px;
    padding: 0px;
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

#hex_map .map_tile img {
    position: relative;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    vertical-align: middle;
}

/*#hex_map .map_tile img[src$="00.png"] {
    z-index: 30;
}*/

#hex_map .map_tile svg {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 110px;
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
}

#hex_map .map_tile svg polygon.filled {
    cursor: pointer
}

#hex_map .map_tile.isolated,
#hex_map .palette_tile.isolated {
    z-index: 10;
}

#hex_map .map_tile.isolated img {
    z-index: 2;
}

#hex_map .map_tile.isolated>svg {
    opacity: 1;
    width: 120px;
    top: -5px;
    left: -5px;
    fill: #ccc;
}

#hex_map .map_tile.isolated #isolatedBtns,
#hex_map .palette_tile.isolated #isolatedBtns {
    position: absolute;
    z-index: 2;
    top: 100px;
    /*left: 5px;*/
    left: calc((110px - 52px) / 2);
    border-radius: 10px;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2),
        /* Top shadow */
        0 10px 20px rgba(0, 0, 0, 0.4),
        /* Side shadow */
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
    width: max-content;
}

#hex_map .palette_tile.isolated #isolatedBtns {
    top: 60px;
    left: 1.5px;
}

#hex_map .map_tile.isolated #isolatedBtns .isolatedBtn,
#hex_map .palette_tile.isolated #isolatedBtns .isolatedBtn {
    background-color: white;
    border: solid #ccc 1px;
    padding: 5px 10px;
    cursor: pointer;
}

#hex_map .map_tile.isolated #isolatedBtns .isolatedBtn:hover,
#hex_map .palette_tile.isolated #isolatedBtns .isolatedBtn:hover {
    background-color: #ddd;
}

#hex_map .map_tile.isolated #isolatedBtns .isolatedBtn:first-child {
    /*border-radius: 10px 0 0 10px;*/
    border-radius: 10px;
}

/*#hex_map .map_tile.isolated #isolatedBtns .isolatedBtn:last-child {
    border-radius: 0 10px 10px 0;
    margin-left: -1px;
}*/

#hex_map .palette_tile.isolated #isolatedBtns .isolatedBtn {
    border-radius: 10px;
}

#hex_map .map_tile.isolated #isolatedBtns .isolatedBtn svg,
#hex_map .palette_tile.isolated #isolatedBtns .isolatedBtn svg {
    position: relative;
    top: unset;
    left: unset;
    width: initial;
    height: initial;
    pointer-events: none;
    opacity: 1;
    z-index: unset;
}

#hex_map .palette_tile {
    z-index: 5;
    cursor: pointer;
}

#hex_map .palette_tile div svg {
    position: relative;
    width: initial;
    height: initial;
    top: unset;
    opacity: initial;
    left: unset;
    z-index: 0;
}

.selected {
    background-color: cadetblue;
}

.center {
    width: 100%;
}

.center img {
    margin: auto;
    display: block;
}

.container {
    margin: auto auto;
    width: 420px;
    height: auto;
    background-color: #fff;
    display: grid;
    grid-template-columns: 200px 200px;
    grid-row: auto auto;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
}

#controls {
    position: fixed;
    top: 0;
    right: 0;
    right: unset;
    left: 0px;
    width: 100%;
    padding-left: 5px;
    background: white;
    z-index: 45;
    border-bottom: 2px solid #d9d9d9;
}

#controls .container {
    width: 100px;
    display: flex;
    flex-direction: column;
    grid-column-gap: 0;
    grid-row-gap: 0;
    flex-direction: row;
    width: auto;
}

.box {
    padding: 5px 10px;
    min-width: 75px;
    margin: 5px;
}

.box.grey {
    background-color: #d9d9d9;
}

.box.selected-style {
    border-color: var(--grey) !important;
}

.message {
    color: #ec5959 !important;
    display: inline-block !important;
    border: 1px solid red;
    padding: 10px 100px;
    width: auto !important;
    margin: auto auto !important;
}

.box a {
    font-size: 16px;
}

.no_padding .box {
    padding: 0px;
}

.box a,
#popup p,
#popup h1,
#popup h2,
#popup label,
#popup select,
#popup input:not([type='checkbox']),
#popupTables h1 {
    color: var(--grey);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: sans-serif;
    flex-direction: column-reverse;
    text-decoration: none;
    width: 100%;
    /*height: 100%;*/
}

.box.grey.off {
    cursor: not-allowed;
    display: none;
}

.box.grey.off a {
    pointer-events: none;
}

.box.grey a:hover {
    color: #fff;
}

.box img {
    width: 100%;
    height: 100%;
}

#MapAndTablesBox,
#JustMapBox {
    background-color: rgb(217, 217, 217);
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    padding: 25px 25px 12.5px 25px;
}

#MapAndTablesBox img,
#JustMapBox img {
    margin-bottom: 12.5px;
}

#controls img {
    position: absolute;
    top: 2px;
    right: 5px;
}

#tablesBtn {
    position: absolute;
    top: 50px;
    right: 5px;
    z-index: 10;
}

#hex_palette {
    width: 405px;
    top: 40px;
    height: calc(100% - 45px);
}

#tab {
    float: left;
    background-color: #f1f1f1;
    width: 75px;
    height: 100%;
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
    scrollbar-width: none;
    /* Firefox */
    width: 185px;
    overflow-y: auto;
    background-color: unset;
}

#tab::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

#tab button {
    display: block;
    color: black;
    padding: 10px 5px;
    width: 100%;
    border: none;
    outline: none;
    text-align: left;
    cursor: pointer;
    transition: 0.3s;
    font-size: 17px;
    position: relative;
    background-color: #ebebeb;
}


#tab button:hover {
    background-color: #ddd;
}

#tab button.active {
    background-color: #ccc;
}

#tab button svg {
    pointer-events: none;
}

.tabcontent {
    float: left;
    padding: 60px 0 10px 0;
    width: 260px;
    border-left: none;
    max-height: 100%;
    overflow: auto;
    flex-flow: row wrap;
    align-items: flex-start;
    align-content: start;
    /*max-height: calc(100% - 60px);*/
    max-height: 100%;
    width: 220px;
    height: 100%;
    background-color: #d9d9d9;
}

.tooltip-info {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

button.tooltip::before {
    content: attr(data-biome-clean-name);
    position: absolute;
    top: 0px;
    left: 80px;
    font-size: 1.2em;
    padding: 0 10px;
    display: none;
    color: #28282a;
    border-radius: 4px;
    transition: opacity 0.1s ease-out;
    z-index: 99;
    text-align: left;
    height: 100%;
}

.no_tiles #tab {
    width: 90px;
}

.no_tiles button.tooltip::before {
    left: 90px;
}

button:hover::before,
button.active::before {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
}

button img {
    height: 100%;
    width: 100%;
    margin: auto;
    display: block;
    pointer-events: none;
}

.heading,
.line div,
.line,
.line div {
    font-size: 1.2em;
    color: var(--grey);
    font-family: sans-serif;
}

.heading {
    display: flex;
    font-weight: bold;
    border-bottom: 2px solid var(--grey);
    padding: 5px 0;
}

.heading span:first-of-type {
    margin-right: 10px;
}

.line {
    display: flex;
    padding: 3px 0;
    border-bottom: 1px solid var(--grey-transparent);
}

.line span {
    line-height: 30px;
}

.line span:not(:first-child) {
    font-size: 0.8em;
    line-height: 27px;
    margin-left: 10px;
}

#tables {
    overflow: auto;
    height: calc(100% - 50px);
    width: calc(100% - 10px);
    padding: 0 20px;
}

#tables .line>div,
#tables .heading>div,
#print_overlay .heading>div {
    flex-grow: 1;
    width: 90px;
    font-size: 14px;
    font-family: sans-serif;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#tables .heading>div,
#print_overlay .heading>div {
    font-size: inherit;
    margin-left: -5px;
}

.row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    margin: 10px 0;
}

.column {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;
}

.column:first-of-type {
    flex: 0 0 65%;
}

.column:not(:first-of-type) {
    flex: 0 0 32%;
}

#rumours {
    flex-direction: column;
}

.loading-container {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/*.treasure::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background-image: url(../images/logos/treasure.png);
    background-size: 40px 40px;
    background-position: 30% 90%;
    background-repeat: no-repeat;
    z-index: 35;
    pointer-events: none;
}*/

#popup_cover {
    display: none;
    padding: 0px;
    width: 100%;
    height: 100%;
    z-index: 50;
    position: fixed;
    top: 0px;
    left: 0px;
    background-color: rgba(0, 0, 0, 0.5);
}

#popup,
#popupTables {
    display: none;
    z-index: 55;
    height: auto;
    width: 575px;
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 15px;
}

#popup .close_btn,
#popupTables .close_btn {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
}

#popup h2,
#popup label,
#popup select,
#popup input:not([type='checkbox']) {
    font-weight: bold;
    align-items: start;
    padding-left: 5px;
    margin-bottom: 10px;
}

#popup label,
#popup select,
#popup input:not([type='checkbox']) {
    font-weight: initial;
    font-size: 18px;
    width: 80px;
    display: inline-block;
}

#popup label {
    width: fit-content;
    min-width: 80px;
}

#popup select,
#popup input:not([type='checkbox']) {
    background-color: var(--light-grey);
    border: 1px solid black;
    width: 125px;
}

/*#popup input:not([type="checkbox"]) {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}*/

#popup input:not([type="checkbox"]):invalid {
    border-color: darkred;
    color: darkred;
}

#popup .checkbox {
    padding-left: 5px;
}

.checkbox input[type="checkbox"] {
    /*opacity: 0;*/
    display: none;
}

.checkbox label {
    position: relative !important;
    display: inline-block !important;

    /*16px width of fake checkbox + 6px distance between fake checkbox and text*/
    padding-left: 22px !important;
}

.checkbox label::before,
.checkbox label::after {
    position: absolute;
    content: "";

    /*Needed for the line-height to take effect*/
    display: inline-block;
}

/*Outer box of the fake checkbox*/
.checkbox label::before {
    height: 16px;
    width: 16px;

    border: 1px solid;
    left: 0px;
    background-color: var(--light-grey);
    /*(24px line-height - 16px height of fake checkbox) / 2 - 1px for the border
     *to vertically center it.
     */
    top: 0px;
}

/*Checkmark of the fake checkbox*/
.checkbox label::after {
    height: 5px;
    width: 9px;
    border-left: 2px solid;
    border-bottom: 2px solid;

    transform: rotate(-45deg);

    left: 4px;
    top: 4px;
}

/*Hide the checkmark by default*/
.checkbox input[type="checkbox"]+label::after {
    content: none;
}

/*Unhide on the checked state*/
.checkbox input[type="checkbox"]:checked+label::after {
    content: "";
}

#popup .biomes {
    display: flex;
    max-width: 572px;
    overflow: auto;
}

#popup label[for=""] #popup .biomes {
    display: flex;
    flex-wrap: wrap;
    width: 640px;
}

#popup .biomes button {
    border: none;
    background-color: white;
    padding: 5px;
    cursor: pointer;
    position: relative;
    min-width: 100px;
    display: flex;
}

#popup .biomes button:disabled {
    opacity: 0.5;
    cursor: unset;
}

#popup .biomes button .border {
    opacity: 0;
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
}

#popup .biomes .selected .border {
    opacity: 1;
}

#popup .buttons {
    float: right;
    margin: calc(0.67em - 8px) 0em 0.67em 0em;
    font-size: 20px;
    display: flex;
}

#popup .buttons .box:last-child {
    font-weight: bold;
}

#popupTables {
    height: 95%;
}

.hide {
    display: none !important;
}

.hide-while-dragging {
    transition: 0.01s;
    transform: translateX(-9999px);
}

#hidden {
    display: none;
    z-index: 50;
}

#footer img {
    position: fixed;
    bottom: 0;
    left: 0;
    margin: 0 0 10px 20px;
    width: 200px;
}

@media print {
    * {
        font-size: 14px;
    }

    img {
        z-index: 20;
    }

    img[src$="Tiles/00.png"] {
        opacity: 0;
        z-index: 0;
    }

    #controls,
    #hex_palette,
    #logo,
    #hex_map_container p,
    #tablesBtn,
    .loading-container,
    #popup,
    #popup_cover {
        display: none !important;
    }

    #hex_map_container {
        margin: 43px 0 43px 0;
        flex-direction: row;
        width: 100%;
        height: calc(100% - 43px);
    }

    #hex_map_container.map #hex_map {
        margin: auto;
    }

    #hex_map {
        margin: -40px 0 0 40px !important;
        display: block !important;
    }

    #hex_map .palette_tile {
        z-index: 50;
    }

    #print_overlay {
        display: block !important;
    }

    #print_overlay .heading {
        position: fixed;
        top: 0;
        left: 0;
        font-size: 22px !important;
        width: 100%;
        padding: 10px 20px 5px 20px;
    }

    #print_overlay .heading span {
        font-size: inherit;
    }

}