/* ══════════════════════════════════════════════════════════════
   MINECRAFT / 8-BIT UI — COMPLETE STANDALONE STYLESHEET
   ══════════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Updated with standard pixelated system fallbacks */
    font-family: 'Press Start 2P', 'Courier New', Courier, monospace !important;
    text-transform: uppercase;
    font-weight: normal !important;
    -webkit-font-smoothing: none !important;
    -webkit-text-stroke: 0 !important;
    border-radius: 0 !important;
}

:root {
    --dock-h: 190px;
    --scale: 1;
    --mc-ui-bg: #c6c6c6;
    --mc-ui-dark: #373737;
    --mc-ui-darker: #1e1e1e;
    --mc-ui-light: #ffffff;
    --mc-text: #3f3f3f;
    --mc-boss-purple: #a200ff;
    --mc-xp-green: #32cd32;
    --mc-red: #ff5555;
    --mc-slot-bg: #8b8b8b;
}

/* ── GLOBAL RESET ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', monospace !important;
    text-transform: uppercase;
    font-weight: normal !important;
    -webkit-font-smoothing: none !important;
    -webkit-text-stroke: 0 !important;
    border-radius: 0 !important;
}

body {
    background-color: #5d5d5d;
    background-image: linear-gradient(45deg, #555 25%, transparent 25%, transparent 75%, #555 75%), linear-gradient(45deg, #555 25%, transparent 25%, transparent 75%, #555 75%);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
    color: var(--mc-text);
    overflow: hidden;
    user-select: none;
    height: 100vh;
}

/* ── HIDE OLD PANELS (dock replaced them) ── */
/* Hide old side panels but keep #ui (it wraps the canvas) */
#left-panel, #right-panel, #mouse-mode-bar {
    display: none !important;
}

/* ── MC BUTTON (Outset Border) ── */
button, .dock-tab, .dock-mode-btn {
    background: var(--mc-ui-bg);
    border-top: 3px solid var(--mc-ui-light);
    border-left: 3px solid var(--mc-ui-light);
    border-bottom: 3px solid var(--mc-ui-dark);
    border-right: 3px solid var(--mc-ui-dark);
    color: var(--mc-text);
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: none;
    font-size: 10px;
    letter-spacing: 0.5px;
}

    button:active:not(:disabled), .dock-mode-btn:active, .dock-tab:active {
        border-top-color: var(--mc-ui-dark);
        border-left-color: var(--mc-ui-dark);
        border-bottom-color: var(--mc-ui-light);
        border-right-color: var(--mc-ui-light);
        transform: translateY(2px);
        background: #b0b0b0;
    }

    button:disabled {
        filter: grayscale(100%);
        color: #888;
        cursor: not-allowed;
    }

/* ── MC SLOT (Inset Border) ── */
.hud-pill, .dock-ball-card, .dock-upg-card, .pnode, .rebirth-section {
    background: var(--mc-slot-bg);
    border-top: 3px solid var(--mc-ui-dark);
    border-left: 3px solid var(--mc-ui-dark);
    border-bottom: 3px solid var(--mc-ui-light);
    border-right: 3px solid var(--mc-ui-light);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

/* ── PANELS / MODALS ── */
#prestige-modal, #rebirth-modal, #ingame-popup, #rewards-panel, #hero-panel, #wheel-container {
    background: var(--mc-ui-bg);
    border-top: 4px solid var(--mc-ui-light);
    border-left: 4px solid var(--mc-ui-light);
    border-bottom: 4px solid var(--mc-ui-dark);
    border-right: 4px solid var(--mc-ui-dark);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
}

.p-header, .hero-header {
    padding: 10px 14px;
    background: var(--mc-ui-dark);
    color: var(--mc-ui-light);
    border-bottom: 4px solid var(--mc-ui-darker);
    font-size: 12px;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
}

/* ── CANVAS ── */
/* #ui is a flex row; canvas-wrap fills remaining space */
#ui {
    display: flex;
    height: 100vh;
    padding: 0;
    gap: 0;
}

#canvas-wrap {
    flex: 1;
    position: relative;
    background: #87ceeb;
    border: none;
    box-shadow: none;
    margin-bottom: var(--dock-h);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ── FLOATS ── */
#floats {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-num {
    position: absolute;
    font-size: 12px;
    color: var(--mc-red);
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    animation: mcFloatUp 0.8s steps(10) forwards;
}

.money-float-anim {
    position: absolute;
    font-size: 14px;
    color: var(--mc-xp-green);
    text-shadow: 2px 2px 0 #000;
    z-index: 100;
    animation: moneyFloatPath 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes mcFloatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

/* ── TOOLTIP ── */
#tooltip {
    display: none;
    position: fixed;
    background: rgba(16, 0, 16, 0.95);
    border: 3px solid #3f00a8;
    box-shadow: inset 0 0 0 2px #200055, 4px 4px 0 rgba(0,0,0,0.5);
    padding: 12px;
    z-index: 9000;
    max-width: 260px;
    color: #aaa;
    pointer-events: none;
}

#tt-name {
    font-size: 11px;
    color: #55ffff;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 #000;
}

#tt-body {
    font-size: 9px;
    line-height: 1.6;
}

    #tt-body b {
        color: var(--mc-red);
    }

/* ── HUD ── */
#top-hud {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 20;
    pointer-events: none;
}

.hud-pill {
    padding: 6px 10px;
    gap: 6px;
    display: flex;
    align-items: center;
}

.hud-icon {
    font-size: 12px;
}

.hud-value {
    font-size: 10px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

/* ── BOTTOM DOCK (Hotbar) ── */
#bottom-dock {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--dock-h);
    z-index: 50;
    display: flex !important;
    flex-direction: column;
    background: var(--mc-ui-bg) !important;
    border-top: 4px solid var(--mc-ui-light) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#dock-tabs {
    display: flex;
    align-items: center;
    background: var(--mc-ui-dark) !important;
    border-bottom: none !important;
    padding: 4px;
    gap: 3px;
    overflow-x: auto;
    flex-shrink: 0;
}

    #dock-tabs::-webkit-scrollbar {
        display: none;
    }

.dock-tab {
    padding: 6px 10px;
    font-size: 9px;
    white-space: nowrap;
    color: var(--mc-ui-light) !important;
    text-shadow: 2px 2px 0 #000;
    background: transparent !important;
}

    .dock-tab.active {
        background: var(--mc-ui-bg) !important;
        color: var(--mc-text) !important;
        text-shadow: none;
    }

    .dock-tab.locked {
        opacity: 0.3;
    }

#dock-content {
    flex: 1;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    background: var(--mc-ui-bg);
    min-height: 0;
}

