:root {
    --custom-color: #f0f0f0;
    --searchbar-length: 200px;
    --searchbar-margin: 0px;
    --loader-margin: 70px;
  }
/* ************************************************************************** */
/*                                    base                                    */
/* ************************************************************************** */

@font-face {
    font-family: 'VCR_OSD_MONO';
    src: url("/assets/fonts/VCR_OSD_MONO.ttf");
}

@font-face {
    font-family: 'CascadiaCode';
    src: url("/assets/fonts/CascadiaCode.ttf");
}

@font-face {
    font-family: 'OpenDyslexic3';
    src: url("/assets/fonts/OpenDyslexic3-Regular.ttf");
}

:root {
    --header-image: url('/assets/images/header.png');
    --body-bg-image: url('/assets/images/background.png');
}

* {
    box-sizing: border-box;
}



/* ************************************************************************** */
/*                                  elements                                  */
/* ************************************************************************** */

body {
    color: white;
    background-image: var(--body-bg-image);
    font-family: 'CascadiaCode';
    max-width: 1200px;
    margin: auto;
}

main {
    max-width: 100%;
    overflow: auto;
    background-color: black;
    flex: 1;
    padding: 20px;
    order: 2;
}

ul, ul li, ol li {
    margin-bottom: 10px;
}

br {
    line-height: 1.2;
}

hr {
    border: 1px #ffffff7f solid;
    margin: 2em 1em;
}

del, s { /* strikethrough */
    /* can't change the position of line-through; using underline and offset instead */
    text-decoration: underline currentcolor solid 2px;
    text-underline-offset: -0.45rem;
    text-decoration-skip-ink: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

button {
    background-color: white;
    border: 2px #434343;
    color: black;
    padding: 7px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}

#container a {
    /* all links except nav */
    color: inherit;
    font-weight: bold;
}

h1, h2, h3, h4 {
    color: white;
    font-family: 'VCR_OSD_MONO';

}

h2 {
    font-size: 30px;
}

h3 {
    font-size: 26px;
}



/* ************************************************************************** */
/*                              basic formatting                              */
/* ************************************************************************** */

.vcr {
    font-family: 'VCR_OSD_MONO';
}

.center {
    text-align: center;
}

.big {
    font-size: larger;
}

.small {
    font-size: smaller;
}

.invis {
    opacity: 0;
    /* for when there's a line break in the middle of dialogue. just copy the head and make it invisible i guess */
}

.indented {
    margin-left: 2em !important;
}

.sr-only {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}

img.cg {
    object-fit: cover;
    object-position: top;
    aspect-ratio: 204 / 115; /* native images are 816/624, cropped it's 816/460. this is that but simplified */
    width: 816px; /* i don't know why this doesn't force it to 816px BUT IT WORKS AND I'M MOVING ON -gold */
}

.inline-img {
    height: 32px;
    width: 32px;
    display: inline-block;
    vertical-align: -0.5em;
    position: relative;
    top: 2px;
}

/* alt text styled like notes */
/* it doesn't work great on cg styled images tho and i couldnt fix it :c */
img::before {
    display: block;
    margin: 0.5em;
    color: #ffffff7f;
}

/* ************************************************************************** */
/*                                  dialogue                                  */
/* ************************************************************************** */

/* * *                        containers and stuff                        * * */

.dialogue {
    font-family: 'VCR_OSD_MONO';
    font-size: 16.5px;
    border: 13px solid transparent;
    border-image: url("/assets/images/border.png") 14 round;
}

#searchbox {
    font-family: 'VCR_OSD_MONO';
    transition: height 100ms;
    max-width: 1200px;
    color: white;
    background-color: black;
    height: 0;
    visibility: hidden;
    flex: auto;
}

#searchbox:focus {
    font-family: 'VCR_OSD_MONO';
    color: white;
    outline: none;
}


.hidden {
    display: none;
}

#searchUL {
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: 1200px;
    max-height: 800px;
    overflow: hidden;
    overflow-y: auto;
    z-index: 100;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #111 black;
    border-color: #555;
}

