/* Generic */

/* {
    transition: background-color .2s, color .2s, box-shadow .2s, outline .2s;
} */

:root {
    --navheight: 60px;
    --tilemin: 100px;
}

.dark {
    --bg1: #19171E;
    --bg2: #2f2b3b;
    --bg3: #43384b;
    --item: #43384b;
    --text: white;
    --title: white;
    --locked: #625f64;
    --link: #7F9AAC;
    --shadow: black;
    --shadow-soft: #19171E;
    --red: #E55B5B;
    --purple: #a25be5;
    --search: white;
    --detail: #43384b;
    --main-shadow: 8px;
    --soft-shadow: 6px;
    --icon-filter: none;
    --border: none;
    --hcborder: 0px;
    --blackfilter: none;
    --font: 'Fira Sans Condensed';
}

.light {
    --bg1: #ccc;
    --bg2: #eee;
    --bg3: #43384b;
    --item: white;
    --text: #545454;
    --title: white;
    --locked: #625f64;
    --link: #466478;
    --shadow: black;
    --shadow-soft: grey;
    --red: #E57272;
    --purple: #8b72e5;
    --search: #43384b;
    --detail: #bbb;
    --main-shadow: 8px;
    --soft-shadow: 6px;
    --icon-filter: none;
    --border: none;
    --hcborder: 0px;
    --blackfilter: none;
    --font: 'Fira Sans Condensed';
}

.carbon {
    --bg1: #111;
    --bg2: #222;
    --bg3: #333;
    --item: #333;
    --text: #bbb;
    --title: #bbb;
    --locked: #444;
    --link: #7F9AAC;
    --shadow: black;
    --shadow-soft: #111;
    --red: #c74747;
    --purple: #a25be5;
    --search: #bbb;
    --detail: #444;
    --main-shadow: 8px;
    --soft-shadow: 6px;
    --icon-filter: none;
    --border: none;
    --hcborder: 0px;
    --blackfilter: none;
    --font: 'Fira Sans Condensed';
    --icon-filter: brightness(0.8);
}

.forest {
    --bg1: #2b3339;
    --bg2: #323c41;
    --bg3: #3a454a;
    --item: #3a454a;
    --text: #d3c6aa;
    --title: #d3c6aa;
    --locked: #7a8478;
    --link: #7fbbb3;
    --shadow: #25282b;
    --shadow-soft: #2b3339;
    --red: #e67e80;
    --purple: #d699b6;
    --search: #d3c6aa;
    --detail: #3a454a;
    --main-shadow: 8px;
    --soft-shadow: 6px;
    --icon-filter: none;
    --border: none;
    --hcborder: 0px;
    --blackfilter: none;
    --font: 'Fira Sans Condensed';
    --icon-filter: sepia(1) saturate(5.5) hue-rotate(-45deg);
}

.nord {
    --bg1: #2e3440;
    --bg2: #3b4252;
    --bg3: #434c5e;
    --item: #434c5e;
    --text: #eceff4;
    --title: #eceff4;
    --locked: #4c566a;
    --link: #5e81ac;
    --shadow: #1b1b1d;
    --shadow-soft: #222427;
    --red: #bf616a;
    --purple: #b48ead;
    --search: #d8dee9;
    --detail: #4c566a;
    --main-shadow: 8px;
    --soft-shadow: 6px;
    --icon-filter: none;
    --border: none;
    --hcborder: 0px;
    --blackfilter: none;
    --font: 'Fira Sans Condensed';
    --icon-filter: ;
}

.contrast {
    --bg1: black;
    --bg2: black;
    --bg3: black;
    --item: black;
    --text: white;
    --title: white;
    --locked: blue;
    --link: yellow;
    --shadow: none;
    --shadow-soft: none;
    --red: red;
    --purple: rgb(174, 0, 255);
    --search: white;
    --detail: white;
    --main-shadow: 0px;
    --soft-shadow: 0px;
    --icon-filter: none;
    --border: white;
    --hcborder: 2px;
    --blackfilter: brightness(2.0);
    --font: 'DM Sans';
}