/* ── DOCK MODE BUTTONS ── */
.dock-mode-btn {
    padding: 4px 8px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

    .dock-mode-btn.active {
        background: var(--mc-xp-green) !important;
        color: #fff !important;
        border-top-color: #5f5;
        border-left-color: #5f5;
    }

.btn-text {
    display: inline-block;
    max-width: 80px;
    opacity: 1;
    overflow: hidden;
    transition: max-width 0.15s, opacity 0.15s;
}

@media (max-width: 1100px) {
    .dock-mode-btn {
        padding: 4px 5px;
        gap: 0;
    }

        .dock-mode-btn .btn-text {
            max-width: 0;
            opacity: 0;
            margin: 0;
        }

        .dock-mode-btn:hover .btn-text {
            max-width: 70px;
            opacity: 1;
            margin-left: 3px;
        }
}

/* ── BOSS BAR ── */
#floating-boss-container {
    pointer-events: none;
    background: #333 !important;
    border: 3px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: 24px !important;
}

#floating-boss-bar {
    background: var(--mc-boss-purple) !important;
    border-top: 2px solid #d080ff;
}

#floating-boss-text {
    position: relative !important;
    top: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 9px !important;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
}

/* ── PRESTIGE ── */
/* ── PRESTIGE OVERLAY ── */
#prestige-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.85);
    padding: 16px;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

    #prestige-overlay[style*="block"] {
        display: flex !important;
    }

#prestige-modal {
    position: relative;
    width: 100%;
    max-width: 780px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--mc-ui-bg);
    overflow: visible;
    border-top: 4px solid var(--mc-ui-light);
    border-left: 4px solid var(--mc-ui-light);
    border-bottom: 4px solid var(--mc-ui-dark);
    border-right: 4px solid var(--mc-ui-dark);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    color: #ff5555;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    z-index: 5;
}

.p-header {
    padding: 14px;
    background: #222;
    color: #ffffff;
    border-bottom: 4px solid #000;
    font-size: 16px;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    margin: -16px -16px 0 -16px;
}

.prestige-stats {
    background: #2a2a2a;
    padding: 14px;
    text-align: center;
    font-size: 11px;
    border: 3px solid #111;
    text-shadow: 1px 1px 0 #000;
    color: #ccc;
}
/* Tabs */
.prestige-tabs {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 4px solid var(--mc-ui-dark);
    padding-bottom: 8px;
}

    .prestige-tabs button {
        flex: 1;
        min-width: 80px;
        font-size: 8px;
        padding: 8px 4px;
        color: var(--mc-text);
    }

        .prestige-tabs button.active {
            background: #222;
            color: #ffffff;
            border-top-color: #000;
            border-left-color: #000;
            border-bottom-color: #666;
            border-right-color: #666;
        }
/* Grid */
.prestige-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 8px;
}

    .prestige-grid::-webkit-scrollbar {
        width: 12px;
    }

    .prestige-grid::-webkit-scrollbar-track {
        background: #1e1e1e;
    }

    .prestige-grid::-webkit-scrollbar-thumb {
        background: var(--mc-ui-bg);
        border: 2px solid var(--mc-ui-light);
        border-bottom-color: var(--mc-ui-dark);
        border-right-color: var(--mc-ui-dark);
    }
/* Tier headers */
.tier-header {
    grid-column: 1 / -1;
    background: #444;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 11px;
    border-top: 3px solid #666;
    border-bottom: 3px solid #222;
    text-shadow: 2px 2px 0 #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

    .tier-header:first-child {
        margin-top: 0;
    }

.tier-req {
    font-size: 8px;
}

    .tier-req.met {
        color: #88ff88;
    }

    .tier-req.unmet {
        color: #ff6666;
    }
/* Cards — LIGHT backgrounds with DARK text (MC inventory style) */
.pnode {
    padding: 12px;
    cursor: pointer;
    background: var(--mc-ui-bg);
    border-top: 3px solid var(--mc-ui-light);
    border-left: 3px solid var(--mc-ui-light);
    border-bottom: 3px solid var(--mc-ui-dark);
    border-right: 3px solid var(--mc-ui-dark);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 150px;
}

    .pnode:hover:not(.maxed):not(.locked) {
        background: #d4d4d4;
    }

    .pnode.pending {
        background: #ffffaa;
        border-top-color: #eeee66;
        border-left-color: #eeee66;
        border-bottom-color: #999944;
        border-right-color: #999944;
    }

    .pnode.maxed {
        background: #aaffaa;
        border-top-color: #88ee88;
        border-left-color: #88ee88;
        border-bottom-color: #448844;
        border-right-color: #448844;
    }

    .pnode.locked {
        filter: grayscale(80%) brightness(0.7);
        opacity: 0.6;
        cursor: not-allowed;
    }

.pnode-icon {
    font-size: 26px;
    text-align: center;
}

.pnode-name {
    font-size: 10px;
    color: #111;
    text-align: center;
    line-height: 1.4;
}

.pnode-level {
    font-size: 9px;
    text-align: center;
    color: #333;
}

.pnode-desc {
    font-size: 8px;
    color: #222;
    text-align: center;
    line-height: 1.5;
    flex-grow: 1;
}

.pnode-tradeoff {
    font-size: 8px;
    color: #cc3300;
    text-align: center;
}

.pnode-req {
    font-size: 7px;
    color: #cc2222;
    text-align: center;
    padding: 4px;
    background: rgba(255,0,0,0.08);
}

.pnode-cost {
    font-size: 9px;
    text-align: center;
    background: #333;
    color: #d080ff;
    padding: 6px;
    text-shadow: 1px 1px 0 #000;
    border-top: 2px solid #222;
    border-left: 2px solid #222;
    border-bottom: 2px solid #555;
    border-right: 2px solid #555;
    margin-top: auto;
}

.pnode.maxed .pnode-cost {
    color: #66ff66;
    background: #224422;
}

.pnode.pending .pnode-cost {
    color: #ffcc44;
    background: #443300;
}
/* Footer */
.prestige-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

    .prestige-footer .prestige-warn {
        font-size: 8px;
        color: #666;
        flex: 1;
    }

#btn-do-prestige {
    background: #a200ff;
    color: #fff;
    padding: 10px 18px;
    font-size: 10px;
    border-top-color: #d080ff;
    border-left-color: #d080ff;
    border-bottom-color: #6600aa;
    border-right-color: #6600aa;
    flex-shrink: 0;
    text-shadow: 1px 1px 0 #000;
}

    #btn-do-prestige:disabled {
        background: #555;
        color: #888;
        border-color: #444;
    }

/* ── IN-GAME POPUPS ── */
#ingame-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

#ingame-popup {
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

