*,
*::before,
*::after {
    box-sizing: border-box;
}

body *,
body {
    transition: background-color var(--transition), border-color var(--transition);
}

button,
a,
input,
select {
    touch-action: manipulation;
}

html {
    min-width: 1250px;
    height: 100%;
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    scrollbar-width: none;
}

html[data-monospace-font="true"] {
    font-family:
        Inconsolata,
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
}

img {
    image-rendering: pixelated;
}

.scrollbar,
.scrollbarX {
    overflow-y: auto;
    scrollbar-width: thin;
}

.scrollbarX {
    overflow-x: auto;
}

.scrollbar::-webkit-scrollbar,
.scrollbarX::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body::-webkit-scrollbar:horizontal {
    display: none;
}

.scrollbar::-webkit-scrollbar-thumb,
.scrollbarX::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 5px;
}

.scrollbar::-webkit-scrollbar-track,
.scrollbarX::-webkit-scrollbar-track {
    background-color: var(--scrollbar-bg-color);
}

body {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;

    /* Custom colors that are used for themes */
    --text-color: white;
    --darkorchid-text-color: darkorchid;
    --orchid-text-color: orchid;
    --violet-text-color: violet;
    --darkcyan-text-color: darkcyan;
    --red-text-color: red;
    --maroon-text-color: maroon;
    --orangered-text-color: orangered;
    --crimson-text-color: crimson;
    --gray-text-color: gray;
    --green-text-color: green;
    --lime-text-color: lime;
    --lightseagreen-text-color: lightseagreen;
    --amber-text-color: #ffbf00;
    --lightgoldenrodyellow-text-color: lightgoldenrodyellow;
    --header-color: var(--bg-color);
    --mobile-subtab-height: 0px;
    --mobile-subtab-top: 0px;
    --bg-color: #111;
    --alert-color: #141414;
    --history-lines: #262626;
    --boxmain-bordercolor: plum;
    --box-color: #111;
    --blueberry-box-color: #4f86f7;
    --blueberry-text-color: #88F;
    --purple-box-color: purple;
    --purple-text-color: #FF29FF;
    --button-color: #171717;
    --blackbtn-color: black;
    --purplebtn-color: purple;
    --purplehover-color: #b300b2;
    --hover-color: #333;
    --buttonbuy-color: #171717;
    --buildings-canbuy-color: #555;
    --buildings-hover-color: #666;
    --blessings-canbuy-color: #222;
    --blessings-hover-color: #444;
    --darkgold-color: #b59410;
    --tab-color: #171717;
    --singtab-color: black;
    --buttonimg-color: black;
    --hoversing-color: #252525;
    --shoptab-color: purple;
    --hovershop-color: #b300b2;
    --hepteract-bar-empty: #555;
    --hepteract-bar-red: red;
    --hepteract-bar-yellow: #cca300;
    --hepteract-bar-green: green;
    --scrollbar-color: #444;
    --scrollbar-bg-color: #111;
    --transition: 0;
    --transition-extra: 0.15s;
}

body.loading {
    overflow: hidden;
}

.bodycolor {
    color: var(--text-color);
    background-color: var(--bg-color);
}

.textOutline:not(button):not(#importFileButton) {
    text-shadow: -1px 0 #67647a, 0 1px #67647a, 1px 0 #67647a, 0 -1px #67647a;
}

.mainText { color: var(--text-color); }
.greenText { color: var(--green-text-color); }
.limeText { color: var(--lime-text-color); }
.lightseagreenText { color: var(--lightseagreen-text-color); }
.crimsonText { color: var(--crimson-text-color); }
.redText { color: var(--red-text-color); }
.grayText { color: var(--gray-text-color); }
.orangeredText { color: var(--orangered-text-color); }
.orchidText { color: var(--orchid-text-color); }
.darkorchidText { color: var(--darkorchid-text-color); }
.darkcyanText { color: var(--darkcyan-text-color); }
.amberText { color: var(--amber-text-color); }
.lightyellowText { color: var(--lightgoldenrodyellow-text-color); }

html[data-legacyicons="false"] {
    --wowcube-color: #fd0;
    --tesseract-color: orange;
    --hypercube-color: #ff004c;
    --platonic-color: orchid;
    --hepteract-color: mediumpurple;
}

html[data-legacyicons="true"] {
    --wowcube-color: #fff200;
    --tesseract-color: #a349a4;
    --hypercube-color: #ed1c24;
    --platonic-color: lightgoldenrodyellow;
    --hepteract-color: #ffc1d6;
}

.wowcubeText { color: var(--wowcube-color); }
.wowtesseractText { color: var(--tesseract-color); }
.wowhypercubeText { color: var(--hypercube-color); }
.wowplatonicText { color: var(--platonic-color); }
.wowhepteractText { color: var(--hepteract-color); }

.active-subtab {
    background-color: crimson;
}

#toggleSingularitySubTab6 {
    color: var(--purple-text-color);
}

#toggleSingularitySubTab6.active-subtab {
    color: #fff0ff;
}

#corrCampaignsBtn.active-subtab,
#corrStatsBtn.active-subtab,
#corrLoadoutsBtn.active-subtab {
    background-color: dodgerblue;
}

.boxColor {
    border: 3px solid;
    border-color: var(--boxmain-bordercolor);
    background-color: var(--box-color);
}

.blueberryBoxColor {
    border: 3px solid;
    border-color: var(--blueberry-box-color);
    background-color: var(--box-color);
}

.purpleBoxColor {
    border: 3px solid;
    border-color: var(--purple-box-color);
    background-color: var(--box-color);
}

a {
    color: white;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: white;
}

label {
    display: block;
}

input,
button,
select,
textarea {
    font-family: inherit;
    font-size: 0.75em;
    padding: 0;
    margin: 0;
    border: 0 solid #ccc;
}

input:disabled {
    color: gray;
}

input {
    min-height: 20px;
    color: white;
    padding: 0 0 0 0.2em;
    background-color: var(--blackbtn-color);
}

input[type="checkbox"] {
    min-height: auto;
}

button {
    min-height: 30px;
    color: white;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
    cursor: pointer;
    background-color: var(--button-color);
}

body button:hover:not(:disabled):not(.disable-hover-color),
body button:active:not(:disabled):not(.disable-hover-color) {
    background-color: var(--hover-color);
}

body button.active-subtab,
body button.active-subtab:hover:not(:disabled):not(.disable-hover-color),
body button.active-subtab:active:not(:disabled):not(.disable-hover-color) {
    background-color: crimson;
}

.tab:not(.active-tab) {
    display: none !important;
}

.none {
    display: none !important;
}

.flex {
    display: flex;
}

.flex.row {
    flex-flow: row;
}

.flex.column {
    flex-flow: column;
}

.flex.center {
    justify-content: center;
}

.vAlign {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hCenter {
    margin-left: auto;
    margin-right: auto;
}

.hCenter.tight {
    margin-top: 0;
    margin-bottom: 0;
}

@keyframes slide-in {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(5%);
    }
}

@keyframes slide-out {
    from {
        transform: translateX(5%);
    }

    to {
        transform: translateX(-100%);
    }
}

#transparentBG {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: max(100vw, 100%);
    height: max(100vh, 100%);
    background-color: rgb(0 0 0 / 50%);
    z-index: 6968;
}

#notificationStack {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: env(safe-area-inset-left);
    right: env(safe-area-inset-right);
    z-index: 6969;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.notification-wrap {
    margin-bottom: 10px;
    overflow: visible;
    transition: max-height 1000ms ease, margin-bottom 1000ms ease;
}

.notification-item {
    position: relative;
    transform: translateX(-100%);
    pointer-events: auto;
    width: 15vw;
    min-width: calc(140px + 10em);
    min-height: calc(40px + 5em);
    overflow: hidden;
    border: 1px solid gold;
    border-radius: 5px;
    font-size: min(1em, 24px);
    color: white;
    background-color: var(--alert-color);
}

#modal {
    position: fixed;
    display: none;
    z-index: 6969;
    width: 33%;
    overflow: hidden;
    border: 2px solid gold;
    border-radius: 5px;
    font-size: min(1em, 24px);
    color: white;
    background-color: var(--alert-color);
}

#modalContent {
    width: 100%;
    padding: 15px;
    justify-content: center;
    align-items: center;
}

#modal.modalBottomSheet {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: rgb(0 0 0 / 45%);
    backdrop-filter: blur(4px);
}

#modal.modalBottomSheet #modalContent {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 72vh;
    padding: 18px 15px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-top: 2px solid;
    border-color: inherit;
    border-radius: 12px 12px 0 0;
    background-color: var(--alert-color);
    box-shadow: 0 -12px 35px rgb(0 0 0 / 60%);
}

#mobileHotkeysOpen,
#mobileHotkeysOverlay,
#mobileHotkeysRestore {
    display: none;
}

html[data-mobile="true"] #mobileHotkeysOpen:not([hidden]) {
    position: fixed;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 6967;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    border: 2px solid gold;
    border-radius: 8px;
    color: gold;
    font-size: 1.65rem;
    line-height: 1;
    background-color: var(--alert-color);
    box-shadow: 0 4px 16px rgb(0 0 0 / 60%);
}

#mobileHotkeysOpen,
#mobileHotkeysMove,
#mobileHotkeysRestore {
    touch-action: none;
    user-select: none;
    cursor: grab;
}

#mobileHotkeysOverlay {
    position: fixed;
    inset: 0;
    z-index: 6967;
    padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    overflow: hidden;
    pointer-events: none;
}

html[data-mobile="true"] #mobileHotkeysOverlay:not([data-state="closed"]) {
    display: block;
}

#mobileHotkeysCard {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(300px, var(--mobile-hotkeys-available-width, calc(100vw - 24px)));
    max-height: min(60vh, 440px, var(--mobile-hotkeys-available-height, 100vh));
    padding: 10px;
    overflow: hidden;
    color: white;
    background-color: var(--alert-color);
    border: 2px solid gold;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgb(0 0 0 / 60%);
    pointer-events: auto;
}

#mobileHotkeysOpen,
#mobileHotkeysCard,
#mobileHotkeysRestore {
    transition: transform 180ms ease-out;
}

#mobileHotkeysOpen.mobileHotkeysDragging,
#mobileHotkeysCard.mobileHotkeysDragging,
#mobileHotkeysRestore.mobileHotkeysDragging {
    transition: none;
    cursor: grabbing;
}

#mobileHotkeysCard.mobileHotkeysDragging #mobileHotkeysMove {
    cursor: grabbing;
}

#mobileHotkeysOverlay[data-state="docked"] #mobileHotkeysCard {
    pointer-events: none;
}

#mobileHotkeysRestore {
    position: absolute;
    top: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 72px;
    padding: 0;
    border: 2px solid gold;
    border-radius: 12px 0 0 12px;
    color: gold;
    background-color: var(--alert-color);
    box-shadow: 0 4px 16px rgb(0 0 0 / 60%);
    font-size: 2rem;
    pointer-events: auto;
}

#mobileHotkeysOverlay[data-state="docked"] #mobileHotkeysRestore {
    display: flex;
}

#mobileHotkeysOverlay[data-side="left"] #mobileHotkeysRestore {
    border-radius: 0 12px 12px 0;
}

.mobileHotkeysHeader {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.mobileHotkeysHeader h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1em;
}

#mobileHotkeysMove {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    border-radius: 5px;
    color: gold;
    background: transparent;
    font-size: 1.1em;
    line-height: 1.2;
    text-align: left;
}

.mobileHotkeysGrip {
    font-size: 1.5rem;
    opacity: 0.7;
}

#mobileHotkeysHint {
    flex-shrink: 0;
    margin: 0;
    color: lightgray;
    font-size: 0.75rem;
    line-height: 1.3;
}

#mobileHotkeysDock,
#mobileHotkeysClose {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid gold;
    border-radius: 5px;
    font-size: 1.4rem;
    line-height: 1;
}

#mobileHotkeysActions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#mobileHotkeysOpen:focus-visible,
#mobileHotkeysCard button:focus-visible,
#mobileHotkeysRestore:focus-visible {
    outline: 2px solid cyan;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    #mobileHotkeysOpen,
    #mobileHotkeysCard,
    #mobileHotkeysRestore {
        transition: none;
    }
}

.mobileHotkeyAction {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 6px;
    border: 1px solid gold;
    border-radius: 5px;
    text-align: left;
}

.mobileHotkeyKey {
    flex: 0 0 auto;
    min-width: 48px;
    padding: 4px;
    overflow-wrap: anywhere;
    border: 1px solid #555;
    border-radius: 4px;
    color: gold;
    font-size: 0.8em;
    line-height: 1.1;
    text-align: center;
}

.mobileHotkeyLabel {
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    line-height: 1.15;
}

.mobileHotkeyAction:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.slide-in {
    animation: slide-in 1000ms;
    animation-fill-mode: forwards;
}

.slide-out {
    animation: slide-out 1000ms;
    animation-fill-mode: forwards;
}

.iconAndNameContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

.notification-item > p {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 2;
    text-align: center;
    white-space: pre-line;
}

.notification-item > .notifx {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 3px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    font-family: inherit;
    font-size: 0;
    line-height: 0;
    z-index: 1;
    color: white;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
    cursor: pointer;
    background-color: var(--button-color);
    appearance: none;
}

.notification-item > .notifx:hover {
    background-color: var(--hover-color);
}

.notification-item > .notifx:focus-visible {
    outline: 2px solid gold;
    outline-offset: 2px;
    border-color: gold;
}

.notification-item > .notifx:active {
    background-color: var(--hover-color);
    transform: translateY(1px);
}

.notification-item > .notifx > img {
    pointer-events: none;
}

#confirmationBox,
#captchaHolder {
    display: none;
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
    z-index: 10000000;
    width: 30vw;
    height: 30vh;
    min-width: min(min(30em, 800px), 100vw);
    min-height: min(min(20em, 600px), 100vh);
    max-width: 100vw;
    max-height: 100vh;
    color: white;
    background-color: var(--alert-color);
    border: 1px solid gold;
    border-radius: 5px;
    font-size: min(1em, 24px);
    padding: 15px;
}

#confirmWrapper,
#alertWrapper,
#promptWrapper {
    height: 100%;
    display: none;
}

#confirm > p,
#alert > p,
#prompt > label {
    grid-area: txt;
    text-align: center;
    white-space: pre-line;
    margin: 0;
}

/* Elements relating to the browser popup functions (Alert, Confirm, etc) */

#ok_confirm,
#ok_alert,
#ok_prompt {
    grid-area: btn;
}

#cancel_confirm,
#cancel_prompt {
    grid-area: btn2;
}

#prompt_text {
    background-color: #171717;
    border: 1px solid gold;
    border-radius: 5px;
    font-size: 1em;
    grid-area: lbl;
    margin: 0 -20%;
    padding: 0 2px;
}

#confirm > button,
#alert > button,
#prompt > button {
    border: 1px solid gold;
}

#confirm {
    height: 100%;
    display: grid;
    grid-template-columns: auto 6em 1em 6em auto;
    grid-template-rows: auto 2em 0.5em;
    grid-template-areas:
        "txt txt txt txt txt"
        ". btn . btn2 ."
        ". . . . .";
}

#alert {
    height: 100%;
    display: grid;
    grid-template-columns: auto 8em auto;
    grid-template-rows: auto 2em 0.5em;
    grid-template-areas:
        "txt txt txt"
        ". btn ."
        ". . .";
}

#prompt {
    height: 100%;
    display: grid;
    grid-template-columns: auto 6em 2em 6em auto;
    grid-template-rows: auto 0.5em 2em 1em 2em 0.5em;
    grid-template-areas:
        "txt txt txt txt txt"
        ". . . . ."
        ". lbl lbl lbl ."
        ". . . . ."
        ". btn . btn2 ."
        ". . . . .";
}

/* Announcements. The overlay and every card are built by Announcement() in UpdateHTML.ts. */

#announcementOverlay {
    display: none;
    position: fixed;
    inset: 0;

    /* Below the offline progress screen, so a load-time announcement waits behind it */
    z-index: 6967;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Falls back to the top rather than clipping when enough announcements stack up to overflow */
    justify-content: safe center;
    gap: 15px;
    padding: 15px;
    overflow-y: auto;
    background-color: rgb(0 0 0 / 50%);
}

.announcement {
    flex: none;
    display: grid;

    /* The two fr columns stay equal, so the header sits dead centre even though only the right one
       holds the close button */
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        ". header close"
        "title title title"
        "content content content";
    gap: 10px;
    width: 30vw;
    min-width: min(min(30em, 800px), 100%);
    max-width: 100%;
    padding: 15px;
    color: white;
    background-color: var(--alert-color);
    border: 1px solid gold;
    border-radius: 5px;
    font-size: min(1em, 24px);
}

.announcement-header {
    grid-area: header;
    margin: 0;
    text-align: center;
    color: #ff6b6b;
}

.announcement-title {
    grid-area: title;
    margin: 0;
    text-align: center;
    font-weight: bold;
}

.announcement-content {
    grid-area: content;
    max-height: 50vh;
    overflow-y: auto;
    text-align: center;
    white-space: pre-line;
}

.announcement-content a {
    color: cyan;
    text-decoration: underline;

    /* Bare URLs are unbreakable words and would otherwise widen the card */
    overflow-wrap: anywhere;
}

.announcement-close {
    grid-area: close;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    font-family: inherit;
    font-size: 0;
    line-height: 0;
    color: white;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
    cursor: pointer;
    background-color: var(--button-color);
    appearance: none;
}

.announcement-close:hover,
.announcement-close:active {
    background-color: var(--hover-color);
}

.announcement-close:focus-visible {
    outline: 2px solid gold;
    outline-offset: 2px;
    border-color: gold;
}

.announcement-close > img {
    pointer-events: none;
}

.confirmBox {
    display: flex;
    align-items: center;
}

.mediumHorizontalLine {
    width: 50%;
    margin: 0;
    padding: 0;
}

.titleTextFont {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
}

#preloadRecovery {
    position: fixed;
    bottom: calc(1em + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    color: white;
    text-align: center;
}

#preloadRecovery > button {
    font-size: 1.25em;
    padding: 0.5em 1.5em;
}

#preloadExportSave {
    border: 2px solid gold;
    color: gold;
}

#preloadImportSave {
    border: 2px solid limegreen;
    color: lightgreen;
}

#preloadDeleteGame {
    border: 2px solid red;
    color: pink;
}

#preloadPlayOffline {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-size: 2em;
    padding: 0.5em 1.5em;
    border: 2px solid limegreen;
    color: lightgreen;
}

#offlineBlur {
    background-color: #111;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 6969;
    width: max(100vw, 100%);
    height: max(100vh, 100%);
}

#offlineBlur img {
    width: 100%;
    height: 100%;
    filter: blur(4px);
}

#offlineContainer,
#fastForwardContainer {
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    left: 50vw;
    z-index: 6969;
    transform: translate(-50%, 0%);
    background-color: var(--alert-color);
    border-radius: 5px;
    border: 2px solid gold;
    padding: 15px;
    margin-top: max(0px, calc(10vh - 15px));
    max-height: 90vh;
    overflow: hidden;
    font-size: min(1em, 20px);
}

.offlineStats,
.cartList {
    display: flex;
    flex-direction: column;
    z-index: 3;
}

.offlineStat {
    display: flex;
    flex-direction: row;
    align-items: center;
    z-index: 3;
    margin-bottom: 2px;
}

.fastForwardStat {
    display: none;
    flex-direction: row;
    align-items: center;
    z-index: 3;
    margin-bottom: 2px;
}

.offlineStatElement,
.cartListElement {
    margin-left: 10px;
}

.offlineText {
    display: flex;
    z-index: 5;
}

#offlineTimer,
#progressbardescription {
    display: flex;
    z-index: 5;
    margin: 5px 0;
}

#exitOffline,
#exitFastForward,
#checkout,
#checkout-xsolla {
    width: 18em;
    min-height: auto;
    min-width: 220px;
    padding: 6px 0;
    z-index: 3;
    margin-top: 20px;
    border: 2px solid ivory;
    background-color: var(--purplebtn-color);
    color: white;
}

#exitOffline:hover,
#checkout:not(:disabled):hover {
    background-color: var(--purplehover-color);
}

#checkout-buttons > #checkout-xsolla:not(:disabled):hover {
    background-color: var(--blessings-hover-color);
}

.resetInformationContainer {
    display: flex;
    flex-direction: column;
    line-height: 1.2em;
    width: 45%;
    flex-basis: 45%;
}

.resetsContainer {
    display: flex;
    flex-direction: column;
    line-height: 1em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.resetbtn {
    cursor: pointer;
    margin-right: 5px;
    background-color: var(--button-color);
}

.resetsButtons {
    display: flex;
    align-items: start;
}

.challengeProgress {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, 1.2em);
    justify-items: start;
    margin-top: 0.25em;
    line-height: 1.2em;
}

#transcensionChallengeProgress { color: var(--orchid-text-color); }
#reincarnationChallengeProgress { color: limegreen; }
#ascensionChallengeProgress { color: orange; }

html[data-mobile="true"] .challengeProgress {
    display: none;
}

#mainHeader {
    flex-shrink: 0;
}

main {
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior-y: contain;
    padding: 0.25rem;
}

#tabrow {
    text-align: center;
    width: 100%;
    list-style: none;
    margin: 0;
    margin-inline: unset;
    margin-block: unset;
    padding-inline: unset;
    display: flex;
    justify-content: center;
    gap: 0 5px;
}

.navbar {
    display: flex;
    justify-content: center;
    width: 100%;
}

nav button {
    display: block;
    border: 1px solid;
    min-width: 100px;
    min-height: 21px;
    line-height: 1em;
    font-size: min(1em, 20px);
    padding: 1px;
    color: white;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: none;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

#tabrow.tab-edit-mode > button:not(#tabEditDone) {
    position: relative;
    overflow: visible;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

/* Motion-independent cue that the tab row is in edit mode */
#tabrow.tab-edit-mode {
    outline: 2px dashed gold;
    outline-offset: 2px;
}

#tabEditDone {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 120px;
    margin: 4px 0;
    padding: 6px 12px;
    border: 1px solid gold;
    border-radius: 5px;
    background-color: var(--purplebtn-color);
    color: white;
}

#tabEditDone:hover {
    background-color: var(--purplehover-color);
}

#tabrow.tab-edit-mode > button:nth-child(even) {
    animation-direction: alternate-reverse;
}

#tabrow.tab-edit-mode > button.tab-being-dragged {
    cursor: grabbing;
    opacity: 0.75;
    z-index: 2;
}

#tabrow.tab-edit-mode > button.tab-hidden-in-edit-mode {
    opacity: 0.55;
}

.tabCloseButton {
    display: none;
}

#tabrow.tab-edit-mode > button.tabRemoveable > .tabCloseButton {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid white;
    border-radius: 50%;
    background-color: #c30000;
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 1px 4px #000b;
    pointer-events: auto;
}

#tabrow.tab-edit-mode > button.tabRemoveable:hover > .tabCloseButton,
#tabrow.tab-edit-mode > button.tabRemoveable:focus-visible > .tabCloseButton {
    background-color: #e00000;
}

#tabrow.tab-edit-mode > button.tabRemoveable > .tabCloseButton.tabCloseButtonToggled {
    background-color: #147a32;
}

#tabrow.tab-edit-mode > button.tabRemoveable:hover > .tabCloseButton.tabCloseButtonToggled,
#tabrow.tab-edit-mode > button.tabRemoveable:focus-visible > .tabCloseButton.tabCloseButtonToggled {
    background-color: #199a40;
}

@keyframes tab-jingle {
    from {
        transform: rotate(-1.2deg) translateY(-1px);
    }

    to {
        transform: rotate(1.2deg) translateY(1px);
    }
}

@keyframes tab-jingle-mobile {
    from {
        transform: rotate(-0.6deg) translateY(-0.5px);
    }

    to {
        transform: rotate(0.6deg) translateY(0.5px);
    }
}

@media (prefers-reduced-motion: no-preference) {
    #tabrow.tab-edit-mode > button:not(#tabEditDone) {
        animation: tab-jingle 170ms ease-in-out infinite alternate;
    }
}

#buildingstab {
    border-color: orange;
}

#upgradestab {
    border-color: orange;
}

#settingstab {
    color: white;
    border-color: white;
}

#achievementstab {
    border-color: white;
}

#runestab {
    border-color: cyan;
}

#challengetab {
    border-color: plum;
}

#researchtab {
    border-color: green;
}

#shoptab {
    border-color: white;
    background-color: var(--shoptab-color);
}

#singularitytab {
    border-color: lightgoldenrodyellow;
    background-color: var(--singtab-color);
    color: red;
}

#singularitytab:hover {
    background-color: var(--hoversing-color);
}

#shoptab:hover {
    background-color: var(--hovershop-color);
}

button.isEvent:hover {
    background-color: gold;
}

#anttab {
    border-color: maroon;
}

#cubetab {
    border-color: var(--wowcube-color);
    color: var(--hypercube-color);
}

#traitstab {
    border-color: orange;
    color: red;
}

.subTabWrapper {
    --subtab-button-width: 150px;
    --subtab-button-height: 30px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, var(--subtab-button-width)));
    justify-content: center;
    gap: 10px 15px;
    width: 90%;
    margin: 0 auto;
    padding: 10px;
    overscroll-behavior: contain;
}

.subTabWrapper > * {
    min-width: 0;
    width: 100%;
}

.subTabWrapper > button,
.subTabWrapper > span > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    min-height: var(--subtab-button-height);
    padding: 0;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
}

.subTabWrapper > button > .subTabButtonTextContainer,
.subTabWrapper > span > button > .subTabButtonTextContainer {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

.subTabWrapper > button > .subTabButtonText,
.subTabWrapper > span > button > .subTabButtonText,
.subTabButtonTextContainer > .subTabButtonText {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

#cartSubTab5 > img {
    flex: 0 0 auto;
}

.mobileSubTabIcon {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 0 !important;
    cursor: pointer;
    background-color: var(--button-color);
    object-fit: fill;
}

.mobileSubTabIcon:hover,
.mobileSubTabIcon:active,
.mobileSubTabIcon:focus-visible {
    background-color: var(--hover-color);
}

.mobileSubTabIcon.active-subtab,
.mobileSubTabIcon.active-subtab:hover,
.mobileSubTabIcon.active-subtab:active,
.mobileSubTabIcon.active-subtab:focus-visible {
    background-color: crimson;
}

.mobileSubTabIconContainer {
    position: relative;
    display: block;
    width: 32px !important;
    height: 32px;
    cursor: pointer;
}

.mobileSubTabIconContainer > .mobileSubTabIcon {
    display: block;
}

.mobileSubTabIconContainer:hover > .mobileSubTabIcon,
.mobileSubTabIconContainer:active > .mobileSubTabIcon,
.mobileSubTabIconContainer:focus-visible > .mobileSubTabIcon {
    background-color: var(--hover-color);
}

.mobileSubTabIconContainer.active-subtab > .mobileSubTabIcon,
.mobileSubTabIconContainer.active-subtab:hover > .mobileSubTabIcon,
.mobileSubTabIconContainer.active-subtab:active > .mobileSubTabIcon,
.mobileSubTabIconContainer.active-subtab:focus-visible > .mobileSubTabIcon {
    background-color: crimson;
}

#coinBuildings {
    display: flex;
    position: relative;
    padding: 0;
    flex-direction: column;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

#coinBuildings p {
    margin: 0;
}

