        /* === SHOP MODAL === */
        #shop-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #shop-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #shop-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
            padding: 20px;
            background: rgba(15, 12, 8, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            z-index: 250;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            max-width: 90vw;
        }

        #shop-container.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .shop-title {
            font-size: 14px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
            letter-spacing: 1px;
        }

        .shop-cards {
            display: flex;
            gap: 12px;
        }

        .shop-card {
            width: 110px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 12px;
            background: rgba(30, 25, 18, 0.8);
            border-radius: 14px;
            border: 2px solid rgba(100, 80, 50, 0.4);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .shop-card:hover {
            background: rgba(50, 40, 25, 0.9);
            border-color: rgba(255, 215, 0, 0.5);
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        }

        .shop-card:active {
            transform: translateY(-2px);
        }

        .shop-card.disabled {
            opacity: 0.5;
            filter: grayscale(30%);
        }

        .shop-card.disabled:hover {
            transform: none;
            border-color: rgba(100, 80, 50, 0.4);
            box-shadow: none;
        }

        .shop-card-preview {
            width: 75px;
            height: 75px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 50%;
            border: 2px solid rgba(80, 60, 40, 0.6);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .shop-card-preview canvas {
            image-rendering: pixelated;
            image-rendering: crisp-edges;
        }

        .shop-card-preview img {
            width: 130%;
            height: 130%;
            object-fit: contain;
        }

        .shop-card-name {
            font-size: 9px;
            color: #fff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
            text-align: center;
        }

        .shop-card-bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding-top: 6px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .shop-card-count {
            font-size: 10px;
            color: rgba(255, 255, 255, 0.5);
        }

        .shop-card-price {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 10px;
            color: #FFD700;
            text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
        }

        .shop-card-price img {
            width: 14px;
            height: 14px;
        }

        /* Shop faded state when worker modal is open */
        #shop-container.faded {
            opacity: 0.3;
            pointer-events: none;
        }

        /* Worker Detail Modal */
        #worker-modal-overlay {
            position: fixed;
            inset: 0;
            background: transparent;
            z-index: 300;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
        }

        #worker-modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #worker-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 280px;
            max-width: 90vw;
            padding: 24px 20px;
            background: rgba(15, 12, 8, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            z-index: 350;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #worker-modal.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .worker-modal-preview {
            width: 100px;
            height: 100px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 50%;
            border: 3px solid rgba(100, 140, 200, 0.4);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 30px rgba(100, 140, 200, 0.2);
            margin-bottom: 12px;
        }

        .worker-modal-preview canvas {
            image-rendering: pixelated;
            image-rendering: crisp-edges;
        }

        .worker-modal-preview img {
            width: 130%;
            height: 130%;
            object-fit: contain;
        }

        .worker-modal-name {
            font-size: 16px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
            margin-bottom: 4px;
        }

        .worker-modal-owned {
            font-size: 9px;
            color: rgba(255, 255, 255, 0.5);
            margin-bottom: 12px;
        }

        .worker-modal-desc {
            font-family: 'Press Start 2P', cursive;
            font-size: 8px;
            color: rgba(255, 255, 255, 0.6);
            line-height: 1.8;
            text-align: center;
            margin-bottom: 16px;
            padding: 0 4px;
        }

        .worker-modal-stats {
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 100%;
            margin-bottom: 16px;
        }

        .worker-modal-stat {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .worker-modal-stat img {
            width: 22px;
            height: 22px;
        }

        .worker-modal-stat-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .worker-modal-stat-label {
            font-size: 8px;
            color: rgba(255, 255, 255, 0.4);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .worker-modal-stat-value {
            font-size: 12px;
            color: #8CFF8C;
            text-shadow: 0 0 8px rgba(140, 255, 140, 0.3);
        }

        .worker-modal-stat-value.negative {
            color: #FF8C8C;
            text-shadow: 0 0 8px rgba(255, 140, 140, 0.3);
        }

        .worker-modal-buy {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(180deg, #5a8a3a 0%, #3a6a1a 100%);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow:
                0 4px 0 #2a4a0a,
                0 6px 20px rgba(0, 0, 0, 0.3);
        }

        .worker-modal-buy:hover:not(:disabled) {
            background: linear-gradient(180deg, #6a9a4a 0%, #4a7a2a 100%);
            transform: translateY(-2px);
            box-shadow:
                0 6px 0 #2a4a0a,
                0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .worker-modal-buy:active:not(:disabled) {
            transform: translateY(2px);
            box-shadow:
                0 2px 0 #2a4a0a,
                0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .worker-modal-buy:disabled {
            background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
            cursor: not-allowed;
            box-shadow: 0 4px 0 #1a1a1a;
        }

        .worker-modal-buy img {
            width: 20px;
            height: 20px;
        }

        .worker-modal-buy-text {
            font-family: 'Press Start 2P', cursive;
            font-size: 12px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .worker-modal-buy:disabled .worker-modal-buy-text {
            color: #666;
        }

        /* === CONSTRUCTION MODAL === */
        #construction-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #construction-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #construction-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
            padding: 20px;
            background: rgba(15, 12, 8, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            z-index: 250;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            max-width: 90vw;
        }

        #construction-container.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        #construction-container.faded {
            opacity: 0.3;
            pointer-events: none;
        }

        /* Building Detail Modal */
        #building-modal-overlay {
            position: fixed;
            inset: 0;
            background: transparent;
            z-index: 300;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
        }

        #building-modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #building-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 280px;
            max-width: 90vw;
            padding: 24px 20px;
            background: rgba(15, 12, 8, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            z-index: 350;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #building-modal.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        /* Shop & Modal responsive */
        @media (max-width: 380px) {
            #shop-container {
                padding: 16px;
            }

            .shop-cards {
                gap: 8px;
            }

            .shop-card {
                width: 90px;
                padding: 10px;
            }

            .shop-card-preview {
                width: 56px;
                height: 56px;
            }

            .shop-card-name {
                font-size: 8px;
            }

            .shop-card-price {
                font-size: 9px;
            }

            #worker-modal {
                width: 260px;
                padding: 20px 16px;
            }

            .worker-modal-preview {
                width: 80px;
                height: 80px;
            }

            .worker-modal-name {
                font-size: 14px;
            }

            .worker-modal-desc {
                font-size: 7px;
            }
        }

        /* === EXCHANGE MODAL === */
        #exchange-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #exchange-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #exchange-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            display: flex;
            flex-direction: column;
            width: 300px;
            max-width: 90vw;
            padding: 20px;
            background: rgba(15, 12, 8, 0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            z-index: 250;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #exchange-container.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .exchange-title {
            font-size: 14px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
            text-align: center;
            margin-bottom: 16px;
            letter-spacing: 1px;
        }

        .exchange-rate-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 8px 16px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            margin-bottom: 16px;
            font-size: 10px;
            color: rgba(255, 255, 255, 0.6);
        }

        .exchange-section {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 12px;
            padding: 14px;
            margin-bottom: 12px;
        }

        .exchange-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .exchange-section-label {
            font-size: 8px;
            color: rgba(255, 255, 255, 0.4);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .exchange-section-balance {
            font-size: 8px;
            color: rgba(255, 255, 255, 0.4);
        }

        .exchange-resource-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .exchange-resource-btns {
            display: flex;
            gap: 6px;
            flex: 1;
        }

        .exchange-resource-btn {
            width: 40px;
            height: 40px;
            background: rgba(30, 25, 18, 0.8);
            border: 2px solid rgba(100, 80, 50, 0.4);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .exchange-resource-btn img {
            width: 24px;
            height: 24px;
        }

        .exchange-resource-btn:hover {
            background: rgba(50, 40, 25, 0.9);
            border-color: rgba(255, 215, 0, 0.3);
        }

        .exchange-resource-btn.active {
            background: rgba(60, 50, 30, 0.9);
            border-color: rgba(255, 215, 0, 0.6);
            box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
        }

        .exchange-resource-btn.hidden {
            display: none;
        }

        /* Exchange Dropdown */
        .exchange-dropdown {
            position: relative;
            flex: 1;
        }

        .exchange-dropdown-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 10px 12px;
            background: rgba(30, 25, 18, 0.9);
            border: 2px solid rgba(100, 80, 50, 0.5);
            border-radius: 10px;
            color: #fff;
            font-family: 'Press Start 2P', cursive;
            font-size: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .exchange-dropdown-btn:hover {
            border-color: rgba(255, 215, 0, 0.4);
            background: rgba(40, 35, 25, 0.9);
        }

        .exchange-dropdown-btn img {
            width: 24px;
            height: 24px;
        }

        .exchange-dropdown-btn span {
            flex: 1;
            text-align: left;
        }

        .exchange-dropdown-btn.icon-only {
            width: auto;
            padding: 10px 12px;
            gap: 8px;
        }

        .exchange-dropdown-btn.icon-only img {
            width: 28px;
            height: 28px;
        }

        .exchange-dropdown-arrow {
            opacity: 0.6;
            transition: transform 0.2s ease;
        }

        .exchange-dropdown.open .exchange-dropdown-arrow {
            transform: rotate(180deg);
        }

        .exchange-dropdown-menu {
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            display: flex;
            flex-direction: row;
            gap: 2px;
            background: rgba(20, 17, 12, 0.98);
            border: 2px solid rgba(100, 80, 50, 0.6);
            border-radius: 10px;
            padding: 4px;
            z-index: 10;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px);
            transition: all 0.2s ease;
        }

        .exchange-dropdown.open .exchange-dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .exchange-dropdown-item {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            padding: 0;
            cursor: pointer;
            transition: all 0.15s ease;
            border-radius: 8px;
        }

        .exchange-dropdown-item:hover {
            background: rgba(255, 215, 0, 0.2);
        }

        .exchange-dropdown-item.active {
            background: rgba(255, 215, 0, 0.3);
            box-shadow: inset 0 0 0 2px rgba(255, 215, 0, 0.5);
        }

        .exchange-dropdown-item.hidden {
            display: none;
        }

        .exchange-dropdown-item img {
            width: 28px;
            height: 28px;
        }

        .exchange-amount-display {
            width: 80px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            flex-shrink: 0;
        }

        .exchange-amount-value {
            font-size: 14px;
            color: #fff;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            white-space: nowrap;
            min-width: 30px;
            text-align: right;
        }

        .exchange-amount-value.receive {
            color: #8CFF8C;
            text-shadow: 0 0 10px rgba(140, 255, 140, 0.3);
        }

        .exchange-icon-group,
        .rate-icon-group {
            position: relative;
            display: inline-block;
            width: 24px;
            height: 24px;
            flex-shrink: 0;
        }

        .exchange-icon-group img,
        .rate-icon-group img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            pointer-events: none;
        }

        .exchange-icon-group img.active,
        .rate-icon-group img.active {
            opacity: 1;
        }

        .rate-icon-group {
            width: 16px;
            height: 16px;
        }

        .exchange-amounts {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 16px;
        }

        .exchange-amount-btn {
            flex: 1;
            padding: 10px 8px;
            background: rgba(30, 25, 18, 0.8);
            border: 2px solid rgba(100, 80, 50, 0.4);
            border-radius: 10px;
            color: #fff;
            font-family: 'Press Start 2P', cursive;
            font-size: 9px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .exchange-amount-btn:hover:not(:disabled):not(.active) {
            background: rgba(50, 40, 25, 0.9);
            border-color: rgba(255, 215, 0, 0.4);
        }

        .exchange-amount-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .exchange-amount-btn.active {
            background: rgba(60, 80, 40, 0.8);
            border-color: rgba(140, 255, 140, 0.5);
        }

        .exchange-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(180deg, #5a8a3a 0%, #3a6a1a 100%);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow:
                0 4px 0 #2a4a0a,
                0 6px 20px rgba(0, 0, 0, 0.3);
        }

        .exchange-btn:hover:not(:disabled) {
            background: linear-gradient(180deg, #6a9a4a 0%, #4a7a2a 100%);
            transform: translateY(-2px);
            box-shadow:
                0 6px 0 #2a4a0a,
                0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .exchange-btn:active:not(:disabled) {
            transform: translateY(2px);
            box-shadow:
                0 2px 0 #2a4a0a,
                0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .exchange-btn:disabled {
            background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
            cursor: not-allowed;
            box-shadow: 0 4px 0 #1a1a1a;
        }

        .exchange-btn-text {
            font-family: 'Press Start 2P', cursive;
            font-size: 11px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .exchange-btn:disabled .exchange-btn-text {
            color: #666;
        }

        @media (max-width: 360px) {
            #exchange-container {
                width: 280px;
                padding: 16px;
            }

            .exchange-resource-btn {
                width: 36px;
                height: 36px;
            }

            .exchange-resource-btn img {
                width: 20px;
                height: 20px;
            }

            .exchange-amount-value {
                font-size: 12px;
            }

            .exchange-amount-display {
                width: 60px;
            }
        }

        /* === WALLET MODAL === */
        #wallet-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #wallet-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #wallet-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 320px;
            max-width: 90vw;
            padding: 20px;
            background: linear-gradient(180deg, #1a1612 0%, #0f0d0a 100%);
            border-radius: 16px;
            border: 1px solid rgba(255, 215, 255, 0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            z-index: 250;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            overflow: hidden;
        }

        #wallet-modal.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .wallet-title {
            text-align: center;
            font-size: 16px;
            color: #FFD700;
            margin: 0 0 16px 0;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .wallet-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .wallet-tab {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 12px 8px;
            background: rgba(30, 25, 18, 0.8);
            border: 2px solid rgba(100, 80, 50, 0.4);
            border-radius: 10px;
            color: rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .wallet-tab span {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .wallet-tab svg {
            opacity: 0.7;
        }

        .wallet-tab:hover {
            background: rgba(50, 40, 25, 0.9);
            border-color: rgba(255, 215, 0, 0.3);
            color: rgba(255, 255, 255, 0.8);
        }

        .wallet-tab:hover svg {
            opacity: 1;
        }

        .wallet-tab.active {
            background: rgba(60, 50, 30, 0.9);
            border-color: rgba(255, 215, 0, 0.6);
            box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
            color: #FFD700;
        }

        .wallet-tab.active svg {
            opacity: 1;
            stroke: #FFD700;
        }

        .wallet-tab-content {
            display: none;
        }

        .wallet-tab-content.active {
            display: block;
        }

        .wallet-qr {
            display: flex;
            justify-content: center;
            margin-bottom: 12px;
        }

        .wallet-qr img {
            width: 140px;
            height: 140px;
            border-radius: 8px;
            background: #fff;
            padding: 8px;
        }

        .wallet-address-row {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(15, 12, 8, 0.9);
            border: 2px solid rgba(100, 80, 50, 0.5);
            padding: 10px 12px;
            border-radius: 8px;
            margin-bottom: 16px;
        }

        .wallet-address {
            flex: 1;
            font-size: 8px;
            color: #FFD700;
            word-break: break-all;
            font-family: 'Press Start 2P', cursive;
            line-height: 1.4;
        }

        .wallet-copy-btn {
            background: rgba(255, 215, 0, 0.1);
            border: 1px solid rgba(255, 215, 0, 0.3);
            border-radius: 6px;
            color: rgba(255, 255, 255, 0.6);
            cursor: pointer;
            padding: 6px;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .wallet-copy-btn:hover {
            color: #FFD700;
            background: rgba(255, 215, 0, 0.2);
            border-color: rgba(255, 215, 0, 0.5);
        }

        .wallet-rate {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 4px 6px;
            padding: 10px;
            background: rgba(255, 215, 0, 0.08);
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.8);
        }

        .wallet-rate.withdraw {
            margin-top: 12px;
            margin-bottom: 12px;
        }

        .wallet-rate-icon {
            width: 18px;
            height: 18px;
            object-fit: contain;
        }

        .wallet-emerald-icon {
            width: 18px;
            height: 18px;
            image-rendering: pixelated;
        }

        .wallet-rate-value {
            color: #FFD700;
            font-weight: bold;
        }

        .wallet-info {
            text-align: center;
            font-size: 10px;
            color: rgba(255, 255, 255, 0.5);
            margin: 0;
            padding: 0 10px;
        }

        .wallet-input-group {
            margin-bottom: 12px;
        }

        .wallet-label {
            display: block;
            font-size: 9px;
            color: rgba(255, 255, 255, 0.6);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .wallet-input {
            width: 100%;
            padding: 12px 14px;
            background: rgba(15, 12, 8, 0.9);
            border: 2px solid rgba(100, 80, 50, 0.5);
            border-radius: 8px;
            color: #FFD700;
            font-family: 'Press Start 2P', cursive;
            font-size: 12px;
            box-sizing: border-box;
            transition: all 0.2s ease;
        }

        .wallet-input:focus {
            outline: none;
            border-color: rgba(255, 215, 0, 0.6);
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
        }

        .wallet-input::placeholder {
            color: rgba(255, 255, 255, 0.25);
            font-family: 'Press Start 2P', cursive;
            font-size: 10px;
        }


        .wallet-summary {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 12px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.7);
        }

        .wallet-receive {
            display: flex;
            align-items: center;
            gap: 5px;
            color: #FFD700;
            font-weight: bold;
            font-size: 15px;
        }

        .wallet-receive .wallet-rate-icon {
            width: 16px;
            height: 16px;
        }

        .wallet-withdraw-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(180deg, #5a8a3a 0%, #3a6a1a 100%);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow:
                0 4px 0 #2a4a0a,
                0 6px 20px rgba(0, 0, 0, 0.3);
            font-family: 'Press Start 2P', cursive;
            font-size: 11px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .wallet-withdraw-btn:hover:not(:disabled) {
            background: linear-gradient(180deg, #6a9a4a 0%, #4a7a2a 100%);
            transform: translateY(-2px);
            box-shadow:
                0 6px 0 #2a4a0a,
                0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .wallet-withdraw-btn:active:not(:disabled) {
            transform: translateY(2px);
            box-shadow:
                0 2px 0 #2a4a0a,
                0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .wallet-withdraw-btn:disabled {
            background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
            cursor: not-allowed;
            box-shadow: 0 4px 0 #1a1a1a;
            color: #666;
        }

        /* === BOOST MODAL === */
        #boost-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #boost-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #boost-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 300px;
            max-width: 90vw;
            padding: 24px;
            background: linear-gradient(180deg, #1a1420 0%, #0f0a14 100%);
            border-radius: 16px;
            border: 1px solid rgba(180, 100, 255, 0.3);
            box-shadow: 0 8px 32px rgba(100, 50, 180, 0.4);
            z-index: 250;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #boost-modal.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .boost-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-bottom: 20px;
        }

        .boost-icon {
            width: 40px;
            height: 40px;
            object-fit: contain;
            image-rendering: pixelated;
        }

        .boost-title {
            font-size: 14px;
            color: #b464ff;
            margin: 0;
            text-shadow: 0 0 20px rgba(180, 100, 255, 0.5);
        }

        .boost-level-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            margin-bottom: 8px;
        }

        .boost-level-label {
            font-size: 9px;
            color: rgba(255, 255, 255, 0.5);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .boost-level-value {
            font-size: 36px;
            color: #b464ff;
            text-shadow: 0 0 30px rgba(180, 100, 255, 0.6);
        }

        .boost-bonus-display {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 16px;
            background: rgba(100, 50, 180, 0.2);
            border-radius: 8px;
            margin-bottom: 16px;
        }

        .boost-bonus-icon {
            width: 18px;
            height: 18px;
        }

        .boost-bonus-value {
            font-size: 10px;
            color: #8CFF8C;
        }

        .boost-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(180, 100, 255, 0.3), transparent);
            margin: 16px 0;
        }

        .boost-next {
            text-align: center;
            margin-bottom: 16px;
        }

        .boost-next-label {
            display: block;
            font-size: 9px;
            color: rgba(255, 255, 255, 0.5);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 8px;
        }

        .boost-next-info {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }

        .boost-next-level {
            font-size: 24px;
            color: #FFD700;
            text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
        }

        .boost-next-bonus {
            font-size: 9px;
            color: #8CFF8C;
        }

        .boost-buy-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(180deg, #6a3a9a 0%, #4a2a6a 100%);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow:
                0 4px 0 #2a1a3a,
                0 6px 20px rgba(100, 50, 180, 0.4);
            font-family: 'Press Start 2P', cursive;
            font-size: 12px;
            color: #FFD700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .boost-buy-btn img {
            width: 18px;
            height: 18px;
        }

        .boost-buy-btn:hover:not(:disabled) {
            background: linear-gradient(180deg, #7a4aaa 0%, #5a3a7a 100%);
            transform: translateY(-2px);
            box-shadow:
                0 6px 0 #2a1a3a,
                0 10px 30px rgba(100, 50, 180, 0.5);
        }

        .boost-buy-btn:active:not(:disabled) {
            transform: translateY(2px);
            box-shadow:
                0 2px 0 #2a1a3a,
                0 4px 10px rgba(100, 50, 180, 0.3);
        }

        .boost-buy-btn:disabled {
            background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
            cursor: not-allowed;
            box-shadow: 0 4px 0 #1a1a1a;
            color: #666;
        }

        .boost-max-reached {
            text-align: center;
            padding: 16px;
            background: linear-gradient(180deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
            border-radius: 12px;
            border: 1px solid rgba(255, 215, 0, 0.3);
        }

        .boost-max-reached span {
            font-size: 11px;
            color: #FFD700;
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .boost-limit-notice {
            text-align: center;
            padding: 8px 12px;
            margin-bottom: 12px;
            background: rgba(255, 200, 100, 0.1);
            border-radius: 8px;
            border: 1px solid rgba(255, 200, 100, 0.2);
        }

        .boost-limit-notice span {
            font-size: 8px;
            color: rgba(255, 200, 100, 0.9);
        }

        /* Boost Limit Warning Modal */
        #boost-limit-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 300;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        #boost-limit-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        #boost-limit-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 280px;
            max-width: 90vw;
            padding: 24px;
            background: linear-gradient(180deg, #1a1815 0%, #0f0d0a 100%);
            border-radius: 16px;
            border: 1px solid rgba(255, 200, 100, 0.3);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            z-index: 301;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            text-align: center;
        }

        #boost-limit-modal.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .boost-limit-header {
            margin-bottom: 16px;
        }

        .boost-limit-icon {
            width: 48px;
            height: 48px;
            opacity: 0.5;
        }

        .boost-limit-title {
            font-size: 12px;
            color: #ffc864;
            margin: 0 0 12px 0;
        }

        .boost-limit-text {
            font-size: 10px;
            color: rgba(255, 255, 255, 0.8);
            line-height: 1.6;
            margin: 0 0 20px 0;
        }

        .boost-limit-text strong {
            color: #FFD700;
        }

        .boost-limit-btn {
            width: 100%;
            padding: 12px 20px;
            background: linear-gradient(180deg, #4a4a3a 0%, #2a2a20 100%);
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-family: 'Press Start 2P', cursive;
            font-size: 10px;
            color: #fff;
            transition: all 0.2s ease;
            box-shadow: 0 4px 0 #1a1a10;
        }

        .boost-limit-btn:hover {
            background: linear-gradient(180deg, #5a5a4a 0%, #3a3a30 100%);
            transform: translateY(-2px);
        }

        .boost-limit-btn:active {
            transform: translateY(2px);
            box-shadow: 0 2px 0 #1a1a10;
        }