#ingame-popup-text {
    font-size: 11px;
    margin-bottom: 20px;
    color: var(--mc-text);
    line-height: 1.8;
}

.popup-btn {
    padding: 10px 20px;
    font-size: 10px;
    margin: 4px;
}

.popup-btn-ok {
    color: var(--mc-xp-green);
}

.popup-btn-cancel {
    color: var(--mc-red);
}

.modal-close {
    width: 28px;
    height: 28px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mc-red);
}

/* ── HERO PANEL ── */
#hero-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    max-width: 400px;
    width: 90%;
}

.hero-stat {
    font-size: 9px;
    color: #333;
    padding: 3px 0;
}

#hero-avatar {
    image-rendering: pixelated;
}

/* ── DPS ── */
#dps-popout {
    position: fixed;
    right: 12px;
    bottom: calc(var(--dock-h) + 12px);
    width: 260px;
    z-index: 39;
    display: none;
    flex-direction: column;
}

#dps-popout-header {
    background: var(--mc-ui-dark);
    color: #fff;
    padding: 8px;
    font-size: 9px;
    text-shadow: 2px 2px 0 #000;
    display: flex;
    justify-content: space-between;
}

#dps-canvas {
    width: 100%;
    height: 50px;
    background: #111;
}

#dps-stats {
    display: flex;
    justify-content: space-between;
    padding: 6px;
    font-size: 8px;
    background: var(--mc-ui-bg);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    #top-hud {
        width: 96vw;
    }

    .hud-pill {
        flex: 1;
        padding: 5px 6px;
    }

    .hud-value {
        font-size: 9px;
    }

    .dock-tab {
        font-size: 8px;
        padding: 5px 7px;
    }
}


/* ═══════════════════════════════════════
   BOTTOM DOCK CARD LAYOUT STYLES
   ═══════════════════════════════════════ */

@keyframes dockRainbow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

#dock-tabs::-webkit-scrollbar {
    display: none;
}

.dock-tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 900;
    font-family: inherit;
    border: none;
    border-right: 2px solid #ccc;
    background: #ddd;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

    .dock-tab:hover {
        background: #eee;
    }

    .dock-tab.active {
        background: #fff;
        color: #111;
        border-bottom: 3px solid #ff8800;
    }

    .dock-tab.locked {
        opacity: 0.35;
        cursor: default;
        filter: grayscale(100%);
    }

.dock-mode-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 900;
    font-family: inherit;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    color: #333;
    white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

    .dock-mode-btn.active {
        background: #ff4444;
        color: #fff;
    }

/* Icon-only text that collapses on smaller screens */
.btn-text {
    display: inline-block;
    max-width: 100px;
    opacity: 1;
    overflow: hidden;
    transition: max-width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

@media (max-width: 1100px) {
    .dock-mode-btn {
        padding: 4px 6px;
        gap: 0;
    }

        .dock-mode-btn .btn-text {
            max-width: 0;
            opacity: 0;
            margin: 0;
        }

        .dock-mode-btn:hover .btn-text {
            max-width: 80px;
            opacity: 1;
            margin-left: 4px;
        }
}

.dock-panel {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    overflow-x: auto;
    overflow-y: visible;
    align-items: stretch;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

    .dock-panel::-webkit-scrollbar {
        height: 6px;
    }

    .dock-panel::-webkit-scrollbar-thumb {
        background: #aaa;
        border-radius: 3px;
    }

.dock-ball-card {
    flex-shrink: 0;
    width: 160px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    box-shadow: 0 4px 0 #000;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s;
}

.dock-upg-card:hover:not(.maxed):not(.cant-afford) {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    border-color: #ffaa00;
}


.dock-ball-card.cant-afford {
    filter: grayscale(70%);
    opacity: 0.5;
}

.dock-ball-card.locked {
    filter: grayscale(100%);
    opacity: 0.35;
    cursor: default;
}

.dock-ball-card .card-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dock-ball-card .card-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #000;
    flex-shrink: 0;
}

.dock-ball-card .card-pick-icon {
    flex-shrink: 0;
    image-rendering: pixelated;
    filter: drop-shadow(1px 1px 0 #000) drop-shadow(-1px -1px 0 #000);
}

.dock-ball-card .card-name {
    font-size: 14px;
    font-weight: 900;
    color: #111;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dock-ball-card .card-owned {
    font-size: 10px;
    color: #888;
    -webkit-text-stroke: 0;
}

.dock-ball-card .card-desc {
    font-size: 11px;
    color: #555;
    -webkit-text-stroke: 0;
    font-family: Arial,sans-serif;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dock-ball-card .card-stats {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dock-ball-card .card-chip {
    font-size: 11px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1px 4px;
    -webkit-text-stroke: 0;
}

.dock-ball-card .card-bottom {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: auto;
}

.dock-ball-card .card-buy {
    flex: 1;
    padding: 4px;
    font-size: 11px;
    font-weight: 900;
    font-family: inherit;
    background: #ffcc00;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 0 #000;
}

    .dock-ball-card .card-buy:disabled {
        background: #aaa;
        cursor: default;
    }

.dock-ball-card .card-auto {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #000;
    background: #eee;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-text-stroke: 0;
}

    .dock-ball-card .card-auto.active {
        background: #32cd32;
    }

.dock-upg-card {
    flex-shrink: 0;
    width: 180px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    box-shadow: 0 4px 0 #000;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s;
}



    .dock-upg-card.cant-afford {
        filter: grayscale(60%);
        opacity: 0.55;
    }

    .dock-upg-card.maxed {
        opacity: 0.45;
        cursor: default;
    }

    .dock-upg-card.can-afford {
        background: #efffef;
    }

    .dock-upg-card .upg-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dock-upg-card .upg-name {
        font-size: 14px;
        font-weight: 900;
    }

    .dock-upg-card .upg-cost {
        font-size: 11px;
        font-weight: 900;
        background: #ffcc00;
        border: 2px solid #000;
        border-radius: 6px;
        padding: 2px 6px;
        -webkit-text-stroke: 0;
    }

    .dock-upg-card .upg-desc {
        font-size: 11px;
        color: #555;
        -webkit-text-stroke: 0;
        font-family: Arial,sans-serif;
        font-weight: 400;
    }

    .dock-upg-card .upg-bar {
        height: 5px;
        background: #e0e0e0;
        border-radius: 3px;
        overflow: hidden;
        margin-top: auto;
    }

    .dock-upg-card .upg-bar-fill {
        height: 100%;
        background: #00a2ff;
        border-radius: 3px;
    }

    .dock-upg-card .upg-level {
        font-size: 11px;
        color: #888;
        -webkit-text-stroke: 0;
        text-align: right;
    }

.dock-section-label {
    flex-shrink: 0;
    writing-mode: vertical-lr;
    background: #333;
    color: #fff;
    padding: 8px 5px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
}

@media (max-height:500px) {
    :root {
        --dock-h: 150px;
    }

    .dock-ball-card {
        width: 140px;
    }

    .dock-upg-card {
        width: 160px;
    }

    .dock-tab {
        padding: 4px 10px;
        font-size: 11px;
    }
}

.dock-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #000;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-text-stroke: 0;
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
    flex-shrink: 0;
}

    .dock-action-btn:active {
        transform: translateY(1px);
        box-shadow: none;
    }

.dock-ball-card .card-price {
    flex: 1;
    font-size: 13px;
    font-weight: 900;
    color: #333;
    text-align: center;
    -webkit-text-stroke: 0;
    background: #ffcc00;
    border: 2px solid #000;
    border-radius: 6px;
    padding: 3px 4px;
}

.dock-ball-card.cant-afford .card-price {
    background: #ccc;
}

#side-menu {
    display: none !important;
}


.dock-upg-card .upg-cur {
    font-size: 11px;
    color: #00a;
    font-weight: 700;
    -webkit-text-stroke: 0;
    font-family: Arial,sans-serif;
}


/* Dock tabs: scrollable tabs with right actions that wrap on small screens */
#dock-tabs {
    flex-wrap: wrap;
}

#dock-modes, #dock-actions {
    flex-shrink: 0;
}