p#buildinghotkeys,
p#buildinghotkeys2 {
    margin-top: 15px;
    color: lightgray;
    text-align: center;
}

p#buildinghotkeys2 {
    margin-top: 0;
}

#buildingtext {
    padding: 0;
    text-align: center;
    width: 1000px;
}

#upgrades {
    position: relative;
    text-align: center;
    padding: 0;
    color: gold;
    margin: 0 auto;
    max-width: 1500px;
}

.upgradeReferenceHeaderIcon {
    border: 2px solid var(--upgrade-reference-color) !important;
}

#upgradesFlex {
    display: flex;
    width: 90%;
    margin: 2% 5% 6%;
    justify-content: space-around;
}

#upgradesFlex > section {
    flex-direction: column;
    align-items: center;
}

#upgradesFlex > section > p {
    margin: 5px 0;
    line-height: 1em;
}

#upgradesFlex > section > table {
    font-size: 0;
    text-align: center;
    border-collapse: collapse;
    margin: 3px;
}

#upgradesFlex > section > table td {
    padding-left: 3px;
}

#upgradesFlex > section > table img {
    cursor: pointer;
}

#upgradesFlex > section > button {
    min-width: 80px;
}

.upgradeSectionTop {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    white-space: pre-line;
    margin: 0.25rem 0;
}

/* Upgrade box */
.mobileUpgradeSection,
.mobileUpgradeTabContainer,
.mobileUpgradeBox {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.mobileUpgradeTabContainer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.mobileUpgradeBox {
    display: flex;
    flex-direction: column;
    border: 2px solid white;
    gap: 1%;
    overflow: hidden;
}

.mobileUpgradeBox > p {
    margin: 0;
    padding: 5px;
}

.mobileUpgradeIconAndCost {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 1%;
}

.mobileUpgradeIconAndCost img {
    flex-shrink: 0;
}

.mobileUpgradeIconAndCost button {
    flex: 1;
    min-width: 0;
    border: 2px solid white;
    margin-left: 1%;
}

#shoptogglecoin { grid-column-start: 1; }
#shoptoggleprestige { grid-column-start: 2; }
#shoptoggletranscend { grid-column-start: 3; }
#shoptogglegenerator { grid-column-start: 4; }
#particleAutoUpgrade { grid-column-start: 6; }

#upgradesAppendix {
    text-align: center;
    margin-top: 8px;
}

#upgradesAppendix > p {
    padding-top: 0;
    margin: 0;
}

#upgradeeffect { color: pink; }

#settings {
    position: relative;
    padding: 0;
    text-align: center;
}

/* Settings settings sub tab */

#settingsubtab {
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.settingSubTabUpper {
    display: flex;
    justify-content: center;
    width: 75%;
}

#confirmationToggleBox,
#exportButtons,
#thirdParty {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33%;
    padding: 5px;
}

.confirmationToggles {
    display: flex;
    justify-content: center;
    flex-flow: wrap;
    gap: 1em;
}

#confirmationToggleBox > p {
    margin: 5px 0;
}

p#specialActionsTitle,
p#appearanceSettingsTitle {
    margin-top: 15px;
}

.appearanceSettings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.appearanceSetting {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--boxmain-bordercolor);
    background-color: var(--box-color);
}

.appearanceSettingWide {
    grid-column: 1 / -1;
}

.appearanceSetting > p {
    margin: 0;
    color: pink;
}

.appearanceSetting > .promocodeButton {
    width: 100%;
    min-width: 0;
    margin: auto 0 0;
}

#exportButtons > * { margin: 2px auto; }

#saveStringInput {
    width: 100%;
    padding: 1px;
    border: 1px solid white;
}

#importFileButton {
    font-size: 0.75em;
    padding: 0.05em;
    border: 2px solid white;
    color: white;
    cursor: pointer;
    background-color: var(--button-color);
}

#savegame,
#deleteGame,
#importFileButton,
#saveStringInput,
#exportButtons > label {
    width: 12em;
    min-width: 180px;
    min-height: 20px;
    margin: 2px auto;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

#importFileButton:hover {
    background-color: var(--hover-color);
}

#savegame[disabled] {
    background-color: crimson;
}

#exportgame {
    width: 12em;
    min-width: 150px;
    min-height: 40px;
    margin: 5px auto;
}

#thirdParty {
    gap: 1em;
}

#thirdParty p {
    margin: 0 auto;
}

/* Third party URLs (Discord or patch notes) */
#thirdParty > div {
    flex-wrap: wrap;
    display: flex;
    flex-direction: column;
    image-rendering: auto;
}

#thirdParty > div > a {
    /* For whatever reason this fixes the click area for the external links */
    margin: 0 auto;
    font-size: 0;
}

/* Confirmation toggle box */
.confirmationToggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
    gap: 5px;
}

.promocodeButton {
    min-width: 65%;
    margin-bottom: 3px;
}

div.addCodeBox {
    display: flex;
}

#addCode {
    flex-grow: 3;
    border: 2px solid green;
}

#addCodeAll {
    flex-grow: 1;
    border: 2px solid green;
    border-left: none;
    border-right: none;
}

#addCodeOne {
    flex-grow: 1;
    border: 2px solid green;
}

p#promocodeinfo {
    width: 100%;
}

#themeArea {
    position: relative;
}

#themeArea > button { width: 100%; }
#themeArea:focus-within > div { display: inline-grid; }

#themeArea > div {
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 50%;
    display: none;
    grid-template-columns: repeat(2, 150px);
    border: 3px solid var(--boxmain-bordercolor);
    background-color: var(--box-color);
    padding: 2px;
    transform: translateX(-50%);
}

#themeArea > div button {
    padding: 5px;
    margin: 1px;
}

#checkMobileUpdates {
    border: 2px solid var(--amber-text-color)
}

.center {
    margin: auto;
}

.settingpic {
    flex-grow: unset;
}

.auto.square {
    min-width: 32px;
    min-height: 32px;
    padding: 0;
}

.auto.square:hover {
    background-color: var(--hover-color);
}

.buttonRow {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
    z-index: 1;
    font-size: min(1em, 20px);
}

#coinInformation {
    text-align: center;
    margin: 10px;
    padding: 10px;
    font-size: 1.2em;
}

#coinVanity {
    max-width: 100%;
    word-break: break-all;
    text-align: center;
    margin: 0;
    padding: 0;
}

.buttonRow > div {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    min-height: 35px;
}

.buttonRow > div:not(.buildingAutomationControls) {
    margin-left: 7.5%;
}

.buttonRow > .buildingAutomationControls {
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.buildingAutomationToggle,
.automatedBuildingVisibilityToggle {
    min-width: 14em;
    background-color: var(--button-color);
}

.buttonRow > .buildingHiddenByAutomation {
    display: none !important;
}

.buildingSpacer {
    height: 35px;
}

.buttonRow > div > p {
    margin-top: 0.25em;
}

.buttonRow > div > .image {
    height: 32px;
    width: 32px;
}

.buttonRow > div > .desc {
    width: 22em;
    min-width: 22em;
}

.buildingPurchaseBtn {
    width: 15em;
    min-width: 15em;
    border-radius: 8px;
    border: 1px solid white;
    background-color: var(--buttonbuy-color);
    cursor: default;
}

.buildingPurchaseBtn:hover {
    background-color: var(--buttonbuy-color);
}

.buildingPurchaseBtn.buildingPurchaseBtnAvailable {
    cursor: pointer;
    background-color: var(--buildings-canbuy-color);
}

.buildingPurchaseBtn.buildingPurchaseBtnAvailable:hover {
    background-color: var(--buildings-hover-color);
}

.buttonRow > div > .auto {
    width: 6em;
    min-width: 80px;
}

#upgradeTopBtns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 15px 0 10px;
    gap: 10px 15px;
}

#upgradeTopBtns > button {
    min-width: 130px;
    text-align: center;
}

#togglePurchasedUpgrades {
    flex-shrink: 0;
    width: 15em;
}

.upgradeHiddenByPurchase {
    display: none !important;
}

.upgradeCategoryBtnRow {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.25rem 0;
}

.autobuyerToggleButton,
.buyAllUpgradeButton {
    background-color: var(--button-color);
    margin: 0 0.25em;
    min-width: 70px;
}

.buttonRow > div > .stats {
    width: 25em;
    min-width: 25em;
    line-height: 1em;
    overflow-wrap: anywhere;
}

#buildtext12,
#buildtext14,
#buildtext16 {
    min-height: 2em;
}

.buttonRow.mobile {
    width: 100%;
    gap: 6px;
    font-size: 1em;
}

.buttonRow.mobile > div:not(.buildingSpacer):not(.buildingAutomationControls) {
    gap: 6px;
    padding: 8px 0;
    border: 2px solid white;
    border-radius: 6px;
    padding-right: 6px;
}

.buttonRow.mobile > div > .buildingPurchaseBtn:not(.buildingPurchaseBtnAvailable) {
    filter: grayscale(1);
    opacity: 0.55;

    &:hover,
    &:focus,
    &:active {
        background-color: var(--buttonbuy-color) !important;
    }
}

.buttonRow.mobile > div > .image {
    height: 32px;
    width: 32px;
}

.buttonRow.mobile > div > .textStack {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;

    > .desc,
    > .cost,
    > .stats {
        width: auto;
        min-width: 0;
        font-size: 1em;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.buttonRow.mobile > div > .buildingPurchaseBtn {
    width: auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.9em;
    flex-shrink: 0;
}

.buttonRow.mobile > div > .auto {
    flex: 0 0 5em;
    width: 5em;
    height: 5em;
    min-width: 0;
    margin: 0;
    padding: 6px;
    border-radius: 6px;
    background-color: #0a2a0a;
    color: lightblue;
    font-size: 0.8em;
    line-height: 1.1;
    white-space: normal;
    text-align: center;
}

#taxinfo {
    text-align: center;
    font-size: 1em;
    margin-top: 30px;
}

.tightText {
    margin: 0 auto;
    text-align: center;
}

#statistics {
    position: relative;
    text-align: center;
    padding: 0;
    color: whitesmoke;
}

#achievements {
    display: flex;
    justify-content: center;
}

#tieredAchievementsTable {
    display: grid;
    grid-template-columns: repeat(8, 48px);
    grid-template-rows: repeat(5, 48px);
    gap: 2px;
}

#tieredAchievementsTable > div {
    width: 48px;
    height: 48px;
}

#ungroupedAchievementsTable {
    display: grid;
    grid-template-columns: repeat(12, 32px);
    grid-template-rows: repeat(5, 32px);
    gap: 2px;
}

#ungroupedAchievementsTable > div {
    width: 32px;
    height: 32px;
}

#progressiveAchievementsTable {
    display: grid;
    grid-template-columns: repeat(8, 48px);
    grid-template-rows: repeat(5, 48px);
    gap: 2px;
}

#progressiveAchievementsTable > div {
    width: 48px;
    height: 48px;
}

#achievementMultiline {
    white-space: pre-line;
}

#achievementstable {
    font-size: 0;
    border-collapse: collapse;
}

#achievementstable [id^="ach"] > img {
    image-rendering: unset;
}

#achievementHeader {
    display: flex;
    justify-self: center;
    align-items: center;
    flex-direction: column;
    margin: 10px;
}

#achievementHeader > p {
    margin: 4px 0;
    font-size: 1.2em;
}

#achievementTNLText {
    margin: 0;
}

.NotificationToggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.NotificationToggle > p {
    margin: 2px 0;
}

.achNotification {
    flex-grow: unset;
}

.nonSquare {
    min-width: 39px;
    min-height: 20px;
}

#achievementinfo > p,
#achievementColorInfo > p {
    margin: 0;
}

#achievementinfo {
    margin-top: 5px;
}

#achievementColorInfo {
    margin-top: 10px;
}

.tieredAchievementType > img,
.progressiveAchievementType > img,
.synergismLevelRewardType > img {
    width: 48px;
    height: 48px;
}

.ungroupedAchievementType > img,
.synergismLevelMilestoneType > img {
    width: 32px;
    height: 32px;
}

.synergismLevelPreview {
    filter: grayscale(1) brightness(0.35) blur(1px);
    opacity: 0.75;
}

.tieredAchievementType img.dimmed,
.ungroupedAchievementType img.dimmed,
.progressiveAchievementType img.dimmed {
    opacity: 0.3;
}

.achievement-ap-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
    text-shadow: 2px 2px 4px #000;
    z-index: 999;
    color: white;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.8;
}

.achievement-fraction-numerator {
    border-bottom: 1px solid white;
    padding-bottom: 1px;
    min-width: 1em;
    text-align: center;
}

.achievement-fraction-denominator {
    padding-top: 1px;
    min-width: 1em;
    text-align: center;
}

.tieredAchievementType,
.ungroupedAchievementType,
.progressiveAchievementType {
    position: relative;
    display: inline-block;
}

.relative-container {
    position: relative;
    display: inline-block;
}

.achievement-ap-overlay.gold-text {
    color: gold;
}

#showAchievementProgress {
    width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    border: 2px solid orange;
}

.achievementSearchIcon {
    width: 20px;
    height: 20px;
    stroke: currentcolor;
    fill: none;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.achievementDetailsModal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.achievementDetailsModalTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: gold;
    font-size: 1.1em;
    flex-wrap: wrap;
}

.achievementDetailsModalTitle img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.achievementDetailsModalInfo {
    line-height: 1.35;
}

#achievementContainer1,
#achievementContainer2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#synergismLevelBonuses {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#synergismLevelBonuses > p {
    text-align: center;
}

#synergismLevelRewardsTable {
    display: grid;
    grid-template-columns: repeat(12, 48px);
    grid-template-rows: repeat(1, 48px);
    gap: 2px;
    align-items: center;
    justify-content: center;
}

#synergismLevelRewardsTable > div {
    width: 48px;
    height: 48px;
}

#synergismLevelMilestonesTable {
    display: grid;
    grid-template-columns: repeat(12, 32px);
    grid-template-rows: repeat(4, 32px);
    gap: 2px;
    align-items: center;
    justify-content: center;
}

#synergismLevelMilestonesTable > div {
    width: 32px;
    height: 32px;
}

#buyamountoffering {
    left: calc(50% + 350px);
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.talismansModify {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.talismansModify p {
    margin: 0;
}

.buyAmountBtn {
    background-color: var(--button-color);
    cursor: pointer;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

.buyAmountBtn:hover {
    background-color: var(--hover-color);
}

#prestige {
    position: relative;
    padding: 0;
    color: cyan;
    flex-direction: column;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

#crystalupgrades {
    width: 50em;
    max-width: 1000px;
    color: white;
    text-align: center;
}

#crystalupgradestable { margin: 0 auto; }

#crystalupgrades img {
    background-color: var(--buttonbuy-color);
}

#autocrystalbuild {
    margin-top: 40px;
}

#toggle15,
#prestigeautotoggle,
#prestigeamount {
    width: 12em;
    min-width: 150px;
    min-height: auto;
}

#prestigeamount {
    color: white;
    border: 1px solid cyan;
    background-color: var(--blackbtn-color);
}

#prestige p {
    margin: 0;
}

#autoprestige {
    color: white;
}

p#prestigehotkeys {
    margin-top: 15px;
    width: 1000px;
    text-align: center;
}

#runes {
    position: relative;
    padding: 0;
}

#runesHeader {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-bottom: 10px;
}

#runeContainer1,
#runeContainer3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.runeDivinitySection {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.runeDivinitySection > h2 {
    margin-bottom: 0;
}

.heptNotification {
    height: 20px;
    width: 20px;
}

#offeringDetails,
#runeFooter {
    max-width: 1200px;
    display: flex;
    text-align: center;
    flex-direction: column;
}

#offeringDetails > p,
#runeFooter > p {
    margin: 0;
}

#runeDetails,
#runeBlessings,
#runeSpirits {
    display: flex;
    position: relative;
    justify-content: center;
    flex-wrap: wrap;
    width: 66%;
}

.runeType {
    display: flex;
    flex-direction: column;
    width: 180px;
    align-items: center;
    padding: 2px;
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.runeTypeMobile {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 2px;
}

.runeIconAndName,
.runeIconAndNameSmall {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.runeIconAndName img,
.runeIconAndNameSmall img {
    flex-shrink: 0;
}

.runeIconAndName p {
    margin: 0;
    font-size: 1.2em;
}

.runeIconAndNameSmall p {
    margin: 0;
    font-size: 1em;
}

.runeType:hover {
    box-shadow:
        0 0 15px var(--glow-color),
        0 0 30px var(--glow-color),
        0 0 45px var(--glow-color);
    background-color: var(--box-color);
}

.runeType > button,
.runeTypeMobile > button {
    min-width: 100px;
    text-align: center;
    border: 2px solid gold;
    cursor: default;
}

.runeTypeMobile > button {
    font-size: 1.5em;
}

.runeType > button:hover,
.runeTypeMobile > button:hover {
    background-color: var(--button-color);
}

.runeTypeElement {
    margin: 0;
    text-align: center;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
    padding-bottom: 1px;
}

.runeTypeElementMobile {
    margin: 0;
    text-align: left;
}

img.runeTypeElement {
    background-color: var(--button-color);
    cursor: pointer;
}

img.runeTypeElement:hover {
    background-color: var(--hover-color);
}

.runeType > .runeButtonAvailable,
.runeTypeMobile > .runeButtonAvailable {
    background-color: var(--purplebtn-color);
    cursor: pointer;
}

.runeType > .runeButtonAvailable:hover,
.runeTypeMobile > .runeButtonAvailable:hover {
    background-color: var(--purplehover-color);
}

.runeTypeLocked {
    opacity: 0.5;
}

.runeImageLocked {
    filter: grayscale(50%);
}

.antSacrificeRewardLocked {
    opacity: 0.5;
    border-color: gray !important;
}

.antSacrificeRewardImageLocked {
    filter: grayscale(80%);
}

#runeContainer2 {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(3, 1fr);
    column-gap: 0;
    row-gap: 0;
    position: relative;
}

.talismansCenter {
    grid-area: 1 / 2 / 4 / 8;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.talismanShardSection {
    grid-area: 1 / 1 / 4 / 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
    width: 100%;
}

.talismanToggles {
    grid-area: 1 / 8 / 4 / 9;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.talismanSettingsContainer {
    display: flex;
    flex-direction: column;
    width: 60%;
    align-items: center;
}

#rarityInfoTexts {
    display: none;
    width: 14.5em;
    align-items: center;
}

#rarityInfoMultiline > br {
    display: none;
}

#rarityInfoMultiline > span:not(:first-child) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 0.5em;
}

.rarityReqNum {
    text-align: right;
    white-space: nowrap;
}

#toggleautofortify {
    min-width: 125px;
    border: 2px solid red;
}

#talismanFragmentCost {
    width: 20em;
    text-align: center;
}

.talismanShardContainers {
    display: flex;
    flex-direction: column;
    width: 60%;
    align-items: center;
}

.talismanShardHeader {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.talismanShardHeader > button {
    width: 100px;
    margin: 2px;
}

.talismanShardContainer {
    display: flex;
    align-items: center;
    padding: 5px;
}

.talismanShardIcon {
    width: 32px;
}

.talismanShardAmount {
    width: 5em;
    min-width: 70px;
    margin-left: 4px;
    font-size: 1em;
}

.fragmentBtn {
    width: 5em;
    min-width: 80px;
    color: orange;
    cursor: default;
}

.fragmentBtn:hover {
    background-color: var(--button-color);
}

.talismanBtn {
    min-width: 100%;
}

.talisminBtnAvailable {
    background-color: var(--purplebtn-color);
    cursor: pointer;
}

.talisminBtnAvailable:hover {
    background-color: var(--purplehover-color);
}

.talismansContainer {
    display: flex;
    position: relative;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.talismanContainer {
    box-sizing: content-box;
    display: flex;
    flex-direction: column;
    width: 90px;
    align-items: center;
    white-space: nowrap;
    padding: 2px;
}

.talismanIcon,
.talismanContainer > .rainbowBorder {
    display: flex;
    width: 80%;
    height: auto;
    aspect-ratio: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.talismanIcon img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: none;
    background-color: var(--bg-color);
    border-radius: 3px;
}

.talismanLevel {
    margin-top: 1px;
    margin-bottom: 3px;
}

#talismanEffect,
#talismanLevelUpCost {
    margin-top: 10px;
    text-align: center;
}

#talismanlevelup {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#talismanlevelup table {
    font-size: 0;
}

#talismanlevelup table p {
    font-size: initial;
    width: 5em;
}

.mobileTalismanShardSection {
    border: 2px solid gold;
    width: 90%;
}

.mobileTalismanShardHead {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border: 2px solid orange;
}

.mobileTalismanShardHead > button {
    width: 100px;
    margin: 2px;
}

#buyTalismanLevelAmount {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
}

.mobileTalismanShardContainers {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    border: 2px solid orange;
}

.mobileTalismanShardContainer {
    display: flex;
    flex: 0 0 calc(100% / 3);
    flex-direction: column;
}

.mobileTalismanShardContainer p {
    margin: 0;
}

.mobileTalismanIconAndQuantity {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
    gap: 5px;
}

.mobileMainTalismans {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
}

#mobileMainTalismansBody {
    width: 100%;
}

.mobileTalismanContainer {
    display: flex;
    flex-direction: column;
    padding: 2px;
    width: 100%;
}

.mobileTalismanInfoSection p,
.mobileTalismanCostSection p {
    margin: 0;
}

.mobileTalismanRuneBonusesSection,
.mobileTalismanCostSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid silver;
    border-radius: 8px;
}

.mobileTalismanRuneBonusesContainer,
.mobileTalismanCostContainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.mobileTalismanRuneBonusesContainer > div,
.mobileTalismanCostContainer > div {
    flex: 0 0 25%;
    justify-content: center;
    padding: 1%;
}

.mobileTalismanBuyButtonsSection {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.mobileTalismanBuyButtonsSection > * {
    flex: 1;
    min-width: 0;
    text-align: center;
    margin: 2px;
}

#transcension {
    position: relative;
    padding: 0;
    flex-direction: column;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

#transcension p {
    margin: 0;
    text-align: center;
}

#transcension > .buttonRow {
    color: plum;
}

#transcendshardbonus {
    margin-top: 2px;
}

#autotranscend {
    text-align: center;
}

#toggle21,
#transcendautotoggle,
#transcendamount {
    width: 12em;
    min-width: 150px;
    min-height: auto;
}

#transcendamount {
    color: white;
    border: 1px solid plum;
    background-color: var(--blackbtn-color);
}

p#transcendhotkeys {
    margin-top: 15px;
}

#transcendhotkeys {
    text-align: center;
}

#challenges {
    position: relative;
    padding: 0;
}

.singularityChallenges {
    display: flex;
    justify-content: center;
    column-gap: 4px;
}

#challengesWrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#challengeIntroduction {
    text-align: center;
    font-size: 1.2em;
    margin-top: 10px;
    margin-bottom: 10px;
}

#ExaltIntroduction {
    text-align: center;
    font-size: 1.2em;
    margin-top: 10px;
    margin-bottom: 10px;
}

#challengesAutoToggles {
    display: flex;
    justify-content: center;
    flex-flow: wrap;
    gap: 10px 15px;
    margin-bottom: 10px;
}

#challengesAutoToggles > button {
    min-width: 200px;
}

#toggleAutoChallengeStart { border: 2px solid gold; }

#startChallenge {
    border: 2px solid red;
    font-size: 1.1em;
    min-width: 300px;
    min-height: 75px;
    background-color: var(--blackbtn-color);
}

#startChallenge:hover {
    background-color: var(--hover-color);
}

#retryChallenge { border: 2px solid plum; }

/* Hide the last 3 buttons until the user clicks on a challenge */
#toggleAutoChallengeIgnore,
#startChallenge,
#retryChallenge { display: none; }

#challengeIcons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    align-self: center;
    color: white;
    text-align: center;
}

#challengeIcons img {
    width: 64px;
    height: 64px;
    cursor: pointer;
    vertical-align: top;
}

/* In webkit, the font-size px is fixed even if it is enlarged, but Firefox fluctuates */
.challengeLevels {
    min-width: 4.8em;
    max-width: 4.8em;
    margin: 4px auto 0;
    font-size: 12px;
    overflow: hidden;
}

#challengeDetails {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-self: center;
    margin-top: 10px;
}

#challengeTimers {
    margin-right: 20px;
    width: 300px;
}

#oneChallengeDetails {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 42em;
}

#oneChallengeDetails > p {
    margin: auto;
    height: auto;
}

#challengeName { color: white; }
#challengeFlavor { color: plum; }
#challengeRestrictions { color: var(--crimson-text-color); }
#challengeGoal { color: gold; }
#challengePerCompletionRewards { color: var(--text-color); }
*[id^="challengePer"] { color: pink; }
#challengeFirst1 { color: orange; }
#challengeQuarkBonus { color: cyan; }

#challengeTimersText {
    display: flex;
    flex-direction: column;
}

#challengeTimersText > p {
    margin: 0;
}

#challengeTimersText > input {
    border: 2px solid orchid;
    width: 10em;
    min-width: 180px;
    max-width: 100%;
    font-size: 1.1em;
}

#challengeWorthlessTexts {
    display: flex;
    flex-direction: column;
    text-align: center;
}

#challengeWorthlessTexts > p {
    margin: 0;
}

#challengehotkeys { color: var(--gray-text-color); }
#challengewarning { color: var(--crimson-text-color); }
#challengewarningreincarnation { color: limegreen; }

.challenge {
    background-color: var(--button-color);
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

.challenge:hover {
    background-color: var(--hover-color);
}

.challengeActive {
    background-color: plum;
}

.challengeActive:hover {
    background-color: #ebc7eb;
}

#reincarnation {
    position: relative;
    padding: 0;
    color: limegreen;
    flex-direction: column;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

#reincarnateautomation {
    margin-top: 80px;
}

#reincarnationTexts {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
}

#reincarnation p { margin: 0; }

#toggle27,
#reincarnationamount,
#reincarnateautotoggle {
    width: 12em;
    min-width: 150px;
    min-height: auto;
}

#reincarnationamount {
    color: white;
    border: 1px solid green;
    background-color: var(--blackbtn-color);
}

#reincarnateautomation > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#reincarnationinfo {
    color: lime;
}

p#reincarnatehotkeys {
    margin-top: 15px;
    text-align: center;
}

#research {
    position: relative;
    padding: 0;
}

.researchUnlocked {
    display: block;
}

.researchLocked {
    display: none;
}

.researchContainer {
    display: flex;
    justify-content: center;
}

#researchtable {
    border-collapse: collapse;
    font-size: 0;
}

#researchtable > tbody {
    margin-top: 15px;
}

.researchDetails {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    margin-top: 5px;
}

.researchDetails > p {
    width: 55em;
    max-width: 100%;
    margin: 0;
}

#researchToggles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 15px;
    margin: 15px 0;
}

#researchToggles > button {
    min-width: 175px;
}

#researchinfo2 {
    min-height: 3em;
}

.researchModal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

#researchtable button > img {
    background-color: var(--buttonimg-color);
}

#researchtable .researchAvailable > img {
    cursor: pointer;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

#researchtable .researchAvailable:hover > img {
    background-color: var(--hover-color);
}

#researchtable .researchPurchased > img {
    background-color: purple;
}

#researchtable .researchPurchasedAvailable > img {
    cursor: pointer;
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

#researchtable .researchPurchasedAvailable:hover > img {
    background-color: #b300b2;
}

#researchtable .researchRoomba > img {
    background-color: orange;
}