.mothership {
    --bg1: #040001;
    --bg2: #040001;
    --bg3: #040001;
    --item: #040001;
    --text: #fbf7c8;
    --title: #fbf7c8;
    --detail: #fbf7c8;
    --border: #fbf7c8;
    --search: #fbf7c8;
    --locked: #f02e25;
    --link: #f02e25;
    --red: #f02e25;
    --purple: #108374;
    --shadow: none;
    --shadow-soft: none;
    --main-shadow: 0px;
    --soft-shadow: 0px;
    --icon-filter: none;
    --blackfilter: brightness(2.0);
    --font: 'DM Sans';
    --hcborder: 1px;
    --icon-filter: sepia(1) saturate(3.6);
}

body {
    background-color: var(--bg1);
    margin: 0;
}

/* Navbar */

@keyframes color-rotate {
    from {
        filter: hue-rotate(0deg);
    }

    to {
        filter: hue-rotate(360deg);
    }
}

nav {
    width: 100%;
    height: var(--navheight);
    background-color: var(--bg3);
    box-shadow: 0 0 var(--main-shadow) var(--shadow);
    z-index: 2;
    position: fixed;
    display: flex;
    align-items: center;
    outline: solid var(--hcborder) var(--border);
}

nav > a {
    text-decoration: none;
}

#logo {
    height: 40px;
    width: 40px;
    margin: 0 20px;
    background-image: url(img/logo.png);
    filter: var(--icon-filter);
    background-size: 40px;
    font-size: 0;
}

#logo:hover {
    background-image: url(img/logo_color.png);
    animation: color-rotate 6s linear 0ms infinite;
}

#title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: x-large;
    margin: 0 40px 0 0;
    text-decoration: none;
    color: var(--title);
}

#title:hover, nav > a:hover {
    text-decoration: underline;
}

nav > a {
    font-size: large;
    margin: 5px 20px 0 0;
    font-family: var(--font), sans-serif;
    color: var(--title);
    cursor: pointer;
}

#separator {
    margin-left: auto;
}

.locked {
    cursor: not-allowed;
    color: var(--locked);
}

.locked:hover {
    text-decoration: underline dashed;
}

#themebutton {
    user-select: none;
    margin-right: 20px;
}

#themeselector {
    width: 600px;
    height: fit-content;
    background-color: var(--bg2);
    z-index: 6;
    display: flex;
    border-radius: 6px;
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    flex-direction: column;
    outline: solid var(--hcborder) var(--border);
    align-items: center;
}

#themeselector * {
    font-family: var(--font), sans-serif;
    font-weight: 300;
    color: var(--text);
    font-size: large;
}

#themeselector h2 {
    padding: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: xx-large;
}

#themeselector > div {
    flex-grow: 1;
    display: flex;
    height: 280px;
    flex-wrap: wrap;
    width: calc(100% - 20px);
    overflow-y: auto;
}

#themeselector button {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0;
    cursor: pointer;
    outline: solid var(--hcborder) var(--border);
}

#themeselector > div button {
    width: calc(33.33% - 20px);
    height: calc(50% - 20px);
    flex-direction: column;
    height: 120px;
    margin: 10px;
    border-radius: 5px;
    background-color: var(--item);
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
}

.display {
    width: min(50%, 82px);
    height: 50%;
    margin-bottom: 10px;
    border-radius: 6px 6px 5px 5px;
    background-color: var(--disp_bg);
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    display: flex;
    flex-direction: column;
    outline: solid var(--disp_b_style) var(--disp_b_col);
}

.mininav {
    height: 20%;
    width: 100%;
    background-color: var(--disp_nav);
    border-radius: 5px 5px 0 0;
    outline: solid var(--disp_b_style) var(--disp_b_col);
    z-index: 7;
}

.minimain {
    padding-top: 10%;
    width: 66.66%;
    margin: auto;
    background-color: var(--disp_main);
    flex-grow: 1;
    border-left: solid var(--disp_b_style) var(--disp_b_col);
    border-right: solid var(--disp_b_style) var(--disp_b_col);
}

.minitext {
    height: 20%;
    width: 80%;
    margin: 0 0 0 10%;
    background-color: var(--disp_text);
    border-radius: 5px;
}

