html {
    overflow-x: clip;
}

body {
    margin: 0;
    background-color: #3c6e51;
    font-family: "Monaco", monospace;
    position: relative;
    min-height: 100vh;
    min-width: 100%;
}

a:link,
a:visited,
button.text-link:active {
    color: #42865e;
}

a:hover,
a:active,
button.text-link:hover,
button.text-link:active {
    color: #1a9e6f;
}

.error {
    color: #a00;
    animation-name: error;
    animation-duration: 0.2s;
    animation-iteration-count: 4;
    animation-direction: alternate-reverse;
    animation-timing-function: ease;
}

@keyframes error {
  from {
    color: #f00;
    }
  to {
    color: #a00;
    }
}

.warning {
    animation-name: warning;
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-direction: alternate-reverse;
    animation-timing-function: ease;
}

@keyframes warning {
  from {
    color: #fd0;
    }
  to {
    color: #c80;
    }
}

#titlebar {
    color: #0f100f;
    background-color: #0004;
    top: 0;
    width: calc(100% - 2em);
    display: flex;
    flex-direction: row;
    gap: 1em;
    padding: 1em;
}

#titlebar.home {
    flex-direction: column;
    align-items: center;
    border-radius: 0 0 2em 2em;
}

.title {
    width: 100%;
    font-size: 4em;
    margin-top: 2em;
    margin-bottom: 0.25em;
    text-align: center;
}

.small-title {
    font-size: 2em;
    padding: 0.25em 1em;
    margin: 0;
    text-align: left;
}

.admin-notice {
    color: darkred;
    font-style: italic;
    font-size: 1em;
    padding: 0 2em;
    margin: 0;
}

.home .admin-notice {
    text-align: center;
}

.top-links {
    display: flex;
    flex-direction: row;
    gap: 2em;
    align-items: center;
}

.top-links>* {
    margin: 0;
}

#front-query {
    width: 100%;
    padding: 1em 0em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#front-query>form {
    width: max(30vw, 20em);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#front-query,
#search {
    text-align: center;
}

#front-query input#search-bar,
#search input#search-bar {
    text-align: center;
    width: calc(100% - 0.5em);
}

.tag-search,
.category-search {
    display: flex;
    width: 100%;
    gap: 0.5em;
    margin-bottom: 1em;
}

.tag-search input#search-bar,
.category-search input#search-bar {
    flex: 1;
}

input#search-button {
    padding: 0.25em 1.5em;
}

#front-query input {
    margin: 0.25em 0;
    font-size: 2em;
}

#search input {
    margin: 0.25em 0;
}

.autocomplete {
    position: fixed;
    height: fit-content;
    background-color: #274634;
    border-color: #0004;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.autocomplete-entry,
.autocomplete-entry-selected {
    padding: 0.5em 1em;
    display: flex;
    color: #42865e;
}

.item-search .autocomplete-entry,
.item-search .autocomplete-entry-selected {
    padding: 0.25em 0.5em;
}

.autocomplete-entry:hover,
.autocomplete-entry-selected {
    background-color: #0004;
    border-radius: 4px;
    color: #1a9e6f;
}

.autocomplete-tag {
    text-align: left;
    flex: 1;
}

#main-body,
#admin-main-body {
    margin: 0.5em;
    margin-bottom: 0em;
    display: flex;
    height: 100%;
    padding-bottom: 4em;
    flex-direction: row;
}

#admin-main-body {
    flex-wrap: wrap;
}

.platform-requirement h2 {
    text-align: center;
}

.platform-requirement img {
    width: 100%;
    height: 100%;
}

.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5em;
}

#sidebar {
    min-width: 20em;
    max-width: 20em;
    float: left;
    background-color: #0004;
    padding: 1em;
    border-radius: 0.5em;
    height: fit-content;
}

#sidebar,
#tag-list-section {
    margin-right: 0.5em;
}

#content {
    flex-grow: 1;
}

.search-results-container {
    min-height: calc(100vh - 12em);
}

#search-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

#search-results>.item {
    margin: 0.5em;
    width: max(min((100vw - 20em)/4 - 3em, 256px), 16px);
    aspect-ratio: 1;
    border-radius: 0.25em;
    color: #eee;
    background-color: #0004;
    border-color: #0000;
    border-width: 0.25em;
    border-style: solid;
}

.item {
    display: flex;
    align-items: center;
}

.item>p {
    text-align: center;
    width: 100%;
}

.item * {
    object-fit: cover;
    max-height: 100%;
    max-width: 100%;
    height: 100%;
    width: 100%;
    border-radius: 5em;
}

.item img {
    border-radius: 0.25em;
}

.imgbox {
    height: 100%;
    width: 100%;
}

.imgbox img {
    max-height: calc(100vh - 6.5em);
    max-width: calc(100vw - 18.5em);
    margin: auto;
}

#item-info,
#tag-info,
#tag-examples,
#category-info,
#tag-list-section,
#category-list-section {
    max-width: calc(100vw - 18.5em);
    background-color: #0004;
    padding: 1em;
    border-radius: 0.5em;
    height: fit-content;
}