#searchUL:focus {
    outline: none;
}

.search-result {
    font-family: "VCR_OSD_MONO";
    max-width: 100%;
    height: fit-content;
    font-size: 16px;
    background-color: black;
    margin: 0;
    padding: 2px 4px;
    border: 3px solid transparent;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}
.search-result::marker {
    content: ''
}
.search-result:hover {
    border-image: url('assets/images/border-choice.png') 3 stretch;
}

.search-result-link {
    display: inline-block;
    font-weight: 400 !important;
    text-decoration: none;
    width: 100%;
}
.search-result:hover {
    background-color: #333;
}

.search-result-source {
    font-style: italic;
    color: #888;
    margin: 0 0.5em;
    font-size: 0.8em;
}

#searchbarContainer {
    margin: 0px;
    padding: 0px;
    height: 0;
    width: 100%;
    visibility: hidden;
    transition: height 100ms;
    overflow: hidden;
    position: fixed;
    color:#fff;
    font-size:20px;
}

#searchWrapper {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    font-family: 'VCR_OSD_MONO';
    height: 0;
    transition: height 100ms;
    color: white;
    background-color: black;
}
#advancedSearchLink  {
    font-size: 16px;
    position: static;
    flex: fit-content;
    text-align: center;
}
#removeSearchbarButton {
    position: static;
    margin: 0;
    padding: 0 10px;
    font-style: normal;
    text-align: center;
    flex: auto;
}
#removeSearchbarButton:hover {
    cursor: pointer;
}
#searchExtras {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 10px;
}

.searchBarHidden {
    visibility: hidden;
    display: none;
    position: fixed;
    height: 0px;
}

.searchBarVisible {
    visibility: visible;
    display: block;
    position: static;
}


/* HTML: <div class="loader"></div> */
.loader {
    align-content: center;
    margin: 0;
    margin-top: 25px;
    margin-left: 80px;
    margin-right: var(--loader-margin);
    position: absolute;
    float: right;
    clear: right;
    padding-left: 0;
    z-index: 0;
    width: 30px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side,white 90%,#0000);
    background: 
      var(--_g) 0%   50%,
      var(--_g) 50%  50%,
      var(--_g) 100% 50%;
    background-size: calc(100%/3) 50%;
    animation: l3 1s infinite linear;
  }
  @keyframes l3 {
      20%{background-position:0%   0%, 50%  50%,100%  50%}
      40%{background-position:0% 100%, 50%   0%,100%  50%}
      60%{background-position:0%  50%, 50% 100%,100%   0%}
      80%{background-position:0%  50%, 50%  50%,100% 100%}
  }

.tooltip {
    visibility: hidden;
    opacity: 1;
    position: absolute;
    bottom: 120%;
    z-index: 99;
    text-align: center;
    background-color: #0008;
    border-radius: 5px;
    width: 150px;
}

ul.bigSearchPageSelect {
    list-style: none;
}
ul.bigSearchPageSelect option {
    display: inline;
    list-style-type: none;
    padding-right: 20px;
    text-decoration: underline;
}
ul.bigSearchPageSelect option:hover {
    cursor: pointer;
}
ul.bigSearchPageSelect option::selection {
    display: none;
}

#big-searchbox {
    width: 100%;
    height: 30px;
    float: right;
    font-family: "VCR_OSD_MONO";
    color: white;
    background-color: black;
}
#big-searchbox:focus {
    outline: none;
}

#big-searchUL {
    width: 100%;
    margin: 0;
    margin-top: 20px;
    padding: 0;
    z-index: 0;
    overflow: hidden;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: #111 black;
    border-color: #555;
}

#big-searchUL:focus {
    outline: none;
}

.big-search-result {
    font-family: "VCR_OSD_MONO";
    width: 100%;
    height: fit-content;
    font-size: 16px;
    background-color: black;
    margin: 3px 0;
    padding: 2px 4px;
    border: 3px solid transparent;
    border-image: url("assets/images/border-choice.png") 3 stretch;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}
