/* MARK: Variables
*/

:root {
    --element-background-color-darker: rgb(29, 87, 134);
    --element-background-color: rgb(35, 108, 168);
    --element-foreground-color: rgb(49, 144, 221);
    --element-foreground-color-brighter: rgb(85, 177, 252);
    --game-width: 1100px;
    --font-family: "Merriweather", Arial, sans-serif;
    --font-weight: 500;
    --default-border-radius: 8px;
    --progress-bar-fill-color: #00BB00;
    --progress-bar-fill-warning-color: #018101;
    --prestige-unlock-bought-color: rgb(22, 196, 88);
    --default-text-color: #000;
    --disabled-background-color: #777;
    --disabled-background-color-lighter: #999;
    --standard-div-spacing: 8px;

    --palette-dark-gray-darker: #616161;
    --tooltip-line-height: 1.6;
    --tooltip-header-size: 1.25rem;
    --tooltip-subtitle-size: 1rem;

    --tooltip-palette-text-primary: rgba(255, 255, 255, 0.7);
    --tooltip-palette-surface: #000000BB;

    --tooltip-palette-table-lines: rgba(255, 255, 255, 0.25);

    --prestige-color: rgb(141, 23, 196);
    --prestige-color-brighter: rgb(162, 54, 204);
}

/* MARK: Main areas
*/

* {
    font-family: var(--font-family);
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

body {
    color: var(--default-text-color);
    margin: var(--standard-div-spacing);
    min-height: calc(100vh - (var(--standard-div-spacing) * 2));
    background: linear-gradient(120deg, #102661, #8c386d) fixed;

    user-select: none;          /* Standard syntax */
    -webkit-user-select: none;  /* Safari */
    -moz-user-select: none;     /* Firefox */
    -ms-user-select: none;      /* Internet Explorer/Edge */
}

#game-area {
    width: var(--game-width);
    margin: 0 auto;
    display: flex;
    gap: var(--standard-div-spacing);
}

#main-area {
    width: 900px;
}

#left-sidebar {
    width: 190px;
}

#play-area {
    display: flex;
    margin-top: 30px;
}

#left-column {
    width: 554px;
}

#right-column {
    width: 338px;
    margin-left: var(--standard-div-spacing);
}

#zone {
    margin-bottom: var(--standard-div-spacing);
}

#zone-name {
    text-align: center;
    margin: 0;
}

#energy .progress-bar {
    height: 20px;
    border-radius: 12px;
}

#energy {
    width: 100%;
}

.low-energy .progress-fill {
    animation: low-energy-pulse 1s infinite alternate;
}

@keyframes low-energy-pulse {
  from { box-shadow: inset 0 0 5px 3px #ecc74b; }
  to   { box-shadow: inset 0 0 10px 5px var(--progress-bar-fill-warning-color); }
}

#top-area {
    width: 900px;
    display: flex;
    gap: var(--standard-div-spacing);
    background: var(--element-background-color);
    border-radius: var(--default-border-radius);
    position: fixed;
    top: -8px;
    padding: 5px;
    padding-top: 13px;
}

button {
    border-radius: var(--default-border-radius);
    background: var(--element-foreground-color);

    border-top: 2px solid #545454;
    border-left: 2px solid #545454;
    border-bottom: 2px solid black;
    border-right: 2px solid black;
}

button.disabled {
    border-left-color: rgba(123, 123, 123, 0.35);
    border-top-color: rgba(123, 123, 123, 0.35);
    border-right-color: rgba(60, 60, 60, 0.35);
    border-bottom-color: rgba(60, 60, 60, 0.35);
    color: rgba(16, 16, 16, 0.3);
}

#settings-area {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: var(--standard-div-spacing);
}

#settings-area button {
    flex: 1;
    font-size: 2em;
}