#researchtable .researchMaxed > img {
    background-color: green;
}

#researchtable.hideMaxedResearches > tbody > tr > td:has(> .researchMaxed) {
    display: none;
}

#shop {
    text-align: center;
    position: relative;
}

#shopWrapper {
    display: flex;
    justify-content: center;
}

#actualWrapper {
    display: grid;
    grid-template-areas:
        ". shoptop"
        "consumables shop"
        ". buttons";
    justify-items: center;
    font-size: min(1em, 20px);
}

#actualShopContainer {
    display: contents;
}

#actualShop {
    grid-area: shop;
    display: flex;
    align-items: stretch;
    margin-top: 10px;
    border: 3px solid plum;
    color: white;
    text-align: left;
}

#shopFamilyList {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 70vh;
    border-right: 1px solid plum;
    scrollbar-width: thin;
}

.shopSectionHeader {
    flex-shrink: 0;
    margin: 8px 8px 2px;
    color: plum;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.shopFamilyRow {
    display: flex;
    flex-shrink: 0;
    align-items: stretch;
    background: none;
    border-left: 3px solid transparent;
    color: white;
}

.shopFamilyRow:hover {
    background-color: rgb(255 255 255 / 8%);
}

.shopFamilyRow.shopFamilySelected {
    border-left-color: cyan;
    background-color: rgb(0 255 255 / 10%);
}

.shopFamilyButton {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 8px;
    background: none;
    border: none;
    color: white;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.shopFamilyRowIcon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.shopFamilyRowInfo {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.shopFamilyRowTiers {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 3px;
    padding: 4px 8px 4px 0;
}

.shopTierShortcut {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 1px;
    background: none;
    border: 1px solid gray;
    border-radius: 2px;
    cursor: pointer;
}

.shopTierShortcut > img {
    width: 16px;
    height: 16px;
}

.shopTierShortcutUnfinished {
    border-color: cyan;
}

.shopTierShortcutMaxed {
    border-color: gold;
}

.shopFamilyRowCost {
    color: gold;
    font-size: 0.8em;
}

.shopFamilyRowCost.shopCantAfford {
    color: gray;
}

.shopFamilyRowCost.shopFamilyMaxed {
    color: orchid;
}

#shopDetail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 62ch;
    padding: 10px;
    text-align: center;
}

#shopDetail > p {
    margin: 0;
    overflow-wrap: break-word;
}

#shopTierRail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.shopTierChip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    background: none;
    border: 1px solid gray;
    color: white;
    font: inherit;
    font-size: 0.8em;
    cursor: pointer;
}

.shopTierChip.shopTierSelected {
    border-color: cyan;
    box-shadow: 0 0 6px cyan;
}

.shopTierChip.shopTierMaxed {
    border-color: gold;
}

.shopTestingOnly {
    background-color: maroon;
}

#shopTestingOnlyWarning {
    box-sizing: border-box;
    max-width: 48ch;
    padding: 6px 8px;
    border: 2px solid red;
    border-radius: 3px;
    background-color: rgb(128 0 0 / 35%);
    color: #ffb3b3;
    font-weight: 600;
}

#shopDetailName {
    font-size: 1.1em;
}

#quarkdescription { color: plum; }
#quarkeffect { color: limegreen; }
#quarkRefundable { color: goldenrod; }

#shopDetailBuy {
    width: auto;
    min-width: 220px;
    padding: 0 12px;
    border: 2px solid cyan;
}

#actualPotionShop > div,
#goldenQuarksShop {
    width: 110px;
}

#actualPotionShop > div > p,
#goldenQuarksShop > p {
    margin: 0 0 3px;
    line-height: 1em;
}

#shoptop {
    grid-area: shoptop;
    color: whitesmoke;
    font-size: 1.2em;
}

#actualConsumables {
    grid-area: consumables;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 250px;
    margin-right: 20px;
}

#actualPotionShop {
    display: flex;
    padding: 5px;
    border: 3px solid yellow;
    background-color: var(--box-color);
    gap: 5px;
    flex-wrap: wrap;
}

#goldenQuarksDisplay > img {
    font-size: 0;
}

#goldenQuarksDisplay,
#octeractsDisplay,
#purpleHoneyDisplay {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    white-space: pre-line;
}

#purpleHoneyDisplay > div {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1;
}

#purpleHoneyDisplay > div > p {
    min-height: 0;
    margin: 0 !important;
    padding: 0;
    line-height: 1;
}

#totalOcteractsDisplay {
    display: flex;
    flex-direction: column;
    row-gap: 6px;
    box-sizing: border-box;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 0 10px;
}

#octeractsDisplay > p {
    margin: 0 0 0 10px;
    font-size: 1.2em;
}

#totalOcteractsDisplay > p {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 1ch;
    margin: 0;
    overflow-wrap: anywhere;
}

#totalOcteractsDisplay > p > span {
    margin-left: auto;
}

#goldenQuarkamount {
    font-size: 1.2em;
    color: gold;
    margin-left: 5px;
}

#consumables {
    color: var(--orangered-text-color);
    font-size: 1.2em;
    margin-top: 20px;
}

#shopButtons {
    grid-area: buttons;
    display: flex;
    justify-content: center;
    flex-flow: wrap;
    float: right;
    gap: 5px;
    margin-top: 5px;
}

#shopButtons > button {
    min-width: 150px;
    min-height: 40px;
    margin-bottom: 6px;
}

.consumablebutton,
.permshopbutton {
    width: 100%;
    min-height: 40px;
    padding: 0;
    line-height: 1em;
    vertical-align: top;
}

#ants {
    position: relative;
    padding: 0;
    text-align: center;
    max-width: 1500px;
    margin: 0 auto;
}

.antUpgrade:hover,
.antBtn:hover {
    box-shadow:
        0 0 3px var(--glow-color),
        0 0 6px var(--glow-color),
        0 0 9px var(--glow-color);
    background-color: var(--glow-color);
}

#antSubtab1,
#antSubtab2,
#antSubtab3 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.introTextContainer > p {
    margin: 0;
}

.introText {
    font-size: 1.3em;
}

#antProducersContainer {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

#antProducers {
    display: flex;
    flex-direction: row;
}

.antProducerColumn {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#antrow2 {
    max-width: 800px;
    margin-top: 10px;
    min-height: 10em;
}

#antrow3 {
    max-width: 800px;
    margin-top: 10px;
    min-height: 7em;
}

#antUpgradesContainer {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.antUpgradeRow {
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-content: center;
}

#antrow2 > p,
#antrow3 > p {
    margin: 0;
}

#crumbcount {
    font-size: 1.2em;
}

.enabledAntToggle {
    border-color: green;
}

.disabledAntToggle {
    border-color: crimson;
}

.singlePurchaseAnt {
    border-color: white;
}

.maxPurchaseAnt {
    border-color: gold;
}

.buyAllAntBtn {
    border-width: 2px;
    border-color: gold;
}

.antToggleBtn {
    min-width: 150px;
    cursor: pointer;
    border-width: 1px;
}

#antToggleFeatures {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}

#antAltarWelcomeTexts {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    width: calc(100% - 20px);
    min-height: 70px;
    padding: 8px 175px;
    overflow: hidden;
    border: 2px solid #34373b;
    border-radius: 7px;
}

#antAltarWelcomeTexts::before,
#antAltarWelcomeTexts::after {
    position: absolute;
    width: 10px;
    height: 10px;
    content: "";
    border-color: #55595e;
}

#antAltarWelcomeTexts::before {
    top: 4px;
    left: 4px;
    border-top: 2px solid;
    border-left: 2px solid;
}

#antAltarWelcomeTexts::after {
    right: 4px;
    bottom: 4px;
    border-right: 2px solid;
    border-bottom: 2px solid;
}

#antAltarWelcome {
    font-size: 1.45em;
    font-weight: 700;
    letter-spacing: 0.04em;
}

#antAltarDescription {
    margin-top: 3px !important;
    font-size: 0.95em;
}

.antAltarHeaderDecoration {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 24px;
    color: #4a4e52;
    pointer-events: none;
    transform: translateY(-50%);
}

.antAltarHeaderDecorationLeft {
    left: 34px;
}

.antAltarHeaderDecorationRight {
    right: 34px;
    transform: translateY(-50%) scaleX(-1);
}

.antAltarHeaderDecoration img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.38;
    filter: grayscale(1) sepia(1) saturate(8) hue-rotate(315deg) brightness(0.72);
}

.antAltarHeaderCircuit {
    width: 108px;
    height: 18px;
    opacity: 0.7;
    background:
        linear-gradient(currentcolor, currentcolor) 0 10px / 46px 2px no-repeat,
        linear-gradient(currentcolor, currentcolor) 45px 7px / 9px 8px no-repeat,
        linear-gradient(currentcolor, currentcolor) 53px 10px / 38px 2px no-repeat,
        linear-gradient(currentcolor, currentcolor) 90px 4px / 8px 8px no-repeat,
        linear-gradient(currentcolor, currentcolor) 97px 4px / 25px 2px no-repeat;
}

#toggleAutoSacrificeAnt {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 31px;
    font-size: 0.95em;
    border-width: 1px;
    border-style: solid;
}

#autoSacrificeAntMode,
#autoAntSacrificeAmount {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 30px;
    font-size: 0.9em;
    color: white;
    background: #030606;
    border: 1px solid #00a6af;
}

#autoAntSacrificeAmount {
    grid-column: 1 / -1;
}

.additionalAutoSacOptions {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 2px;
}

.antSacToggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    min-height: 25px;
    text-align: left;
}

.antSacToggle p {
    margin: 0;
}

.antSacToggleInput {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #e9e9e9;
}

#sacrificeUnlockTexts > p {
    margin: 0;
    font-size: 1.3em;
}

.sacrificeAntsUnlocked {
    display: grid;
    grid-template-areas:
        "elo altar rewards"
        "lotus lotus lotus";
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    box-sizing: border-box;
    width: calc(100% - 16px);
    margin: 8px;
    text-align: center;
}

.sacrificeAntsContainer {
    --ant-altar-panel-color: #666;

    position: relative;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 9px 12px 10px;
    overflow: hidden;
    border: 2px solid var(--ant-altar-panel-color);
    border-radius: 7px;
    box-shadow:
        inset 0 0 22px rgb(0 0 0 / 78%),
        0 0 0 1px rgb(0 0 0 / 80%);
}

.sacrificeAntsContainer::before,
#lotusCorner::before {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 9px;
    height: 9px;
    pointer-events: none;
    content: "";
    border-top: 2px solid var(--ant-altar-panel-color);
    border-left: 2px solid var(--ant-altar-panel-color);
}

.antSacrificePanelTitle {
    width: 100%;
    margin: 0 0 8px;
    font-size: 1.15em;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

#eloCorner {
    --ant-altar-panel-color: #008d88;

    grid-area: elo;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#eloCorner .antSacrificePanelTitle {
    color: #00d8e8;
}

#immortalELOInfoToggleButton {
    width: min(190px, 80%);
    min-height: 34px;
    margin: 0 0 9px;
    color: white;
    background: #05090a;
    border-color: #00cbd2;
    border-radius: 7px;
}

#altar {
    --ant-altar-panel-color: #ad8b00;

    grid-area: altar;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.94em;
}

#altar .antSacrificePanelTitle {
    color: gold;
}

#altar p {
    margin: 0;
}

#antSacrifice {
    width: 82px;
    height: 82px;
    padding: 0;
    margin: -2px 0 2px;
    background: transparent;
    border: 0;
    border-radius: 50%;
}

#antSacrifice > img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#anthillAliveText {
    margin-top: 1px !important;
}

#antSacrificeRequired {
    min-height: 1.25em;
    margin-top: 2px !important;
}

.autoSacrifice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
    margin-top: 2px;
}

.autoSacrifice > br {
    display: none;
}

#antSacrificeTimer {
    padding: 1px 0.5em;
    font-size: 1.05em;
    color: gold;
}

.canAntSacrifice {
    box-shadow:
        0 0 15px crimson,
        0 0 30px crimson,
        0 0 45px crimson;
    background-color: crimson;
    border-radius: 50%;
}

.canAntSacrifice:hover {
    box-shadow:
        0 0 20px lightgoldenrodyellow,
        0 0 40px gold,
        0 0 60px goldenrod;
    background-color: white !important;
    border-radius: 50%;
}

.antSacrificeSettingsContainer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    width: min(370px, 96%);
}

.antSacrificeRewardColumn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 90px;
    min-width: 0;
    height: 74px;
    margin: 0;
    border: 2px solid currentcolor;
    border-radius: 7px;
    box-shadow: inset 0 0 12px rgb(0 0 0 / 70%);
    transform-origin: center;
    transition:
        transform 160ms cubic-bezier(0.2, 1.35, 0.4, 1),
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.antSacrificeRewardColumn > p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.1;
}

.antSacrificeRewardColumn > img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    image-rendering: pixelated;
    transition: filter 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
    #antSacrificeRewards .antSacrificeRewardColumn:hover {
        z-index: 1;
        background-color: rgb(255 255 255 / 10%);
        box-shadow:
            inset 0 0 16px rgb(255 255 255 / 10%),
            0 4px 14px currentcolor;
        transform: translateY(-3px) scale(1.06);
    }

    #antSacrificeRewards .antSacrificeRewardColumn:hover > img {
        filter: brightness(1.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .antSacrificeRewardColumn,
    .antSacrificeRewardColumn > img {
        transition: none;
    }
}

#immortalELOInfo,
#immortalELOOverview {
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
    padding: 0;
    font-size: 1.05em;
    line-height: 1.35;
    text-align: left;
}

#immortalELOGain {
    font-size: 0.9em;
}

#immortalELOInfo > p,
#immortalELOOverview > p {
    margin: 0;
}

#immortalELOInfo > br,
#immortalELOOverview > br {
    height: 0.35rem;
}

#immortalELOInfo {
    max-height: calc(100% - 52px);
    overflow-y: auto;
    scrollbar-width: thin;
}

#lotusCorner {
    --ant-altar-panel-color: #9a438f;

    position: relative;
    display: block;
    grid-area: lotus;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    interpolate-size: allow-keywords;
    text-align: left;
    border: 2px solid var(--ant-altar-panel-color);
    border-radius: 7px;
    box-shadow:
        inset 0 0 22px rgb(0 0 0 / 78%),
        0 0 0 1px rgb(0 0 0 / 80%);
    transition: height 260ms ease;
}

#lotusExpandedContent {
    display: grid;
    grid-template-columns: 130px minmax(220px, 1.2fr) minmax(190px, 0.8fr) minmax(220px, 0.95fr);
    gap: 16px;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    padding: 0 46px 0 30px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 180ms ease,
        transform 260ms ease;
}

#lotusCorner.lotusCollapsed {
    height: 44px;
    min-height: 44px;
}

#lotusCorner.lotusCollapsed #lotusExpandedContent {
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
}

#toggleLotusSection {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 28px;
    color: #ef9ae4;
    cursor: pointer;
    background: #150c16;
    border: 1px solid #bd5fb0;
    border-radius: 4px;
}

#toggleLotusSection:hover {
    color: white;
    background-color: #713068;
}

#toggleLotusSection > span {
    display: block;
    font-size: 0.75em;
    line-height: 1;
    transition: transform 260ms ease;
}

#toggleLotusSection > span::before {
    content: "▲";
}

#lotusCorner.lotusCollapsed #toggleLotusSection > span {
    transform: rotate(180deg);
}

#lotusCollapsedSummary {
    position: absolute;
    inset: 0 45px 0 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(7px);
    transition:
        visibility 0s linear 180ms,
        opacity 160ms ease,
        transform 220ms ease;
}

#lotusCorner.lotusCollapsed #lotusCollapsedSummary {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 90ms;
}

#lotusCollapsedSummary > img {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.lotusCollapsedTitle {
    min-width: 0;
    overflow: hidden;
    font-size: 1.05em;
    font-weight: 700;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.lotusCollapsedValues {
    display: flex;
    flex: 0 0 auto;
    gap: 18px;
    align-items: center;
    margin-left: auto;
    white-space: nowrap;
}

.lotusCollapsedActions {
    display: flex;
    flex: 0 1 auto;
    gap: 6px;
    align-items: center;
    min-width: 0;
    pointer-events: auto;
}

#use-lotus-collapsed,
#lotusConsumablesButtonCollapsed {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    padding: 2px 8px;
    margin: 0;
    overflow: hidden;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 4px;
}

#use-lotus-collapsed {
    flex: 0 0 auto;
    color: #ef9ae4;
    background: #150c16;
    border: 1px solid #dd72cd;
}

#lotusConsumablesButtonCollapsed {
    display: flex;
    flex: 0 1 auto;
    gap: 5px;
    align-items: center;
    justify-content: center;
    border-width: 2px;
}

#lotusConsumablesButtonCollapsed > img {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0);
}

@media (prefers-reduced-motion: reduce) {
    #lotusCorner,
    #lotusExpandedContent,
    #lotusCollapsedSummary,
    #toggleLotusSection > span {
        transition: none;
    }
}

#lotusCorner p {
    margin: 0;
}

#lotusVisual {
    position: relative;
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
}

#lotusVisual::before,
#lotusVisual::after {
    position: absolute;
    content: "";
    border-radius: 50%;
}

#lotusVisual::before {
    inset: 6px;
    border: 2px dotted rgb(180 89 167 / 55%);
}

#lotusVisual::after {
    inset: 18px;
    border: 1px solid rgb(180 89 167 / 40%);
}

#lotusVisual > img {
    z-index: 1;
    width: 78px;
    height: 78px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 9px rgb(255 108 235 / 35%));
}

#lotusNameIcon {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#lotusNameIcon > p:first-child {
    margin-bottom: 6px;
    font-size: 1.12em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

#lotusInventory {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 82px;
    padding-left: 20px;
    border-left: 2px solid rgb(161 75 150 / 48%);
}

#lotusButtons {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

#use-lotus {
    width: min(275px, 100%);
    min-height: 40px;
    margin-top: auto;
    color: #ef9ae4;
    font-size: 0.95em;
    text-transform: uppercase;
    background: #150c16;
    border: 2px solid #dd72cd;
    border-radius: 4px;
}

#lotusButtons > .consumableButton {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: min(320px, 100%);
    min-height: 56px;
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    border: 3px solid #ffd700;
    border-radius: 7px;
    box-shadow:
        inset 0 0 0 3px #b38d00,
        0 0 12px rgb(255 215 0 / 15%);
}

#lotusButtons > .consumableButton img {
    width: 27px;
    height: 27px;
    object-fit: contain;
    filter: brightness(0);
}

#antSacrificeObtainiumOfferings,
#antSacrificeShardsRow1,
#antSacrificeShardsRow2,
#antSacrificeShardsRow3 {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

#antSacrificeObtainiumOfferings .antSacrificeRewardColumn {
    width: 105px;
}

#antSacrificeRewards {
    --ant-altar-panel-color: #824181;

    display: flex;
    grid-area: rewards;
    flex-direction: column;
    align-items: center;
}

#antSacrificeRewards .antSacrificePanelTitle {
    color: #cb71c4;
}

.antSacrificeRewardOffering,
.antSacrificeRewardTalisman,
#antSacrificeOffering,
#antSacrificeTalismanShard {
    color: gold;
}

.antSacrificeRewardObtainium,
#antSacrificeObtainium {
    color: pink;
}

.antSacrificeRewardCommon,
#antSacrificeCommonFragment {
    color: white;
}

.antSacrificeRewardUncommon,
#antSacrificeUncommonFragment {
    color: limegreen;
}

.antSacrificeRewardRare,
#antSacrificeRareFragment {
    color: #00bde3;
}

.antSacrificeRewardEpic,
#antSacrificeEpicFragment {
    color: plum;
}

.antSacrificeRewardLegendary,
#antSacrificeLegendaryFragment {
    color: orange;
}

.antSacrificeRewardMythical,
#antSacrificeMythicalFragment {
    color: crimson;
}

#autoAntSacrifice {
    display: block;
    min-height: 2em;
    margin: 1px 0;
}

#otherAutoSac {
    box-sizing: border-box;
    width: min(100%, 480px);
}

#minimumTimeToSacrifice,
#sacrificeSecondsElapsed {
    display: block;
    width: 100%;
}

#sacrificeSecondsElapsed {
    margin-top: 2px;
}

.antSacrificeHeader {
    margin-bottom: 4px;
    overflow-wrap: break-word;
    white-space: initial;
}

@media (width <= 1150px) {
    #antAltarWelcomeTexts {
        padding-right: 120px;
        padding-left: 120px;
    }

    .antAltarHeaderDecoration {
        gap: 12px;
    }

    .antAltarHeaderDecorationLeft {
        left: 22px;
    }

    .antAltarHeaderDecorationRight {
        right: 22px;
    }

    .antAltarHeaderCircuit {
        width: 80px;
    }

    .sacrificeAntsUnlocked {
        grid-template-areas:
            "elo altar"
            "rewards rewards"
            "lotus lotus";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    }

    #antSacrificeRewards {
        height: 390px;
    }

    #lotusExpandedContent {
        grid-template-columns: 160px minmax(240px, 1fr) minmax(220px, 1fr);
        min-height: 180px;
    }

    #lotusButtons {
        grid-column: 2 / 4;
    }
}

@media (width <= 768px) {
    #antAltarWelcomeTexts {
        min-height: 80px;
        padding: 12px 62px;
    }

    #antAltarWelcome {
        font-size: 1.35em;
    }

    #antAltarDescription {
        font-size: 0.95em;
    }

    .antAltarHeaderDecorationLeft {
        left: 12px;
    }

    .antAltarHeaderDecorationRight {
        right: 12px;
    }

    .antAltarHeaderDecoration img {
        width: 36px;
        height: 36px;
    }

    .antAltarHeaderCircuit {
        display: none;
    }

    .sacrificeAntsUnlocked {
        grid-template-areas:
            "elo"
            "altar"
            "rewards"
            "lotus";
        grid-template-columns: minmax(0, 1fr);
    }

    #altar {
        min-height: 430px;
    }

    #immortalELOInfo {
        max-height: none;
        overflow-y: visible;
    }

    #antSacrificeRewards {
        height: auto;
        min-height: 390px;
    }

    #lotusExpandedContent {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        padding: 24px;
        text-align: center;
    }

    #lotusNameIcon {
        align-items: center;
    }

    #lotusInventory {
        align-items: stretch;
        box-sizing: border-box;
        width: min(360px, 100%);
        min-height: 0;
        padding: 20px 0 0;
        text-align: center;
        border-top: 2px solid rgb(161 75 150 / 48%);
        border-left: 0;
    }

    #lotusButtons {
        grid-column: auto;
        width: min(360px, 100%);
    }
}

@media (width <= 600px) {
    .lotusCollapsedValues {
        display: none;
    }

    .lotusCollapsedActions {
        margin-left: auto;
    }
}

@media (width <= 480px) {
    #lotusCollapsedSummary > img,
    .lotusCollapsedTitle {
        display: none;
    }

    .lotusCollapsedActions {
        width: 100%;
        margin-left: 0;
    }

    #lotusConsumablesButtonCollapsed {
        flex: 1 1 auto;
    }

    #antAltarWelcomeTexts {
        padding: 12px 18px;
    }

    .antAltarHeaderDecoration {
        display: none;
    }

    #antSacrificeObtainiumOfferings,
    #antSacrificeShardsRow1,
    #antSacrificeShardsRow2,
    #antSacrificeShardsRow3 {
        gap: 8px;
    }

    .antSacrificeRewardColumn {
        width: 30%;
        min-width: 92px;
    }
}

#antSacrificeCompendium {
    width: 50%;
}

/* Ant Leaderboard Styles */
#antLeaderboardContainer {
    margin-top: 10px;
}

.antLeaderboardToggleBtn {
    padding: 8px 16px;
    color: white;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
    margin-bottom: 10px;
    width: 33%;
}

.antLeaderboardToggleBtn:hover {
    background-color: #5a5a5a;
    border-color: #888;
}

.antLeaderboardToggleBtn[data-mode="daily"] {
    border-color: #3a9;
}

.antLeaderboardToggleBtn[data-mode="allTime"] {
    border-color: #f90;
}

.antLeaderboardToggleBtn[data-mode="overview"] {
    border-color: #0df;
}

.antLeaderboardToggleBtn[data-mode="info"] {
    border-color: #8a2be2;
}

#antLeaderboardTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#antLeaderboardTable th,
#antLeaderboardTable td {
    padding: 6px;
    text-align: center;
    border: 1px solid #555;
}

#antLeaderboardTable th {
    background-color: #3a3a3a;
    font-weight: bold;
    color: #fff;
}

#antLeaderboardTable tr {
    background-color: #2a2a2a;
    transition: background-color 0.2s;
}

.antLeaderboardCurrentSacrifice {
    background-color: #2a4a2a !important;
    border: 2px solid #4a8a4a !important;
}

.antTierBtnAvailable > img {
    cursor: pointer;
    background-color: burlywood;
}

.antMasteryBtnAvailable > img {
    cursor: pointer;
    background-color: lightgreen;
}

.antUpgradeBtnAvailable > img {
    cursor: pointer;
    background-color: silver;
}

#cubes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Wow! Cube sidebar */
#wowCubeSidebar {
    display: flex;
    flex-direction: column;
    margin: 0 30px;
    line-height: 1.1em;
    text-align: center;
    width: 250px;
    align-items: center;
}

.cubesToQuark {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 126%;
}

.cubeToQuark {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

#wowCubeSidebar p {
    margin: 0;
}

#cubeToQuarkTimer,
#cubeToQuarkTimerValue {
    font-size: 1.2em;
}

.cubeBtn {
    min-width: 100px;
    background-color: var(--blackbtn-color);
    border: 1px solid var(--wowcube-color);
}

.autoOpensBtn {
    height: 30px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.autoOpens {
    width: 8em;
    min-width: 100px;
    min-height: 30px;
    background-color: var(--blackbtn-color);
}

.autoOpensInput {
    width: 8em;
    min-width: 100px;
    color: white;
    background-color: var(--blackbtn-color);
    z-index: 1;
}

p[id$="BlessingsTotal"] {
    padding: 15px;
    margin-left: 22.5%;
    margin-right: auto;
}

#platonicFooter,
#cubeFooter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

#platonicFooter p,
#cubeFooter p {
    margin: 0;
}

#platonicAsterisk {
    font-size: 0.75em;
}

#cubesWrapper {
    display: flex;
    justify-content: flex-start;
    margin-top: 30px;
    width: 1250px;
}

.cubesBonus {
    align-self: flex-start;
}

.cubesBonus tbody tr > td:first-child {
    font-size: 0;
}

.openGrid {
    display: flex;
    align-self: flex-start;
    margin: 10px 0 5px;
}

.openImage {
    height: 64px;
    width: 64px;
}

.inventory {
    margin: auto 10px;
}

.openBtn {
    display: flex;
    flex-flow: wrap;
    align-items: flex-start;
    gap: 5px;
    margin-left: 10px;
}

.openButtons {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cubeBonus {
    align-self: flex-start;
    margin-left: -1px;
    margin-top: 5px;
    white-space: nowrap;
}

.cubeIcon {
    border-spacing: 0;
}

.cubeIcon img {
    margin-right: 5px;
}

.cubeTab {
    flex-direction: column;
    align-items: center;
    width: 800px;
    margin-left: 50px;
}

.cubeTab > span {
    text-align: center;
}

#cubeTab5Wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    text-align: center;
    align-self: normal;
}