#themeselector button > p {
    margin: 0;
    vertical-align: middle;
}

#themeselector button a {
    display: inline;
    color: var(--link);
}

#overlay {
    background-color: #00000088;
    float: left;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    position: fixed;
    z-index: 5;
    align-items: center;
    justify-content: center;
}

#closemenu {
    background-color: var(--red);
    color: var(--text);
    flex: 0 0 50px;
    width: 100px;
    margin: 10px;
    border-radius: 5px;
}

#darktheme {
    --disp_bg: #19171e;
    --disp_nav: #43384b;
    --disp_main: #2f2b3b;
    --disp_text: white;
    --disp_b_style: none;
    --disp_b_col: none;
}

#lighttheme {
    --disp_bg: #ccc;
    --disp_nav: #43384b;
    --disp_main: #eee;
    --disp_text: #545454;
    --disp_b_style: none;
    --disp_b_col: none;
}

#contrasttheme {
    --disp_bg: black;
    --disp_nav: black;
    --disp_main: black;
    --disp_text: white;
    --disp_b_style: 2px;
    --disp_b_col: white;
}

#carbontheme {
    --disp_bg: #111;
    --disp_nav: #333;
    --disp_main: #222;
    --disp_text: #bbb;
    --disp_b_style: none;
    --disp_b_col: none;
}

#foresttheme {
    --disp_bg: #2b3339;
    --disp_nav: #3a454a;
    --disp_main: #323c41;
    --disp_text: #d3c6aa;
    --disp_b_style: none;
    --disp_b_col: none;
}

#nordtheme {
    --disp_bg: #2e3440;
    --disp_nav: #3b4252;
    --disp_main: #434c5e;
    --disp_text: #eceff4;
    --disp_b_style: none;
    --disp_b_col: none;
}

#mothershiptheme {
    --disp_bg: #040001;
    --disp_nav: #040001;
    --disp_main: #040001;
    --disp_text: #fbf7c8;
    --disp_b_style: 1px;
    --disp_b_col: #fbf7c8;
}

.hideselector {
    display: none;
}

.showselector {
    display: flex;
}

#menubutton {
    display: none;
}

/* Body */

main {
    padding-top: var(--navheight);
    width: min(890px, 100%);
    margin: auto;
    background-color: var(--bg2);
    box-shadow: 0 0 var(--main-shadow) var(--shadow);
    min-height: calc(100vh - var(--navheight));
    display: flex;
    flex-direction: column;
    outline: solid var(--hcborder) var(--border);
}

main * {
    font-family: var(--font), sans-serif;
    font-weight: 300;
    color: var(--text);
    font-size: large;
}

h1, h2, .detail {
    margin: 0;
    padding: 10px;
    padding-bottom: 0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: xx-large;
}

h2, .detail {
    font-size: x-large;
}

.detail {
    color: var(--detail);
}

.help {
    padding: 10px 10px 0 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.dot {
    height: 25px;
    width: 25px;
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    background-color: var(--item);
    border-radius: 6px;
    display: inline-block;
}

p {
    margin: 10px 10px 0 10px;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.list {
    display: flex;
    gap: 10px;
    padding: 10PX;
    flex-wrap: wrap;
}

.item {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 60px;
    border-radius: 6px;
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    background: var(--item);
    background-size: 300px;
    outline: solid var(--hcborder) var(--border);
}

.item * {
    user-select: none;
    pointer-events: none;
}

.item > h3 {
    font-size: medium;
    text-align: center;
    margin: 0;
    margin-left: 5px;
}

.item img {
    margin: 0;
    color: var(--red);
}

.first {
    outline: solid max(var(--hcborder), 1px) var(--red);
}

.rush {
    outline: solid max(var(--hcborder), 1px) var(--purple);
}

.black img {
    filter: var(--blackfilter);
}

.hidden {
    display: none;
}

#searchdiv {
    display: flex;
    flex-wrap: wrap;
}

#currentsearchkeys {
    display: inline;
    width: 50%;
    overflow-x: hidden;
}

