/* This is probably a mess */
:root {
    --background: #222244;
    --color: #ffffff;
    --unfocused-color: #aaaaaa;
    --foreground-background: #333333;
    --foreground-background-dark: #282828;
    --sidebar-background: var(--foreground-background);
    --player-info-background: var(--foreground-background);
    --log-background: var(--foreground-background);
    --center-background: #222222;
    --center-top-background: #332233;
    --center-top-color: #ccccff;
    --link: #518ae0;
    --link-hover: #7da8e8;
    --center-bottom-background: #181818;
    --money: #cccc55;
    --hover-background: #444444;
    --menu-button-background: #444444;
    --menu-button-background-hover: #555555;
    --equipment-background: #333344;
    --equipment-border: #444499;
    --equipment-durability-background: #555577;
    --skillbar-background: #bbbb44;
    --healthbar-background: #44bb44;
    --healthbar-damage-background: #ff4444;
    --energy-bar-background: #bb4444;
    --xp-bar-background: #4444bb;
    --bottombar-background: #999999;
    --background-background: #222222;
    --tooltip-background: #111111;
    --tooltip-color: #ffffff;
}

body {
    background-color: var(--background);
    margin: 0;
    font-family: monospace;
}

#center {
    background-color: var(--center-background);
    position: fixed;
    top: 20%;
    bottom: 20px;
    left: 305px;
    right: 305px;
    overflow-y: hidden;
    overflow-x: hidden;
}

#center-top {
    position: absolute;
    background-color: var(--center-top-background);
    top: 0;
    width: 100%;
    height: 30px;
    text-align: right;
    color: var(--center-top-color);
    font-size: 20px;
    line-height: 30px;
}

#main, #main-transition {
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: 5px;
    right: 5px;
    overflow-y: auto;
    scrollbar-color: #555555 #333333;
    scrollbar-width: thin;
}

#main-transition {
    background-color: var(--center-background);
    opacity: 100%;
    transition: opacity 0.3s linear;
}

.main-text {
    display: inline;
    white-space: pre-line;
    font-size: 20px;
    color: var(--color);
}

.main-link {
    color: var(--link);
    border: 0;
    background: none;
    padding: 0;
    outline: none;
    font-size: 20px;
    display: inline;
    cursor: pointer;
    font-family: monospace;
}

.main-link:hover {
    color: var(--link-hover);
}

.main-processing::after {
    color: #cccccc;
    content: ".";
    animation: processingText 3s infinite
}

@keyframes processingText {
    0% {content: ".";}
    33% {content: "..";}
    67% {content: "...";}
}

img { 
    image-rendering: pixelated;
}

.shop-holder, #storage-table {
    color: var(--color);
    font-size: 16px;
    max-width: 350px;
    border: 1px solid #555555;
    border-left: 2px solid #555555;
    border-right: 2px solid #555555;
    background-color: #333333;
    margin-top: 20px;
}

.crafting-holder {
    color: var(--color);
    font-size: 16px;
    max-width: 300px;
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#center-bottom {
    display: flex;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background-color: var(--center-bottom-background);
}

.action-button {
    display: inline;
    padding-inline: 6px;
    padding-block: 1px;
    background: 0;
    font-size: 14px;
    font-family: monospace;
    color: #00ff00;
    border: 1px solid #007700;
    cursor: pointer;
}

.action-button.enabled {
    background-color: #333333;
    border: 1px solid #00aa00;
}

.action-button:hover {
    color: #aaffaa;
    border: 1px solid #00ff00;
}

#sidebar {
    background-color: var(--foreground-background);
    position: fixed;
    top: 20%;
    bottom: 20px;
    width: 300px;
    color: var(--color);
}

#inventory-table, #quests-table, #completed-quests-table, #achievements-table {
    border: 1px solid #555555;
    border-left: 2px solid #555555;
    border-right: 2px solid #555555;
    font-size: 16px;
}

#quests-table, #completed-quests-table, #achievements-table {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    border: 0;
    padding-bottom: 50px;
}

#achievements-table {
    gap: 4px;
}

#completed-quests-header {
    margin-top: 20px;
}

#inventory-holder {
    text-align: center;
    position: relative;
}

#inventory-money {
    display: inline;
    position: absolute;
    left: 0;
    bottom: 0;
    color: var(--money);
    font-size: 16px;
}

#inventory-discard {
    display: inline;
    position: absolute;
    left: 50px;
    bottom: 0;
    color: #bb0000;
    font-size: 16px;
    outline: 1px solid #bb0000;
    cursor: pointer;
    user-select: none;
}

#inventory-discard:hover {
    background-color: #664444;
}

#multi-holder {
    position: absolute;
    bottom: 120px;
}

.multi-button {
    display: inline;
    color: #9999bb;
    font-size: 16px;
    outline: 1px solid #0000bb;
    cursor: pointer;
    user-select: none;
}