#cubeTab5Wrapper p {
    margin: 0;
}

#cubeTab6 {
    flex-direction: row;
    align-items: flex-start;
}

#cubeUpgradeTable {
    margin: 5px 0;
    border-collapse: collapse;
    font-size: 0;
}

.cubeUpgradeInfo {
    min-height: 4em;
}

.cubeUpgradeModal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.cubeUpgradeModalTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: gold;
    font-size: 1.1em;
}

.cubeUpgradeModalIcon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background-color: var(--buttonimg-color);
}

.cubeUpgradeModalDescription {
    color: lightblue;
    line-height: 1.35;
}

.cubeUpgradeModalCost.affordable {
    color: var(--green-text-color);
}

.cubeUpgradeModalCost.unaffordable {
    color: var(--crimson-text-color);
}

.cubeUpgradeModalCost.maxed {
    color: gold;
}

.cubeUpgradeModalLevel {
    color: white;
}

.cubeUpgradeModalLevel.maxed {
    color: plum;
}

.cubeUpgradeToggles {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 0 15px;
}

#toggleCubeBuy {
    min-width: 200px;
}

#toggleAutoCubeUpgrades {
    min-width: 150px;
}

.gridImg {
    background-color: var(--buttonimg-color);
    cursor: pointer;
}

#languagesubtab {
    flex-direction: row;
    margin-top: 15px;
    align-items: center;
}

.languagesMenu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    flex-grow: 0;
    min-width: 450px;
    max-width: 750px;
    padding: 5px;
}

.languageOptions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

button.language-select {
    border: 2px solid white;
    width: 12em;
    min-width: 150px;
    min-height: 40px;
    margin: 5px;
}

button.language-select span.lang-flag {
    font-size: 2em;
    padding-right: 4px;
    vertical-align: middle;
}

button.language-select span.lang-name {
    font-size: 1.2em;
    vertical-align: middle;
}

.languageContribution {
    flex-grow: 0;
    min-width: 450px;
    max-width: 750px;
    padding: 5px;
}

/* Credits */

#creditssubtab {
    margin-top: 20px;
    flex-direction: column;
}

#creditssubtab > * {
    font-size: 1.2em;
    text-align: center;
    margin: 0.4em 0;
}

#creditssubtab img {
    image-rendering: unset;
}

#versionnumber {
    color: fuchsia;
}

#ascension {
    position: relative;
    padding: 0;
    color: orange;
    flex-direction: column;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

#ascension p {
    margin: 0;
    text-align: center;
}

#ascendConstantUpgrades {
    display: flex;
    width: 50em;
    max-width: 1000px;
    flex-direction: column;
    align-items: center;
}

#ascendautomation {
    margin-top: 10px;
}

.resetautomation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 100px;
}

#constUpgradeLevel,
#constUpgradeCost,
#constUpgradeEffect1 {
    color: white;
}

#tesseractautobuytoggle,
#tesseractautobuymode,
#tesseractAmount {
    width: 12em;
    min-width: 150px;
    min-height: auto;
}

#tesseractAmount {
    color: white;
    border: 1px solid var(--tesseract-color);
    background-color: var(--blackbtn-color);
}

#autotessbuyeramount {
    margin: 0;
}

p#ascendHotKeys {
    margin-top: 15px;
    text-align: center;
}

#creditssubtab > h1 {
    font-size: 1.5em;
    text-align: center;
}

#creditList {
    display: grid;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    max-width: 1000px;
    margin: 0 auto;
}

.credit {
    display: flex;
    flex-direction: row;
    margin-top: 2px;
}

.credit > a {
    margin-left: 5px;
}

#artistList {
    display: grid;
    grid-template-columns: repeat(5, 160px);
    justify-content: center;
}

#artistList > p {
    margin: 0.4em 0;
}

#statisticsSubTab {
    padding-top: 25px;
    justify-content: center;
}

#statsForNerds {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    height: fit-content;
    gap: 10px 15px;
}

html[data-mobile="false"] #statsForNerds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    align-items: stretch;
}

html[data-mobile="false"] #summaryGeneration {
    grid-column: 1 / -1;
    justify-self: center;
}

.statContainer {
    width: 30em;
    min-width: 600px;
    max-width: 750px;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: auto;
    padding-left: 25px;
    padding-right: 25px;
    padding-bottom: 25px;
    display: none;
}

html[data-mobile="true"] #statisticsSubTab > .statContainer {
    display: none !important;
}

#miscStats {
    display: block;
}

.statsNerdsModal {
    width: 100%;
}

.statsNerdsModal .statPortion {
    width: 100%;
    min-width: unset;
    overflow-wrap: anywhere;
}

.statPortion {
    margin: 0;
    text-align: left;
    font-size: 0.9em;
    min-width: max-content;
}

.statPortion.indented {
    width: 360px;
    padding-left: 20px;
}

.statNumber {
    color: yellow;
    float: right;
}

.statPortion.statTotal {
    color: orange;
    font-weight: bold;
    font-size: 1em;
}

.statNumber.statTotal {
    color: deepskyblue;
}

.constUpgrade {
    background-color: var(--button-color);
    transition: background-color var(--transition-extra), border-color var(--transition-extra);
}

.constUpgradeAvailable {
    background-color: purple;
    cursor: pointer;
}

.constUpgradeAvailable:hover {
    background-color: #b300b3;
}

.constUpgradeAuto {
    background-color: green;
}

.subtabContent {
    display: none;
}

#exitOffline.subtabContent {
    display: block;
    visibility: hidden;
}

.subtabContent.subtabActive {
    display: block;
}

.subtabContent.subtabActive.subtabDisplayFlex {
    display: flex;
    justify-content: center;
}

.subtabContent.subtabActive.historySubTab.subtabDisplayFlex > div {
    display: flex;
}

.historySubTab {
    color: white;
}

.historySubTab p:first-of-type {
    color: var(--text-color);
}

.historySubTab p {
    margin: 8px 0 12px;
}

.historySubTab table {
    margin: auto;
    border-collapse: collapse;
    width: 100%;
    white-space: nowrap;
    text-align: left;
    line-height: 1em;
}

.historySubTab tbody span {
    vertical-align: middle;
}

.historySubTab tbody img {
    vertical-align: middle;
    height: 20px;
    margin-right: 3px;
}

#historyAscendTable td:nth-last-child(3) > img {
    margin-right: 0;
}

#historyAscendTable td:nth-last-child(3) > span {
    visibility: hidden;
    font-size: 0;
}

.historySubTab tbody td {
    padding: 2px 6px;
    height: 28px;
}

.historySubTab tbody .history-gain:last-child { margin-right: 0; }

.historySubTab tbody tr:nth-child(odd) {
    background: var(--history-lines);
}

.historySubTab tbody .history-seconds {
    white-space: nowrap;
}

.historySubTab tbody .history-filler {
    padding: 0;
}

.historySubTab tbody *[title] {
    text-decoration: underline;
}

#historyReset,
#historyAnts {
    margin-left: 20px;
}

#historyAscend,
#historySingularity {
    margin: 0 auto;
}

#historyTogglePerSecondButton {
    min-width: 110px;
    min-height: 25px;
    float: right;
}

.onOffToggle {
    text-align: center;
    padding: 5px;
    border: 2px solid red;
    margin-top: 8px;
}

#historyResetTable {
    min-width: 400px;
}

#historyAntsTable {
    min-width: 700px;
}

#historyAscendTable,
#historySinhgularityTable {
    min-width: 1180px;
    white-space: nowrap;
}

.historyTableWrap {
    max-height: 650px;
    overflow-y: auto;
}

#historyAscend .historyTableWrap,
#historySingularity .historyTableWrap {
    min-width: 1212px;
}

.runeBlessingPurchaseSettings {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 50px;
}

.runeIcons {
    height: 64px;
    width: 64px;
}

.runeTexts {
    width: 12em;
    max-width: 250px;
}

.runeButtons {
    width: 25em;
    min-width: 325px;
    max-width: 350px;
    border: 1px solid yellow;
    color: gold;
}

.runeEffectTexts {
    width: 35em;
    max-width: 600px;
}

.runeButtonsBuyAll {
    width: 10em;
    min-width: 120px;
    border: 1px solid yellow;
    color: gold;
}

#toggle36,
#toggle37 {
    width: 6em;
    min-width: 80px;
}

.runeButtonsAvailable {
    background-color: var(--blessings-canbuy-color);
    cursor: pointer;
}

.runeButtonsAvailable:hover {
    background-color: var(--blessings-hover-color);
}

.runeButtonsAvailable > span {
    pointer-events: none;
}

#buyRuneBlessingInput {
    min-width: 100px;
    width: 5em;
    font-size: 0.8em;
    border: 2px solid crimson;
    color: white;
}

#buyRuneSpiritInput {
    min-width: 100px;
    width: 5em;
    font-size: 0.8em;
    border: 2px solid orange;
    color: white;
}

#campaigns {
    contain: inline-size;
    margin-top: 10px;
}

#campaignsMain {
    contain: inline-size;
    min-width: 0;
    row-gap: 10px;
    line-height: 1.2;
    margin-top: 10px;
}

#campaignsIcons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-items: center;
}

#campaignIconGrid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 48px));
    grid-template-rows: repeat(5, minmax(0, 48px));
    column-gap: 2px;
    row-gap: 2px;
    justify-content: center;
}

/* Credit: gwabo_ */
.campaignIcon:not(.green-background),
.tieredAchievementType img:not(.green-background),
.progressiveAchievementType img:not(.green-background) {
    --pct: 0;

    background-image:
        linear-gradient(
            0deg,
            #00800033 -25%,
            #00800088 calc(round(var(--pct) * 100%, 1px) - 1px),
            green calc(round(var(--pct) * 100%, 1px) - 1px),
            green calc(round(var(--pct) * 100%, 1px)),
            transparent calc(round(var(--pct) * 100%, 1px))
        );
}

#campaignsIcons h3 {
    text-align: center;
}

#campaignsIcons img {
    box-sizing: content-box;
    width: 100%;
    max-width: 48px;
    height: auto;
    font-size: 0;
    cursor: pointer;
}

#campaignsIcons img:hover {
    background-color: var(--hover-color);
}

#campaignsDescriptions {
    border: 2px solid red;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

#campaignsDescriptions h3 {
    margin-top: 1px;
    margin-bottom: 1px;
}

#campaignsDescriptions h5 {
    margin-top: 1px;
    margin-bottom: 1px;
}

#campaignCorruptionInfo {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.campaignCorrDisplay {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.campaignCorrDisplay img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    font-size: 0;
}

.campaignCorrDisplay p {
    margin: 0;
}

#campaignCorruptions {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#campaignCorruptionStats {
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#campaignCorruptionStats p {
    margin: 0;
}

#campaignCorruptionStats button {
    align-self: flex-end;
    width: 100%;
    border: 1px solid gold;
    font-size: 1.2em;
}

#campaignsTokensInfo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-items: center;
    text-align: center;
}

#campaignsTokensInfo img {
    width: 48px;
    height: 48px;
    font-size: 0;
    cursor: pointer;
    margin-left: 2px;
    margin-right: 2px;
}

#campaignsTokensInfo img:hover {
    background-color: var(--hover-color);
}

#campaignsTokensInfo h2 {
    margin-top: 1px;
    margin-bottom: 1px;
}

#campaignsTokensInfo h4 {
    margin-top: 1px;
    margin-bottom: 1px;
}

.campaignTokenRewardModal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    line-height: 1.25;
}

.campaignTokenRewardModal img {
    width: 48px;
    height: 48px;
}

.campaignTokenRewardModalInfo {
    width: 100%;
}

.campaignTokenRewardSumModal {
    align-items: stretch;
    gap: 8px;
}

.campaignTokenRewardSumModal > div {
    padding-bottom: 8px;
    border-bottom: 1px solid rgb(255 255 255 / 20%);
}

.campaignTokenRewardSumModal > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

#traits {
    display: flex;
    justify-content: center;
    align-items: start;

    /* Hopefully prevent some elements from overlapping with the tab buttons */
    margin-top: 10px;
}

#corruptionMain {
    min-width: 43.75rem;
    max-width: 75rem;
}

#corruptionMain.campaigns-active > :not(#campaignsMain) {
    visibility: hidden;
    block-size: 0;
    min-block-size: 0;
    margin-block: 0;
    overflow: hidden;
}

#corruptionIntroduction {
    font-size: 1.2em;
    color: var(--darkorchid-text-color);
}

#corruptionInfo1 {
    color: yellow;
}

#corruptionSelected {
    width: 70px;
    height: 70px;
    margin-top: 15px;
}

#corruptionSelectedPic {
    height: 100%;
    object-fit: contain;
}

#corruptionDetails {
    display: flex;
    min-height: 9em;
    visibility: hidden;
}

#corruptionName {
    font-size: 1.2em;
}

#corruptionDescription {
    color: darkviolet;
}

#corruptionLevelCurrent {
    color: var(--orchid-text-color);
}

#corruptionLevelPlanned {
    color: lime;
}

#corruptionSpiritContribution {
    color: gold;
}

#corruptionRewards {
    width: min(100%, 800px);
    margin: 5px auto 0;
    text-align: center;
}

#corruptionRewardsHeading {
    margin: 0 0 10px;
    color: white;
    font-size: 1.25em;
}

#corruptionRewardGrid {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: clamp(6px, 2vw, 28px);
}

.corruptionReward {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    max-width: 105px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

button.corruptionRewardSelector {
    min-height: 0;
    font-size: inherit;
    color: inherit;
    background-color: transparent;
}

body button.corruptionRewardSelector:hover:not(:disabled):not(.disable-hover-color),
body button.corruptionRewardSelector:active:not(:disabled):not(.disable-hover-color) {
    background-color: transparent;
}

#corruptionTesseracts {
    --corruption-reward-color: var(--tesseract-color);
}

#corruptionHypercubes {
    --corruption-reward-color: var(--hypercube-color);
}

#corruptionPlatonicCubes {
    --corruption-reward-color: var(--platonic-color);
}

#corruptionHepteracts {
    --corruption-reward-color: var(--hepteract-color);
}

.corruptionRewardSelector.selected > img,
.corruptionRewardSelector:focus-visible > img {
    outline: 2px solid var(--corruption-reward-color);
    outline-offset: 3px;
}

html[data-chal13="true"] .corruptionReward.chal13,
html[data-chal14="true"] .corruptionReward.chal14,
html[data-hepteracts="true"] .corruptionReward.hepteracts {
    display: flex;
}

.corruptionReward > img {
    width: clamp(40px, 6vw, 64px);
    height: clamp(40px, 6vw, 64px);
    object-fit: contain;
}

.corruptionAscensionIcon {
    width: clamp(40px, 6vw, 64px);
    height: clamp(40px, 6vw, 64px);
    display: grid;
    place-items: center;
}

.corruptionAscensionIcon > img {
    width: 75%;
    height: 75%;
    object-fit: contain;
}

.corruptionRewardValue {
    max-width: 100%;
    font-size: clamp(0.75em, 2vw, 1.25em);
    line-height: 1.1;
    white-space: nowrap;
}

#corruptionAscensionCount {
    color: darkorange;
}

#corruptionScoreProgress {
    --corruption-progress-color: var(--tesseract-color);

    width: min(calc(100% - 80px), 650px);
    height: 24px;
    min-height: 24px;
    position: relative;
    margin: 16px auto 0;
    overflow: hidden;
    border-radius: 12px;
    color: var(--corruption-progress-color);
    background-color: var(--blessings-hover-color);
    font-size: 1.05em;
    isolation: isolate;
}

#corruptionScoreProgress:focus-visible {
    outline: 2px solid var(--corruption-progress-color);
    outline-offset: 3px;
}

#corruptionScoreProgressFill {
    width: 0;
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    background-color: var(--corruption-progress-color);
    transition: width var(--transition-extra);
}

#corruptionScoreProgressText {
    position: relative;
    z-index: 1;
    color: black;
    font-weight: bold;
}

#ascensionAutomation {
    margin-top: 10px;
}

#ascensionAmount,
#ascensionAutoEnable,
#ascensionAutoToggle {
    width: 12em;
    min-width: 150px;
    min-height: auto;
}

#ascensionAmount {
    border: 1px solid orange;
    color: gold;
    background-color: var(--blackbtn-color);
}

#corruptionStatsLoadouts {
    min-width: 500px;
    max-width: 600px;
    margin: 10px;
    padding: 30px 10px;
    border: 1px solid orange;
    color: white;
    background-color: var(--box-color);
    text-align: center;
}

#corrCampaignsBtn,
#corrStatsBtn,
#corrLoadoutsBtn {
    min-width: 120px;
    max-width: 100%;
    border: 2px solid;
}

#corrButtonRow {
    gap: 30px;
}

.corruptionContainer {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.corruptionStatRow {
    display: flex;
    flex-flow: row;
    align-items: center;
}

.corruptionStatRow > img {
    height: 40px;
}

.corruptionDetailsModal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    line-height: 1.35;
}

.corruptionDetailsModalTitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--crimson-text-color);
    font-size: 1.1em;
}

.corruptionDetailsModalTitle img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.corruptionDetailsModalDescription {
    color: var(--corruption-details-color);
}

.corruptionDetailsModalCurrent {
    color: var(--green-text-color);
}

.corruptionDetailsModalPlanned {
    color: var(--red-text-color);
}

.corruptionDetailsModalFree {
    color: orchid;
}

.corrDesc {
    color: white;
    min-width: 240px;
    margin: 0 auto;
    text-align: center;
    line-height: 1em;
}

.corrLoadoutName:hover {
    text-decoration: underline;
    cursor: pointer;
}

.corrLoadoutNameCol {
    width: 20%;
}

.corrBtn {
    width: 30px;
    margin: 0 auto;
}

#corruptionStats button {
    white-space: nowrap;
}

.corruptionMax {
    border: 2px solid green;
    width: 3.5em;
}

.corruptionUp {
    border: 1px solid green;
    min-width: 30px;
    width: 1.5em;
}

.corruptionDown {
    border: 1px solid red;
    min-width: 30px;
    width: 1.5em;
}

.corruptionReset {
    border: 2px solid red;
    width: 3.5em;
}

#corruptionStats,
#corruptionLoadouts {
    font-size: min(1em, 20px);
    min-height: 350px;
    z-index: 1;
}

#corruptionLoadouts {
    margin-top: 10px;
}

#corruptionDisplays {
    margin-top: 5%;
}

.corrLoadoutName {
    white-space: nowrap;
}

#corruptionLoadoutTable {
    border-collapse: collapse;
    text-align: center;
    width: 100%;
}

#corruptionLoadoutTable tbody th {
    font-size: 0;
    padding: 0;
}

img.small {
    width: 32px;
}

img.corruptionImg.small {
    width: 100%;
    max-width: 32px;
}

.corrSave {
    min-height: 20px;
    min-width: 40px;
    border: 1px solid dodgerblue;
    width: 100%;
}

.corrLoad {
    min-height: 20px;
    min-width: 40px;
    border: 1px solid #5b5ddc;
    width: 100%;
}

.corrImport {
    min-height: 20px;
    min-width: 40px;
    border: 1px solid green;
    width: 100%;
}

#corruptionCleanse {
    width: 8em;
    min-width: 150px;
    margin: auto 20px;
    border: 2px solid darkmagenta;
    z-index: 2;
}

#corruptionCleanseConfirm {
    width: 100px;
    margin: auto;
    border: 2px solid green;
    visibility: hidden;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--header-color);
}

header .img {
    height: 32px;
    width: 32px;
}

#mobileHeaderContent {
    display: contents;
}

#mobileHeaderResizeHandle {
    display: none;
}

.subHeader {
    display: flex;
    flex-direction: row;
    min-width: 1250px;
    max-width: calc((38px + 7.5em) * 4 + 40em);
    min-height: 90px;
    margin-bottom: 5px;
}

.currenciesContainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    line-height: 1em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    justify-content: space-around;
    flex-basis: 55%;
}

.currencyContainer {
    display: flex;
    align-items: center;
    width: calc(38px + 7.5em);
    min-width: 150px;
}

header #quarkDisplay { color: white; }
header #coinDisplay { color: gold; }
header #diamondDisplay { color: cyan; }
header #offeringDisplay { color: gold; }
header #mythosDisplay { color: plum; }
header #mythosshardDisplay { color: plum; }
header #particlesDisplay { color: limegreen; }
header #obtainiumDisplay { color: pink; }

.statDisplay {
    padding-left: 6px;
    margin: auto 0;
    line-height: 1em;
}

.ascensionStats {
    display: flex;
    margin: 10px 0;
    min-width: 1250px;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1em;
}

.ascensionStats > span {
    display: flex;
    white-space: pre;
    align-items: center;
}

.ascensionStats img {
    height: 20px;
    margin: auto 4px auto 0;
}

#ascLen {
    color: var(--darkcyan-text-color);
    min-width: 8em; /* prevent bouncing around */
}

#ascC10 {
    color: limegreen;
}

#ascTimeAccel {
    color: royalblue;
}

#ascAscensionTimeAccel {
    color: orange;
}

#ascSingularityCount {
    color: gold;
}

#ascSingLen {
    color: gold;
}

#tabBorder {
    height: 2px;
    position: relative;
    min-width: 100%;
    z-index: 0;
}

.challengeContainer {
    display: flex;
    flex-direction: column;
    margin-bottom: auto;
    padding: 5px 10px;
    text-align: left;
    font-size: 1em;
    line-height: 1.1em;
}

#c15RewardList {
    margin-bottom: 10px;
}

.challengePortion {
    width: 26em;
    max-width: 450px;
    color: white;
    margin: 0;
}

.challengeNumber {
    height: auto;
    text-align: left;
    font-size: 1em;
}

#c15Reward26,
#c15Reward26Num { color: var(--red-text-color); }

#c15Reward29,
#c15Reward29Num { color: var(--gray-text-color); }

#c15Reward33,
#c15Reward33Num,
#c15RewardList { color: var(--orchid-text-color); }

.platonicUpgradesContainer {
    display: flex;
    flex-direction: column;
    margin-left: 30px;
}

#platonicUpgradePics {
    font-size: 0;
}

#platonicUpgrades {
    display: flex;
    margin-bottom: 30px;
}

.platonicUpgradesToggles {
    display: flex;
    flex-direction: column;
    margin-left: 5px;
    margin-top: 6px;
    row-gap: 5px;
}

.platonicUpgradesToggles > button {
    width: 130px;
    height: 32px;
}

.platonicUpgradeImage {
    background-color: var(--buttonimg-color);
    cursor: pointer;
}

.platonicContainer {
    width: 400px;
    display: flex;
    flex-direction: column;
    margin-bottom: auto;
    padding: 5px 10px;
    color: white;
    text-align: left;
    font-size: 1em;
    white-space: pre-wrap;
}

.platonicPortion {
    margin: 0;
}

.platonicUpgradeModal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.platonicUpgradeModalTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: gold;
    font-size: 1.1em;
}

.platonicUpgradeModalIcon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background-color: var(--buttonimg-color);
}

.platonicUpgradeModalDescription {
    color: white;
    line-height: 1.35;
}

.platonicUpgradeModalLevel {
    color: cyan;
}

.platonicUpgradeModalLevel.maxed,
.platonicUpgradeModalStatus.maxed {
    color: gold;
}

.platonicUpgradeModalCosts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platonicUpgradeModalCosts .affordable,
.platonicUpgradeModalStatus.affordable {
    color: var(--green-text-color);
}

.platonicUpgradeModalCosts .unaffordable,
.platonicUpgradeModalStatus.unaffordable {
    color: var(--crimson-text-color);
}

.hepteractGrid {
    display: grid;
    grid-template-columns: repeat(4, calc(60px + 3.8em * 2));
    grid-template-rows: repeat(3, calc(max(28px, 1.1em) * 3));
    margin-top: 10px;
    padding: 8px;
    grid-column: shop 2/4;
    grid-row: 1;
    column-gap: 15px;
    row-gap: 15px;
    align-self: flex-start;
    line-height: 1.2em;
    padding-bottom: 2em;
    font-size: min(1em, 20px);
}

.hepteractGrid > div {
    display: grid;
    width: calc(60px + 3.8em + 3.8em);
    grid-template-columns: 60px 3.8em 3.8em;
    grid-template-rows: repeat(2, max(28px, 1.1em));
    align-items: center;
}

.heptTypeImage {
    grid-row: 1 / 3;
    align-self: center;
}

.heptGridInventory {
    grid-column: 1 / 4;
    display: block;
}

#warpAuto,
#powderDayWarp {
    grid-column: 2 / 4;
}

.heptGridInventoryLabel,
.heptGridInventoryValue {
    float: left;
}

.heptGridInventoryValue {
    float: right;
}

.hepteractGrid button {
    border: 2px solid pink;
    width: 100%;
    min-height: 26px;
    height: 1.4em;
    line-height: 1em;
    white-space: nowrap;
    margin: auto 0;
    padding: 0;
}

#hepteractAuto {
    display: block;
}

.autoHepteractText {
    margin-bottom: 5px;
    color: lightgoldenrodyellow;
    text-align: center;
}

.meter {
    height: 1em;
    position: relative;
    background: var(--hepteract-bar-empty);
    border-radius: 5px;
    padding: 2px;
    grid-column: 1 / 4;
    text-align: center;
    align-self: center;
}

.meter > span {
    display: block;
    height: 100%;
    color: white;
}

.progressBar {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    overflow: hidden;
    left: 0;
    top: 0;
    position: absolute;
    z-index: 1;
}

.progressText {
    position: absolute;
    color: white;
    line-height: 1;
    z-index: 2;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 100%;
    white-space: nowrap;
}

#hepteractCraftTexts {
    display: flex;
    flex-direction: column;
    text-align: center;
    margin-top: 15px;
}

#hepteractCraftTexts > p {
    margin: 0;
}

#hotkeys {
    flex-direction: column;
}

.hotkeys {
    display: grid;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    margin: 20px auto;
}

.hotkeyItem {
    display: flex;
    flex-direction: row;
    margin-top: 2px;
    gap: 0 5px;
}

#hotKeyDesc {
    margin: 0;
}

#hotkeyTooltip {
    color: var(--darkorchid-text-color);
}

.actualHotkey {
    padding: 1px 15px;
    color: gold;
    min-height: 2em;
}

.resetHotkeys {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.resetHotkeys > button {
    padding: 2px 4px;
}

#saveString {
    overflow-wrap: anywhere;
}

#singularity {
    position: relative;
    padding: 0;
    text-align: center;
}

#singularityUpgradeContainer,
#singularityOcteracts,
#singularityAmbrosia,
#singularityPurple {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#singularityOcteracts {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

/* Singularity Elevator Styles */
.singularityElevatorContainer {
    border: 2px solid gold;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
}

.lookaheadInfo {
    margin: 20px;
}

.lookaheadInfo > p {
    margin: 0;
}

.elevatorControls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.elevatorTargetSection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.elevatorTargetSection label {
    color: var(--text-color);
    font-weight: bold;
}

.elevatorInput:focus {
    outline: none;
    border-color: orange;
}

.elevatorButton {
    --glow-color: gold;

    transition: background-color 0.2s ease, color 0.2s ease !important;
    border: 2px solid gold;
    border-radius: 6px;
    padding: 12px 24px;
    color: var(--text-color);
    min-width: 140px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
}

.elevatorInput {
    background-color: var(--input-color);
    border: 2px solid gold;
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-color);
    font-size: 1.1em;
    width: 100px;
    text-align: center;
    appearance: textfield;
}