@media (max-width: 800px) {
    #dock-tabs {
        gap: 2px;
    }

    .dock-tab {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Bounce animation for hero/prestige buttons */
@keyframes dockBtnBounce {
    0%, 100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.15) rotate(-3deg);
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    75% {
        transform: scale(1.12) rotate(-1deg);
    }
}

.dock-mode-btn.bouncing {
    animation: dockBtnBounce 0.6s ease infinite;
    background: #ffcc00 !important;
    color: #000 !important;
    border-color: #ff8800 !important;
    box-shadow: 0 0 12px #ffcc00, 0 2px 0 rgba(0,0,0,0.2) !important;
}

/* Left floating buttons for rewards/spin */
#dock-left-btns {
    position: fixed;
    left: 12px;
    bottom: calc(var(--dock-h, 190px) + 10px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 25;
}

.dock-float-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #000;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 #000;
    position: relative;
    transition: transform 0.1s;
}

    .dock-float-btn:active {
        transform: translateY(3px);
        box-shadow: 0 1px 0 #000;
    }

    .dock-float-btn .btn-timer {
        position: absolute;
        bottom: -10px;
        background: #000;
        color: #fff;
        font-size: 9px;
        font-weight: 900;
        padding: 1px 5px;
        border-radius: 6px;
        border: 2px solid #fff;
        white-space: nowrap;
        font-family: Arial, sans-serif;
        -webkit-text-stroke: 0;
    }

/* Quest pill removed — using restyled #bvb-quest-layer instead */

/* ═══════════════════════════════════════
   BUGFIX OVERRIDES
   ═══════════════════════════════════════ */

/* Fix 1: Hero panel - no sideways scroll, proper sizing */
#hero-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 200;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden !important;
}

    #hero-panel * {
        max-width: 100%;
    }

/* Fix 5: Hide boss taunt banner (old floating text) */
#boss-taunt, #boss-banner {
    display: none !important;
}

/* Fix 6: Wisp popup styling */

/* Rebirth confirmation modal */
#rebirth-confirm {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10100;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
}

    #rebirth-confirm.active {
        display: flex;
    }

#rebirth-modal {
    max-width: 420px;
    width: 90%;
    padding: 20px;
    text-align: center;
}

    #rebirth-modal h2 {
        font-size: 18px;
        color: #ffcc00;
        text-shadow: 2px 2px 0 #000;
        margin-bottom: 12px;
    }

.rebirth-cost-line {
    font-size: 11px;
    color: #fff;
    margin-bottom: 14px;
}

.rebirth-section {
    margin-bottom: 12px;
    text-align: left;
    padding: 10px;
}

    .rebirth-section h3 {
        font-size: 11px;
        margin-bottom: 6px;
    }

.rebirth-loses {
    background: rgba(255,50,50,0.15);
    border: 2px solid #cc4444;
}

    .rebirth-loses h3 {
        color: #ff6666;
    }

.rebirth-gains {
    background: rgba(50,255,50,0.15);
    border: 2px solid #44cc44;
}

    .rebirth-gains h3 {
        color: #66ff66;
    }

.rebirth-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rebirth-section li {
    font-size: 9px;
    color: #ddd;
    padding: 2px 0;
}

    .rebirth-section li.no-pending {
        color: #888;
        font-style: italic;
    }

.rebirth-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

    .rebirth-buttons button {
        flex: 1;
        padding: 10px;
        font-size: 11px;
    }

#btn-cancel-rebirth {
    color: #ff4444;
}

#btn-confirm-rebirth {
    background: #a200ff;
    color: #fff;
}

#wisp-popup {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 300;
    padding: 12px 24px;
    background: var(--mc-ui-bg);
    border-top: 4px solid var(--mc-ui-light);
    border-left: 4px solid var(--mc-ui-light);
    border-bottom: 4px solid var(--mc-ui-dark);
    border-right: 4px solid var(--mc-ui-dark);
    font-size: 12px;
    color: var(--mc-text);
    text-align: center;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    pointer-events: none;
    animation: wispFadeUp 2s forwards;
}

@keyframes wispFadeUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -65%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -75%);
    }
}

/* Fix 7: Remove progress bar/slider from upgrade cards */
.upg-bar, .upg-bar-fill, .level-progress-bar {
    display: none !important;
}

/* Fix 4: Ensure card buy buttons are clickable */
.card-price, .card-buy {
    position: relative;
    z-index: 2;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.dock-ball-card, .dock-upg-card {
    pointer-events: auto !important;
}

    /* Fix card hover - don't let it block clicks */
    .dock-ball-card:hover, .dock-upg-card:hover {
        transform: scale(1.02);
        z-index: 5;
    }


/* ═══════════════════════════════════════════════════════════
   NUCLEAR OVERRIDES — beats all dynamically-injected IIFE styles
   Uses !important on everything to override <style> elements
   injected by quest/hero/tutorial/reward IIFEs
   ═══════════════════════════════════════════════════════════ */

/* ── POPUPS (welcome back, confirm, etc) ── */
#ingame-popup-overlay {
    background: rgba(0,0,0,0.85) !important;
}