.multi-button:hover {
    background-color: #444466;
}

.multi-button.selected {
    outline: 1px solid #7777dd;
    background-color: #4444aa;
}

#inventory-weight {
    display: inline;
    position: absolute;
    right: 0;
    bottom: 0;
}

.item-parent {
    width: 100%;
    height: 20px;
    border-top: 1px solid #555555;
    border-bottom: 1px solid #555555;
    line-height: 20px;
}

.crafting-item-parent {
    width: 100%;
    min-height: 20px;
    border: 2px solid #555555;
    line-height: 20px;
}

.crafting-item-holder {
    height: 20px;
    border-bottom: 1px solid #555555;
    background-color: var(--foreground-background);
}

.crafting-item-requirements {
    font-size: 12px;
    background-color: var(--foreground-background-dark);
}

.item-parent:hover {
    background-color: var(--hover-background);
}

.crafting-type {
    font-weight: bold;
    padding-left: 5px;
    padding-right: 5px;
}

.item-text {
    display: inline-block;
    width: 240px;
    height: 100%;
}

.item-quantity {
    color: #ccccff;
}

.item-price {
    color: var(--money);
    margin-left: 20px;
}

.item-complexity {
    color: #ffaa55;
}

.item-equipped {
    color: #00cccc;
}

.item-selected {
    color: #cc00cc;
}

#skill-table {
    border: 1px solid #555555;
    text-align: center;
    font-size: 16px;
}

.skill-parent {
    width: 100%;
    height: 20px;
    border-top: 1px solid #555555;
    border-bottom: 1px solid #555555;
}

.quest-parent {
    width: calc(100% - 4px);
    border: 2px solid #555555;
    font-size: 14px;
}

.quest-title {
    text-align: center;
    font-size: 16px;
    margin-bottom: 5px;
}

.quest-goals {
    margin-top: 5px;
    border-top: 1px solid #555555;
}

.achievement-parent {
    width: calc(100% - 4px);
    border: 2px solid #555555;
}

.achievement-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 12px;
    color: var(--unfocused-color);
}

.achievement-progress {
    font-size: 12px;
    color: var(--unfocused-color);
    text-align: right;
    margin-right: 4px;
}

.achievement-bar {
    background-color: #777777;
    height: 4px;
    width: 90%;
}

#menu-buttons-holder {
    margin-top: 10px;
    text-align: center;
}

.menu-button {
    background-color: var(--menu-button-background);
    border: 2px solid #777777;
    color: var(--color);
    font-family: monospace;
    cursor: pointer;
}

.menu-button:hover {
    background-color: var(--menu-button-background-hover);
}

.sidebar-menu {
    width: calc(100% - 10px);
    height: calc(100% - 40px);
    margin-left: 5px;
    margin-top: 10px;
}

#sidebar-menu-quests, #sidebar-menu-achievements {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-color: #555555 #333333;
    scrollbar-width: thin;
    padding-bottom: 100px;
}

#inventory-table {
    max-height: calc(100% - 180px);
    overflow-y: auto;
    scrollbar-color: #555555 #333333;
    scrollbar-width: thin;
}

#equipment-holder {
    position: absolute;
    background-color: var(--equipment-background);
    bottom: 0;
    height: fit-content;
    width: calc(100% - 10px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.equipment-item-holder {
    position: relative;
    border: 2px solid var(--equipment-border);
    height: 24px;
}

.bar-fill.equipment {
    background-color: var(--equipment-durability-background);
    width: 0;
}

.equipment-item-text {
    text-align: center;
    font-size: 16px;
    line-height: 24px;
    color: var(--unfocused-color);
    position: relative;
}

#debug-scene-jump-autocomplete-suggestions {
    text-align: left;
    width: calc(100% - 10px);
    position: absolute;
    overflow-y: hidden;
    background-color: #222222;
}

.suggestion {
    cursor: pointer;
}

.suggestion:hover {
    color: #ffff00;
}

.suggestion.selected {
    color: #ffff00;
}

.sidebar-menu-title {
    text-align: center;
    font-size: 20px;
}

.debug-header {
    text-align: center;
    font-size: 16px;
    border-top: 2px solid #555555;
}

.skillbar-parent {
    position: relative;
    width: 100%;
    height: 20px;
    border-top: 1px solid #555555;
    border-bottom: 1px solid #555555;
}

.skillbar-fill, .skillbar-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
}

.skillbar-fill {
    background-color: var(--skillbar-background);
}

#player-info {
    background-color: var(--foreground-background);
    position: fixed;
    top: 0;
    bottom: calc(80% + 5px);
    width: 500px;
    color: var(--color);
    font-size: 16px;
    line-height: 20px;
}

#player-info-left {
    text-align: center;
    position: absolute;
    width: 290px;
    left: 5px;
    height: 100%;
}