.elevatorInput::-webkit-outer-spin-button,
.elevatorInput::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.elevatorButton:hover {
    background-color: white !important;
    border: 2px solid lightgoldenrodyellow;
    color: black;
    box-shadow:
        0 0 15px var(--glow-color),
        0 0 30px var(--glow-color),
        0 0 45px var(--glow-color);
}

.elevatorLockSection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.elevatorLockSection p {
    margin: 0;
}

#elevatorSettings {
    border: 2px solid white;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.elevatorToggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    justify-content: flex-start;
    width: 75%;
    height: 32px;
}

#elevatorLockToggle,
#elevatorSlowClimbToggle {
    transform: scale(2);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.elevatorToggleLabel {
    color: var(--text-color);
    font-weight: bold;
    flex: 1;
    text-align: left;
}

.elevatorLockStatus {
    margin: 5px 0;
    font-weight: bold;
    text-align: center;
}

#actualSingularityUpgradeContainer,
#octeractUpgradeContainer,
#blueberryUpgradeContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    margin-top: 5px;
    width: calc(36px * 14);
    gap: 4px;
}

#octeractUpgradeContainer {
    --octeract-line-color: lightseagreen;
    --octeract-icon-size: 46px;

    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: fit-content;
    max-width: 94vw;
    padding: 0 18px 18px;
    margin: 10px;
}

.octeractUpgradeLines {
    position: relative;
    display: grid;
    grid-template-columns: max-content max-content max-content;
    padding: 10px 0 0;
}

#octeractUpgradeContainer [data-octeract-line="core"] { --octeract-line-color: #2dd4bf; }
#octeractUpgradeContainer [data-octeract-line="goldenQuarks"] { --octeract-line-color: #facc15; }
#octeractUpgradeContainer [data-octeract-line="quarks"] { --octeract-line-color: #38bdf8; }
#octeractUpgradeContainer [data-octeract-line="daily"] { --octeract-line-color: #f472b6; }
#octeractUpgradeContainer [data-octeract-line="freeLevels"] { --octeract-line-color: #f472b6; }
#octeractUpgradeContainer [data-octeract-line="ascensions"] { --octeract-line-color: #e2e8f0; }
#octeractUpgradeContainer [data-octeract-line="speed"] { --octeract-line-color: #c084fc; }
#octeractUpgradeContainer [data-octeract-line="corruption"] { --octeract-line-color: #e2e8f0; }
#octeractUpgradeContainer [data-octeract-line="tokens"] { --octeract-line-color: #fb7185; }
#octeractUpgradeContainer [data-octeract-line="resources"] { --octeract-line-color: #34d399; }
#octeractUpgradeContainer [data-octeract-line="potions"] { --octeract-line-color: #4ade80; }
#octeractUpgradeContainer [data-octeract-line="shop"] { --octeract-line-color: #22c55e; }
#octeractUpgradeContainer [data-octeract-line="talismans"] { --octeract-line-color: #a78bfa; }
#octeractUpgradeContainer [data-octeract-line="blueberries"] { --octeract-line-color: #fb923c; }
#octeractUpgradeContainer [data-octeract-line="ambrosiaLuck"] { --octeract-line-color: #fb923c; }
#octeractUpgradeContainer [data-octeract-line="ambrosiaGeneration"] { --octeract-line-color: #fb923c; }

.octeractUpgradeSpine {
    position: relative;
    grid-column: 2;
    width: 4px;
}

.octeractUpgradeSpine::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-color: var(--octeract-line-color);
    box-shadow: 0 0 6px var(--octeract-line-color);
    content: '';
}

.octeractUpgradeLines > :first-child + .octeractUpgradeSpine::before {
    top: 50%;
    border-radius: 2px 2px 0 0;
}

.octeractUpgradeSpine:nth-last-child(2)::before {
    bottom: 50%;
    border-radius: 0 0 2px 2px;
}

.octeractUpgradeSpine::after {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 3px solid white;
    border-radius: 50%;
    background-color: var(--box-color);
    box-shadow: 0 0 6px var(--octeract-line-color);
    content: '';
    transform: translate(-50%, -50%);
}

.octeractUpgradeTrack {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 18px);
    min-height: calc(var(--octeract-icon-size) + 16px);
}

.octeractUpgradeTrackLeft {
    grid-column: 1;
    flex-direction: row-reverse;
    justify-self: end;
    padding-right: 28px;
}

.octeractUpgradeTrackRight {
    grid-column: 3;
    justify-self: start;
    padding-left: 28px;
}

.octeractUpgradeTrack::before {
    position: absolute;
    z-index: 0;
    top: 50%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--octeract-line-color);
    box-shadow: 0 0 6px var(--octeract-line-color);
    content: '';
    transform: translateY(-50%);
}

.octeractUpgradeTrackLeft::before {
    right: -4px;
    left: calc(var(--octeract-icon-size) / 2);
}

.octeractUpgradeTrackRight::before {
    right: calc(var(--octeract-icon-size) / 2);
    left: -4px;
}

#octeractUpgradeContainer .octeractUpgrade {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 var(--octeract-icon-size);
    place-items: center;
    box-sizing: border-box;
    width: var(--octeract-icon-size);
    height: var(--octeract-icon-size);
    padding: 4px;
    border: 3px solid var(--octeract-line-color);
    border-radius: 11px;
    background-color: var(--button-color);
    box-shadow: 0 0 0 2px var(--box-color);
    transition: box-shadow 120ms ease, transform 120ms ease;
}

#octeractUpgradeContainer .octeractUpgrade::after {
    position: absolute;
    right: -7px;
    bottom: -8px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-width: 18px;
    height: 16px;
    padding: 0 3px;
    border: 1px solid var(--octeract-line-color);
    border-radius: 8px;
    background-color: var(--box-color);
    color: var(--text-color);
    content: attr(data-octeract-level);
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    white-space: nowrap;
}

#octeractUpgradeContainer .octeractUpgrade:not([data-octeract-level])::after {
    display: none;
}

#octeractUpgradeContainer .octeractUpgradeFreeLevels::before {
    position: absolute;
    z-index: 2;
    top: -6px;
    left: -6px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--box-color);
    border-radius: 50%;
    background-color: orange;
    box-shadow: 0 0 6px orange;
    content: '';
}

#octeractUpgradeContainer .octeractUpgradeAffordable {
    box-shadow:
        0 0 0 2px var(--box-color),
        0 0 0 4px lightseagreen,
        0 0 13px lightseagreen;
}

#octeractUpgradeContainer .octeractUpgradeAffordable:not(.octeractUpgradeMaxed) {
    box-shadow:
        0 0 0 2px var(--box-color),
        0 0 13px lightseagreen;
    outline: 2px dotted lightseagreen;
    outline-offset: 2px;
}

#octeractUpgradeContainer .octeractUpgradeMaxed {
    box-shadow:
        0 0 0 2px var(--box-color),
        0 0 0 4px plum,
        0 0 11px plum;
}

#octeractUpgradeContainer .octeractUpgrade:hover,
#octeractUpgradeContainer .octeractUpgrade:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
    transform: translateY(-2px) scale(1.05);
}

#octeractUpgradeContainer .octeractUpgrade:active {
    transform: translateY(0) scale(0.98);
}

.octeractUpgradeTrack:not(:has(.octeractUpgrade:not(.upgradeHiddenByMaxLevel))) {
    display: none;
}

.octeractUpgradeTrackLeft:not(:has(.octeractUpgrade:not(.upgradeHiddenByMaxLevel)))
+ .octeractUpgradeSpine:not(:has(+ .octeractUpgradeTrackRight .octeractUpgrade:not(.upgradeHiddenByMaxLevel)))::after {
    display: none;
}

@media (width <= 768px) {
    #singularityOcteracts {
        flex-direction: column;
    }

    #octeractUpgradeContainer {
        --octeract-icon-size: 30px;

        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        padding: 0 8px 12px;
        overflow-x: auto;
    }

    .octeractUpgradeLines {
        justify-content: center;
    }

    .octeractUpgradeTrack {
        gap: 7px;
    }

    .octeractUpgradeTrackLeft {
        padding-right: 16px;
    }

    .octeractUpgradeTrackRight {
        padding-left: 16px;
    }

    #octeractUpgradeContainer .octeractUpgrade > img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

.upgradeVisibilityControls {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.toggleMaxedUpgrades {
    border: 2px solid green;
    min-width: 15em;
}

#toggleMaxedOcteractUpgrades {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    min-width: 0;
    padding: 5px;
    margin: 2px;
}

.upgradeHiddenByMaxLevel {
    display: none !important;
}

#blueberryUpgradeContainer {
    --ambrosia-cell-size: 32px;
    --ambrosia-grid-gap: 4px;
    --ambrosia-side-width: calc(8 * var(--ambrosia-cell-size) + 7 * var(--ambrosia-grid-gap));
    --ambrosia-zodiac-width: calc(2 * var(--ambrosia-cell-size) + var(--ambrosia-grid-gap));

    overflow-x: auto;
    flex-direction: column;
    width: unset;
}

#ambrosiaWorkspace {
    width: 60em;
    max-width: calc(100% - 20px);
}

#ambrosiaLedger {
    container: ambrosia-ledger / inline-size;
    width: 100%;
    margin: 5px 0;
    color: var(--text-color);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

#ambrosiaLedger p {
    margin: 0;
}

#ambrosiaLedger [hidden] {
    display: none;
}

.ambrosiaLedgerRow {
    /* Reserve two comma-formatted nine-digit balances, plus the icon and its gap. */
    display: grid;
    grid-template-columns: min(50%, calc(24ch + 40px)) minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    padding: 3px 0;
}

.ambrosiaLedgerRow + .ambrosiaLedgerRow {
    margin-top: 0.5em;
}

#redAmbrosiaDisplay {
    margin-top: 0;
    padding-top: 0;
}

.ambrosiaLedgerRow > div,
.ambrosiaLedgerResource > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ambrosiaLedgerResource {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ambrosiaLedgerGeneration {
    text-align: right;
}

#ambrosiaAmountPerGeneration,
#redAmbrosiaAmountPerGeneration {
    font-size: 0.85em;
}

.ambrosiaLedgerBonuses {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
}

.ambrosiaLedgerBonuses:not(:has(> :not([hidden]))) {
    display: none;
}

.ambrosiaLedgerResource > img {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ambrosiaLedgerCurrent {
    font-size: 1.15em;
}

.ambrosiaLedgerTotal {
    display: inline-block;
    max-width: 100%;
    font-size: 0.85em;
}

#blueberryDisplay {
    color: lightblue;
}

.ambrosiaLedgerEmpty .ambrosiaLedgerCurrent {
    color: var(--gray-text-color);
}

#purpleAmbrosiaDisplay {
    color: var(--purple-text-color);
}

.ambrosiaLedgerBonuses > p {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5ch;
}

/* Text determines the bar height so large values can wrap without clipping. */
.ambrosiaLedgerProgress {
    grid-column: 1 / -1;
    justify-self: center;
    width: 50%;
    min-width: 0;
    min-height: 24px;
    position: relative;
    overflow: hidden;
    background-color: black;
    border: 1px solid #006;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}

.ambrosiaLedgerProgress > div {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, navy, darkturquoise);
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.ambrosiaLedgerProgress > span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: inherit;
    padding: 0 4px;
    overflow-wrap: anywhere;
    color: white;
    font-weight: bold;
    text-align: center;
}

#pixelProgressBar {
    border-color: maroon;
}

#pixelProgress {
    background: linear-gradient(to right, maroon, red);
}

/* Stack based on the panel width, including when text is enlarged. */
@container ambrosia-ledger (width <= 42em) {
    .ambrosiaLedgerRow {
        grid-template-columns: minmax(0, 1fr);
    }

    .ambrosiaLedgerGeneration {
        text-align: left;
    }

    .ambrosiaLedgerProgress {
        width: 100%;
    }
}

@media (any-pointer: coarse) {
    .ambrosiaLedgerProgress,
    .ambrosiaLedgerBalance {
        min-height: 44px;
    }
}

.purpleUpgradeAP {
    grid-area: ap;
    margin: 0;
    padding: 0 10px;
    text-align: center;
}

.purplePopup {
    --purple-popup-close-size: 34px;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    color: white;
    font-size: 16px;
    text-align: left;
}

.purplePopup[hidden] {
    display: none;
}

.purplePopupHeader {
    display: grid;
    flex-shrink: 0;
    grid-template-columns: var(--purple-popup-close-size) minmax(0, 1fr) var(--purple-popup-close-size);
    align-items: center;
    padding: 7px;
    border-bottom: 1px solid rgb(176 0 176 / 55%);
    background-color: var(--box-color);
}

.purpleUpgradeHeader {
    grid-template-areas: ". ap close";
}

#singularityPurple {
    position: absolute;
    z-index: 3;
    top: 8px;
    right: -3px;
    left: -3px;
    height: min(70vh, 600px);
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgb(0 0 0 / 70%);
}

#singularityPurple[hidden] {
    display: none;
}

#singularityPurple .scrollbar {
    scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color);
}

#singularityPurple:where(.purpleSynthesisOpen) {
    bottom: -3px;
    height: auto;
}

#purpleReactantContainers.purplePopupOpen {
    overflow: visible;
}

.purplePopupClose {
    display: grid;
    grid-area: close;
    place-items: center;
    width: var(--purple-popup-close-size);
    height: var(--purple-popup-close-size);
    padding: 0;
    border: 1px solid var(--purple-text-color);
    border-radius: 3px;
    background-color: var(--box-color);
    color: var(--purple-text-color);
    font: inherit;
    font-size: 1.35em;
    line-height: 1;
    cursor: pointer;
}

#singularityPurple .purplePopupClose:is(:hover, :focus-visible) {
    background-color: rgb(176 0 176 / 22%);
    box-shadow: 0 0 7px var(--purple-text-color);
}

.synthesisHeader {
    grid-template-areas:
        ". heading close"
        ". conversion .";
}

.synthesisTitle,
:where(.synthesisSource, .synthesisProduct, .synthesisUpgradeCard) p {
    margin: 0;
}

.synthesisTitle {
    grid-area: heading;
    color: var(--purple-text-color);
    font-size: 20px;
    text-align: center;
}

.synthesisConversion {
    grid-area: conversion;
    margin: 0;
    color: lightgray;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
}

.synthesisConversionRed {
    color: red;
}

.synthesisConversionPurple {
    color: var(--purple-text-color);
}

.synthesisWorkspace {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.synthesisConversionWorkspace {
    min-width: 0;
}

.synthesisUpgradeRegion {
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border-left: 1px solid rgb(176 0 176 / 35%);
}

.synthesisUpgradeModal {
    border: 2px solid var(--purple-box-color);
    background-color: var(--box-color);
}

.synthesisUpgradeModalTitle {
    margin: 0;
    padding: 7px;
    border-bottom: 1px solid rgb(176 0 176 / 55%);
    color: var(--purple-text-color);
    font-size: 20px;
    text-align: center;
}

.synthesisUpgradeList {
    display: grid;
    gap: 7px;
    padding: 7px;
}

.synthesisUpgradeCard {
    padding: 6px;
    border: 1px solid rgb(176 0 176 / 45%);
    background-color: var(--box-color);
}

.synthesisUpgradeHeading {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
}

.synthesisUpgradeHeading > img,
.synthesisSource > img,
.synthesisProduct > img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.synthesisUpgradeFlavor,
.synthesisUpgradeEffect,
.synthesisUpgradeNextCost,
.synthesisUpgradeAP {
    margin-top: 4px;
    line-height: 1.2;
}

.synthesisUpgradeTitle {
    color: white;
    font-weight: bold;
    line-height: 1.1;
}

.synthesisUpgradeLevel {
    color: lightgray;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.synthesisUpgradeFlavor {
    color: silver;
    font-style: italic;
}

.synthesisUpgradeEffect {
    color: white;
}

.synthesisUpgradeEffectMaxed {
    color: plum;
}

.synthesisUpgradeNextCost {
    color: lightgray;
}

.synthesisUpgradeAP {
    color: gold;
}

.synthesisUpgradePurchaseButtons,
#purpleUpgradeDetailButtons {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.synthesisUpgradePurchaseButtons {
    margin-top: 6px;
}

.synthesisUpgradePurchaseButton {
    flex: 1 1 4.5em;
    font: inherit;
    cursor: pointer;
}

.synthesisUpgradePurchaseButton,
#purpleUpgradeDetailButtons > button {
    max-width: 100%;
    min-height: 34px;
    padding: 3px 10px;
    border: 2px solid var(--purple-text-color);
    color: white;
    line-height: 1.3;
    white-space: pre-line;
}

.synthesisUpgradePurchaseButton:disabled {
    border-color: #555;
    color: gray;
    cursor: not-allowed;
}

.synthesisMap {
    display: grid;
    grid-template-areas:
        "inputs"
        "product";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(62px, auto);
    align-items: center;
    width: min(100%, 760px);
    margin: 0 auto;
    column-gap: 16px;
    row-gap: 10px;
    padding: 16px 18px 12px;
}

.synthesisInputs {
    display: grid;
    grid-area: inputs;
    grid-template-columns: repeat(2, minmax(0, 240px));
    justify-content: center;
    gap: 16px;
}

.synthesisSource,
.synthesisProduct {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 2px solid var(--synthesis-resource-color, var(--purple-text-color));
    border-radius: 3px;
    background-color: var(--box-color);
}

.synthesisSource {
    gap: 7px;
    padding: 7px;
    transition: border-color 150ms ease;
}

.synthesisSource > div,
.synthesisProduct > div {
    min-width: 0;
}

.synthesisSourceName,
.synthesisProductName {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.15;
}

.synthesisSourceName {
    color: var(--synthesis-resource-color);
}

.synthesisBalance {
    margin-top: 3px;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.synthesisBalance.fitText,
.synthesisProductStat.fitText {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
}

.synthesisBalance,
.synthesisProductStat {
    color: lightgray;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.synthesisSourceRed {
    --synthesis-resource-color: red;
}

.synthesisSourceHoney {
    grid-template-columns: minmax(0, 1fr) 32px;

    --synthesis-resource-color: #ff5cff;
}

.synthesisSourceHoney > img {
    grid-column: 2;
}

.synthesisSourceHoney > div {
    grid-column: 1;
    grid-row: 1;
}

@media (width > 600px) {
    .synthesisSource {
        width: min(100%, 240px);
    }

    .synthesisSourceRed {
        justify-self: end;
    }

    .synthesisSourceRed > div {
        text-align: right;
    }

    .synthesisSourceHoney {
        justify-self: start;
    }

    .synthesisProduct {
        width: min(100%, 240px);
        justify-self: center;
    }
}

.synthesisProduct {
    grid-area: product;
    gap: 10px;
    padding: 10px;
}

.synthesisProductName {
    color: var(--purple-text-color);
}

.synthesisProductStat {
    margin-top: 2px;
}

.synthesisResourceInsufficient {
    border-color: #555;
}

.synthesisResourceInsufficient > img {
    filter: grayscale(0.5);
    opacity: 0.55;
}

.synthesisCrafting {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 14px;
}

.synthesisCraftableTitle {
    margin: 0;
    color: lightgray;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

#synthesisCraftButtons {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.synthesisCraftButtonRow {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.synthesisCraftButtonRow[hidden] {
    display: none;
}

.synthesisCraftButtonRow > button {
    flex: 0 1 140px;
    width: 140px;
    max-width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 5px 7px;
    border: 2px solid var(--purple-text-color);
    border-radius: 2px;
    background-color: var(--button-color);
    color: white;
    font: inherit;
    line-height: 1.2;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.synthesisCraftButtonRow > button:hover,
.synthesisCraftButtonRow > button:focus-visible {
    background-color: var(--hover-color);
}

.synthesisCraftButtonRow > button:disabled {
    border-color: #555;
    background-color: var(--box-color);
    color: gray;
    cursor: not-allowed;
}

#synthesisAutomationUnlock {
    flex-basis: 300px;
    width: 300px;
}

#purpleUpgradeShop {
    display: flex;
    flex: 1;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
}

#purpleUpgradeFamilyList {
    display: flex;
    flex: 0 1 47%;
    flex-direction: column;
    min-width: 390px;
    min-height: 0;
    overflow-y: auto;
    border-right: 1px solid var(--purple-box-color);
    scrollbar-width: thin;
}

.purpleUpgradeSectionHeader {
    flex-shrink: 0;
    margin: 8px 8px 2px;
    color: var(--purple-text-color);
    font-size: 0.875em;
}

.purpleUpgradeFamilyRow {
    display: flex;
    flex-shrink: 0;
    align-items: stretch;
    border-left: 3px solid transparent;
    background: none;
    color: white;
}

.purpleUpgradeFamilyRow:where(:hover) {
    background-color: rgb(255 255 255 / 8%);
}

.purpleUpgradeFamilySelected {
    border-left-color: var(--purple-text-color);
    background-color: rgb(176 0 176 / 12%);
}

.purpleUpgradeFamilyButton {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 5px 8px;
    border: 0;
    background: none;
    color: white;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.purpleUpgradeFamilyRowIcon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.purpleUpgradeFamilyRowInfo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.purpleUpgradeFamilyRowName {
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.purpleUpgradeFamilyRowTiers {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 3px;
    padding: 4px 8px 4px 0;
}

.purpleUpgradeTierShortcut {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 2px;
    border: 1px solid gray;
    border-radius: 2px;
    background: none;
    cursor: pointer;
}

.purpleUpgradeTierShortcut > img {
    width: 20px;
    height: 20px;
}

.purpleUpgradeFamilyRowCost {
    color: var(--purple-text-color);
    font-size: 0.75em;
    line-height: 1.15;
}

.purpleUpgradeCantAfford {
    color: gray;
}

.purpleUpgradeFamilyMaxed {
    color: gold;
}

#purpleUpgradeDetail {
    display: flex;
    flex: 1 1 53%;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    overflow-y: auto;
    text-align: center;
}

#purpleUpgradeTierRail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.purpleUpgradeTierChip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 70px;
    padding: 6px 8px;
    border: 1px solid gray;
    background: none;
    color: white;
    font: inherit;
    font-size: 0.75em;
    cursor: pointer;
}

.purpleUpgradeTierChip > img {
    width: 52px;
    height: 52px;
}

.purpleUpgradeTierShortcutSelected,
.purpleUpgradeTierSelected {
    border-color: var(--purple-text-color);
    outline: 1px solid var(--purple-text-color);
    outline-offset: 1px;
}

.purpleUpgradeTierShortcutMaxed,
.purpleUpgradeTierMaxed {
    border-color: gold;
}

#purpleUpgradeDetailText {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    line-height: 1.3;
    overflow-wrap: break-word;
}

#purpleUpgradeDetailText p {
    margin: 0;
}

.purpleUpgradeDetailSecondary {
    font-size: 0.875em;
}

#purpleUpgradeDetailButtons > button {
    flex: 0 1 140px;
    width: 140px;
}

#purpleUpgradeDetailButtons > button:disabled {
    border-color: gray;
    color: gray;
    cursor: not-allowed;
}

.ambrosiaUpgradeActions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2px;
    width: 100%;
    gap: var(--ambrosia-grid-gap);
}

/* Independent sections let blueberry groups grow without shifting the Zodiac columns. */
#ambrosiaUpgradeGrid {
    display: grid;
    grid-template-columns: var(--ambrosia-side-width);
    justify-content: center;
    align-items: start;
    gap: 12px;
    min-width: max-content;
    padding: 2px;
}

#blueberryUpgradeContainer[data-ambrosia-layout="red"] #ambrosiaUpgradeGrid {
    grid-template-columns: repeat(2, var(--ambrosia-side-width));
}

#blueberryUpgradeContainer[data-ambrosia-layout="purple"] #ambrosiaUpgradeGrid {
    grid-template-columns: var(--ambrosia-side-width) var(--ambrosia-zodiac-width) var(--ambrosia-side-width);
}

.ambrosiaUpgradeSection {
    display: grid;
    grid-template-rows: repeat(6, var(--ambrosia-cell-size));
    align-content: start;
    gap: 8px var(--ambrosia-grid-gap);
    min-width: 0;
}

.ambrosiaUpgradeGroup {
    display: grid;
    grid-template-columns: repeat(auto-fit, var(--ambrosia-cell-size));
    justify-content: start;
    gap: var(--ambrosia-grid-gap);
}

#blueberryUpgradeGroups {
    order: 1;
    grid-template-columns: var(--ambrosia-cell-size) minmax(0, 1fr);
    direction: ltr;
}

#redAmbrosiaUpgradeGroups {
    order: -1;
    direction: rtl;
}

#redAmbrosiaUpgradeGroups button {
    direction: ltr;
}

.blueberryUpgradeGroup {
    grid-column: 2;
}

.blueberryUpgradeGroup[data-upgrade-group="general"] {
    grid-column: 1;
    grid-row: 1 / span 6;
    grid-template-columns: var(--ambrosia-cell-size);
    grid-template-rows: repeat(6, var(--ambrosia-cell-size));
    row-gap: 8px;
}

.ambrosiaUpgradeGroup > :is(button, div),
.ambrosiaUpgradeSection[data-ambrosia-kind="purple"] > :is(button, div) {
    width: var(--ambrosia-cell-size);
    height: var(--ambrosia-cell-size);
}

.ambrosiaUpgradeSection[data-ambrosia-kind="purple"] {
    grid-template-columns: repeat(2, var(--ambrosia-cell-size));
}

#blueberryUpgradeContainer[data-ambrosia-layout="blueberry"] .Exalt5x1,
#blueberryUpgradeContainer:not([data-ambrosia-layout="purple"]) .Exalt9x1 {
    display: none;
}

.ambrosiaUpgradeUnlockHint {
    display: none;
    margin: 6px 0;
    text-align: center;
}

#blueberryUpgradeContainer[data-ambrosia-layout="blueberry"] [data-ambrosia-next="red"],
#blueberryUpgradeContainer[data-ambrosia-layout="red"] [data-ambrosia-next="purple"] {
    display: block;
}

.singularityUpgrade,
.octeractUpgrade,
.singularityChallenge {
    font-size: 0;
    cursor: pointer;
}

.ambrosiaLoadoutBtn {
    width: 20%;
    height: 30px;
    cursor: pointer;
    text-align: center;
}

#showCurrAmbrosiaUpgrades {
    width: 8%;
    height: 30px;
    cursor: pointer;
    text-align: center;
    border: 2px solid orange;
}

.blueberryLoadoutSlot {
    height: 32px;
    width: 32px;
    border: 2px solid blue;
}

.blueberryLoadoutSlot.activeBlueberryLoadout {
    background-color: #1d4ed8;
    border-color: deepskyblue;
    color: white;
    font-weight: bold;
}

#ambrosiaEditLevels.ambrosiaEditingToggled {
    background-color: #4a2c00;
    border-color: gold;
    color: gold;
}

#blueberryUpgradeContainer.ambrosiaEditing .blueberryUpgrade {
    outline: 1px dashed orange;
    outline-offset: -1px;
}

.ambrosiaEditModal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.ambrosiaEditModal .modalBtnBuy {
    width: auto;
    min-width: 60px;
    margin: 0;
    padding: 0 10px;
}

.ambrosiaEditModal .modalBtnBuy:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.ambrosiaEditModal .ambrosiaEditSave {
    border-color: lime;
}

.ambrosiaEditModal .ambrosiaEditDiscard {
    border-color: crimson;
}

.blueberryLoadoutSetting {
    height: 32px;
    width: 192px;
    border: 2px solid blue;
}