#ingame-popup {
    background: var(--mc-ui-bg) !important;
    border-top: 4px solid var(--mc-ui-light) !important;
    border-left: 4px solid var(--mc-ui-light) !important;
    border-bottom: 4px solid var(--mc-ui-dark) !important;
    border-right: 4px solid var(--mc-ui-dark) !important;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5) !important;
    border-radius: 0 !important;
    color: var(--mc-text) !important;
    padding: 20px !important;
}

#ingame-popup-text {
    color: var(--mc-text) !important;
    font-size: 11px !important;
    text-shadow: none !important;
    background: transparent !important;
}

#ingame-popup-buttons {
    background: transparent !important;
}

    #ingame-popup-buttons button, .popup-btn, .popup-btn-ok, .popup-btn-cancel {
        background: var(--mc-ui-bg) !important;
        border-top: 3px solid var(--mc-ui-light) !important;
        border-left: 3px solid var(--mc-ui-light) !important;
        border-bottom: 3px solid var(--mc-ui-dark) !important;
        border-right: 3px solid var(--mc-ui-dark) !important;
        color: var(--mc-text) !important;
        text-shadow: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        padding: 10px 20px !important;
        font-size: 10px !important;
    }

/* ── HERO PANEL (overrides heroStyles IIFE) ── */
#hero-panel {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 200 !important;
    max-width: 380px !important;
    width: 85% !important;
    max-height: 75vh !important;
    overflow: visible !important;
    background: var(--mc-ui-bg) !important;
    border-top: 4px solid var(--mc-ui-light) !important;
    border-left: 4px solid var(--mc-ui-light) !important;
    border-bottom: 4px solid var(--mc-ui-dark) !important;
    border-right: 4px solid var(--mc-ui-dark) !important;
    border-radius: 0 !important;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5) !important;
    color: var(--mc-text) !important;
}

    #hero-panel * {
        max-width: 100% !important;
        color: var(--mc-text) !important;
        text-shadow: none !important;
        -webkit-text-stroke: 0 !important;
        border-radius: 0 !important;
        font-size: inherit;
    }

.hero-header {
    background: var(--mc-ui-dark) !important;
    color: var(--mc-ui-light) !important;
    text-shadow: 2px 2px 0 #000 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

#hero-avatar {
    width: 64px !important;
    height: 64px !important;
    border: 3px solid var(--mc-ui-dark) !important;
    background: var(--mc-slot-bg) !important;
    border-radius: 0 !important;
    image-rendering: pixelated !important;
}

.hero-stat {
    font-size: 9px !important;
    color: var(--mc-text) !important;
    padding: 3px 0 !important;
}

.aura-slot, .aura-inv-slot {
    background: var(--mc-slot-bg) !important;
    border-top: 2px solid var(--mc-ui-dark) !important;
    border-left: 2px solid var(--mc-ui-dark) !important;
    border-bottom: 2px solid var(--mc-ui-light) !important;
    border-right: 2px solid var(--mc-ui-light) !important;
    border-radius: 0 !important;
}

.aura-lvl {
    font-size: 8px !important;
    color: var(--mc-red) !important;
    background: var(--mc-ui-bg) !important;
}

/* ── QUEST PANEL (overrides questStyles IIFE) ── */
#bvb-quest-layer {
    background: var(--mc-ui-dark) !important; /* Dark background for high contrast */
    border: 3px solid var(--mc-ui-light) !important;
    border-radius: 0 !important;
    height: 50px !important; /* Make it a bit taller */
    padding-right: 12px !important;
}

    #bvb-quest-layer .bvb-q-text-item {
        font-size: 11px !important; /* Much bigger, readable font */
        text-shadow: 2px 2px 0 #000 !important; /* Heavy black shadow for readability */
        -webkit-text-stroke: 0 !important;
        line-height: 1.4 !important;
    }

#bvb-quest-text {
    color: #ffcc00 !important; /* Bright Gold */
}

#bvb-q-bar-text {
    color: #ffffff !important; /* Crisp White */
}

#bvb-quest-reward {
    color: #55ff55 !important; /* Bright Green */
}

.quest-pill {
    background: var(--mc-ui-dark) !important;
    color: var(--mc-ui-light) !important;
    border-radius: 0 !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
}

/* ── TUTORIAL (overrides tutStyles IIFE) ── */
#bvb-tut-text {
    background: var(--mc-ui-bg) !important;
    border: 3px solid var(--mc-ui-dark) !important;
    border-radius: 0 !important;
    color: var(--mc-text) !important;
    font-size: 10px !important;
    text-shadow: none !important;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5) !important;
}

#bvb-tut-face {
    background: var(--mc-slot-bg) !important;
    border: 3px solid var(--mc-ui-dark) !important;
    border-radius: 0 !important;
}

#bvb-tut-target-ring {
    border-color: var(--mc-xp-green) !important;
    border-radius: 0 !important;
}

/* ── REWARDS PANEL ── */
#rewards-panel, .reward-card {
    background: var(--mc-ui-bg) !important;
    border-radius: 0 !important;
    color: var(--mc-text) !important;
}

/* ── WHEEL / SPIN ── */
#wheel-overlay, #wheel-container {
    border-radius: 0 !important;
}

#wheel-overlay {
    background: rgba(0,0,0,0.85) !important;
}

#btn-spin {
    background: var(--mc-xp-green) !important;
    border-top: 3px solid #5f5 !important;
    border-left: 3px solid #5f5 !important;
    border-bottom: 3px solid #090 !important;
    border-right: 3px solid #090 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
    -webkit-text-stroke: 0 !important;
    font-size: 14px !important;
}

/* ── HIDE SIDE MENU (boss emoji buttons on top right) ── */
#side-menu {
    display: none !important;
}

/* ── PARKED WISPS ── */
#parked-wisps-container {
    position: fixed !important;
    right: 12px !important;
    top: 50px !important;
    z-index: 20 !important;
}

.parked-wisp {
    background: var(--mc-slot-bg) !important;
    border: 2px solid var(--mc-ui-dark) !important;
    border-radius: 0 !important;
}

/* ── DOCK BUTTONS — force styles over inline ── */
.dock-mode-btn[style*="ff4444"] {
    background: var(--mc-red) !important;
    color: #fff !important;
    border-top-color: #ff8888 !important;
    border-left-color: #ff8888 !important;
    border-bottom-color: #880000 !important;
    border-right-color: #880000 !important;
}

/* ── REBIRTH MODAL ── */
#rebirth-modal {
    background: var(--mc-ui-bg) !important;
    border-radius: 0 !important;
    color: var(--mc-text) !important;
}

    #rebirth-modal * {
        color: var(--mc-text) !important;
        text-shadow: none !important;
        -webkit-text-stroke: 0 !important;
    }

    #rebirth-modal h2 {
        color: var(--mc-text) !important;
        font-size: 14px !important;
    }