.sidebar-button {
    height: 48px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MARK: Common
*/

button:hover:not(.disabled):not(:disabled) {
    filter: brightness(1.1);
}

.disabled {
    color: #44444488;
    opacity: 0.6;
}

.disabled .text {
    filter: grayscale(1);
}

.hidden {
    display: none !important;
}

/* MARK: Tasks
*/

.task {
    margin-bottom: var(--standard-div-spacing);
    background: var(--element-background-color);
    border-radius: var(--default-border-radius);
    padding: 5px;
    display: flex;
    flex-direction: column-reverse;
}

.task button {
    position: relative;
    width: 50%;
    height: 32px;
    display: flex;
    align-items: center;
    border-radius: var(--default-border-radius);
    margin-bottom: 5px;
}

.task .disabled {
    background: linear-gradient(5deg, var(--disabled-background-color), var(--disabled-background-color-lighter));
    opacity: 1.0;
}

.task.Normal button:not(.disabled) {
    background: linear-gradient(5deg, rgb(22, 196, 88), rgb(53, 197, 101));
}

.tooltip .Normal {
    color: rgb(22, 196, 88);
}

.task.Travel button:not(.disabled) {
    background: linear-gradient(5deg, rgb(23, 112, 196), rgb(54, 132, 204));
}

.tooltip .Travel {
    color: rgb(23, 112, 196);
}

.task.Mandatory button:not(.disabled) {
    background: linear-gradient(5deg, rgb(224, 193, 68), rgb(220, 221, 130));
}

.tooltip .Mandatory {
    color: rgb(224, 193, 68);
}

.task.Boss button:not(.disabled) {
    background: linear-gradient(5deg, rgb(214, 60, 60), rgb(236, 107, 107));
}

.tooltip .Boss {
    color: rgb(214, 60, 60);
}

.task.Prestige button:not(.disabled) {
    background: linear-gradient(5deg, var(--prestige-color), var(--prestige-color-brighter));
}

.prestige-glow {
    animation: prestige-glow 1s infinite alternate;
}

.tooltip .Prestige {
    color: var(--prestige-color);
}

.task .indicator {
    width: 16px;
    height: 16px;
    margin-left: 3px;
    vertical-align: middle;
}

.task-upper {
    width: 100%;
    display: flex;
    position: relative;
}

.task-reps {
    width: 60%;
    display: flex;
    margin-left: 3px;
    align-items: center;
}

.task-rep {
    width: 22px;
    height: 22px;
    background: #555;
    margin: 3px;
    border-radius: 5px;
}

.task-rep.finished {
    background: #00BB00;
}

.task-automation {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: smaller;
}

.disable-reason {
    color: red;
}

.perk-unlock {
    animation: perk-glow 1s infinite alternate;
}

@keyframes prestige-glow {
    from {
        box-shadow: 0 0 5px 5px rgba(166, 52, 219, 0.6);
    }

    to {
        box-shadow: 0 0 15px 8px rgba(166, 52, 219, 0.9);
    }
}

@keyframes perk-glow {
    from {
        box-shadow: 0 0 8px 2px rgba(52, 219, 66, 0.6);
    }

    to {
        box-shadow: 0 0 12px 4px rgba(52, 219, 66, 0.9);
    }
}

/* MARK: Skills
*/

#skills {
    width: 100%;
    gap: var(--standard-div-spacing);
    display: flex;
    flex-direction: column;
}

.skill .progress-bar {
    width: 100%;
    text-align: center;
    margin-top: 5px;
}

.skills-used-text {
    margin-top: 2px;
    margin-bottom: 2px;
}

/* MARK: Sidebars
*/

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--standard-div-spacing);
}

.sidebar-item {
    width: 100%;
    text-align: center;
    background: var(--element-background-color);
    border-radius: var(--default-border-radius);
    padding: 5px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

.sidebar-item-text {
    display: flex;
    justify-content: space-between;
}

.sidebar-item-text span {
    display: inline-flex;
    align-items: flex-end;
}

.sidebar-section {
    position: relative;
    background: var(--element-background-color);
    border-radius: var(--default-border-radius);
    padding: 5px;
}

.section-name {
    margin: 5px;
}

.elements-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--standard-div-spacing);
    margin-bottom: 5px;
}

.element {
    width: 48px;
    height: 48px;
    text-align: center;
    border-radius: var(--default-border-radius);
    background: var(--element-foreground-color);
}

.section-info {
    position: absolute;
    top: 0;
    right: 0;
    margin: 5px;
    width: 24px;
    height: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 100px;
    border: 2px solid #000;
}

#controls .element {
    width: 60px;
    height: 60px;
}

.automation {
    text-align: center;
}

#controls .automation button {
    width: 60px;
    height: 42px;
}

.automation .on {
    background-color: rgb(49, 221, 72);
}

/* MARK: Items
*/

.item-button {
    position: relative;
    align-items: center;
    justify-content: center;
    display: flex;
}

.item-button .text {
    font-size: 1.5em;
}

.item-button .item-count {
    position: absolute;
    bottom: 0;
    right: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #FFF;
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 0.9em;
}

#item-undo, #artifact-undo {
    position: absolute;
    top: 4px;
    right: 34px;
    height: 30px;
    font-size: 1em;
}

/* MARK: Perks
*/

.perk {
    font-size: 1.5em;
    align-items: center;
    justify-content: center;
    display: flex;
}

/* MARK: Overlays
*/

.full-screen-overlay button {
    font-size: 1em;
}

.confirmation {
    height: 250px;
    width: 400px;

    flex-direction: column;
}