.bar-parent {
    position: relative;
    width: 100%;
    height: 20px;
}

.bar-fill, .bar-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
}

#healthbar-fill, #enemy-healthbar-fill {
    background-color: var(--healthbar-background);
}

#healthbar-fill-damage, #enemy-healthbar-fill-damage {
    background-color: var(--healthbar-damage-background);
    /* transition: width 0.3s linear;
    transition-delay: 0.5s; */
}

#energy-bar-fill {
    background-color: var(--energy-bar-background);
}

#xp-bar-fill {
    background-color: var(--xp-bar-background);
}

#effects-bar, #enemy-effects-bar {
    display: flex;
    gap: 4px;
    position: absolute;
    bottom: 5px;
    width: 100%;
    height: 16px;
}

.effect-icon {
    width: 16px;
    height: 16px;
}

#player-info-divider {
    background-color: #444444;
    position: absolute;
    width: 5px;
    height: 100%;
    left: 300px;
}

#player-info-right {
    position: absolute;
    left: 310px;
    right: 5px;
    height: 100%;
}

#bottombar {
    background-color: var(--bottombar-background);
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 20px;
    display: flex;
}

#game-title {
    font-size: 16px;
    text-decoration: none;
    color: #000000;
}

#game-title.update {
    font-weight: bold;
    border: 2px solid #ffff00
}

#bottombar-right {
    margin-left: auto;
}

.bottombar-text {
    font-size: 14px;
    display: inline;
    border: 1px solid #000000;
    padding-inline: 6px;
    padding-block: 1px;
}

.bottombar-button {
    border: 1px solid #000000;
    background: 0;
    padding-inline: 6px;
    padding-block: 1px;
    font-family: monospace;
    font-size: 14px;
}

.bottombar-button:hover {
    background-color: #888888;
}

#attack-info {
    background-color: var(--background-background);
    position: fixed;
    top: 0;
    bottom: calc(80% + 5px);
    left: 505px;
    right: 305px;
    color: var(--color);
    font-size: 16px;
    line-height: 20px;
}

#attack-info-left {
    text-align: center;
    position: absolute;
    width: 290px;
    left: 5px;
    height: 100%;
}

#attack-info-divider {
    background-color: #444444;
    position: absolute;
    width: 5px;
    height: 100%;
    left: 300px;
}

#attack-info-right {
    position: absolute;
    left: 310px;
    right: 5px;
    height: 100%;
}

#log {
    background-color: var(--foreground-background);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 20px;
    width: 300px;
    color: var(--color);
    overflow-y: auto;
    scrollbar-color: #555555 #333333;
    scrollbar-width: thin;
}

.log-entry {
    width: 100%;
    border-top: 1px solid #555555;
    border-bottom: 1px solid #555555;
    text-align: center;
    font-size: 16px;
    padding-top: 2px;
    padding-bottom: 2px;
}

#tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--tooltip-background);
    border: 2px solid #999999;
    color: var(--tooltip-color);
    padding: 6px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0;
    transform: translate(10px, 10px);
    transition: opacity 0.2s ease;
    width: 250px;
}

#tooltip-title {
    text-align: center;
    font-size: 16px;
}

#tooltip-text {
    text-align: center;
    white-space: pre-wrap;
    font-size: 13px;
}

#settings {
    position: fixed;
    width: 60%;
    height: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #444444;
}

#settings-categories {
    position: absolute;
    width: 200px;
    height: 100%;
    border-right: 2px solid #555555;
}

#settings-options {
    position: absolute;
    width: calc(100% - 220px);
    height: 100%;
    left: 220px;
    white-space: pre-wrap;
    color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-color: #555555 #333333;
    scrollbar-width: thin;
}

.settings-options-title {
    font-size: 16px;
}

.settings-category {
    width: 100%;
    height: 30px;
    background-color: #444444;
    border: 0;
    border-bottom: 2px solid #555555;
    color: #ffffff;
    font-family: monospace;
    font-size: 16px;
}

.settings-category:hover {
    background-color: #555555;
}

.settings-option-holder {
    display: flex;
    gap: 4px;
    align-items: center;
}

.settings-option-checkbox {
    margin: 0;
}

.settings-option-text-input {
    padding: 0;
    flex: 1;
    margin-right: 10px;
}

.settings-option-color-input {
    padding: 0;
}

.settings-save-holder {
    position: relative;
    background-color: #333333;
    width: 200px;
    min-height: 50px;
    margin-top: 8px;
    padding-bottom: 20px;
    border: 2px solid #555555
}

.settings-save-title {
    width: 100%;
    height: 20px;
    font-size: 16px;
    line-height: 20px;
}

.settings-save-data {
    white-space: pre;
}

.settings-save-download {
    position: absolute;
    bottom: 0;
    right: 0;
}