/* ── DPS POPOUT ── */
#dps-popout {
    background: var(--mc-ui-bg) !important;
    border-radius: 0 !important;
}

/* Fix wheel overlay below popup so prize message shows */
#wheel-overlay {
    z-index: 150 !important;
}

#ingame-popup-overlay {
    z-index: 9999 !important;
}


    /* Fix: popup show class fallback */
    #ingame-popup-overlay.show {
        display: flex !important;
    }

/* Fix: boss banner/taunt hidden completely */
/* Boss banner hidden but boss taunt restored */
#boss-banner, .boss-banner {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

#boss-taunt {
    background: var(--mc-ui-bg) !important;
    border-top: 3px solid var(--mc-ui-light) !important;
    border-left: 3px solid var(--mc-ui-light) !important;
    border-bottom: 3px solid var(--mc-ui-dark) !important;
    border-right: 3px solid var(--mc-ui-dark) !important;
    border-radius: 0 !important;
    font-size: 9px !important;
    color: var(--mc-text) !important;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5) !important;
}

    #boss-taunt * {
        color: var(--mc-text) !important;
        text-shadow: none !important;
        border-radius: 0 !important;
    }



/* Fix: prestige close button top-right */
#prestige-modal {
    position: relative !important;
}


/* Wisps keep their round shape */
.parked-wisp, .parked-wisp::before, .parked-wisp::after {
    border-radius: 50% !important;
}

/* Tutorial face shows image */
#bvb-tut-face {
    padding: 4px !important;
    overflow: hidden !important;
}

    #bvb-tut-face img {
        image-rendering: pixelated !important;
        border-radius: 0 !important;
    }

/* Welcome back popup styling */
#ingame-popup {
    max-width: 380px !important;
}

/* Wisp popup keep visible */
#wisp-popup {
    font-size: 11px !important;
    border-radius: 0 !important;
    z-index: 300 !important;
}

/* Hide old bottom-hud boss display completely */
#bottom-hud {
    display: none !important;
}

/* Hide wave-tracker and boss-banner completely - floating boss bar handles this */
#wave-tracker, #boss-banner {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
}

/* ═══════════════════════════════════════════════════════════
   BALL CARD FIXES & SHIFT-FREE BUTTONS
   ═══════════════════════════════════════════════════════════ */

:root {
    --dock-h: 215px !important;
}

.dock-panel {
    align-items: stretch !important;
    padding-top: 10px !important;
    padding-bottom: 12px !important;
}

/* 1. Make Pickaxe Cards Wider */
.dock-ball-card {
    width: 195px !important;
    display: flex !important;
    flex-direction: column !important;
}

    /* 2. Stats on a single line at the bottom */
    .dock-ball-card .card-stats {
        display: flex !important;
        justify-content: space-between !important;
        gap: 2px !important;
        margin-top: auto !important; /* Acts like a spring to push stats downward */
        margin-bottom: 4px !important;
    }

    .dock-ball-card .card-chip {
        font-size: 8px !important;
        background: #f0f0f0 !important;
        border: 1px solid #ccc !important;
        border-radius: 4px !important;
        padding: 3px !important;
        white-space: nowrap !important;
        flex: 1;
        text-align: center;
        color: #333 !important;
    }

/* 3. Stop expanding buttons from shifting the UI! */
.btn-text {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 1150px) {
    .dock-mode-btn {
        position: relative !important;
        width: 36px !important; /* Fixed width stops the flexbox from resizing and shifting! */
        padding: 4px 0 !important;
        overflow: visible !important;
        justify-content: center !important;
    }

        /* Drawer slides out to the right for Mode buttons */
        .dock-mode-btn .btn-text {
            position: absolute !important;
            top: -2px !important;
            left: 80% !important;
            height: calc(100% + 4px) !important;
            background: inherit !important; /* Magically matches the red color when active! */
            color: inherit !important;
            border: 2px solid #000 !important;
            border-left: none !important;
            border-radius: 0 6px 6px 0 !important;
            display: flex !important;
            align-items: center !important;
            padding: 0 8px !important;
            opacity: 0 !important;
            transform: translateX(-10px) !important;
            z-index: -1 !important;
            pointer-events: none !important;
            max-width: none !important;
        }

    /* Drawer slides out to the left for Action buttons (right side of screen) */
    #dock-actions .dock-mode-btn .btn-text {
        left: auto !important;
        right: 80% !important;
        border-left: 2px solid #000 !important;
        border-right: none !important;
        border-radius: 6px 0 0 6px !important;
        transform: translateX(10px) !important;
    }

    .dock-mode-btn:hover .btn-text {
        opacity: 1 !important;
        transform: translateX(0) !important;
        z-index: 20 !important;
    }
}

/* Smooth hop for pickaxe cards to prevent clipping */
.dock-ball-card:hover:not(.locked):not(.cant-afford) {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 0 rgba(0,0,0,0.5) !important;
    z-index: 10 !important;
    border-color: #ffaa00 !important;
}

/* Push the top HUD down so it doesn't cover the Wave Progress Bar */
#top-hud {
    top: 25px !important;
}

/* ═══════════════════════════════════════════════════════════
   3-LINE SLIM UI OVERRIDES (Fixed Heights, Clean Spacing)
   ═══════════════════════════════════════════════════════════ */

/* 1. Perfect dock height to fit exactly 3 lines + scrollbar without cutting off */
:root {
    --dock-h: 175px !important;
}

@media (max-height: 720px) {
    :root {
        --dock-h: 175px !important;
    }
}

/* 2. Push the scrollbar completely underneath the cards */
.dock-panel {
    align-items: stretch !important;
    padding-top: 10px !important;
    padding-bottom: 18px !important; /* Safe zone so the scrollbar doesn't eat the buy buttons */
    overflow-y: hidden !important;
}