.rainbowBorder {
    width: 64px;
    height: 64px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rainbowBorder > img {
    position: relative;
    width: calc(100% - 6px); /* 58px */
    height: calc(100% - 6px);
    object-fit: none;
    background-color: var(--bg-color);
    border-radius: 3px;
}

.singularityChallenges > .rainbowBorder > img {
    /* Sprite dimensions are applied inline, so preserve the original 3px inset. */
    clip-path: inset(3px round 3px);
}

.rainbowBorder:hover {
    cursor: pointer;
    background-color: var(--hover-color);
}

.rainbowBorder::before {
    position: absolute;
    width: 150%; /* 96px */
    height: 150%;
    background-image: conic-gradient(#ca001f, #ffb17f, #fff200, #22b14c, #767dda, #a349a4, #ca001f);
    animation: 3s linear infinite rotaterainbow;
    animation-play-state: inherit; /* For easier pause if needed */
    content: "";
}

@keyframes rotaterainbow {
    to { transform: rotate(360deg); }
}

@keyframes rainbow-border {
    0% { border-color: #f00; }
    16.67% { border-color: #ff7f00; }
    33.33% { border-color: #ff0; }
    50% { border-color: #0f0; }
    66.67% { border-color: #00f; }
    83.33% { border-color: #8b00ff; }
    100% { border-color: #f00; }
}

.talismanRarityRainbowBorder {
    border: 2px solid #f00;
    animation: rainbow-border 2s linear infinite;
}

.rainbowText,
.godlikeText,
.perfectText {
    color: transparent;
    background-clip: text;
    animation: rainbow-animation 5s linear infinite;
}

.rainbowText {
    background-image: linear-gradient(90deg, #ca001f, #ffb17f, #fff200, #22b14c, #767dda, #a349a4, #ca001f, #ffb17f);
    background-size: 700%;
}

.godlikeText,
.perfectText {
    background-size: 300%;
}

.godlikeText {
    background-image: linear-gradient(90deg, violet, hotpink, magenta, white, magenta, hotpink, violet, hotpink, magenta, white);
}

.perfectText {
    background-image: linear-gradient(90deg, blueviolet, mediumorchid, gold, yellow, gold, mediumorchid, blueviolet, mediumorchid, gold, yellow);
}

@keyframes rainbow-animation {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.gradientText {
    color: transparent;
    background-image: linear-gradient(90deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    background-clip: text;
    background-size: 700%;
    animation: gradient-animation 5s linear infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.transcendedBallerGradient {
    --gradient-start: orchid;
    --gradient-end: #a741a7;
}

.reincarnatedBallerGradient {
    --gradient-start: green;
    --gradient-end: greenyellow;
}

.ascendedBallerGradient {
    --gradient-start: orange;
    --gradient-end: yellow;
}

.singularityGradient {
    --gradient-start: gold;
    --gradient-end: lightgoldenrodyellow;
}

.bellGradient {
    --gradient-start: gold;
    --gradient-end: darkgoldenrod;
}

.lotusGradient {
    --gradient-start: purple;
    --gradient-end: pink;
}

.singularityUpgrade > img,
.octeractUpgrade > img,
.singularityChallenge img {
    cursor: pointer;
}

#singularityInfo {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-content: center;
}

#singularityPenaltiesMultiline {
    align-self: center;
    white-space: pre-line;
    justify-content: center;
    margin-top: 1px;
    margin-bottom: 1px;
}

#singularityPerksGrid {
    position: relative;
    display: flex;
    justify-content: center;
    width: min(50vw, 760px);
    box-sizing: border-box;
    margin: 4px auto 0;
    font-size: 1em;
    overflow: visible;
}

.singularityPerkTreeCanvas {
    position: relative;
    isolation: isolate;
    width: min(100%, 760px);
    height: clamp(440px, 50vh, 520px);
    box-sizing: border-box;
}

#singularityPerkTreeConnections {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.singularityPerkTreeConnection {
    fill: none;
    stroke: rgb(218 165 32 / 68%);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.singularityPerkTreeConnectionNew {
    stroke: gold;
    stroke-width: 2.25;
    filter: drop-shadow(0 0 3px gold);
}

.singularityPerkTreeConnectionPreview {
    stroke: rgb(218 165 32 / 30%);
    stroke-dasharray: 4 4;
}

.singularityPerkTreeJunction {
    fill: goldenrod;
    stroke: var(--box-color);
    stroke-width: 1;
}

.singularityPerkModal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.singularityPerkModalTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: gold;
    font-size: 1.1em;
    flex-wrap: wrap;
}

.singularityPerkModalTitle img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.singularityPerkModalLevel {
    color: lightgoldenrodyellow;
}

.singularityPerkModalNextLevel {
    color: white;
}

.singularityPerkModalDescription {
    line-height: 1.35;
    white-space: pre-line;
}

#ambrosiaUpgradeValues {
    width: 100%;
}

#goldenQuarkMultiline,
#singularityAmbrosiaMultiline {
    white-space: pre-line;
    margin: 15px auto 0;
    justify-content: center;
    width: 40%;
    text-align: center;
}

#accountSubTab {
    white-space: pre-line;
    margin: 15px 0 0;
    justify-content: center;
    flex-direction: column;
}

#singularityChallengeDetails,
.singularityChallengeDetails {
    display: block;
}

#singularityChallengesInfo,
.singularityChallengesInfo {
    white-space: pre-line;
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: center;
}

#singularityChallengeAllRewards,
.singularityChallengeAllRewards {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-template-columns: repeat(2, minmax(0, 375px));
    justify-content: center;
    gap: 10px;
}

#singularityChallengeScalingHeader,
.singularityChallengeScalingHeader {
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    margin: 0;
}

#singularityChallengeUniqueHeader,
.singularityChallengeUniqueHeader {
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    margin: 0;
}

#singularityChallengesScalingRewards,
.singularityChallengesScalingRewards {
    display: block;
    white-space: pre-line;
    margin: 0;
    text-align: center;
}

#singularityChallengesUniqueRewards,
.singularityChallengesUniqueRewards {
    display: block;
    white-space: pre-line;
    margin: 0;
}

.newPerk,
.oldPerk {
    --singularity-perk-recent-glow: 0 0 0 0 transparent;
    --singularity-perk-upcoming-glow: 0 0 0 0 transparent;

    position: absolute;
    z-index: 2;
    top: var(--singularity-perk-tree-y);
    left: var(--singularity-perk-tree-x);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    padding: 2px;
    cursor: pointer;
    background: linear-gradient(145deg, var(--button-color), var(--box-color));
    border-radius: 6px;
    box-shadow:
        0 3px 8px rgb(0 0 0 / 35%),
        var(--singularity-perk-recent-glow),
        var(--singularity-perk-upcoming-glow);
    transform: translate(-50%, -50%);
    transition:
        color var(--transition-extra),
        background-color var(--transition-extra),
        border-color var(--transition-extra),
        box-shadow var(--transition-extra),
        transform var(--transition-extra);
}

.singularityPerkRecentlyUpgraded {
    border: 2px solid gold;

    --singularity-perk-recent-glow: 0 0 4px gold;
}

.singularityPerkRecentlyUnlocked {
    border: 2px solid limegreen;

    --singularity-perk-recent-glow: 0 0 4px limegreen;
}

.singularityPerkNextUpgrade {
    --singularity-perk-upcoming-glow: 0 0 4px white;
}

.oldPerk {
    border: 2px solid rgb(218 165 32 / 68%);
}

.singularityPerkPreview {
    filter: grayscale(1) brightness(0.35) blur(1px);
    opacity: 0.75;
}

.singularityPerkNode > img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.newPerk:hover,
.oldPerk:hover,
.newPerk:focus-visible,
.oldPerk:focus-visible {
    background-color: var(--hover-color);
    box-shadow:
        0 5px 14px rgb(218 165 32 / 30%),
        var(--singularity-perk-recent-glow),
        var(--singularity-perk-upcoming-glow);
}

.newPerk:focus-visible,
.oldPerk:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

#autoHepteractPercentage {
    display: block;
    width: 100%;
    text-align: center;
    padding-bottom: 5px;
}

#event {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.event-container {
    border-radius: 8px;
    padding: 15px;
}

.event-title {
    margin: 0 0 10px;
    color: #ffd700;
}

#event-bonus,
#event-timer,
.event-timer {
    margin: 5px 0;
}

#globalEventBonus,
#globalEventTimer {
    color: #8f8;
}

.temporaryBuffContainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.eventBuffVal,
.consumableBuffVal {
    display: flex;
    align-items: center;
}

.eventBuffVal img,
.consumableBuffVal img {
    margin: 0;
    padding: 0;
    height: 32px;
    width: 32px;
}

.eventBuffVal p,
.consumableBuffVall p {
    margin: 0;
    padding: 0;
}

.consumableButton,
#apply-tips {
    border: 2px solid #ffd700;
    background-color: #ffd700;
    color: black;
    cursor: pointer;
    padding: 5px;
    margin: 5px;
    width: 150px;
}

#apply-tips:not(:hover) {
    border: 2px solid var(--hovershop-color);
    background-color: var(--hovershop-color);
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(359deg);
    }
}

*[class^="hoveredBlueberryLoadout"] div[class^="bbPurchasedLoadout"] {
    background-color: green;
}

.blueberryPrereq {
    outline: 2px solid red;
    outline-offset: -2px;
}

.blueberryPrereqMet {
    outline-color: var(--lime-text-color);
}

.redAmbrosiaTarget {
    outline: 2px solid red;
    outline-offset: -2px;
}

.ambrosiaPrerequisites {
    display: block;
    margin: 6px 0;
    text-align: left;
    white-space: normal;
}

.ambrosiaPrerequisiteHeading {
    display: block;
    margin-bottom: 4px;
    color: lightgray;
    font-size: 0.875em;
}

.ambrosiaPrerequisiteList {
    display: contents;
}

.ambrosiaDependencyGraph {
    /* A 3px shaft keeps all three prerequisite bands visible at the same arrow size. */
    --ambrosia-arrow-shaft-height: 3px;
    --ambrosia-arrow-row: 2;
    --ambrosia-arrow-fill: var(--ambrosia-prerequisite-1-color);

    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 40px;
    align-items: center;
}

.ambrosiaDependencyGraph[data-prerequisite-count="1"] {
    --ambrosia-arrow-row: 1;
}

/* With two prerequisites, the arrow sits exactly at the boundary between their rows. */
.ambrosiaDependencyGraph[data-prerequisite-count="2"] {
    --ambrosia-arrow-fill: linear-gradient(
        to bottom,
        var(--ambrosia-prerequisite-1-color) 50%,
        var(--ambrosia-prerequisite-2-color) 50%
    );

    grid-template-rows: auto 0 auto;
}

.ambrosiaDependencyGraph[data-prerequisite-count="2"] .ambrosiaPrerequisite:last-child {
    grid-row: 3;
}

.ambrosiaDependencyGraph[data-prerequisite-count="3"] {
    --ambrosia-arrow-band-half: calc(var(--ambrosia-arrow-shaft-height) / 6);
    --ambrosia-arrow-fill: linear-gradient(
        to bottom,
        var(--ambrosia-prerequisite-1-color) calc(50% - var(--ambrosia-arrow-band-half)),
        var(--ambrosia-prerequisite-2-color) calc(50% - var(--ambrosia-arrow-band-half))
            calc(50% + var(--ambrosia-arrow-band-half)),
        var(--ambrosia-prerequisite-3-color) calc(50% + var(--ambrosia-arrow-band-half))
    );
}

.ambrosiaPrerequisite {
    --ambrosia-prerequisite-color: red;

    position: relative;
    grid-column: 1;
    align-self: stretch;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 3px 4px 3px 0;
}

.ambrosiaPrerequisiteMet {
    --ambrosia-prerequisite-color: var(--lime-text-color);
}

/* Paint the vertical connector after the branch so its band colors stay visible at the junction. */
.ambrosiaPrerequisite::before,
.ambrosiaPrerequisite::after {
    content: "";
    position: absolute;
    right: -12px;
    background: var(--ambrosia-prerequisite-color);
}

.ambrosiaPrerequisite::before {
    top: 50%;
    width: 12px;
    height: 2px;
    transform: translateY(-50%);
}

.ambrosiaPrerequisite::after {
    top: 0;
    bottom: 0;
    width: 2px;
}

.ambrosiaPrerequisite:first-child::after {
    top: 50%;
}

.ambrosiaPrerequisite:last-child::after {
    bottom: 50%;
}

/* Carry the outer branches through the middle row to their corresponding arrow bands. */
.ambrosiaDependencyGraph[data-prerequisite-count="3"] .ambrosiaPrerequisite:nth-child(2)::after {
    background: var(--ambrosia-arrow-fill);
}

/* A single prerequisite needs only the arrow, without an extra connector extending its shaft. */
.ambrosiaPrerequisite:only-child::before,
.ambrosiaPrerequisite:only-child::after {
    content: none;
}

.ambrosiaPrerequisite > img {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    outline: 2px solid var(--ambrosia-prerequisite-color);
    outline-offset: -2px;
}

.ambrosiaDependencyArrow {
    grid-column: 2;
    grid-row: var(--ambrosia-arrow-row);
    height: 10px;
    margin: 0 6px 0 12px;
    background: var(--ambrosia-arrow-fill);
    clip-path: polygon(
        0 calc(50% - var(--ambrosia-arrow-shaft-height) / 2),
        calc(100% - 6px) calc(50% - var(--ambrosia-arrow-shaft-height) / 2),
        calc(100% - 6px) 0,
        100% 50%,
        calc(100% - 6px) 100%,
        calc(100% - 6px) calc(50% + var(--ambrosia-arrow-shaft-height) / 2),
        0 calc(50% + var(--ambrosia-arrow-shaft-height) / 2)
    );
}

.ambrosiaDependencyTarget {
    grid-column: 3;
    grid-row: var(--ambrosia-arrow-row);
    display: flex;
    padding: 2px;
    border: 2px solid gold;
}

.ambrosiaDependencyTarget > img {
    width: 32px;
    height: 32px;
}

.ambrosiaPrerequisiteDetails {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    min-width: 0;
    color: var(--ambrosia-prerequisite-color);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ambrosiaPrerequisiteName {
    flex: 1 1 8em;
}

.ambrosiaPrerequisiteLevels {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Style for dimmed image */
.blueberryUpgrade img.dimmed,
.redAmbrosiaUpgrade img.dimmed,
.purpleAmbrosiaUpgrade img.dimmed {
    opacity: 0.3;
}

.blueberryUpgrade img.superDimmed,
.redAmbrosiaUpgrade img.superDimmed {
    opacity: 0; /* if not bought, fully dim */
}

/* Style for level display */
.blueberryUpgrade .level-overlay,
.redAmbrosiaUpgrade .level-overlay,
.purpleAmbrosiaUpgrade .level-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    text-shadow: 2px 2px 4px #000;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.8;
    background-color: black;
}

/* Style for relative positioning */
.blueberryUpgrade,
.redAmbrosiaUpgrade,
.purpleAmbrosiaUpgrade {
    position: relative;
    display: inline-block; /* Or block, depending on your layout */
    cursor: pointer;
}

.blueberryUpgrade > .purpleAmbrosiaEnchantmentIcon {
    position: absolute;
    right: -3px;
    bottom: -3px;
    z-index: 2;
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 0 2px black);
    cursor: pointer;
}

.purpleAmbrosiaEnchantmentIconType2 {
    transform: scaleX(-1);
}

.blueberryUpgrade > .purpleAmbrosiaEnchantmentIconLoadoutHidden,
.blueberryUpgrade > .purpleAmbrosiaEnchantmentIconMaxed {
    display: none;
}

.purpleAmbrosiaEnchantmentModal {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--purple-text-color);
    text-align: center;
}

.purpleAmbrosiaEnchantmentTitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--purple-text-color);
}

.purpleAmbrosiaEnchantmentTitle > img {
    width: 24px;
    height: 24px;
}

.purpleAmbrosiaEnchantmentModal .modalBtnBuy {
    width: auto;
    min-width: 120px;
    padding: 0 10px;
    border-color: var(--purple-text-color);
}

.purpleAmbrosiaEnchantmentModal .modalBtnBuy:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.maxBlueberryLevel,
.maxRedAmbrosiaLevel,
.maxPurpleAmbrosiaLevel {
    color: orchid;
    font-weight: bold;
}

.notMaxBlueberryLevel,
.notMaxRedAmbrosiaLevel,
.notMaxPurpleAmbrosiaLevel {
    color: white;
}

/* Stolen from https://codepen.io/mike-schultz/pen/NgQvGO */
#switchSettingSubTab9 {
    --border-width: 2px;

    position: relative;
    border-radius: var(--border-width);
}

#switchSettingSubTab9::after {
    content: "";
    position: absolute;
    top: calc(-1 * var(--border-width));
    left: calc(-1 * var(--border-width));
    height: calc(100% + var(--border-width) * 2);
    width: calc(100% + var(--border-width) * 2);
    background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82);
    border-radius: calc(2 * var(--border-width));
    z-index: -1;
    animation: animatedgradient 3s ease alternate infinite;
    background-size: 300% 300%;
}

#switchSettingSubTab9:hover {
    background-color: var(--hover-color);
}

@keyframes animatedgradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* // Stolen from https://codepen.io/mike-schultz/pen/NgQvGO */

#accountSubTab div#left.scrollbarX > div[id="button-holder"] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

#accountSubTab div#left.scrollbarX > div[id="button-holder"] > button {
    border: 2px solid red;
    min-width: 150px;
    min-height: 30px;
    margin: 2px;
}

#accountSubTab div#left.scrollbarX > div:is(#register, #login, #forgotpassword) {
    display: flex;
    flex-direction: column;
    border: 1px solid gold;
    width: max-content;
    margin: 0 auto;
}

#accountSubTab div#left.scrollbarX > div:is(#login, #forgotpassword) {
    display: none;
}

/* The purchase auth modal hosts the real #register/#login form node inline. */
.purchaseAuthModal > div:is(#register, #login) {
    flex-direction: column;
    border: 1px solid gold;
    max-width: 100%;
    margin: 0 auto;
}

/** Remove vertical spacing */
#accountSubTab div#left.scrollbarX > div > form,
.purchaseAuthModal > div:is(#register, #login) > form {
    font-size: 0;
}

#accountSubTab div#left.scrollbarX > div > form > *,
.purchaseAuthModal > div:is(#register, #login) > form > * {
    font-size: medium;
    margin: 2px 10px;
}

#accountSubTab div#left.scrollbarX > div > form > button[type="submit"],
.purchaseAuthModal > div:is(#register, #login) > form > button[type="submit"] {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin: 2px auto;
    border: 1px solid gold;
    padding: 3px 5px;
}

#accountSubTab div#left.scrollbarX > div > form > button[type="submit"]:disabled,
.purchaseAuthModal > div:is(#register, #login) > form > button[type="submit"]:disabled {
    cursor: wait;
}

.authSubmitSpinner.spinner {
    width: 12px;
    height: 12px;
}

.splitContainer {
    display: flex;
    flex-direction: row;
}

.splitContainer > .scrollbarX {
    width: 50%;
}

#accountSubTab div#right.scrollbarX > #buttons {
    display: flex;
    justify-content: center;
}

#accountSubTab div#right.scrollbarX #upload,
#accountSubTab div#right.scrollbarX #transfer {
    min-width: 100px;
    min-height: 30px;
    border: 2px solid purple;
    margin: 2px;
}

#accountSubTab div#right.scrollbarX #transfer {
    border: 2px solid pink;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    transform: translateY(-1px); /* Fine-tune this value */
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: translateY(-1px) rotate(0deg); }
    100% { transform: translateY(-1px) rotate(360deg); }
}

#accountSubTab div#right.scrollbarX > #table {
    white-space: nowrap;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table {
    display: grid;
    grid-template-columns: 80px 0.5fr 0.5fr;
    width: 99%;
    justify-content: center;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table > * {
    display: flex;
    align-items: center;
    padding: 16px 0;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table > .grid-header {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid white;
    padding-bottom: 5px;
    padding-top: 0;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table .grid-cell {
    text-align: left;
    padding: 5px;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table .grid-cell.alt-row {
    background: var(--history-lines);
}

#accountSubTab div#right.scrollbarX > #table > .grid-table .name-cell {
    font-weight: 500;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table .date-cell {
    font-size: 14px;
}

#accountSubTab div#right.scrollbarX > #table > .grid-table .grid-details-row {
    background: var(--alert-color);
    border-left: 3px solid #007bff;
    margin: 0;
    padding: 0;
}

/* Details content container */
.details-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
}

/* Details actions section */
.details-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.details-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.details-actions .btn-download {
    background: var(--success-color, #28a745);
    color: white;
}

.details-actions .btn-download:hover {
    background: var(--success-hover, #218838);
}

.details-actions .btn-load {
    background: var(--primary-color, #007bff);
    color: white;
}

.details-actions .btn-load:hover {
    background: var(--primary-hover, #0056b3);
}

.details-actions .btn-rename {
    background: var(--secondary-color, #6c757d);
    color: white;
}

.details-actions .btn-rename:hover {
    background: var(--secondary-hover, #5a6268);
}

.details-actions .btn-refresh {
    background: var(--info-color, #17a2b8);
    color: white;
}

.details-actions .btn-refresh:hover {
    background: var(--info-hover, #138496);
}

.details-actions .btn-delete {
    background: var(--danger-color, #dc3545);
    color: white;
}

.details-actions .btn-delete:hover {
    background: var(--danger-hover, #c82333);
}

/* Add hover effect to main rows to indicate they're clickable */
#accountSubTab div#right.scrollbarX > #table > .grid-table .grid-row:hover .grid-cell {
    background: var(--hover-color, rgb(0 123 255 / 10%));
}

/* Smooth animation for expanding rows */
.grid-details-row {
    animation: slide-down 0.2s ease-out;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (width <= 768px) {
    .details-content {
        flex-direction: column;
        gap: 15px;
    }

    .details-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

#purpleReactantContainers {
    container: purple-reactor / inline-size;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(96%, 1000px);
    margin: 10px auto;
    padding: 12px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    font-size: clamp(16px, 1.2vw, 18px);
}

.purpleReactorHeader {
    display: grid;
    grid-template-areas:
        "heading controls"
        "recipe settings"
        "draw draw";
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
    align-items: start;
    gap: 12px 24px;
    position: relative;
    z-index: 2;
    padding: 0 8px 12px;
    border-bottom: 1px solid rgb(176 0 176 / 55%);
    background-color: transparent;
    color: lightgray;
    font-size: 0.9em;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    text-align: left;
}

.purpleReactorHeader p {
    margin: 0;
}

.purpleReactorHeader > div {
    min-width: 0;
}

.purpleReactorHeading {
    grid-area: heading;
}

.purpleReactorTitle {
    color: var(--purple-text-color);
    font-size: 1.6em;
    font-weight: bold;
    line-height: 1.2;
}

.purpleReactorRecipe {
    grid-area: recipe;
}

.purpleReactorSettings {
    grid-area: settings;
}

.purpleReactorSectionLabel {
    font-weight: bold;
}

#purpleReactorMaximumDraw {
    grid-area: draw;
}

.purpleReactorMachine {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px minmax(300px, 1.25fr) 30px minmax(0, 1fr);
    align-items: stretch;
    gap: 0 4px;
    position: relative;
    z-index: 2;
}

.purpleReactorControls {
    display: flex;
    flex-wrap: wrap;
    grid-area: controls;
    align-self: center;
    gap: 8px;
}

.purpleCheckbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    cursor: pointer;
}

.purpleCheckbox[hidden] {
    display: none;
}

.purpleCheckbox > input {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    accent-color: var(--purple-text-color);
    font: inherit;
    cursor: inherit;
}

#purpleReactantOvercapControls {
    margin-top: 4px;
}

.purpleReactorToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding: 4px 12px;
    border: 2px solid var(--purple-box-color);
    border-radius: 3px;
    color: var(--purple-text-color);
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.purpleReactorToggle:is(:hover, :focus-visible, [aria-expanded="true"]) {
    border-color: var(--purple-text-color);
    background-color: var(--hover-color);
}

.purpleReactorPanel {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / span 4;
    row-gap: 0;
    min-width: 0;
    position: relative;
    z-index: 2;
    padding: 10px;
    border: 2px solid var(--reactant-dark, var(--purple-box-color));
    border-radius: 4px;
    background-color: var(--box-color);
}

.purpleReactorPanelBody {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.purpleReactorPanel::after,
.purpleReactorCore::before {
    /* Match the progress bar's row without depending on heading height. */
    content: "";
    position: absolute;
    grid-row: 3 / 4;
    top: 0;
    bottom: 0;
    right: -2px;
    width: 4px;
    color: var(--reactant-bright, var(--purple-text-color));
    background-color: currentcolor;
    box-shadow: 0 0 7px color-mix(in srgb, currentcolor 55%, transparent);
    pointer-events: none;
}

.purpleReactantTankRed::after,
.purpleReactorCore::before {
    right: auto;
    left: -2px;
}

.purpleReactantTankAmbrosia {
    --reactant-dark: var(--blueberry-box-color);
    --reactant-bright: darkturquoise;
    --reactant-rgb: 0 206 209;

    grid-column: 1;
}

.purpleReactantTankRed {
    --reactant-dark: maroon;
    --reactant-bright: red;
    --reactant-rgb: 255 0 0;

    grid-column: 5;
}

.purpleReactorPanelHeader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-bottom: 5px;
    text-align: center;
}

.purpleReactorPanelLabel {
    min-width: 0;
    margin: 0;
    color: gray;
    font-size: 0.72em;
    letter-spacing: 0.12em;
    line-height: 1.1;
    text-transform: uppercase;
}

.purpleReactorProgressTitle {
    margin: 0 0 3px;
    font-size: 0.86em;
    font-weight: bold;
    text-align: center;
}

.purpleReactantReserveTitle {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: lightgray;
    font-size: 0.8em;
    line-height: 1.2;
}

.purpleReactorProgressBar {
    width: 100%;
    height: 40px;
    background-color: black;
    border: 2px solid var(--reactant-dark, white);
    border-radius: 3px;
    box-shadow: inset 0 0 8px rgb(0 0 0 / 70%);
    overflow: hidden;
    position: relative;
}

#purpleHoneyProgressBar {
    border-color: #650065;
}

.purpleReactorProgressFill {
    width: 100%;
    height: 100%;
    transform: scaleX(var(--progress-fill, 0));
    transform-origin: left;
    transition: transform 0.4s ease;
}

#ambrosiaContainerProgress {
    background: linear-gradient(to right, navy, darkturquoise);
}

#redAmbrosiaContainerProgress {
    background: linear-gradient(to right, maroon, red);
}

#purpleHoneyProgressFill {
    display: flex;
    height: 100%;
}

#purpleHoneyProgressFill > .purpleReactorProgressFill {
    width: 50%;
    background: linear-gradient(to right, blue, var(--purple-honey-center-color));
}

#purpleHoneyProgressFill > .purpleReactorProgressFill:last-child {
    transform-origin: right;
    background: linear-gradient(to right, var(--purple-honey-center-color), red);
}

.purpleReactorProgressText {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px black;
    white-space: nowrap;
    z-index: 2;
}

.purpleReactorRate {
    margin: 3px 0 0;
    color: var(--reactant-bright, var(--purple-text-color));
    font-size: 0.82em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    text-align: center;
}

.purpleReactorCore {
    --purple-honey-center-color: purple;

    grid-column: 3;
}

.purpleReactorCore::before {
    color: color-mix(in srgb, blue, var(--purple-honey-center-color));
}

.purpleReactorCore::after {
    color: color-mix(in srgb, red, var(--purple-honey-center-color));
}

.purpleReactorModifiers {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    margin-top: 6px;
    text-align: center;
}

.purpleReactorModifiers > p {
    margin: 0;
    font-size: 0.82em;
    line-height: 1.3;
}

.purpleReactorConduit {
    grid-row: 3;
    align-self: center;
    position: relative;
    z-index: 1;
    width: calc(100% + 8px);
    height: 18px;
    margin: 0 -4px;
    border-top: 3px solid var(--conduit-dark);
    border-bottom: 3px solid var(--conduit-dark);
    background-color: #050505;
    opacity: 0.42;
    transition: opacity 250ms ease;
}

.purpleReactorConduit > span {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.purpleReactorConduit > span::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -36px;
    width: calc(100% + 36px);
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 8px,
            var(--conduit-bright) 8px 13px,
            transparent 13px 18px
        );
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.purpleReactorConduit::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    transform: translateY(-50%);
}

.purpleReactorConduitAmbrosia {
    --conduit-dark: #006;
    --conduit-bright: darkturquoise;

    grid-column: 2;
}

.purpleReactorConduitAmbrosia::after {
    right: -7px;
    border-left: 8px solid var(--conduit-bright);
}

.purpleReactorConduitRed {
    --conduit-dark: maroon;
    --conduit-bright: red;

    grid-column: 4;
}

.purpleReactorConduitRed::after {
    left: -7px;
    border-right: 8px solid var(--conduit-bright);
}

.purpleReactorActive .purpleReactorConduit {
    opacity: 0.9;
}

@keyframes purple-honey-gain {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

#purpleHoneyGainContainer,
#synthesisGainContainer {
    position: absolute;
    z-index: 4;
    inset: 0;
    pointer-events: none;
}

.purpleHoneyGain {
    position: absolute;
    top: 0;
    right: 8px;
    color: var(--purple-text-color);
    font-weight: bold;
    text-shadow: 0 1px 2px #650065;
    white-space: nowrap;
    opacity: 0;
}

.purpleHoneyGainAnimating {
    animation: purple-honey-gain 900ms ease-out forwards;
}

.synthesisGain {
    top: 48%;
    right: 10px;
    font-size: 1.05em;
}

@keyframes purple-reactor-flow {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(36px, 0, 0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .purpleReactorActive .purpleReactorConduit > span::before {
        animation: purple-reactor-flow 900ms linear infinite;
    }

    .purpleReactorActive .purpleReactorConduitRed > span::before {
        animation-direction: reverse;
    }

}

.purpleReactantRoutingControl {
    margin-top: auto;
    padding-top: 3px;
}

.purpleReactantRoutingHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.purpleReactantReserveTitle > .fitText {
    display: block;
    width: 100%;
    white-space: nowrap;
}

.purpleReactantRoutingHeader > output {
    flex: 0 0 auto;
    min-width: 4ch;
    color: var(--reactant-bright);
    font-size: 0.94em;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: right;
}

.purpleReactantPercentageSlider {
    --routing-percentage: 0%;

    appearance: none;
    display: block;
    width: 100%;
    height: 30px;
    min-height: 30px;
    margin: 1px 0 0;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    outline-offset: 1px;
    background: transparent;
    accent-color: var(--reactant-bright);
    cursor: pointer;
    touch-action: pan-y;
}

.purpleReactantPercentageSlider:focus-visible {
    outline: 2px solid white;
}

.purpleReactantPercentageSlider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border: 1px solid var(--reactant-dark);
    border-radius: 1px;
    background:
        linear-gradient(
            90deg,
            var(--reactant-bright) 0 var(--routing-percentage),
            #111 var(--routing-percentage) 100%
        );
    box-shadow: inset 0 0 4px black;
}

.purpleReactantPercentageSlider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border: 2px solid white;
    border-radius: 50%;
    background-color: var(--reactant-bright);
    box-shadow: 0 0 7px rgb(var(--reactant-rgb) / 75%);
}

.purpleReactantPercentageSlider::-moz-range-track {
    width: 100%;
    height: 8px;
    border: 1px solid var(--reactant-dark);
    border-radius: 1px;
    background-color: #111;
    box-shadow: inset 0 0 4px black;
}

.purpleReactantPercentageSlider::-moz-range-progress {
    height: 8px;
    background-color: var(--reactant-bright);
}

.purpleReactantPercentageSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-radius: 50%;
    background-color: var(--reactant-bright);
    box-shadow: 0 0 7px rgb(var(--reactant-rgb) / 75%);
}

