    body {
        margin: 0;
        background: #111;
        color: #fff;
        font-family: 'Momo Sans', sans-serif;
        overflow: hidden;
    }

    #layout {
        display: grid;
        grid-template-columns: 300px 1fr 300px;
        height: 100vh;
        overflow: hidden;
    }

    #upgradePanel {
        background: #181818;
        padding: 20px;
        box-shadow: 2px 0 10px #000;
        overflow-y: auto;
        position: relative;
        z-index: 5;
    }

    #upgradePanel h2 {
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
    }

    #upgradePanel button {
        width: 100%;
        padding: 12px;
        margin: 12px 0;
        background: #222;
        border: none;
        color: white;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        z-index: 1;
    }

    #upgradePanel button:hover {
        background: #333;
    }

    #upgradePanel button .tooltip {
        position: absolute;
        /* relative to button */
        bottom: 120%;
        /* above the button */
        left: 50%;
        transform: translateX(-50%);
        background: #000;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 1000;
        visibility: hidden;
    }

    #upgradePanel button:hover .tooltip {
        visibility: visible;
    }

    #gameContainer {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        overflow: hidden;
        z-index: 1;
    }

    #gameWrapper {
        width: 100%;
        height: 100vh;
        position: relative;
    }

    canvas#game {
        display: block;
        position: absolute;
        left: 0;
        width: 50vw;
        height: 100vh;
        z-index: 1;
    }

    #score,
    #prestigeMultiplier,
    #transcendMultiplier,
    #critChance {
        position: absolute;
        left: 25%;
        transform: translateX(-50%);
        font-size: 28px;
        z-index: 10;
    }

    #score {
        font-size: 28px;
        top: 20px;
    }

    #prestigeMultiplier {
        font-size: 14px;
        top: 60px;
        background-image: linear-gradient(90deg, #ffa600, #ff4800);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    #transcendMultiplier {
        font-size: 14px;
        top: 85px;
    }

    #critChance {
        top: 110px;
        font-size: 12px;
    }

    #transcensionShards {
        font-size: 14px;
        margin: 10px 0;
        text-align: left;
        background-image: linear-gradient(90deg, #0084ff, #0400ff);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    #critChance {
        position: absolute;
        left: 25%;
        transform: translateX(-50%);
        font-size: 12px;
        top: 100px;
    }

    #rightPanel {
        background: #181818;
        box-shadow: -2px 0 10px #000;
        overflow-y: auto;
    }

    #prestigeBtn {
        display: block;
        margin: 20px auto;
        padding: 12px 24px;
        background: linear-gradient(90deg, #ff9100, #ff3d00);
        color: #fff;
        border: none;
        border-radius: 12px;
        font-size: 20px;
        cursor: pointer;
    }

    #prestigeBtn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    #actualTranscendBtn {
        display: block;
        margin: 20px auto;
        padding: 12px 24px;
        background: linear-gradient(90deg, #ff9100, #ff3d00);
        color: #fff;
        border: none;
        border-radius: 12px;
        font-size: 20px;
        cursor: pointer;
    }

    #actualTranscendBtn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    #prestigeInfo,
    #transcendInfo {
        border: 1px solid #fff;
        padding: 5px;
        border-radius: 5px;
        margin: 10px 0;
    }


    #prestigeProgressBar {
        width: 100%;
        height: 18px;
        background: #222;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 0 10px #000;
        margin: 10px 0;
        position: relative;
    }

    #prestigeProgressFill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #ffa600, #ff4800);
        border-radius: 12px;
        transition: width 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    #transcendProgressBar {
        width: 100%;
        height: 18px;
        background: #222;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 0 10px #000;
        margin: 10px 0;
        position: relative;
    }

    #transcendProgressFill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #0084ff, #0400ff);
        border-radius: 12px;
        transition: width 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .progressText {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 12px;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
        pointer-events: none;
    }

    #transcendBtn {
        width: 100%;
        background: #222;
        color: #fff;
        border: none;
        padding: 10px;
        border-radius: 5px;
        cursor: pointer;
        position: relative;
        margin: 5px 0;
    }

    #transcendBtn:hover:not(.disabled) {
        background: #333;
    }

    #transcendBtn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .hide {
        display: none;
    }

    #upgradeMenu {
        position: absolute;
        top: 0;
        right: 0;
        width: 50vw;
        height: 100vh;
        background: #181818;
        padding: 20px;
        display: flex;
        flex-direction: column;
        box-shadow: -2px 0 10px #000;
        z-index: 50;
    }

    .tabs {
        display: flex;
        margin-bottom: 20px;
    }

    .tab {
        flex: 1;
        background: #111;
        border: none;
        color: #fff;
        padding: 10px;
        cursor: pointer;
        font-size: 12px;
    }

    .tab.active {
        background: #333;
    }

    .tab.highlight {
        animation: highlight 1s infinite;
    }

    @keyframes highlight {
        0% {
            box-shadow: 0 0 0 0 rgba(255, 145, 0, 0.7);
        }

        70% {
            box-shadow: 0 0 0 10px rgba(255, 145, 0, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(255, 145, 0, 0);
        }
    }

    .tab-content {
        flex: 1;
        overflow: visible;
    }

    .tab-pane {
        display: none;
    }

    .tab-pane.active {
        display: block;
    }

    #upgradeMenu button {
        background: linear-gradient(135deg, #2a2a2a, #333);
        color: #fff;
        border: 1px solid #444;
        padding: 12px;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        width: 100%;
        margin: 8px 0;
        font-weight: 500;
        transition: all 0.2s ease;
        font-size: 0.95em;
    }

    #upgradeMenu button:hover:not(.disabled) {
        background: linear-gradient(135deg, #3a3a3a, #444);
        border-color: #555;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }

    #upgradeMenu button:active:not(.disabled) {
        transform: translateY(0);
    }

    #upgradeMenu button.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    #upgradeMenu button:hover .tooltip {
        display: block;
    }

    .upgrade-button-group {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        gap: 8px;
        margin-bottom: 20px;
        background: linear-gradient(135deg, #1a1a1a, #222);
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #333;
    }

    .upgrade-button-group button {
        width: 100%;
        margin: 0;
        padding: 12px;
        background: linear-gradient(135deg, #2a2a2a, #333);
        border: 1px solid #444;
        color: #fff;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 500;
        transition: all 0.2s ease;
        font-size: 0.95em;
    }

    .upgrade-button-group button:hover:not(.disabled) {
        background: linear-gradient(135deg, #3a3a3a, #444);
        border-color: #555;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }

    .upgrade-button-group button:active:not(.disabled) {
        transform: translateY(0);
    }

    .upgrade-button-group button:first-child {
        grid-column: 1;
    }

    .upgrade-button-group button:nth-child(2),
    .upgrade-button-group button:nth-child(3) {
        padding: 12px;
        font-size: 0.85em;
        font-weight: 600;
    }

    .upgrade-button-group button.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .buy-mode-selector {
        display: flex;
        float: right;
        align-items: center;
        gap: 3px;
        padding: 2px 4px;
        background: transparent;
        border-radius: 3px;
        border: none;
        margin: 0;
        flex-shrink: 0;
    }

    .buy-mode-selector label {
        display: none;
        margin-bottom: 0;
        font-weight: 600;
        font-size: 0.75em;
        color: #aaa;
        white-space: nowrap;
    }

    .buy-mode-buttons {
        display: flex;
        gap: 2px;
    }

    .buy-mode-btn {
        padding: 0px 2px;
        background: linear-gradient(135deg, #2a2a2a, #333);
        border: 1px solid #555;
        color: #fff;
        border-radius: 3px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px !important;
        transition: all 0.2s ease;
        min-width: 20px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .buy-mode-btn:hover {
        background: linear-gradient(135deg, #3a3a3a, #444);
        border-color: #666;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(255, 255, 255, 0.1);
    }

    .buy-mode-btn.active {
        background: linear-gradient(135deg, #ffa600, #ff6800);
        border-color: #ff4800;
        color: #fff;
        box-shadow: 0 0 8px rgba(255, 166, 0, 0.4);
    }

    .buy-mode-btn.active:hover {
        background: linear-gradient(135deg, #ffb820, #ff7800);
        border-color: #ff5800;
    }

    .tooltip {
        display: none;
        width: 120px;
        background-color: #333;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 5px;
        position: absolute;
        z-index: 10000;
        top: 50%;
        right: 100%;
        left: auto;
        transform: translateY(-50%);
    }

    .tooltip::after {
        content: "";
        position: absolute;
        top: 50%;
        right: -5px;
        left: auto;
        margin-top: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent transparent #333;
    }

    /* save popup */
    #savePopup {
        position: fixed;
        left: 20px;
        bottom: 20px;
        min-width: 180px;
        max-width: 320px;
        padding: 12px 14px;
        background: linear-gradient(90deg, #222, #2b2b2b);
        color: #fff;
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
        display: none;
        /* hidden by default */
        align-items: center;
        gap: 10px;
        z-index: 9999;
        /* above canvas */
        font-family: sans-serif;
        font-size: 14px;
    }

    /* message text */
    #savePopup .msg {
        flex: 1;
    }

    /* close button */
    #savePopup .close {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        padding: 4px;
        border-radius: 6px;
    }

    #savePopup .close:focus {
        outline: 2px solid #fff6;
    }


    .pUpTitle,
    #multiplier {
        background-image: linear-gradient(90deg, #ffa600, #ff4800);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    #prestex {
        color: #fff;
    }

    #confirmPopup {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        min-width: 250px;
        max-width: 400px;
        padding: 20px;
        background: linear-gradient(90deg, #222, #2b2b2b);
        color: #fff;
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        z-index: 10000;
        font-family: sans-serif;
        font-size: 16px;
        text-align: center;
    }

    #confirmPopup #confirmMsg {
        font-weight: bold;
    }

    #confirmPopup div {
        display: flex;
        gap: 10px;
    }

    #confirmPopup button {
        background: #444;
        border: none;
        color: #fff;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
    }

    #confirmPopup button:hover {
        background: #555;
    }

    #confirmYes {
        background: #d9534f;
    }

    #confirmYes:hover {
        background: #c9302c;
    }

    #exportImportPopup {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        min-width: 300px;
        max-width: 500px;
        padding: 20px;
        background: linear-gradient(90deg, #222, #2b2b2b);
        color: #fff;
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        z-index: 10000;
        font-family: sans-serif;
        font-size: 16px;
        text-align: center;
    }

    #exportImportPopup h3 {
        margin: 0;
    }

    #exportImportPopup textarea {
        width: 100%;
        height: 100px;
        resize: vertical;
        background: #333;
        color: #fff;
        border: none;
        border-radius: 5px;
        padding: 10px;
        font-family: monospace;
        font-size: 12px;
    }

    #exportImportPopup div {
        display: flex;
        gap: 10px;
    }

    #exportImportPopup button {
        background: #444;
        border: none;
        color: #fff;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
    }

    #exportImportPopup button:hover {
        background: #555;
    }

    #prestex {
        background-image: linear-gradient(90deg, #ffa600, #ff4800);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    button {
        margin: 5px;
    }

    /* Stats */
    .stat {
        background: #222;
        padding: 10px;
        margin: 10px auto;
        border-radius: 5px;
        border: 1px solid #444;
        width: 90%;
        margin-bottom: 10px;
        display: flex;
        justify-content: space-between;
    }

    /* Achievements */
    .achievement {
        background: #222;
        padding: 10px;
        margin: 10px auto;
        border-radius: 5px;
        border: 1px solid #444;
        width: 90%;
        margin-bottom: 20px;
    }

    #stats-tab {
        overflow-y: auto;
        max-height: 90vh;
    }

    .achievement.unlocked {
        background: #2a4a2a;
        border-color: #4a4;
    }

    .achievement {
        position: relative;
    }

    .achievement h3 {
        margin: 0 0 5px 0;
        color: #fff;
    }

    .achievement p {
        margin: 0;
        color: #ccc;
    }

    .achievement .hint {
        font-size: 12px;
        color: #aaa;
        margin-top: 5px;
    }

    .checkmark {
        float: right;
        color: #4a4;
        font-size: 20px;
    }

    #upgradeMenu {
        padding-bottom: 20px;
    }

    #critChance {
        background-image: linear-gradient(90deg, #ffa600, #ff4800);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .trUpTitle {
        background-image: linear-gradient(90deg, #0084ff, #0400ff);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .transcend-mult {
        background-image: linear-gradient(90deg, #0084ff, #0400ff);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    #version {
        position: fixed;
        bottom: 10px;
        left: 10px;
        color: #aaa;
        font-size: 12px;
        z-index: 1000;
        pointer-events: none;
    }

    /* Mission Box */
    #missionBox {
        position: absolute;
        width: 280px;
        background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
        border: 2px solid #ffa600;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
        z-index: 1000;
        font-family: 'Momo Sans', sans-serif;
        overflow: hidden;
        animation: missionBoxSlideIn 0.5s ease-out;
    }

    @keyframes missionBoxSlideIn {
        from {
            transform: translateX(100%);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .mission-header {
        background: linear-gradient(90deg, #ffa600, #ff4800);
        padding: 8px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        border-bottom: 1px solid #333;
    }

    .mission-icon {
        font-size: 16px;
    }

    .mission-title {
        color: white;
        font-weight: bold;
        font-size: 14px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    .mission-content {
        padding: 12px;
    }

    .mission-name {
        color: #ffa600;
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 4px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    }

    .mission-description {
        color: #ccc;
        font-size: 13px;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .mission-progress {
        margin-bottom: 10px;
    }

    .mission-progress-bar {
        width: 100%;
        height: 16px;
        background: #222;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 4px;
        border: 1px solid #444;
    }

    .mission-progress-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #00ff88, #00cc6a);
        border-radius: 8px;
        transition: width 0.3s ease;
        box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    }

    .mission-progress-text {
        color: #aaa;
        font-size: 11px;
        text-align: center;
    }

    /* Gradient text classes for Transcendence and Prestige */
    .transcend-gradient {
        background-image: linear-gradient(90deg, #0084ff, #0400ff);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .prestige-gradient {
        background-image: linear-gradient(90deg, #ffa600, #ff4800);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .wilderness-gradient {
        background-image: linear-gradient(90deg, #00ff88, #00cc6a);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .wildernessTitle {
        background-image: linear-gradient(90deg, #00ff88, #00cc6a);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    #wildernessInfo {
        background: #222;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 15px;
        border: 1px solid #00cc6a;
        box-shadow: 0 0 10px rgba(0, 204, 106, 0.2);
    }

    #wildernessInfo p {
        margin: 8px 0;
        color: #ccc;
        font-size: 14px;
        line-height: 1.4;
    }

    #wildernessInfo p:first-child {
        font-weight: bold;
        color: #00ff88;
        font-size: 15px;
    }

    #wildernessContent {
        background: #1a1a1a;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #008844;
    }

    #wildernessStats {
        margin-bottom: 15px;
        padding: 10px;
        background: #2a2a2a;
        border-radius: 5px;
        border: 1px solid #006633;
    }

    #wildernessRewards {
        margin-top: 15px;
        padding: 10px;
        background: #2a2a2a;
        border-radius: 5px;
        border: 1px solid #006633;
    }

    #wildernessPegRemoval {
        margin-top: 15px;
        padding: 10px;
        background: #2a2a2a;
        border-radius: 5px;
        border: 1px solid #006633;
    }

    #unlockWildernessBtn,
    #exploreWildernessBtn,
    #removePegBtn,
    #convertShardsBtn {
        background: linear-gradient(90deg, #008844, #00cc6a);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: bold;
        margin: 5px 0;
        width: 100%;
        transition: all 0.2s ease;
    }

    #unlockWildernessBtn:hover:not(.disabled),
    #exploreWildernessBtn:hover:not(.disabled),
    #removePegBtn:hover:not(.disabled) {
        background: linear-gradient(90deg, #00994d, #00dd77);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
    }

    #unlockWildernessBtn.disabled,
    #exploreWildernessBtn.disabled,
    #removePegBtn.disabled,
    #convertShardsBtn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .automationTitle {
        background-image: linear-gradient(90deg, #ffffff, #cccccc);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }

    .auto-prestige-controls {
        display: flex;
        gap: 10px;
        margin: 10px 0;
    }

    .auto-prestige-controls button {
        flex: 1;
        width: auto;
    }

    .auto-prestige-controls input {
        flex: 1;
        padding: 10px;
        background: #222;
        color: #fff;
        border: none;
        border-radius: 5px;
        font-size: 14px;
    }

    .auto-prestige-controls input:focus {
        outline: 2px solid #ffa600;
    }

    .auto-prestige-description {
        font-size: 12px;
        color: #ccc;
        margin: 5px 0 10px 0;
        line-height: 1.4;
    }

    /* Form controls styling */
    #controls-tab div {
        margin-bottom: 16px;
        padding: 12px;
        background: linear-gradient(135deg, #1a1a1a, #222);
        border-radius: 8px;
        border: 1px solid #333;
    }

    #controls-tab label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 0.95em;
        color: #fff;
    }

    #controls-tab select,
    #controls-tab input[type="checkbox"] {
        accent-color: #ffa600;
    }

    #controls-tab select {
        width: 100%;
        padding: 10px;
        background: linear-gradient(135deg, #2a2a2a, #333);
        color: #fff;
        border: 1px solid #444;
        border-radius: 6px;
        font-size: 0.9em;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    #controls-tab select:hover {
        border-color: #555;
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    }

    #controls-tab select:focus {
        outline: none;
        border-color: #ffa600;
        box-shadow: 0 0 8px rgba(255, 166, 0, 0.3);
    }

    #controls-tab input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        margin-right: 8px;
        vertical-align: middle;
    }

    #controls-tab input[type="checkbox"] + label {
        display: inline;
        margin-bottom: 0;
        margin-left: 0;
    }

    #upgradeMenu h2 {
        margin-top: 20px;
        margin-bottom: 12px;
        font-size: 1.3em;
        border-bottom: 2px solid #333;
        padding-bottom: 8px;
    }

    #upgradeMenu h2:first-child {
        margin-top: 0;
    }