/* 3. Cards get a strict minimum height based on the 3-line font size math */
.dock-ball-card, .dock-upg-card {
    height: auto !important;
    min-height: 85px !important; /* Exactly tall enough for 3 lines of pixel font */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 6px 8px !important;
}

    /* 4. Hide old unnecessary elements (Tooltips handle descriptions) */
    .dock-ball-card .card-desc {
        display: none !important;
    }

    /* 5. Pickaxe 3-Line Layout Adjustments */
    .dock-ball-card .card-top {
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
    }

    .dock-ball-card .card-pick-icon {
        max-height: 24px !important;
        width: auto !important;
        object-fit: contain !important;
    }

    .dock-ball-card .card-stats {
        margin-top: auto !important;
        margin-bottom: 6px !important;
    }

    .dock-ball-card .card-bottom {
        margin-top: 0 !important;
    }

    /* 6. Clean, simple hover hop */
    .dock-ball-card:hover:not(.locked):not(.cant-afford),
    .dock-upg-card:hover:not(.maxed):not(.cant-afford) {
        transform: translateY(-4px) !important;
        box-shadow: 0 8px 0 rgba(0,0,0,0.5) !important;
        border-color: #ffaa00 !important;
        z-index: 10 !important;
    }

    .dock-ball-card:active:not(.locked):not(.cant-afford),
    .dock-upg-card:active:not(.maxed):not(.cant-afford) {
        transform: translateY(2px) !important;
        box-shadow: 0 2px 0 rgba(0,0,0,0.6) !important;
    }

/* ═══════════════════════════════════════════════════════════
   COLLAPSIBLE TABS FIX (Seamless Overlap & Perfect Alignment)
   ═══════════════════════════════════════════════════════════ */

/* 1. Force the entire tab bar to NEVER wrap */
#bottom-dock #dock-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    width: 100% !important;
}

.dock-tab, #dock-modes, #dock-actions {
    flex-shrink: 0 !important;
}

/* 2. Flexbox alignment perfectly centers the text */
.dock-tab {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: visible !important;
}

.tab-base, .tab-ext {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

@media (max-width: 1150px) {
    .dock-tab {
        padding-left: 8px !important;
        padding-right: 8px !important; /* Exactly 8px of padding on the right */
    }

        /* 3. Pull the extension OUT of the document flow and OVERLAP the padding */
        .dock-tab .tab-ext {
            position: absolute !important;
            top: 0 !important;
            bottom: 0 !important;
            left: calc(100% - 8px) !important;
            /* FIX: Solid backgrounds instead of 'inherit' so it covers text underneath! */
            background: #373737 !important; /* Matches the dark grey dock header */
            color: inherit !important;
            border-right: 2px solid #ccc !important;
            padding-left: 0 !important;
            padding-right: 12px !important;
            opacity: 0 !important;
            transform: translateX(-10px) !important;
            pointer-events: none !important;
            z-index: -1 !important;
            transition: opacity 0.2s ease, transform 0.2s ease !important;
        }

        /* 4. Match the active orange border seamlessly and stretch down to cover it */
        .dock-tab.active .tab-ext {
            background: #c6c6c6 !important; /* Matches the light grey active tab */
            border-bottom: 3px solid #ff8800 !important;
            bottom: -3px !important;
        }

        /* 5. Pop out over the UI elements on the right */
        .dock-tab:hover .tab-ext {
            opacity: 1 !important;
            transform: translateX(0) !important;
            z-index: 30 !important;
            box-shadow: 4px 0 6px rgba(0,0,0,0.3) !important;
        }

        /* Hide empty extensions completely (like Rare and Epic) */
        .dock-tab .tab-ext:empty {
            display: none !important;
        }
}

/* ═══════════════════════════════════════════════════════════
   FULL-SCREEN UPGRADES & AUTO-HIDE DOCK
   ═══════════════════════════════════════════════════════════ */
/* 2. Manual Toggle Dock Animations */
#bottom-dock {
    /* Uses a snappy curve to pop up cleanly */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

    #bottom-dock.retracted {
        /* Slides down entirely, leaving EXACTLY the top 34px (the tabs) sticking up like a handle! */
        transform: translateY(calc(100% - 34px)) !important;
    }

/* ═══════════════════════════════════════════════════════════
   AUTO-HIDE BUG FIXES (Full Canvas & Pinned Buttons)
   ═══════════════════════════════════════════════════════════ */

/* 1. Camera Pan Effect: Canvas shifts up and down in sync with the dock */
#canvas-wrap {
    margin-bottom: 34px !important; /* Permanent safe space so the Hero sits perfectly above the tabs */
    height: calc(100vh - 34px) !important;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
    /* When dock is OPEN, push the camera UP by the height of the dock minus the tabs */
    transform: translateY(calc(-1 * (var(--dock-h) - 34px))) !important;
}

    #canvas-wrap.dock-retracted {
        /* When dock is CLOSED, the camera rests normally */
        transform: translateY(0) !important;
    }

/* 2. Pin the right-side buttons to the screen edge so they never hide when tabs overflow */
#dock-actions {
    position: sticky !important;
    right: 0 !important;
    background: #373737 !important; /* Matches the dark dock bar */
    z-index: 20 !important;
    box-shadow: -4px 0 6px rgba(0,0,0,0.3) !important;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL CLOSE BUTTON STYLING
   ═══════════════════════════════════════════════════════════ */
.modal-close {
    position: absolute !important;
    top: -15px !important;
    right: -15px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    color: #ff4444 !important;
    background: var(--mc-ui-bg) !important;
    border-top: 3px solid var(--mc-ui-light) !important;
    border-left: 3px solid var(--mc-ui-light) !important;
    border-bottom: 3px solid var(--mc-ui-dark) !important;
    border-right: 3px solid var(--mc-ui-dark) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5) !important;
    z-index: 9999 !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
}

    .modal-close:active {
        transform: translateY(2px) !important;
        box-shadow: 2px 2px 0 rgba(0,0,0,0.5) !important;
        border-top-color: var(--mc-ui-dark) !important;
        border-left-color: var(--mc-ui-dark) !important;
        border-bottom-color: var(--mc-ui-light) !important;
        border-right-color: var(--mc-ui-light) !important;
    }

/* ═══════════════════════════════════════════════════════════
   FONT SIZE OVERRIDES FOR 'PRESS START 2P' READABILITY
   ═══════════════════════════════════════════════════════════ */

/* 1. Floating Damage & Money Text */
.float-num {
    font-size: 16px !important;
}

.money-float-anim {
    font-size: 20px !important;
}

/* 2. Top HUD Values (Money, Level, Pickaxes) */
.hud-value {
    font-size: 14px !important;
}

@media (max-width: 900px) {
    .hud-value {
        font-size: 12px !important;
    }
}

/* 3. Headers (Shop, Upgrades, Hero, Rewards, etc.) */
.p-header, .hero-header {
    font-size: 16px !important;
    padding: 14px !important;
}

/* 4. Pop-ups (Wisp effects, Welcome Back, Confirmations) */
#wisp-popup {
    font-size: 16px !important;
    padding: 16px 24px !important;
}

#ingame-popup-text {
    font-size: 14px !important;
}

#ingame-popup-buttons button, .popup-btn {
    font-size: 12px !important;
}

/* 5. Boss Taunt Box */
#taunt-name {
    font-size: 16px !important;
}