.purpleReactantSliderScale {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    color: silver;
    font-size: 0.7em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

@container purple-reactor (width <= 650px) {
    .purpleReactorHeader {
        grid-template-areas:
            "heading"
            "controls"
            "recipe"
            "settings"
            "draw";
        grid-template-columns: minmax(0, 1fr);
    }

    #purpleUpgradeShop {
        flex-direction: column;
    }

    #purpleUpgradeFamilyList {
        flex: 0 0 50%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid var(--purple-box-color);
    }

    #purpleUpgradeDetail {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
    }
}

@container purple-reactor (width <= 850px) {
    .synthesisWorkspace {
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .synthesisConversionWorkspace,
    .synthesisUpgradeRegion {
        overflow: visible;
    }

    .synthesisUpgradeRegion {
        border-top: 1px solid rgb(176 0 176 / 35%);
        border-left: 0;
    }
}

@media (width <= 900px) {
    #purpleReactantContainers {
        width: min(96%, 760px);
    }

    .purpleReactorMachine {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .purpleReactorPanel {
        grid-row: span 4;
    }

    .purpleReactantTankRed {
        grid-column: 2;
    }

    .purpleReactorCore {
        grid-column: 1 / -1;
    }

    .purpleReactorConduit {
        display: none;
    }
}

@media (width <= 560px) {
    #purpleReactantContainers {
        width: calc(100% - 10px);
    }

    .purpleReactorMachine {
        grid-template-columns: minmax(0, 1fr);
    }

    .purpleReactantTankRed {
        grid-column: 1;
    }

    .purpleReactorHeader {
        padding-inline: 2px;
    }
}

@media (width <= 1024px) {
    #singularityPurple {
        bottom: auto;
        height: calc(var(--purple-popup-viewport-height, 100dvh) - var(--mobile-subtab-height) - 1rem);
        scroll-margin-top: calc(var(--mobile-subtab-height) + 0.5rem);
    }
}

@media (width <= 600px), (any-pointer: coarse) {
    .purpleReactorToggle,
    .synthesisCraftButtonRow > button {
        min-height: 44px;
    }

    .purplePopup {
        --purple-popup-close-size: 44px;
    }
}

@media (width <= 600px) {
    .purpleUpgradeFamilyRow {
        flex-wrap: wrap;
    }

    .purpleUpgradeFamilyButton {
        flex-basis: 100%;
    }

    .purpleUpgradeFamilyRowTiers {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding: 0 8px 6px;
    }

    .synthesisMap {
        grid-template-areas:
            "red"
            "honey"
            "product";
        row-gap: 2px;
    }

    .synthesisInputs {
        display: contents;
    }

    .synthesisSourceRed {
        grid-area: red;
    }

    .synthesisSourceHoney {
        grid-area: honey;
    }

}

@media (any-pointer: coarse) {
    .purpleUpgradeTierShortcut {
        min-width: 44px;
    }

    .purpleReactantPercentageSlider {
        height: 44px;
        min-height: 44px;
    }

    .purpleReactantPercentageSlider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        margin-top: -9px;
    }

    .purpleReactantPercentageSlider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

#bbLoadoutContainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

form input:hover {
    background-color: var(--hover-color);
    cursor: pointer;
}

#logoutButton {
    border: 2px solid #5865f2;
    height: 25px;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 5px;
}

/* Event Bonuses Dropdown Styles */
.event-bonuses-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    user-select: none;
    vertical-align: middle;
}

.event-bonuses-header:hover {
    opacity: 0.8;
}

.event-bonuses-header .chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    font-size: 12px;
    line-height: 1;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.event-bonuses-content {
    display: block;
    margin-left: 24px;
}

.personal-bonus-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.bonus-line-name {
    flex: 1;
    text-align: left;
}

.bonus-line-right {
    display: flex;
    justify-content: flex-end;
}

.pseudoUpgradeContainer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    justify-items: center;
    width: 70%;
    margin: 0 auto;
}

.pseudoSubscriptionContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#manage-subscription-holder {
    display: flex;
    flex-direction: row;
}

#manage-subscription-holder > form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 5px;
}

#manage-subscription-holder > form > input[type="submit"] {
    border: 2px solid gold;
    background-color: var(--box-color);
    width: 200px;
    height: 40px;
}

#manage-subscription-holder > form > input[type="submit"]:hover {
    background-color: var(--hover-color);
    cursor: pointer;
}

.subscriptionManager:focus-within > div { display: flex; }

.subscriptionManager > button {
    border: 2px solid gold;
    width: 200px;
    height: 40px;
    margin: 5px;
}

.subscriptionManager > div {
    position: absolute;
    display: none;
    flex-direction: column;
    border: 2px solid white;
    margin-top: 50px;
    background-color: var(--box-color);
}

.subscriptionManager > div > button {
    width: 200px;
    height: 40px;
    margin: 2px;
}

.pseudoSubscriptionContainer > #sub-section-holder {
    font-family: Inconsolata, monospace;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 75%;
}

.subscriptionWebsite {
    border: 1px solid gold;
    background-color: darkgoldenrod;
    color: var(--text-color);
    margin: 2px;
    cursor: pointer;
}

.subscriptionCancel {
    border: 1px solid red;
    background-color: maroon;
    color: var(--text-color);
    margin: 2px;
    cursor: pointer;
}

.pseudoCoinContainer {
    margin: 10px 10px 0 0;
    border: 1px solid #ccc;
    border: 2px solid orchid;
    text-align: center;
}

.subscriptionContainer {
    margin: 0;
    border: 1px solid lightgoldenrodyellow;
    border: 2px solid gold;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.subscriptionContainer > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.subscriptionContainer > div:first-child > ul {
    flex: 1;
    margin-bottom: auto;
}

.subscriptionContainer > .pseudoCoinButton,
.subscriptionContainer > div:not(:first-child) {
    margin-top: auto;
}

.subscriptionContainer > div.checkout-paypal {
    width: 76%;
    margin: 0 auto;
}

.subscriptionContainer > .pseudoCoinButton {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

.subscriptionContainer > div > .pseudoCoinSubImage {
    margin: 12px auto 4px;
}

#pseudoCoins > #productContainer > section > * > .pseudoCoinImage {
    margin-top: 8px;
}

#pseudoCoins > #supportContainer {
    text-align: center;
    padding-top: 10px;
}

#pseudoCoins > #supportContainer > a {
    border: 1px solid gold;
    padding: 4px 8px;
}

#pseudoCoins img {
    image-rendering: unset;
}

.pseudoCoinSubImage {
    margin-top: 7px;
    height: 48px;
    width: 48px;
}

.pseudoCoinText {
    width: 90%;
    padding: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgb(0 0 0 / 10%);
    border: 1px solid #ccc;
    margin: 5px auto;
}

.pseudoSubscriptionText {
    width: 100%;
    padding: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgb(0 0 0 / 10%);
    margin: 5px auto 0;
}

.pseudoCoinButton {
    width: 75%;
    padding: 10px;
    background-color: black;
    color: white;
    cursor: pointer;
    border: 2px solid white;
    font-size: 1.2em;
    overflow-wrap: break-word;
    margin-bottom: 5px;
    font-family: Inconsolata, monospace;
}

html[data-mobile="false"] .pseudoCoinButton {
    height: 65px;
}

.pseudoCoinButton:hover {
    background-color: white;
    color: black;
}

#cart {
    width: fit-content;
    margin: 5px auto 0;
    border: 2px solid white;
    border-radius: 5px;
}

#cart > img {
    width: 24px;
    height: 24px;
}

#totalCost {
    margin: 0 auto;
}

#checkout-buttons {
    display: flex;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto;
}

#checkout-buttons > button[id^="checkout"] {
    margin: 2px auto 4px;
}

#checkout-buttons > #checkout-xsolla {
    background-color: cadetblue;
}

.cartListElementContainer > * {
    width: 5vh;
}

.cartListElementContainer > button {
    min-height: unset;
    height: 50%;
    border: 2px solid green;
    border-radius: 2px;
}

#itemList {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

.cartListElementContainer {
    display: flex;
}

.cartListElement {
    width: 30vh;
}

.cartListElementContainer > span:first-of-type {
    width: 80%;
}

#upgradesContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cartContainer {
    display: flex;
    width: 70vh;
    justify-content: center;
    margin: 0 auto;
    margin-top: 10px;
}

#consumablesSection {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 70%;
}

.purchaseConsumableContainer {
    border: 2px solid var(--amber-text-color);
    padding: 5px;
    width: 50%;
    display: flex;
}

.consumablePurchaseBtn {
    align-items: center;
    white-space: pre;
    padding: 0 5px;
    border: 2px solid var(--amber-text-color);
    margin: 5px auto 0;
}

.timeSkipSet {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.timeSkipContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 33.333%;
    height: 30%;
}

.timeSkipOptions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

#topRowConsumables {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.lotusHeaderText {
    text-align: center;
}

.lotusHeaderText p {
    margin: 0;
}

.lotusContainer {
    border: 2px solid pink !important;
}

/* Cost text */
#consumablesGrid > div > button > :nth-child(2) {
    color: var(--amber-text-color);
}

#upgradeGrid {
    display: grid;
    grid-template-columns: repeat(6, 64px);
    grid-auto-rows: 64px;
    justify-content: center;
    column-gap: 16px;
    row-gap: 16px;
    margin: 0;
    width: 100%;
    padding-top: 15px;
}

#upgradeGrid > div {
    box-sizing: border-box;
    position: relative;
    height: 64px;
    width: 64px;
    border: 2px solid var(--darkgold-color);
    background: #222;
}

#upgradeGrid > div > p {
    margin: 0;
    position: absolute;
    bottom: 0;
}

#upgradeGrid > div > p:nth-child(odd) {
    margin: 0;
    position: absolute;
    top: 0;
    right: 0;
}

#upgradeGrid > div > img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    width: 70%;
}

#upgradeGrid > div[data-id].active {
    outline: 2px solid white;
}

#pseudoCoinBalanceDisplay {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 24px;
    width: fit-content;
    min-height: 32px;
    margin: 6px auto 8px;
    padding: 4px 16px;
    border: 1px solid var(--darkgold-color);
    border-radius: 4px;
}

.pseudoCoinBalanceResource {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pseudoCoinBalanceResource > img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

#refreshPseudoCoinBalance {
    padding: unset;
    min-width: 30px;
    font-size: 1em;
    color: var(--amber-text-color);
}

#refreshPseudoCoinBalance:disabled > span {
    display: inline-block;
    animation: rotation 1s linear infinite;
}

.pseudoCoinBalanceValue,
.lotusBalanceValue {
    min-width: 16px;
    text-align: center;
}

.pseudoCoinBalanceValue {
    color: gold;
}

.lotusBalanceValue {
    color: pink;
}

#upgradeInfo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    width: 50%;
    border: 3px solid var(--darkgold-color);
}

#pseudoCoinUpgradeName {
    background-color: var(--darkgold-color);
    width: 100%;
    text-align: center;
    font-size: 0.8em;
}

#pseudoCoinUpgradeDescription {
    display: grid;
    min-height: 192px;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    width: 100%;
}

#pseudoCoinUpgradeIcon {
    grid-column: 1;
    margin: auto;
}

#pseudoCoinUpgradeTexts {
    display: grid;
    grid-template-rows: 1fr auto;
    grid-column: 2 / 4;
    margin: auto;
    width: 100%;
    min-height: 192px;
    align-items: center;
}

#pCoinUpgradeDesc {
    grid-row: 1;
    text-align: center;
    margin: auto;
    width: 100%;
}

#pCoinUpgradeDesc > p {
    margin: 0;
}

#pCoinButton {
    grid-row: 2;
    margin: 0 auto;
    width: 100%;
}

#buy {
    width: 100%;
    border: 2px solid gold;
    font-size: 1.2em;
}

#captchaHolder > .cf-turnstile {
    max-width: fit-content;
    max-height: fit-content;
    margin: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
}

.upgrade-button {
    background: none;
    cursor: pointer;
}

.upgrade-button:focus-visible {
    outline: 2px solid #4a90e2;
}

.upgrade-button[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.fastForwardVisible {
    display: flex !important;
}

h2,
h3 {
    margin: 2px;
}

.green-background {
    background-color: var(--green-text-color);
}

.purple-background {
    background-color: var(--purplebtn-color);
}

.green-background img {
    background-color: var(--green-text-color);
}

.purple-background img {
    background-color: var(--purplebtn-color);
}

html[data-coin-one="true"] .coinunlock1 {
    display: flex;
}

html[data-coin-one="false"] .coinunlock1 {
    display: none;
}

html[data-coin-two="true"] .coinunlock2 {
    display: flex;
}

html[data-coin-two="false"] .coinunlock2 {
    display: none;
}

html[data-coin-three="true"] .coinunlock3 {
    display: flex;
}

html[data-coin-three="false"] .coinunlock3 {
    display: none;
}

html[data-coin-four="true"] .coinunlock4 {
    display: flex;
}

html[data-coin-four="false"] .coinunlock4 {
    display: none;
}

html[data-generation-unlock="true"] .generationunlock {
    display: block;
}

html[data-generation-unlock="false"] .generationunlock {
    display: none;
}

html[data-reincarnation-one="true"] .reinrow1 {
    display: block;
}

html[data-reincarnation-one="false"] .reinrow1 {
    display: none;
}

html[data-reincarnation-two="true"] .reinrow2 {
    display: block;
}

html[data-reincarnation-two="false"] .reinrow2 {
    display: none;
}

html[data-reincarnation-three="true"] .reinrow3 {
    display: block;
}

html[data-reincarnation-three="false"] .reinrow3 {
    display: none;
}

html[data-reincarnation-four="true"] .reinrow4 {
    display: block;
}

html[data-reincarnation-four="false"] .reinrow4 {
    display: none;
}

html[data-chal6="true"] .chal6 {
    display: block;
}

html[data-chal6="false"] .chal6 {
    display: none;
}

html[data-chal7="true"] .chal7 {
    display: block;
}

html[data-chal7="false"] .chal7 {
    display: none;
}

html[data-chal7x10="true"] .chal7x10 {
    display: block;
}

html[data-chal7x10="false"] .chal7x10 {
    display: none;
}

html[data-chal9="true"] .chal9 {
    display: block;
}

html[data-chal9="false"] .chal9 {
    display: none;
}

html[data-chal9x1="true"] .chal9x1 {
    display: block;
}

html[data-chal9x1="false"] .chal9x1 {
    display: none;
}

html[data-sacrifice-unlock="true"] .sacrificeUnlock {
    display: inline-block;
}

html[data-sacrifice-unlock="false"] .sacrificeUnlock {
    display: none;
}

html[data-chal10="true"] .chal10 {
    display: block;
}

html[data-chal10="false"] .chal10 {
    display: none;
}

html[data-chal11="true"] .chal11 {
    display: block;
}

html[data-chal11="false"] .chal11 {
    display: none;
}

html[data-chal12="true"] .chal12 {
    display: block;
}

html[data-spirit-unlock="true"] .spiritUnlock {
    display: flex;
}

html[data-spirit-unlock="false"] .spiritUnlock {
    display: none;
}

html[data-chal12="false"] .chal12 {
    display: none;
}

html[data-chal13="true"] .chal13 {
    display: block;
}

html[data-chal13="false"] .chal13 {
    display: none;
}

html[data-chal14="true"] .chal14 {
    display: block;
}

html[data-chal14="false"] .chal14 {
    display: none;
}

html[data-ascend-unlock="true"] .ascendunlockib {
    display: inline-block;
}

html[data-ascend-unlock="false"] .ascendunlockib {
    display: none;
}

html[data-prestige-unlock="true"] .prestigeunlockib {
    display: inline-block;
}

html[data-prestige-unlock="true"] .buttonRow > div.prestigeunlock {
    display: flex;
}

html[data-prestige-unlock="false"] .prestigeunlockib {
    display: none;
}

html[data-prestige-unlock="true"] .prestigeunlock {
    display: block;
}

html[data-prestige-unlock="true"] .offlineStats > .prestigeunlock {
    display: flex;
}

html[data-prestige-unlock="true"] .shopSection > .prestigeunlock {
    display: flex;
}

html[data-transcend-unlock="true"] .transcendunlock {
    display: block;
}

html[data-transcend-unlock="true"] .offlineStats > .transcendunlock {
    display: flex;
}

html[data-reincarnate-unlock="true"] .reincarnationunlock {
    display: block;
}

html[data-reincarnate-unlock="true"] .offlineStats > .reincarnationunlock {
    display: flex;
}

html[data-prestige-unlock="false"] .prestigeunlock {
    display: none;
}

html[data-prestige-unlock="false"] .offlineStats > .prestigeunlock {
    display: none;
}

html[data-transcend-unlock="false"] .transcendunlock {
    display: none;
}

html[data-transcend-unlock="false"] .offlineStats > .transcendunlock {
    display: none;
}

html[data-auto-transcend="true"] .autoTranscend {
    display: block;
}

html[data-auto-transcend="false"] .autoTranscend {
    display: none;
}

html[data-auto-prestige="true"] .autoPrestige {
    display: block;
}

html[data-auto-prestige="false"] .autoPrestige {
    display: none;
}

html[data-reincarnate-unlock="false"] .reincarnationunlock {
    display: none;
}

html[data-reincarnate-unlock="false"] .offlineStats > .reincarnationunlock {
    display: none;
}

html[data-particle-upgrade-research="true"] .particleUpgradeResearch {
    display: block;
}

html[data-particle-upgrade-research="false"] .particleUpgradeResearch {
    display: none !important;
}

html[data-research150="true"] .research150 {
    display: block;
}

html[data-research150="false"] .research150 {
    display: none;
}

html[data-research39="true"] .research39 {
    display: block;
}

html[data-research39="false"] .research39 {
    display: none;
}

html[data-research40="true"] #reincarnationMythosInfo {
    display: block;
}

html[data-research40="false"] #reincarnationMythosInfo {
    display: none;
}

html[data-research46="true"] #reincarnateautomation {
    display: block;
}

html[data-research46="false"] #reincarnateautomation {
    display: none;
}

html[data-research130="true"] #toggleautofortify {
    display: block;
}

html[data-research130="false"] #toggleautofortify {
    display: none;
}

html[data-research190="true"] .research190 {
    display: block !important;
}

html[data-research190="false"] .research190 {
    display: none !important;
}

html[data-offering-auto="true"] .offeringAuto {
    display: block;
}

html[data-offering-auto="false"] .offeringAuto {
    display: none;
}

html[data-auto-buy-fragments="true"] .autoBuyFragments {
    display: block;
}

html[data-auto-buy-fragments="false"] .autoBuyFragments {
    display: none;
}

html[data-auto-research="true"] .autoResearch {
    display: block;
}

html[data-auto-research="false"] .autoResearch {
    display: none;
}

html[data-auto-research-mode="true"] .autoResearchMode {
    display: block;
}

html[data-auto-research-mode="false"] .autoResearchMode {
    display: none;
}

html[data-cube-upgrade8="true"] .cubeUpgrade8 {
    display: block;
}

html[data-cube-upgrade8="false"] .cubeUpgrade8 {
    display: none;
}

html[data-save-offerings="true"] .saveOfferings {
    display: block;
}

html[data-save-offerings="false"] .saveOfferings {
    display: none;
}

html[data-auto-open-cubes="true"] .autoOpenCubes {
    display: block;
}

html[data-auto-open-cubes="false"] .autoOpenCubes {
    display: none;
}

html[data-auto-cube-upgrades="true"] .autoCubeUpgrades {
    display: block;
}

html[data-auto-cube-upgrades="false"] .autoCubeUpgrades {
    display: none;
}

html[data-auto-platonic-upgrades="true"] .autoPlatonicUpgrades {
    display: block;
}

html[data-auto-platonic-upgrades="false"] .autoPlatonicUpgrades {
    display: none;
}

html[data-hepteract-confirmation="true"] .hepteractConfirmation {
    display: block;
}

html[data-hepteract-confirmation="false"] .hepteractConfirmation {
    display: none;
}

html[data-auto-warp="false"] .autoWarp {
    display: none;
}

html[data-sing-challenges="true"] .singChallenges {
    display: block;
}

html[data-sing-challenges="false"] .singChallenges,
html[data-sing-challenges="false"] .singChallengesTabs {
    display: none;
}

html[data-inside-singularity-challenge="false"] .insideSingularityChallenge {
    display: none;
}

html[data-ascension-stats="true"] .ascensionStats {
    visibility: visible;
}

html[data-ascension-stats="false"] .ascensionStats {
    visibility: hidden;
}

html[data-asc-hyper-stats="false"] .ascHyperStats {
    display: none;
}

html[data-asc-platonic-stats="false"] .ascPlatonicStats {
    display: none;
}

html[data-asc-hepteract-stats="false"] .ascHepteractStats {
    display: none;
}

html[data-unread-messages="true"] .unreadMessages {
    display: block;
}

html[data-unread-messages="false"] .unreadMessages {
    display: none;
}

html[data-cube-upgrade10="true"] .cubeUpgrade10 {
    display: flex;
}

html[data-cube-upgrade10="false"] .cubeUpgrade10 {
    display: none;
}

html[data-cube-upgrade19="true"] .cubeUpgrade19 {
    display: block;
}

html[data-cube-upgrade19="false"] .cubeUpgrade19 {
    display: none;
}

.sacrificeAnts,
.sacrificeAntsLocked {
    display: flex;
}

html[data-sacrifice-ants="true"] .sacrificeAntsLocked,
html[data-sacrifice-ants="false"] .sacrificeAnts,
html[data-sacrifice-ants="false"] .sacrificeAntsUnlocked {
    display: none;
}

html[data-auto-ant-sacrifice="true"] .autoSacrificeLocked,
html[data-auto-ant-sacrifice="false"] .autoSacrifice {
    display: none;
}

html[data-additional-auto-sacrifice-options="true"] .additionalAutoSacOptionsLocked,
html[data-additional-auto-sacrifice-options="false"] .additionalAutoSacOptions {
    display: none;
}

html[data-hepteracts="true"] .hepteracts {
    display: block;
}

html[data-hepteracts="false"] .hepteracts {
    display: none;
}

html[data-singularity="true"] .singularity {
    display: block;
}

html[data-singularity="false"] .singularity {
    display: none;
}

html[data-singularity-button="true"] .singularityButton {
    display: block;
}

html[data-singularity-button="false"] .singularityButton {
    display: none;
}

html[data-singularity-confirmation="true"] .singularityConfirmation {
    display: block;
}

html[data-singularity-confirmation="false"] .singularityConfirmation {
    display: none;
}

html[data-cookies1="true"] .assortedCookies1 {
    display: block;
}

html[data-cookies1="false"] .assortedCookies1 {
    display: none;
}

html[data-cookies2="true"] .assortedCookies2 {
    display: block;
}

html[data-cookies2="false"] .assortedCookies2 {
    display: none;
}