.confirmation-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

/* MARK: Game over
*/

.full-screen-overlay {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-items: center;
    color: white;

    background: #0008;
}

#end-of-content-box {
    text-align: center;
}

button#end-of-content-reset, button.game-over-dismiss {
    font-size: 1.5em;
}

#game-over-overlay p {
    margin: 0.7em;
}

/* MARK: Prestige
*/

#open-prestige {
    background-color: var(--prestige-color);
}

button.do-prestige {
    background-color: var(--prestige-color);
    font-size: 2em;
}

#prestige-box {
    position: relative;
    height: 730px;
    width: 530px;
    padding: 0;
    
    scrollbar-color: var(--element-foreground-color) var(--element-foreground-color-brighter); /* Firefox */
}

.scroll-area {
    height: 100%;
    width: 100%;

    align-items: center;

    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: var(--standard-div-spacing);

    overflow-y: auto;
}

.close {
    position: absolute;
    top: 8px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 1em;
}

.prestige-purchase {
    width: 115px;
    height: 84px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

div.prestige-purchase {
    background-color: var(--prestige-unlock-bought-color);
    border-radius: var(--default-border-radius);
}

.prestige-purchase.prestige-purchase-repeatable {
    height: 84px;
}

.prestige-section {
    width: 100%;
    border-top: 1px solid var(--tooltip-palette-table-lines);
}

.prestige-purchases {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.divine-spark-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

.divine-spark-info {
    margin-left: 5px;
    width: 24px;
    height: 24px;
    text-align: center;

    border-radius: 100px;
    border: 2px solid #000;
}

/* MARK: Stats
*/

#stats-box {
    position: relative;
    height: 730px;
    width: 530px;
    padding: 0;
    
    scrollbar-color: var(--element-foreground-color) var(--element-foreground-color-brighter); /* Firefox */
}

.stat-section {
    width: 75%;
}

/* MARK: Tooltips
*/

#tooltip {
    position: absolute;
    background-color: var(--tooltip-palette-surface);
    color: var(--tooltip-palette-text-primary);
    margin-left: 5px;
    margin-right: 5px;
    padding: 5px;
    border-radius: var(--default-border-radius);
    z-index: 1000;
}

#tooltip h3 {
    margin-top: 3px;
    margin-bottom: 8px;
}

#tooltip .subheader {
    font-weight: bold;
}

.tooltip hr {
    border: none;
    border-bottom: 1px solid var(--tooltip-palette-table-lines);
}

.table {
    overflow-x: auto;
}

.tooltip>.simple-table {
    min-width: 350px;
}

.simple-table {
    width: 100%;
    border-spacing: 0;
}

.simple-table tr>td {
    display: table-cell;
    padding: 6px;
    font-size: .875rem;
    text-align: start;
    line-height: 1.43;
    vertical-align: inherit;
}

.simple-table td:last-child {
    text-align: end;
}

.simple-table tr:not(:last-child)>td {
    border-bottom: 1px solid var(--tooltip-palette-table-lines);
}

.tooltip-asterisk {
    font-size: 0.6em;
}

.tooltip .good {
    color: green;
}

.tooltip .bad {
    color: orange;
}

.tooltip .very-low {
    color: green;
}

.tooltip .normal {
    color: palegoldenrod;
}

.tooltip .high {
    color: yellow;
}

.tooltip .very-high {
    color: orange;
}

.tooltip .extreme {
    color: red;
}

/* MARK: Progress bars
*/

.progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    background: #555;
    overflow: hidden;
    border-radius: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--progress-bar-fill-color);
    transition: width 0.2s;
}

.progress-value {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* MARK: Settings
*/

.overlay-box {
    position: relative;
    justify-content: center;
    align-items: center;
    background: var(--element-background-color);
    border-radius: var(--default-border-radius);
    border: #000;
    border-width: 2px;
    border-style: solid;
    padding: 8px;
    display: flex;
    flex-direction: column;
    color: var(--default-text-color);
    gap: var(--standard-div-spacing);
}

#settings {
    height: 200px;
    width: 200px;
}

/* MARK: Changelog
*/

#changelog-box {
    position: relative;
    height: 730px;
    width: 530px;
    padding: 0;
    
    scrollbar-color: var(--element-foreground-color) var(--element-foreground-color-brighter); /* Firefox */
}

.changelog-entry {
    width: 90%;
    text-align: left;
}

/* MARK: Messages
*/
footer {
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--game-width);
    padding: 10px 0;
    background-color: transparent;
    pointer-events: none;
    z-index: 999;
}

.message {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    margin: 3px 0;
    padding: 5px 10px;
    border-radius: var(--default-border-radius);
    font-size: 0.9em;
}