#searchbox {
    background-color: var(--item);
    border: max(var(--hcborder), 1px) solid var(--search);
    border-radius: 6px;
    flex-grow: 1;
}

#searchbutton, #resetbutton {
    background-color: var(--item);
    border: max(var(--hcborder), 1px) solid var(--search);
    border-radius: 6px;
}

/* Footer */

footer {
    background-color: var(--item);
    height: 40px;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

footer > a {
    font-size: large;
    margin: 0;
    font-family: var(--font), sans-serif;
    color: var(--link);
}

/* Floatmenu */

.floatmenu {
    display: none;
    position: fixed;
    padding: 0;
    bottom: 20px;
    right: 20px;
    width: fit-content;
    height: fit-content;
    background-color: var(--item);
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    border-radius: 6px;
    padding: 10px;
    outline: solid var(--hcborder) var(--border);
    z-index: 4;
}

.item:hover > .floatmenu {
    display: flex;
    flex-direction: column;
}

.floattitlediv {
    display: flex;
    align-items: center;
    margin: auto;
}

.floattitle {
    margin: 0 0 0 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: x-large;
}

.floattext {
    margin-top: 10px;
    white-space: pre;
}

/* Extra */

.gallery > img {
    margin-left: 10px;
    margin-right: auto;
}

#scrollbutton {
    display: none;
    position: fixed;
    padding: 0;
    top: 80px;
    right: calc(50% - 15px);
    width: 30px;
    height: 30px;
    border-radius: 20px;
    background-color: var(--item);
    border: 0;
    cursor: pointer;
    font-size: large;
    font-family: var(--font), sans-serif;
    text-align: center;
    color: var(--text);
    box-shadow: 0 0 var(--soft-shadow) var(--shadow-soft);
    outline: solid var(--hcborder) var(--border);
}

#scrollbutton > span {
    padding-top: 3px;
}

@keyframes popup {
    from {top: 40px; opacity: 1; visibility: visible;}
    to {top: 80px; opacity: 1; visibility: visible;}
}

.popup {
    animation: popup 50ms ease-out;
}

@keyframes popdown {
    from {top: 80px; opacity: 1; visibility: visible;}
    to {top: 40px; opacity: 0; visibility: hidden;}
}

.popdown {
    animation: popdown 100ms ease-in;
}

/* Resizing */

@media only screen and (max-width: 890px) {
    .display {
        width: min(50%, 49px);
        height: 50%;
        border-radius: 6px;
    }

    .minimain {
        padding-top: 15%;
        width: 100%;
        border: 0;
        border-radius: 0 0 5px 5px;
    }
}

@media only screen and (max-width: 420px) {
    #themeselector {
        width: calc(100% - 40px);
    }

    #themeselector > div button {
        width: calc(50% - 20px);
    }

    #title {
        display: none;
    }
}

@media only screen and (max-width: 290px) {
    #themeicon {
        display: none;
    }

    #themeselector > div button {
        width: calc(100% - 20px);
    }
}

@media only screen and (max-width: 270px) {
    .navbar {
        display: none;
    }
}

@media only screen and (min-width: calc(100px*2 + 30px)) {
    .list > * {
        width: calc((100% - 10px) / 2);
    }
}

@media only screen and (min-width: calc(100px*3 + 40px)) {
    .list > * {
        width: calc((100% - 20px) / 3);
    }
}

@media only screen and (min-width: calc(120px*4 + 50px)) {
    .list > * {
        width: calc((100% - 30px) / 4);
    }
}

@media only screen and (min-width: calc(120px*5 + 60px)) {
    .list > * {
        width: calc((100% - 40px) / 5);
    }
}

@media only screen and (min-width: calc(120px*6 + 70px)) {
    .list > * {
        width: calc((100% - 50px) / 6);
    }
}

@media only screen and (min-width: 890px) {
    .list > * {
        width: calc((100% - 61px) / 7);
    }

    .item {
        background-size: 400px;
    }

    nav > a:last-child {
        margin-right: 0;
    }

    #separator {
        margin-left: 0;
    }

    #themebutton {
        margin-left: auto;
    }

    footer {
        gap: 20px;
    }
}