.big-search-result::marker {
    content: "";
}
.big-search-result-link {
    display: inline-block;
    font-weight: 400 !important;
    text-decoration: none;
    width: 100%;
}
.big-search-result:hover {
    background-color: #333;
}
.big-search-result-source {
    font-style: italic;
    color: #888;
    margin: 0 0.5em;
    font-size: 0.8em;
}

.filterDropdown {
    font-family: "VCR_OSD_MONO";
    border: 3px solid transparent;
    border-image: url("assets/images/border-choice.png") 3 stretch;
    background-color: black;
    color: white;
    height: 24px;
}
#clearFilters {
    margin: 2px;
    padding: 7px 4px;
    height: 40px;
    border: 2px solid white;
    background-color: #434343;
    color: white;
    cursor: pointer;
    font-family: "VCR_OSD_MONO";
    text-align: center;
}
#searchOptions {
    display: flex;
    width: 100%;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
}

.dialogue-expression:hover .tooltip,
.dialogue-expression:active .tooltip,
.dialogue-expression:focus .tooltip {
    visibility: visible;
}

.option {
    /* DEPRECATED - use dialogue-option-only instead */
    margin: 0.5em 0 0.5em 2em;
    padding: 0.5em;
    border: 3px solid transparent;
    border-image: url("/assets/images/border-choice.png") 3 stretch;
}

.dialogue-option-only {
    /*
     * this class is used when there's only one option to choose from,
     * or when there's no reason to have a dropdown because the option
     * chosen doesn't affect anything
     */
    margin-left: 0.5em;
}

.dialogue-option summary,
.dialogue-option-only {
    margin: 0.5em 0 0.5em 2em;
    padding: 0.5em;
    border: 3px solid transparent;
    border-image: url("/assets/images/border-choice.png") 3 stretch;
}

ul.dialogue-option {
    padding: 0;
    margin-right: 0.5em;
}

.dialogue-option li {
    list-style: none;
}

summary::-webkit-details-marker,
summary::marker {
    list-style: none;
    display: none;
    content: '';
}

.dialogue-option details::before {
    content: ">";
    float: left;
    margin: 0.5em;
}

.dialogue-option .invis-arrow details::before {
    color: transparent;
}

.dialogue-option details[open]::before {
    transform: rotate(90deg);
}

.dialogue-option .dialogue-note details::before {
    color: #ffffff7f;
}

details .dialogue {
    margin-left: 2em;
}

/* * *                           dialogue lines                           * * */

.dialogue-line {
    display: block;
    margin: 0.5em;
}

.dialogue-head {
    display: inline-flex;
}

.dialogue-head::after {
    content: ":";
}

.dialogue-name {
    font-weight: bold;
    display: inline-flex;
}

.dialogue-expression {
    display: inline-flex;
    font-size: smaller;
    color: #ffffffbf;
    position: relative;
}

.dialogue-expression::before {
    content: "\00a0" /* space */;
}

/* * *                                notes                               * * */

.dialogue-note {
    display: block;
    margin: 0.5em;
    color: #ffffff7f;
}

.note-color {
    color: #ffffff7f;
}

.inline-note-box {
    display: flex;
    flex-flow: row wrap;
}

.inline-note-box > :first-child {
    flex: 2 1 auto;
}

.inline-note-box > :last-child {
    flex: 1 1 auto;
    color: #ffffff7f;
    text-align: right;
}

/* * *                               skills                               * * */

.skill {
    font-family: 'VCR_OSD_MONO';
    text-align: center;
    display: block;
}

.skill img {
    height: 32px;
    width: 32px;
    display: inline-block;
    vertical-align: bottom;
    position: relative;
    top: 2px;
}

.skill-name {
    font-size: 22px;
    padding: 0.1em 0.25em 0.25em 0.25em;
    border: 3px solid transparent;
    border-image: url("/assets/images/border-choice.png") 3 stretch;
    display: inline-block;
}