#taunt-msg {
    font-size: 12px !important;
    line-height: 1.4 !important;
}

/* 6. Floating Boss HP Bar Text */
#floating-boss-text {
    font-size: 16px !important; /* Overrides the Bangers font size to fit the pixel font */
}


/* ═══════════════════════════════════════════════════════════
   PRESTIGE TREE OVERHAUL (FULLSCREEN NODE GRAPH)
   ═══════════════════════════════════════════════════════════ */
#prestige-overlay {
    padding: 2% !important; /* Small padding from screen edges */
}

#prestige-modal {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

#prestige-grid, .prestige-grid {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important; /* Stretch to fill all available space */
    width: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#prestige-viewport {
    flex: 1 !important; /* Takes up all space between header and footer */
    width: 100% !important;
    height: auto !important; /* Removed fixed height */
    overflow: hidden !important;
    position: relative;
    background: #000;
    border: 4px solid var(--mc-ui-dark);
    cursor: grab;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

    #prestige-viewport:active {
        cursor: grabbing;
    }

#prestige-canvas {
    position: relative;
    background-image: url('../img/dirt.png');
    background-size: 64px 64px;
    image-rendering: pixelated;
}

#prestige-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Base Minecraft Node */
.mc-tree-node {
    position: absolute;
    width: 48px;
    height: 48px;
    background: #8b8b8b;
    border: 2px solid #000;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.4), inset -2px -2px 0 rgba(0,0,0,0.5), 4px 4px 0 rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.1s;
}

    .mc-tree-node:hover {
        transform: scale(1.15);
        z-index: 10;
    }

    /* State Colors */
    .mc-tree-node.locked {
        background: #444;
        filter: grayscale(100%);
    }

    .mc-tree-node.pending {
        background: #ffcc00;
    }

    .mc-tree-node.maxed {
        background: #32cd32;
    }

/* Level Indicator Badge */
.mc-node-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: #ff4444;
    border: 2px solid #000;
    color: #fff !important;
    font-size: 10px !important;
    padding: 2px 4px;
    box-shadow: 2px 2px 0 #000;
    text-shadow: 1px 1px 0 #000 !important;
    z-index: 5;
}

/* Floating Tooltip inside the viewport */
#tree-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    background: rgba(16,0,16,0.95);
    border: 3px solid #3f00a8;
    box-shadow: inset 0 0 0 2px #200055, 4px 4px 0 rgba(0,0,0,0.6);
    padding: 12px;
    width: 220px;
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   PRESTIGE TREE OVERHAUL (FULLSCREEN, ZOOM, & Z-INDEX)
   ═══════════════════════════════════════════════════════════ */

/* 1. Force the overlay ABOVE quests and popups */
#prestige-overlay {
    padding: 12px !important; /* Slimmer outer border */
    z-index: 10005 !important; /* 10005 overrides quests (9999) */
}

/* 2. Slim down the inner grey border */
#prestige-modal {
    padding: 8px !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

    /* 3. Restructure the Header (Title Left, Points Right) */
    #prestige-modal .p-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
        text-align: left !important;
    }

.p-header-right {
    font-size: 10px !important;
    text-align: right !important;
    color: #aaa;
}

/* 4. Fix Hover Bug (Force SVG lines to ignore the mouse) */
#prestige-lines, #prestige-lines * {
    pointer-events: none !important;
}

.mc-tree-node {
    z-index: 50 !important;
    pointer-events: auto !important; /* Ensure nodes always accept hovers */
}

/* 5. Smooth Canvas Zooming */
#prestige-canvas {
    transform-origin: 0 0 !important;
    will-change: transform;
}

/* 6. Zoom UI Buttons */
.zoom-controls {
    position: absolute !important;
    bottom: 25px !important;
    left: 25px !important;
    display: flex !important;
    gap: 10px !important;
    z-index: 200 !important;
}

.zoom-btn {
    background: var(--mc-ui-bg) !important;
    border-top: 3px solid var(--mc-ui-light) !important;
    border-left: 3px solid var(--mc-ui-light) !important;
    border-bottom: 3px solid var(--mc-ui-dark) !important;
    border-right: 3px solid var(--mc-ui-dark) !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 24px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--mc-text) !important;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5) !important;
}

    .zoom-btn:active {
        transform: translateY(2px) !important;
        box-shadow: 2px 2px 0 rgba(0,0,0,0.5) !important;
        border-top-color: var(--mc-ui-dark) !important;
        border-left-color: var(--mc-ui-dark) !important;
        border-bottom-color: var(--mc-ui-light) !important;
        border-right-color: var(--mc-ui-light) !important;
    }

/* 7. Float the Rebirth Button */
#btn-do-prestige {
    position: absolute !important;
    bottom: 25px !important;
    right: 25px !important;
    z-index: 200 !important;
    font-size: 14px !important;
    padding: 16px 24px !important;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.6) !important;
    border-radius: 0 !important;
}

/* Ensure Tooltip is completely unclipped and above everything */
#tree-tooltip {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL FONT SIZE OVERRIDES (LARGER TEXT)
   ═══════════════════════════════════════════════════════════ */
.dock-tab {
    font-size: 13px !important;
}

.dock-mode-btn {
    font-size: 13px !important;
}

.btn-text {
    font-size: 13px !important;
}

.card-name, .upg-name {
    font-size: 16px !important;
}

.card-desc, .upg-desc {
    font-size: 12px !important;
    line-height: 1.4 !important;
}

.card-buy {
    font-size: 13px !important;
}

.card-chip {
    font-size: 9px !important;
}

.upg-cost {
    font-size: 13px !important;
}

.upg-cur {
    font-size: 11px !important;
}

.dock-section-label {
    font-size: 14px !important;
}

.hero-stat {
    font-size: 12px !important;
}

#hero-name-input {
    font-size: 20px !important;
}

.aura-title {
    font-size: 16px !important;
}

#equipped-aura {
    font-size: 14px !important;
}

.hud-value {
    font-size: 16px !important;
}

.p-header, .hero-header {
    font-size: 18px !important;
}

#bvb-quest-layer .bvb-q-text-item {
    font-size: 13px !important;
}

/* ═══════════════════════════════════════════════════════════
   KILL GHOST HOVER (Force Retracted State)
   ═══════════════════════════════════════════════════════════ */
#bottom-dock.retracted:hover,
#bottom-dock.retracted:active,
#bottom-dock.retracted:focus-within {
    /* Forces the dock to STAY down even if the mouse brushes over it */
    transform: translateY(calc(100% - 34px)) !important;
}

#canvas-wrap.dock-retracted:hover {
    /* Ensures the camera doesn't jitter if the dock is hovered */
    transform: translateY(0) !important;
}