html[data-cookies3="true"] .assortedCookies3 {
    display: block;
}

html[data-cookies3="false"] .assortedCookies3 {
    display: none;
}

html[data-cookies4="true"] .assortedCookies4 {
    display: block;
}

html[data-cookies4="false"] .assortedCookies4 {
    display: none;
}

html[data-cookies5="true"] .assortedCookies5 {
    display: block;
}

html[data-cookies5="false"] .assortedCookies5 {
    display: none;
}

html[data-golden-quark3-upg="true"] .goldenQuark3Upg {
    display: block;
}

html[data-golden-quark3-upg="false"] .goldenQuark3Upg {
    display: none;
}

html[data-mobile="true"] {
    -webkit-touch-callout: none;
    -webkit-user-select: none; /* stylelint-disable-line property-no-vendor-prefix */
    user-select: none;
}

/* Keep text editable where typing is expected (save import, search fields, etc.) */
html[data-mobile="true"] input,
html[data-mobile="true"] textarea,
html[data-mobile="true"] [contenteditable="true"] {
    -webkit-user-select: text; /* stylelint-disable-line property-no-vendor-prefix */
    user-select: text;
}

html[data-mobile="true"] .showOnMobile {
    display: block !important;
}

html[data-mobile="false"] .showOnMobile {
    display: none !important;
}

html[data-mobile="true"] .hideOnMobile {
    display: none !important;
}

.modalBtnBuy {
    width: 60px;
    height: 30px;
    background-color: var(--button-color);
    border: 2px solid gold;
    margin: 5px auto;
    text-align: center;
}

#modal.modalBottomSheet .modalBtnBuy[data-modal-action="buyAll"] {
    width: auto;
    min-width: min(240px, 100%);
    max-width: 100%;
    height: auto;
    min-height: 30px;
    padding: 6px 12px;
    white-space: normal;
}

.modalButtonRow {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.resetModal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.resetModalTitle,
.resetModalRewards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.resetModalTitle {
    font-size: 1.15em;
    color: gold;
}

.resetModalTitle img,
.resetModalReward img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.resetModalReward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: gold;
}

.resetModalInfo {
    line-height: 1.35;
}

.resetModal + br + br + .modalButtonRow .modalBtnBuy {
    width: auto;
    min-width: 120px;
    padding: 0 12px;
}

.purchaseAuthModal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
}

.purchaseAuthModal .modalBtnBuy {
    width: auto;
    min-width: 120px;
    padding: 0 12px;
}

#patchnotes {
    cursor: pointer;
}

#iframeOverlayWrapper {
    width: 50%;
    height: 100%;
    z-index: 10000;
    position: fixed;
    margin: 0 auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}

#iframeOverlayBlur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    backdrop-filter: blur(8px);
    background-color: rgb(0 0 0 / 30%);
    pointer-events: all;
    display: none;
}

.rainbow-border-highlight {
    border: 3px solid #f00;
    border-radius: 5px;
    padding: 5px;
    animation: rainbow-border 2s linear infinite;
}

.mobile-menu-toggle {
    display: none;
}

.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 1px;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (width <= 1024px) {
    html {
        min-width: unset;
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
    }

    body {
        overflow-x: hidden;
        overscroll-behavior: none;
    }

    html[data-mobile="true"] body {
        height: 100%;
        overflow: hidden;
    }

    main {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-top: var(--mobile-subtab-height);
    }

    html[data-mobile="true"] #mobileHeaderContent {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-height: var(--mobile-header-content-height, none);
        overflow: hidden;
    }

    html[data-mobile="true"] #mobileHeaderResizeHandle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 16px;
        background-color: var(--header-color);
        cursor: ns-resize;
        touch-action: none;
    }

    html[data-mobile="true"] #mobileHeaderResizeHandle::before {
        content: "";
        width: 44px;
        height: 3px;
        border-radius: 999px;
        background-color: #777;
        box-shadow: 0 0 0 1px #0009;
    }

    html[data-mobile="true"] #mobileHeaderResizeHandle:focus-visible::before,
    body.mobileHeaderIsResizing #mobileHeaderResizeHandle::before {
        background-color: white;
    }

    body.mobileHeaderIsResizing {
        user-select: none;
    }

    /* Ascension stats - horizontally scrollable on mobile */
    .ascensionStats {
        min-width: unset;
        width: 100%;
        padding: 0 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: thin;
    }

    .ascensionStats > span {
        flex-shrink: 0;
    }

    /* Navigation tabs - make scrollable // i assume remnant from before mobile hamburger was added */
    #tabrow {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding: 9px 10px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    nav button {
        min-width: 80px;
        flex-shrink: 0;
        font-size: 0.85em;
    }

    .subHeader {
        flex-direction: column;
        min-width: unset;
        max-width: unset;
    }

    html[data-mobile="true"] .subHeader {
        display: contents;
    }

    html[data-mobile="true"] .resetInformationContainer {
        order: 1;
        flex: 0 0 auto;
    }

    html[data-mobile="true"] .ascensionStats {
        order: 2;
        flex: 0 0 auto;
    }

    html[data-mobile="true"] .currenciesContainer {
        order: 3;
        flex: 0 0 auto;
        width: 100%;
    }

    /* Sub tab wrappers */
    html[data-mobile="true"] .subTabWrapper {
        position: fixed;
        top: var(--mobile-subtab-top);
        left: 0;
        right: 0;
        z-index: 20;
        grid-template-columns: repeat(auto-fit, minmax(130px, var(--subtab-button-width)));
        gap: 5px;
        width: 100%;
        margin: 0 auto 10px;
        padding-top: 0;
        padding-bottom: 5px;
        background-color: var(--bg-color);
        touch-action: manipulation;
    }

    .mobileIconSubTabWrapper {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }

    #upgradeReferenceHeader {
        display: flex !important;
    }

    .upgradeSectionTop > img {
        scroll-margin-top: calc(var(--mobile-subtab-height) + 0.25rem);
    }

    .mobileIconSubTabWrapper > .mobileSubTabIcon,
    .mobileIconSubTabWrapper > .mobileSubTabIconContainer {
        flex: 0 0 32px;
        width: 32px;
    }

    .mobileIconSubTabWrapperWithInlineControl > :not(.mobileSubTabIcon):not(.mobileSubTabIconContainer) {
        flex: 0 1 160px;
        width: auto;
    }

    .mobileIconSubTabWrapperWithFullRowControl > :not(.mobileSubTabIcon):not(.mobileSubTabIconContainer) {
        flex: 0 0 100%;
    }

    .subTabWrapper > button,
    .subTabWrapper > span > button {
        min-width: unset;
        width: 100%;
        font-size: 0.85em;
        text-align: center;
    }

    .subTabHeaderDetails {
        margin: 0 auto 10px;
    }

    /* Building rows */
    .buttonRow {
        margin-left: 2%;
        margin-right: 2%;
        font-size: 0.9em;
        margin-top: unset;
    }

    .buttonRow > div {
        gap: 5px;
    }

    .buttonRow > div:not(.buildingAutomationControls) {
        margin-left: 0;
    }

    .buttonRow > div > .desc {
        width: 100%;
        min-width: 0;
        order: -1;
    }

    .buttonRow > div > .stats {
        width: 100%;
        min-width: 0;
        font-size: 0.9em;
    }

    /* Building text */
    #buildingtext {
        width: 95%;
        max-width: 100%;
    }

    /* Coin buildings */
    #coinBuildings {
        max-width: 100%;
    }

    #coinInformation {
        font-size: 1em;
        padding: 5px;
    }

    /* Upgrades flex container */
    #upgradesFlex {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        justify-content: center;
        margin: 2% auto;
        width: unset;
    }

    #upgradesFlex button:has(img) {
        min-height: unset;
    }

    #upgradesFlex > section {
        margin-top: 10px;
    }

    /* Prestige/Transcension containers */
    #prestige,
    #transcension {
        max-width: 100%;
    }

    #crystalupgrades {
        width: 95%;
        max-width: 100%;
    }

    p#prestigehotkeys,
    p#buildinghotkeys {
        width: 95%;
        font-size: 0.85em;
    }

    /* Rune containers */
    #runeDetails,
    #runeBlessings,
    #runeSpirits {
        width: 90%;
    }

    .runeType {
        width: 140px;
    }

    #runeContainer2 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .talismansCenter {
        order: 1;
    }

    .talismanShardSection {
        order: 2;
        align-items: center;
        margin-left: 0;
    }

    .talismanToggles {
        order: 3;
        align-items: center;
    }

    #challengeTimers {
        margin-right: 0;
        width: 100%;
        text-align: center;
    }

    #oneChallengeDetails {
        width: 95%;
    }

    #startChallenge {
        min-width: 200px;
        width: 80%;
    }

    /* Research section - convert table to wrapping grid */
    .researchContainer {
        overflow-x: visible;
    }

    .researchContainer > .scrollbarX {
        overflow-x: visible;
    }

    #researchtable,
    #researchtable > tbody,
    #researchtable > tbody > tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    #researchtable > tbody > tr > td {
        display: block;
    }

    #researchtable button > img {
        width: 36px;
        height: 36px;
    }

    /* Ants */
    #antSacrificeRewards > div {
        flex-wrap: wrap;
    }

    .antUpgradeRow {
        display: grid;
        grid-template-columns: repeat(4, 25%);
    }

    #antSacrificeCompendium {
        width: unset;
    }

    /* WowCubes */
    #cubesWrapper {
        width: unset;
        flex-direction: column;
    }

    #wowCubeSidebar {
        width: unset;
        flex-direction: column;
    }

    .cubeTab {
        width: 100vw;
        margin-left: unset;
    }

    .cubeBonus {
        white-space: unset;
        margin-top: 25px; /* fix overlapping with custom open input */
    }

    p[id$="BlessingsTotal"] {
        margin-left: unset;
        margin-right: unset;
    }

    #cubeTab6 {
        flex-direction: row;
        align-items: unset;
    }

    .challengePortion {
        width: unset;
    }

    .platonicUpgradesContainer {
        margin-left: unset;
    }

    .platonicContainer {
        width: unset;
    }

    .hepteractGrid {
        grid-template-columns: repeat(3, 1fr);
        align-self: center;
        width: unset;
    }

    .openGrid {
        align-self: unset;
    }

    #heptGrid button:not(#hepteractAutoPercentageButton) {
        min-height: 100%;
    }

    #cubeUpgradeTable button {
        min-height: unset;
    }

    /* Campaigns */
    #campaignsIcons {
        width: unset;
    }

    #campaignIconGrid {
        grid-template-columns: repeat(5, 48px);
        column-gap: unset;
        row-gap: unset;
    }

    #campaignsTokensInfo {
        width: unset;
    }

    #traits {
        flex-direction: column;
    }

    #corruptionStatsLoadouts {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: unset;
    }

    #corrButtonRow {
        width: 100%;
        gap: clamp(0.5rem, 2vw, 1rem);
    }

    #corrButtonRow > button {
        flex: 1 1 0;
        min-width: 0;
    }

    .corrDesc {
        min-width: unset;
    }

    .corruptionStatRow > button {
        min-width: 44px;
    }

    #campaignsMain,
    #corruptionMain {
        min-width: unset;
    }

    #elevatorLockToggle,
    #elevatorSlowClimbToggle {
        transform: unset;
    }

    #actualSingularityUpgradeContainer,
    #octeractUpgradeContainer,
    #blueberryUpgradeContainer {
        width: unset;
    }

    #singularityInfo {
        grid-template-columns: unset;
    }

    #singularityPerksGrid {
        width: 100%;
    }

    .singularityPerkTreeCanvas {
        width: min(100%, 680px);
        height: 400px;
    }

    .newPerk,
    .oldPerk {
        width: 26px;
        height: 26px;
        padding: 1px;
        border-width: 1px;
        border-radius: 4px;
    }

    .singularityPerkNode > img {
        width: 22px;
        height: 22px;
    }

    .ambrosiaUpgradeActions {
        gap: unset;
    }

    .ambrosiaUpgradeActions button,
    #ambrosiaUpgradeGrid button {
        min-height: unset !important;
    }

    /* Achievement grids */
    #tieredAchievementsTable {
        width: min(100%, 420px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        order: 2;
    }

    #tieredAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #ungroupedAchievementsTable {
        order: 3;
    }

    #ungroupedAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #progressiveAchievementsTable {
        width: min(100%, 420px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        order: 1;
    }

    #progressiveAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #achievementHeader {
        width: 100%;
        padding: 0 6px;
    }

    #achievementQuarkBonus {
        text-align: center;
        width: auto;
        margin-inline: auto;
        line-height: 1;
    }

    #achievementTNLInfo {
        width: min(100%, 24rem) !important;
    }

    #achievementTNLText {
        white-space: nowrap;
        text-align: center !important;
    }

    #synergismLevelRewardsTable {
        width: min(100%, 420px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 2px;
    }

    #synergismLevelRewardsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #synergismLevelMilestonesTable {
        width: min(100%, 420px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 2px;
    }

    #synergismLevelMilestonesTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    /* Settings */
    .settingSubTabUpper {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    #confirmationToggleBox,
    #exportButtons,
    #thirdParty {
        max-width: 95%;
        width: 95%;
    }

    /* Modals and dialogs */
    #confirmationBox,
    #captchaHolder,
    .announcement {
        width: 90vw;
        min-width: unset;
        max-width: 95vw;
    }

    #modal {
        width: 90%;
        max-width: 95vw;
    }

    .notification-item {
        width: 80vw;
        min-width: unset;
    }

    #offlineContainer,
    #fastForwardContainer {
        width: 90vw;
        max-width: 95vw;
        font-size: 0.9em;
    }

    #iframeOverlayWrapper {
        width: 90%;
    }

    .resetsContainer {
        margin-top: 10px;
        flex-wrap: wrap;
        flex-direction: column;
    }

    .resetInformationContainer {
        width: unset;
    }

    .resetsButtons {
        margin: 0 auto;
    }

    /* Cube upgrades */
    .pseudoUpgradeContainer {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Toggle buttons */
    #challengesAutoToggles {
        gap: 8px 10px;
    }

    /* Reset Subtabs */
    #historyResetTable,
    #historyAntsTable {
        min-width: unset;
    }

    #historyReset,
    #historyAnts {
        margin-left: unset;
    }

    .subtabContent.subtabActive.historySubTab.subtabDisplayFlex > div {
        flex-direction: column;
    }

    html[data-sacrifice-ants="true"] .sacrificeAnts {
        flex-direction: column;
    }

    #achievements {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* Display values on a new line */
    .statNumber {
        float: none;
        display: block;
    }

    #statisticsSubTab > * {
        overflow-wrap: anywhere;
    }

    .statContainer {
        min-width: unset;
        max-width: 50%;
        width: unset;
        padding-left: 5px;
        padding-right: 5px;
    }

    .statPortion {
        min-width: unset;
    }

    /* PseudoCoins / Subscriptions */
    .subscriptionContainer > div.checkout-paypal {
        width: unset;
    }

    #pseudoCoins > #supportContainer {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .pseudoSubscriptionContainer > #sub-section-holder {
        width: unset;
    }

    #upgradeGrid {
        row-gap: 12px;
        padding-bottom: 15px;
    }

    .timeSkipSet {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .timeSkipContainer {
        height: auto;
        justify-content: space-between;
        font-size: 0.75rem;
        overflow: hidden; /* TODO */
    }

    .lotusOptions {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    *[data-lotus="true"] *:not(span) {
        width: 80%;
        margin: 0 auto;
    }

    .consumablePurchaseBtn {
        white-space: unset;
        width: 80%;
    }

    #topRowConsumables > .purchaseConsumableContainer {
        display: flex;
        flex-direction: column;
    }

    #event {
        padding: unset;
        padding-top: 20px;
    }

    #themeArea > div {
        position: unset;
        transform: unset;
    }

    #themeArea.open > div {
        display: inline-grid;
    }

    /* On mobile the dropdown is toggled via .open; don't let focus-within force it open */
    #themeArea:not(.open):focus-within > div {
        display: none;
    }

    #ascendConstantUpgrades {
        width: unset;
    }

    #actualPotionShop {
        flex-wrap: unset;
    }
}

@media (width <= 1024px) and (orientation: portrait) {
    /* Keep the research icons readable by transposing the 8x25 table. */
    .researchContainer > .scrollbarX {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    #researchtable,
    #researchtable > tbody {
        flex-flow: row nowrap;
    }

    #researchtable {
        flex: none;
        width: max-content;
    }

    #researchtable > tbody > tr {
        flex-flow: column nowrap;
    }

    #researchtable > tbody > tr > td {
        padding: 0;
    }

    #researchtable button:not(.researchLocked) {
        display: flex;
        width: 44px;
        height: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        padding: 2px;
    }

    #researchtable button > img {
        display: block;
    }
}

@media (width <= 600px) {
    /* Extra small screens */
    html {
        font-size: 14px;
    }

    /* Prevent mobile browsers from zooming in on input focus
       https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/ */
    input:not(#manage-patreon-sub-button),
    select,
    textarea {
        font-size: 16px;
    }

    /* Mobile menu toggle button - use high specificity to override nav button */
    nav.navbar > button.mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
        border: 1px solid #555;
        border-radius: 4px;
        padding: 4px 8px;
        cursor: pointer;
        margin: 3px auto;
        min-height: unset;
        min-width: unset;
        width: auto;
        font-size: 1em;
    }

    nav.navbar > button.mobile-menu-toggle:hover,
    nav.navbar > button.mobile-menu-toggle:focus {
        background: linear-gradient(135deg, #444 0%, #2a2a2a 100%);
        border-color: #777;
    }

    nav.navbar > button.mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    /* Hamburger animation when menu is open */
    .mobile-menu-toggle.menu-open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }

    .mobile-menu-toggle.menu-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.menu-open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -3px);
    }

    /* Tab row - collapsed by default on mobile */
    nav.navbar #tabrow {
        display: none !important;
        flex-direction: column;
        gap: 5px;
        padding: 10px;
        background: #000c;
        border-radius: 8px;
        margin: 5px 10px;
        overflow-y: auto;
        flex-wrap: nowrap;
    }

    /* Show tab row when menu is open */
    nav.navbar.menu-open #tabrow {
        display: flex !important;
    }

    html[data-mobile="true"] nav.navbar #tabrow {
        grid-template-columns: repeat(auto-fit, 32px);
        justify-content: center;
        gap: 8px !important;
    }

    html[data-mobile="true"] nav.navbar.menu-open #tabrow {
        display: grid !important;
    }

    @media (prefers-reduced-motion: no-preference) {
        nav.navbar #tabrow.tab-edit-mode > button:not(#tabEditDone) {
            animation: tab-jingle-mobile 240ms ease-in-out infinite alternate;
        }
    }

    /* Tab buttons in mobile menu */
    nav.navbar #tabrow > button {
        width: 100%;
        min-width: unset;
        padding: 12px 15px;
        font-size: 1em;
        text-align: center;
        border-radius: 6px;
    }

    html[data-mobile="true"] nav.navbar #tabrow > button.mobileTabIconButton {
        box-sizing: border-box;
        width: 32px;
        height: 32px;
        min-width: unset;
        min-height: unset;
        padding: 0;
        border: 0;
        border-radius: 0;
        overflow: visible;
        background-color: var(--button-color) !important;
        -webkit-touch-callout: none;
        -webkit-user-select: none; /* stylelint-disable-line property-no-vendor-prefix */
        user-select: none;
    }

    html[data-mobile="true"] nav.navbar #tabrow > button.mobileTabIconButton.active-tab {
        background-color: red !important;
    }

    .mobileTabIcon {
        display: block;
        width: 32px;
        height: 32px;
        object-fit: fill;
        -webkit-touch-callout: none;
        -webkit-user-select: none; /* stylelint-disable-line property-no-vendor-prefix */
        user-select: none;
    }

    nav button {
        min-width: 70px;
        font-size: 0.75em;
        padding: 2px;
    }

    .subTabWrapper {
        grid-template-columns: repeat(auto-fit, minmax(130px, var(--subtab-button-width)));
        gap: 5px;
    }

    .buttonRow {
        margin-left: 5px;
        margin-right: 5px;
        font-size: 0.85em;
    }

    .buildingPurchaseBtn {
        width: 100%;
        min-width: 0;
        font-size: 0.85em;
    }

    .buttonRow > div > .auto {
        width: 5em;
        min-width: 60px;
    }

    /* Upgrades */
    #upgradesFlex {
        grid-template-columns: repeat(1, 100%);
    }

    /* Runes */
    .runeType {
        width: 100px;
    }

    #runeDetails,
    #runeBlessings,
    #runeSpirits {
        width: 100%;
    }

    #buyRuneBlessingToggle,
    #buyRuneSpiritToggleValue {
        text-align: center;
    }

    /* Achievements */
    #tieredAchievementsTable {
        width: min(100%, 360px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        order: 2;
    }

    #tieredAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .tieredAchievementType > img,
    .progressiveAchievementType > img,
    .synergismLevelRewardType > img {
        width: 100%;
        height: 100%;
    }

    #ungroupedAchievementsTable {
        width: min(100%, 360px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 2px;
        order: 3;
    }

    #ungroupedAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .ungroupedAchievementType > img {
        width: 100%;
        height: 100%;
    }

    #progressiveAchievementsTable {
        width: min(100%, 360px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        order: 1;
    }

    #progressiveAchievementsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #achievements {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    #achievementQuarkBonus {
        white-space: nowrap;
        text-align: center;
        width: auto;
        margin-inline: auto;
        line-height: 1;
    }

    #achievementTNLInfo {
        width: min(100%, 22rem) !important;
    }

    #achievementTNLText {
        white-space: nowrap;
        text-align: center !important;
        font-size: 0.95em !important;
    }

    #synergismLevelRewardsTable {
        width: min(100%, 360px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 2px;
    }

    #synergismLevelRewardsTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    #synergismLevelMilestonesTable {
        width: min(100%, 360px);
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 2px;
    }

    #synergismLevelMilestonesTable > div {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .synergismLevelMilestoneType > img {
        width: 100%;
        height: 100%;
    }

    /* Challenge icons */
    #challengeIcons img {
        width: 48px;
        height: 48px;
    }

    #oneChallengeDetails {
        font-size: 0.9em;
    }

    #startChallenge {
        min-width: 150px;
        min-height: 60px;
        font-size: 1em;
    }

    .singularityChallenges {
        flex-wrap: wrap;
    }

    #singularityChallengeAllRewards,
    .singularityChallengeAllRewards {
        grid-template-columns: repeat(2, 50%);
    }

    #researchToggles {
        flex-wrap: wrap;
    }

    /* Cubes */
    #cubeTab6 {
        flex-direction: column;
    }

    /* Campaigns */
    #campaignsDescriptions {
        width: unset;
    }

    /* Dialogs */
    #confirmationBox,
    #captchaHolder,
    .announcement {
        min-height: unset;
        padding: 10px;
    }

    #confirm,
    #alert,
    #prompt {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    #confirm {
        grid-template-areas:
            "txt"
            "btn"
            "btn2";
        gap: 10px;
    }

    #alert {
        grid-template-areas:
            "txt"
            "btn";
        gap: 10px;
    }

    #prompt {
        grid-template-areas:
            "txt"
            "lbl"
            "btn"
            "btn2";
        gap: 10px;
    }

    #prompt_text {
        margin: 0;
    }

    /* Settings */
    #savegame,
    #deleteGame,
    #importFileButton,
    #saveStringInput,
    #exportButtons > label {
        width: 100%;
        min-width: unset;
    }

    #exportgame {
        width: 100%;
        min-width: unset;
    }

    #upgradeGrid {
        width: 100%;
        grid-template-columns: repeat(5, 15%);
        justify-content: center;
        column-gap: 4px;
        row-gap: 4px;
        padding: 0;
    }

    #upgradeGrid > div {
        justify-self: center;
    }

    #upgradeInfo {
        width: unset;
    }

    /* PseudoCoins / Subscriptions */
    #productContainer {
        width: unset;
    }

    #consumablesSection {
        width: 95%;
    }

    #topRowConsumables {
        flex-wrap: wrap;
    }

    .purchaseConsumableContainer {
        min-width: 0;
        flex: 1 1 auto;
    }

    #manage-subscription-holder {
        flex-direction: column;
    }

    .pseudoSubscriptionContainer > #sub-section-holder {
        grid-template-columns: repeat(2, 50%);
        width: unset;
    }

    #cartContainer {
        width: unset;
    }

    /* Settings subtabs */

    #languagesubtab {
        flex-direction: column;
    }

    .languageContribution {
        min-width: unset;
    }

    .languagesMenu {
        min-width: unset;
    }

    #creditList {
        grid-template-columns: repeat(2, 50%);
    }

    #artistList {
        grid-template-columns: repeat(2, 50%);
    }

    .splitContainer {
        flex-direction: column;
    }

    .splitContainer > div {
        width: unset !important;
    }

    .grid-row > .name-cell {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hotkeys {
        grid-template-columns: repeat(2, 50%);
        text-overflow: ellipsis;
        overflow: hidden;
    }

    /* Shops tab */
    #actualWrapper {
        padding-bottom: max(0px, calc(100vh - 20rem));
        grid-template-areas:
            "consumables"
            "shoptop"
            "shop"
            "buttons";
    }

    #actualConsumables {
        width: unset;
    }

    #actualShop {
        flex-direction: column;
        align-items: stretch;
    }

    #shopFamilyList {
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid plum;
    }

    #shopDetail {
        width: unset;
        scroll-margin-top: calc(var(--mobile-subtab-height) + 0.5rem);
    }

    #antSacrificeShardsRow1,
    #antSacrificeShardsRow2,
    #antSacrificeShardsRow3 {
        flex-wrap: wrap;
    }

    /* Stats for nerds */
    #statsForNerds {
        display: grid;
        grid-template-columns: repeat(auto-fit, 32px);
        gap: 10px;
        min-width: unset;
        width: 95%;
        max-width: 500px;
        justify-content: center;
        align-items: center;
    }

    #mobileStatsNerdsInstruction {
        grid-column: 1 / -1;
        margin: 0;
        text-align: center;
    }

    #summaryGeneration {
        grid-column: 1 / -1;
        width: 250px !important;
        justify-self: center;
    }

    .mobileStatsNerdsIcon {
        box-sizing: border-box;
        width: 32px;
        height: 32px;
        padding: 0;
        cursor: pointer;
        background-color: var(--button-color);
        object-fit: fill;
    }

    #wowCubeSidebar {
        flex-direction: column;
    }

    .hepteractGrid {
        grid-template-columns: repeat(2, 50%);
    }
}

/* Ensure touch-friendly tap targets */
@media (any-pointer: coarse) {
    @media not all and (any-pointer: fine) {
        button:not(.mobile-menu-toggle):not(.mobileTabIconButton):not(.singularityUpgrade):not(.octeractUpgrade),
        .buildingPurchaseBtn,
        nav button:not(.mobile-menu-toggle):not(.mobileTabIconButton) {
            min-height: 44px;
        }

        #antProducers .antProducerColumn > button {
            min-height: 0;
            min-width: 0;
        }

        #platonicUpgradePics button {
            min-height: unset;
        }

        input[type="checkbox"] {
            min-width: 24px;
            min-height: 24px;
        }

        .confirmationToggle {
            gap: 10px;
        }

        #challengesAutoToggles > button {
            min-height: 44px;
            padding: 4px 8px;
        }

        #accountSubTab div#left.scrollbarX > div:is(#register, #login, #forgotpassword) {
            width: 100%;
        }
    }
}