.skill-desc {
    padding: 0.5em;
    border: 13px solid transparent;
    border-image: url("/assets/images/border.png") 14 round;
    display: inline-block;
}



/* ************************************************************************** */
/*                               text formatting                              */
/* ************************************************************************** */

.wish {
    /* more easily readable */
    font-weight: 1000;
    text-shadow: 1px 1px 2px white;
}

.wish-alt {
    /* same as the game */
    -webkit-text-stroke: 3px #FFF5;
}

.shake-visual,
.wave-visual {
    font-style: italic;
}

@keyframes shake {
    0% {
        transform: var(--shake-state-1);
    }
    33% {
        transform: var(--shake-state-2);
    }
    66% {
        transform: var(--shake-state-3);
    }
    100% {
        transform: var(--shake-state-1);
    }
}

@keyframes wave {
    0% {
        transform: translateY(var(--wave-amplitude));
    }
    100% {
        transform: translateY(calc(var(--wave-amplitude) * -1));
    }
}

/* ************************************************************************** */
/*                                   layout                                   */
/* ************************************************************************** */

help-er {
    display: block;
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 99;
    width: 180px;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}

help-er button {
    margin: 2px;
    padding: 7px 0;
    width: 100%;
    height: 40px;
    border: 2px solid white;
    background-color: #434343;
    color: white;
    cursor: pointer;
    font-family: 'VCR_OSD_MONO';
    text-align: center;
    text-decoration: none;
}

help-er button:hover {
    background-color: #6d6d6d;
}

#settings {
    order: 1;
}

button[onclick="toggleSettings()"] {
    order: 2;
}

button[onclick="topFunction()"] {
    order: 3;
}

#container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#center {
    display: flex;
    flex-direction: row;
}

header > img {
    width: 100%;
}

nav {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-around;
    min-height: 60px;
    width: 100%;
    background-color: #434343;
    font-family: 'VCR_OSD_MONO';
}

nav img {
    margin: auto;
    width: 32px;
    height: 32px;
    display: inline-block;
}

nav span {
    display: inline-block;
    margin: auto;
    text-align: center;
}


nav a {
    color: white;
    font-weight: 800;
}

nav a:hover {
    color: white;
}

#searchButtonMobile {
    display: none;
}

side-bar {
    background-color: #6d6d6d;
    padding: 20px;
    font-size: smaller;
    width: min-content;
    flex: 1 10 auto;
}

aside {
    position: sticky;
    top: 20px;
}

main {
    flex: 10 1 auto;
}

footer {
    background-color: #434343;
    width: 100%;
    height: 100px;
    padding: 10px;
    text-align: center;
}


/* ************************************************************************** */
/*                                 media query                                */
/* ************************************************************************** */

@media only screen and (min-width: 600px) {
    .dialogue {
        font-size: 15px;
    }
}

@media only screen and (min-width: 768px) {
    .dialogue {
        font-size: 16px;
    }
}

@media only screen and (min-width: 992px) {
    #mobnav, #mobSidebar {
        display: none;
    }
    
    .dialogue {
        font-size: 16.5px;
    }
}

@media only screen and (min-width: 1200px) {}

@media only screen and (max-width: 991px) {
    #settings {
        order: 3;
    }
    
    button[onclick="toggleSettings()"] {
        order: 2;
    }
    
    button[onclick="topFunction()"] {
        order: 1;
    }

    help-er {
        left: auto;
        right: 20px;
        top: 20px;
        bottom: auto;
    }

    #center {
        flex-direction: column-reverse;
    }

    side-bar {
        width: 100%;
    }
}

@media only screen and (max-width: 768px) {
    nav span {
        width: 25%;
    }

    nav img {
        display: none;
    }

    #searchButtonDesktop {
        display: none;
    }

    #searchButtonMobile {
        display: inline-block;
    }
}

@media only screen and (max-width: 600px) {
    .dialogue {
        font-size: 15px;
    }

    nav span {
        width: 30%;
    }
}

@media only screen and (max-width: 450px) {
    nav span {
        width: 50%;
    }
}