#tag-examples {
    margin-top: 0.5em;
}

#tag-examples h2 {
    margin-top: 0;
}

.tag-examples {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

.tag-examples img {
    max-width: 10em;
    aspect-ratio: 1;
    border-radius: 0.5em;
}

.horizontal-stack {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: row;
    padding: 0 1em;
}

#tag-list-section,
#category-list-section {
    min-width: calc(50% - 2em);
    max-width: calc(50% - 2em);
}

.list-header {
    margin-top: 0;
}

#tag-name,
#tag-description,
#category-name,
#category-description,
#item-name,
#item-description {
    margin: 0;
}

#tag-name,
#category-name,
#item-name,
#tag-info>form,
#category-info>form,
#item-info>form {
    display: inline-block;
}

.form-field {
    margin-top: 0.25em;
    font-size: x-large;
}

.form-field:first-of-type {
    margin-top: 0;
}

hr {
    border: 1px solid #0008;
    border-radius: 1px;
}

i.missing {
    color: #0008;
}

.tag-list,
.category-list {
    list-style: none;
    padding-left: 1em;
    margin: 0;
}

.tag-list li,
.category-list li {
    width: auto;
    display: flex;
    flex-direction: row;
    max-width: 100%;
}

.tag-link,
.category-link {
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#post-search-contents {
    width: 100%;
}

#search-page-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    background-color: #0004;
    border-radius: 0.25em;
    padding: 0.5em;
}

label {
    white-space: nowrap;
}

.item-preview,
div.existing-tags,
div.new-tags {
    padding: 0.5em;
    background-color: #0004;
    border-radius: 0.25em;
    margin: 0 0.5em;
}

.item-preview {
    height: fit-content;
}

div.edit-tag-info,
div.edit-tag-category-info,
div.admin-login,
div.admin-panel, div.oauth-results-container {
    padding: 0.5em;
    background-color: #0004;
    border-radius: 0.25em;
    margin: 0.5em 0.5em;
    height: fit-content;
    min-width: max(34% - 3em, 30em);
    max-width: max(34% - 3em, 30em);
}

div.admin-panel img.header {
    height: 5em;
}

div.existing-tags h2,
div.new-tags h2,
div.edit-tag-info h2,
div.edit-tag-category-info h2 {
    white-space: nowrap;
}

div.edit-tag-info input[type=submit],
div.edit-tag-info select,
div.edit-tag-category-info input[type=submit],
div.edit-tag-category-info select,
div.admin-login input[type=submit],
div.admin-login select,
div.admin-panel input[type=submit],
div.admin-panel select {
    min-width: 100%;
    max-width: 100%;
}

form.submit-changes input[type=submit],
.tag-category {
    font-size: larger;
}

form.submit-changes input[type=submit] {
    margin-top: 0.5em;
}

.color-picker {
    height: fit-content;
    display: flex;
    gap: 1em;
    align-items: center;
}

.clear-color {
    padding: 0.5em 1em;
}

.clear-color,
input[type=color] {
    height: 3em;
    vertical-align: top;
}

p.color {
    display: inline;
    margin: 0;
}

div.edit-tag-info input[type=text],
div.edit-tag-info textarea,
div.edit-tag-category-info input[type=text],
div.edit-tag-category-info textarea,
div.admin-login input[type=text],
div.admin-login input[type=password],
div.admin-login textarea,
div.admin-panel input[type=text],
div.admin-panel input[type=password],
div.admin-panel textarea {
    min-width: calc(100% - 8px);
    max-width: calc(100% - 8px);
}

.admin-panel h1, .admin-panel h2, .admin-panel h3, .admin-panel h4 {
    margin: 0.25em 0;
}

.admin-panel input[type=submit] {
    padding: 0.25em 0.5em;
    font-size: 1.25em;
}

form.add-tag {
    white-space: nowrap;
}

div.existing-tags,
div.new-tags {
    min-height: calc(100vh - 11em);
}

div.existing-tags,
div.new-tags {
    flex-grow: 1;
}

.item-preview img {
    width: 512px;
}

.item-preview form {
    max-width: 512px;
}

.item-preview input,
.item-preview textarea {
    min-width: 504px;
    max-width: 504px;
}

.item-preview input.button {
    width: 512px;
    max-width: 512px;
}
.collapsible {
    background-color: #fff4;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
}

.collapsible.active {
    background-color: #fff5;
}

.collapsible:hover {
    background-color: #fff3;
}

button.text-link {
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
    font-size: inherit;
}

[data-tooltip]:hover::after {
    display: block;
    position: absolute;
    content: attr(data-tooltip);
    border: 1px solid black;
    border-radius: 4px;
    background: #eee;
    padding: .25em;
    font-size: 16px;
    font-weight: normal;
    font-family: "Monaco", monospace;
}

footer {
    width: calc(100% - 1em);
    height: 2.5em;
    padding: 0.5em;
    background-color: #0003;
    border-radius: 1em 1em 0 0;
    text-align: center;
    position: absolute;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

footer * {
    margin: 0
}