html, body {
    height: 100dvh;
}
body { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    background: #000; 
    color: white; 
    font-family: 'Press Start 2P', monospace; 
    user-select: none; 
    -webkit-user-select: none; 
    touch-action: none; 
    overscroll-behavior: none; 
    -webkit-tap-highlight-color: transparent; 
    text-shadow: 2px 2px 0px #000;
}
button, input, select, textarea {
    font-family: inherit;
}
        body.inventory-dragging, body.inventory-dragging * { cursor: grabbing !important; }
        
        /* Modern Minimalist Scrollbars */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

        /* Accessibility: Focus visible outline for interactive elements */
        button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
            outline: 2px solid #3498db;
            outline-offset: 2px;
        }
    #canvas { display: block; margin: 0 auto; background: #05070a; touch-action: none; width: 100vw; height: 100dvh; image-rendering: auto; transform: translate3d(0, 0, 0); will-change: transform; backface-visibility: hidden; }
/* =========================================================
   MINIMALIST MOBILE HUD (Top Left)
   ========================================================= */

#ui.mobile-hud {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none; /* Let clicks pass through to the game world */
}

.hud-bars-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    pointer-events: auto;
    position: relative;
}

/* Grouped Potion Slots (R & T) anchored right next to HP/MP bars */
#potion-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 8px;
}

#potion-bar .skill-slot,
.potion-slot {
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    border-radius: 6px !important;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.15s ease !important;
}

#potion-bar .hp-potion-slot {
    border: 1px solid rgba(231, 76, 60, 0.7) !important;
}

#potion-bar .mp-potion-slot {
    border: 1px solid rgba(52, 152, 219, 0.7) !important;
}

#potion-bar .skill-slot:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2) !important;
}

#potion-bar .skill-slot-content {
    width: 24px !important;
    height: 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#potion-bar .skill-slot-key {
    position: absolute;
    top: 2px !important;
    left: 3px !important;
    bottom: auto !important;
    right: auto !important;
    font-size: 8px !important;
    font-family: 'Press Start 2P', monospace;
    color: #fff;
    text-shadow: 1px 1px 0px #000;
}

#hp-potion-count,
#mp-potion-count {
    position: absolute !important;
    bottom: 2px !important;
    right: 3px !important;
    left: auto !important;
    font-size: 10px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 !important;
    line-height: 1 !important;
    z-index: 2;
}

/* Modern Unified Level Badge */
.hud-level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.hud-level-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: #f1c40f; /* Gold highlight */
    margin-bottom: 1px;
}

.hud-level-num {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1;
}

.hud-bars-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0; /* Prevents the stack itself from squishing */
}

/* Simplistic Rectangular Bars */
.minimal-bar {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.hp-bar {
    width: 160px !important;
    min-width: 160px !important;
    height: 16px !important;
}

.mp-bar {
    width: 130px !important;
    min-width: 130px !important;
    height: 11px !important;
}

.bar-fill {
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    transition: width 0.2s ease-out;
}

.hp-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.shield-fill {
    background: #00ffff;
    opacity: 0.8;
    z-index: 1;
}

.mp-fill {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.dodge-bar {
    width: 120px !important;
    min-width: 120px !important;
    height: 6px !important;
    margin-top: 2px;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 3px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.dodge-fill {
    background: linear-gradient(90deg, #d97706, #f59e0b, #fef08a);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
    transition: width 0.1s linear;
}

.dodge-bar.dodge-ready .dodge-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #ffffff);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 1px 3px rgba(0, 0, 0, 0.9);
    z-index: 2;
    letter-spacing: 0.5px;
}

.status-indicator {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #e74c3c;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #e74c3c;
    animation: alert-pulse 1s infinite alternate;
}

@keyframes alert-pulse {
    0% { opacity: 1; box-shadow: 0 0 8px rgba(231, 76, 60, 0.6); }
    100% { opacity: 0.5; box-shadow: none; }
}

        canvas { 
            image-rendering: auto;
        }
        img { 
            image-rendering: -moz-crisp-edges;
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            image-rendering: pixelated; 
        }
        svg {
            /* Enable crisp rendering for pixel SVGs if rendered as vectors */
            shape-rendering: crispEdges;
        }

        /* Icon Styles */
        .pixel-icon {
            width: 100%;
            height: 100%;
            display: inline-block;
            vertical-align: middle;
            filter: drop-shadow(1px 1px 0px rgba(0,0,0,0.8));
            image-rendering: -moz-crisp-edges;
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            image-rendering: pixelated;
        }


        /* Bank UI Styles */





        .bank-item-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0,0,0,0.4);
            padding: 6px;
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.05);
            margin-bottom: 4px;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        .bank-item-row:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
            transform: translateX(2px);
        }

        .bank-action-btn {
            border: none;
            border-radius: 6px;
            padding: 6px 12px;
            cursor: pointer;
            font-weight: 500;
            white-space: nowrap;
            font-size: 12px;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        .bank-action-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
        .bank-action-btn:active { transform: translateY(0) scale(0.95); }
        .bank-action-btn.deposit { background: rgba(52, 152, 219, 0.9); color: #fff; }
        .bank-action-btn.withdraw { background: rgba(234, 179, 8, 0.9); color: #000; }

        /* INVENTORY UI STYLES */


/* --- Inventory Action Buttons UX Polish --- */
.inv-action-btn {
    font-size: 10px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}
.inv-action-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.inv-action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.inv-action-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
#expand-inv-btn {
    background: #9b59b6;
    color: #fff;
    border: 1px solid #8e44ad;
}
#loot-all-btn {
    background: #2ecc71;
    color: #111;
    border: 1px solid #27ae60;
}
#auto-sort-btn {
    background: #3498db;
    color: #111;
    border: 1px solid #2980b9;
}

        #inventory-ui {
            display: flex;
            flex-direction: column;
            position: absolute;
            top: 50px;
            left: 50px;
            background: rgba(10, 15, 20, 0.4);
            border: 1px solid rgba(255,255,255,0.08);
            z-index: 20;
            color: white;
            border-radius: 14px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
            min-width: 520px;
            backdrop-filter: blur(12px);
        }
        #inventory-header {
            background: transparent;
            padding: 12px;
            cursor: grab;
            border-radius: 14px 14px 0 0;
            font-weight: bold;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            letter-spacing: 0.4px;
            text-transform: uppercase;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        #inventory-body { display: flex; padding: 18px; gap: 18px; align-items: flex-start; }
        .grid {
            display: grid;
            grid-template-columns: repeat(5, 52px);
            grid-auto-rows: 52px;
            gap: 8px;
            width: 300px;
            height: 236px;
            overflow-y: auto;
            background: transparent;
            border: none;
            border-radius: 10px;
            padding: 10px;
        }
        .slot {
            box-sizing: border-box !important;
            width: 52px;
            height: 52px;
            background-color: #222 !important;
            border: 2px solid #555 !important;
            box-shadow: inset -2px -2px 0px 0px #000, inset 2px 2px 0px 0px #777 !important;
            border-radius: 0 !important;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: none !important;
            flex-shrink: 0;
        }
        .slot.slot-hover, .slot:focus-visible {
            border-color: #fff !important;
            box-shadow: inset -2px -2px 0px 0px #aaa, inset 2px 2px 0px 0px #fff !important;
            transform: scale(1.05) !important;
            z-index: 10;
        }

        /* Gold styling for bank slots to separate them from inventory */
        .slot.bank-slot {
            border: 2px solid #d4af37 !important;
            box-shadow: inset -2px -2px 0px 0px #000, inset 2px 2px 0px 0px rgba(254, 215, 0, 0.4) !important;
            background-color: #221c00 !important;
        }
        .slot.bank-slot.slot-hover, .slot.bank-slot:focus-visible {
            border-color: #ffd700 !important;
            box-shadow: inset -2px -2px 0px 0px #d4af37, inset 2px 2px 0px 0px #fff !important;
        }

        .item {
            box-sizing: border-box !important;
            width: 44px;
            height: 44px;
            cursor: grab;
            border-radius: 7px;
            user-select: none;
            z-index: 100;
            border: 1px solid rgba(255,255,255,0.05);
            background: transparent !important;
            box-shadow: none !important;
            color: #ecf6ff;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
            flex-shrink: 0;
        }
        .item:hover { transform: scale(1.08); filter: brightness(1.15); background: rgba(255,255,255,0.08) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important; border-color: rgba(255,255,255,0.2); z-index: 101; }
        .item:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; transform: scale(1.08); filter: brightness(1.15); background: rgba(255,255,255,0.08) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important; border-color: rgba(255,255,255,0.2); z-index: 101; }
        .item:active { cursor: grabbing; transform: scale(0.95); }
        .item-token { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-shadow: 0 1px 2px rgba(0,0,0,0.7); display: inline-block; width: 32px; height: 32px; line-height: 32px; flex-shrink: 0; }

        .item.tier-common { outline: 1px solid rgba(180, 190, 210, 0.28); }
        .item.tier-uncommon { outline: 1px solid rgba(120, 236, 146, 0.45); }
        .item.tier-rare { outline: 1px solid rgba(110, 173, 255, 0.5); }

        .item.type-stick { background: transparent; }
        .item.type-stone, .item.type-stone_t1 { background: transparent; }
        .item.type-stone_t2 { background: transparent; }
        .item.type-faca_esfolar { background: transparent; }
        .item.type-axe { background: transparent; }
        .item.type-pickaxe { background: transparent; }
        .item.type-wood_axe { background: transparent; }
        .item.type-wood_log_t1 { background: transparent; }
        .item.type-wood_log_t2 { background: transparent; }

        .craft-panel { border-right: 1px solid rgba(255,255,255,0.08); padding-right: 18px; flex: 0 0 auto; }

        #drag-ghost {
            position: fixed;
            width: 46px;
            height: 46px;
            z-index: 2000;
            pointer-events: none;
            opacity: 0;
            transform: translate(-50%, -50%) scale(1.1);
            transition: opacity 0.08s linear;
            filter: drop-shadow(0 12px 24px rgba(0,0,0,0.5));
        }
        
        /* TOOLTIP */
        .tooltip { position: absolute; background: rgba(13, 17, 23, 0.95); border: 2px solid #5d4037; padding: 15px; border-radius: 6px; pointer-events: none; z-index: 10000; display: none; width: 240px; color: #e4eeff; box-shadow: 0 0 20px rgba(0,0,0,0.8), inset 0 0 0 1px #8d6e63; font-family: 'Press Start 2P', monospace; }
        .tooltip-icon { font-size: 32px; text-align: center; margin-bottom: 12px; line-height: 1.2; background: rgba(0,0,0,0.4); border: 1px solid #5d4037; border-radius: 4px; padding: 12px 0; box-shadow: inset 0 0 10px rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; }
        .tooltip-title { font-weight: bold; font-size: 11px; margin-bottom: 10px; color: #ffb300; border-bottom: 1px dashed #5d4037; padding-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; text-shadow: 1px 1px 0 #000; }
        .tooltip-desc { font-size: 10px; color: #b0bec5; line-height: 1.6; font-family: 'Press Start 2P', monospace; text-shadow: 1px 1px 0 #000; }

        #auth-ui {
            position: absolute;
            z-index: 999;
            top: 0;
            right: 0;
            left: auto;
            width: 440px;
            max-width: 100vw;
            height: 100vh;
            background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(25, 25, 30, 0.95) 12%, rgba(25, 25, 30, 0.95) 100%);
            border-left: none;
            box-shadow: none;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            box-sizing: border-box;
            overflow: hidden;
        }
        .auth-card {
            width: 100%;
            height: 100%;
            padding: 32px 28px 32px 12%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            box-sizing: border-box;
            overflow-y: auto;
            background: transparent;
            border: none;
            box-shadow: none;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.2) rgba(0,0,0,0.1);
        }
        .auth-card::-webkit-scrollbar {
            width: 6px;
        }
        .auth-card::-webkit-scrollbar-track {
            background: rgba(0,0,0,0.1);
        }
        .auth-card::-webkit-scrollbar-thumb {
            background-color: rgba(255,255,255,0.2);
            border-radius: 3px;
        }

        /* Responsive adjustments for landscape / small screens */
        @media (max-height: 680px) {
            .auth-card {
                justify-content: flex-start !important;
                padding-top: 16px !important;
                padding-bottom: 16px !important;
            }
        }
        @media (max-height: 600px) {
            .auth-intro {
                display: none !important;
            }
            .auth-instructions {
                display: none !important;
            }
            .auth-card {
                gap: 12px !important;
                padding-left: 20px !important;
                padding-right: 20px !important;
            }
            .auth-card h1 {
                font-size: 18px !important;
                margin-bottom: 4px !important;
            }
            #login-form {
                gap: 10px !important;
            }
            #login-form input, #login-form select, #login-form button {
                padding: 10px !important;
                font-size: 10px !important;
            }
        }
        @media (max-width: 600px) {
            #auth-ui {
                width: 100vw !important;
                max-width: 100vw !important;
                border-left: none !important;
            }
        }
        #auth-ui input,
        #auth-ui select,
        .login-input,
        .auth-select {
            padding: 11px 14px;
            font-size: 11px;
            border-radius: 4px;
            border: 1px solid #3a404d;
            background-color: rgba(10, 15, 20, 0.85);
            color: #f8fafc;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
            outline: none;
            width: 100%;
            box-sizing: border-box;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
            appearance: none;
            -webkit-appearance: none;
        }

        #auth-ui select,
        .auth-select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%3C94a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 32px;
            cursor: pointer;
        }

        #auth-ui input:focus,
        #auth-ui select:focus,
        .login-input:focus,
        .auth-select:focus {
            border-color: #38bdf8;
            background: rgba(15, 23, 42, 0.95);
            color: #ffffff;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 12px rgba(56, 189, 248, 0.4);
            outline: none;
        }

        #auth-ui input::placeholder {
            color: #64748b;
        }

        #auth-ui button { transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); }
        #auth-ui button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

        .btn-primary-cta {
            background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%) !important;
            border: 1.5px solid #60a5fa !important;
            box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
        }
        .btn-primary-cta:hover {
            transform: translateY(-2px) scale(1.01) !important;
            filter: brightness(1.2) !important;
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6) !important;
        }
        .btn-primary-cta:active {
            transform: translateY(0) scale(0.99) !important;
        }

        .btn-secondary-cta {
            background: rgba(15, 23, 42, 0.8) !important;
            transition: all 0.2s ease !important;
        }
        .btn-secondary-cta:hover {
            transform: translateY(-2px) !important;
            background: rgba(30, 41, 59, 0.95) !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
            filter: brightness(1.15) !important;
        }
        .btn-secondary-cta:active {
            transform: translateY(0) !important;
        }

        #auth-error { color: #f87171; font-weight: bold; background: rgba(239, 68, 68, 0.15); padding: 8px 12px; border-radius: 6px; border: 1px solid rgba(239, 68, 68, 0.3); text-shadow: none; }
        #auth-error:empty { display: none !important; }

        #corpse-menu {
            position: fixed;
            z-index: 1200;
            display: none;
            background: rgba(10,15,20,0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            min-width: 180px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            backdrop-filter: blur(12px);
            overflow: hidden;
            
        }
        #corpse-menu button {
            width: 100%;
            text-align: left;
            background: transparent;
            color: #e8efff;
            border: none;
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        #corpse-menu button:last-child { border-bottom: none; }
        #corpse-menu button:hover { background: rgba(255,255,255,0.1); }

        .context-menu-btn {
            width: 100%;
            text-align: left;
            background: transparent;
            color: rgba(255, 255, 255, 0.9);
            border: none;
            padding: 8px 10px;
            cursor: pointer;
                        transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
            font-size: 12px;
            font-family: system-ui, -apple-system, sans-serif;
            font-weight: 500;
        outline: none;
        }
        .context-menu-btn:last-child {
            border-bottom: none;
        }
        .context-menu-btn:hover {
            background: rgba(255,255,255,0.1);
        }
        .context-menu-btn:focus, .context-menu-btn:active, .context-menu-btn:focus-visible { outline: none; border: none; background: rgba(255,255,255,0.1); }

        #inspect-panel {
            position: fixed;
            right: 20px;
            top: 70px;
            z-index: 12000;
            display: none;
            width: 290px;
            max-width: 90vw;
            background: rgba(14, 18, 25, 0.96);
            border: 1px solid #46556f;
            border-radius: 10px;
            box-shadow: 0 12px 28px rgba(0,0,0,0.65);
            backdrop-filter: blur(8px);
            padding: 14px;
            color: #dce8ff;
            font-size: 12px;
            line-height: 1.5;
        }

        #mini-map-wrap {
            display: block;
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 1050;
            background: rgba(10, 15, 20, 0.4);
            display: none;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
            backdrop-filter: blur(12px);
            padding: 8px;
        }
        #mini-map {
            display: block;
            width: 180px;
            height: 180px;
            border-radius: 6px;
            background: #101622;
            border: 1px solid #2f405c;
        }
        #mini-map-title {
            font-size: 11px;
            color: #cfdcff;
            margin-bottom: 6px;
            letter-spacing: 0.4px;
            text-transform: uppercase;
        }

        #world-map-modal {
            position: absolute;
            inset: 0;
            z-index: 15000;
            display: none;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            align-items: center;
            justify-content: center;
        }
        #world-map-panel {
            font-family: 'Inter', system-ui, sans-serif;
            width: min(1000px, 94vw);
            height: min(720px, 90vh);
            background: linear-gradient(135deg, #11151c 0%, #0a0d12 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            box-shadow: 0 24px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #world-map-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 24px;
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        #world-map-header span {
            color: #f8fafc;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1.2px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        #world-map-header button {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #94a3b8;
                        padding: 6px 16px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        #world-map-header button:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #f8fafc;
        }
        #world-map-header button:active {
            transform: translateY(1px);
        }
        #world-map-header button:focus-visible {
            outline: 2px solid #3498db;
            outline-offset: 2px;
        }
        #world-map-content {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 280px;
            min-height: 0;
            background: #080a0f;
        }
        #world-map-canvas {
            width: 100%;
            height: 100%;
            display: block;
            background: #080b11;
        }
        #world-map-legend {
            background: #0f131a;
            border-left: 1px solid rgba(255, 255, 255, 0.05);
            padding: 24px;
            color: #cbd5e1;
            font-size: 13px;
            overflow-y: auto;
        }
        .legend-row { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            margin-bottom: 12px; 
            padding: 6px 8px;
            border-radius: 6px;
            transition: background 0.2s;
        }
        .legend-row:hover {
            background: rgba(255, 255, 255, 0.03);
        }
        .legend-swatch { 
            width: 16px; 
            height: 16px; 
            border-radius: 4px; 
            border: 1px solid rgba(255,255,255,0.1); 
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
            flex-shrink: 0;
        }

        .biome-legend-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-bottom: 12px;
        }
        .biome-chip {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 7px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 6px;
            font-size: 10px;
            color: #94a3b8;
            cursor: pointer;
            user-select: none;
            transition: all 0.2s ease;
        }
        .biome-chip:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #f8fafc;
            border-color: rgba(255, 255, 255, 0.2);
        }
        .biome-chip.active {
            background: rgba(56, 189, 248, 0.15);
            color: #38bdf8;
            border-color: #38bdf8;
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
        }
        .biome-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        #mobile-controls {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 1600;
            display: none;
            justify-content: space-between;
            align-items: flex-end;
            padding: 18px;
            pointer-events: none;
        }
        #move-pad {
            width: 132px;
            height: 132px;
            border-radius: 50%;
            background: rgba(10, 15, 20, 0.4);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
            backdrop-filter: blur(12px);
            position: relative;
            pointer-events: auto;
            touch-action: none;
        }
        #move-knob {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            backdrop-filter: blur(8px);
            transform: translate(-50%, -50%);
            box-shadow: 0 4px 12px rgba(0,0,0,0.4);
            pointer-events: none;
        }
        #mobile-actions {
            display: grid;
            grid-template-columns: repeat(2, 84px);
            gap: 10px;
            pointer-events: auto;
        }
        #mobile-actions button {
            border-radius: 50%;
            width: 70px;
            height: 70px;
            color: #ffffff !important;
            font-size: 10px !important;
            font-weight: bold;
            font-family: 'Press Start 2P', monospace !important;
            text-transform: uppercase;
            box-shadow: 0 4px 15px rgba(0,0,0,0.6), inset -3px -3px 0px 0px rgba(0,0,0,0.4), inset 3px 3px 0px 0px rgba(255,255,255,0.4) !important;
            text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000 !important;
            transition: all 0.1s ease;
            user-select: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #mobile-attack-btn {
            background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
            border: 3px solid #222 !important;
        }
        #mobile-collect-btn {
            background: linear-gradient(135deg, #f1c40f, #d35400) !important;
            border: 3px solid #222 !important;
        }
        #mobile-inventory-btn {
            background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
            border: 3px solid #222 !important;
        }
        #mobile-map-btn {
            background: linear-gradient(135deg, #3498db, #2980b9) !important;
            border: 3px solid #222 !important;
        }
        #mobile-actions button:active { transform: translateY(2px) scale(0.95); box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 3px 3px 0px 0px rgba(0,0,0,0.4), inset -3px -3px 0px 0px rgba(255,255,255,0.4) !important; }
        #mobile-actions button:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 255, 255, 0.2); }
        #mobile-actions button:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }

        /* NOVO UI: Barra Inferior e Janela de Status */
        .draggable-panel,
        .draggable-container {
            cursor: grab;
        }

        .draggable-panel.dragging,
        .draggable-container.dragging {
            cursor: grabbing;
        }

        .draggable-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            padding: 10px 18px;
            background: transparent;
            border: none;
            border-radius: 12px;
            box-shadow: none;
            backdrop-filter: none;
        }

        #main-exp-bar-container:hover {
            height: 14px !important;
            cursor: pointer;
        }
        #main-exp-bar-container:hover #main-exp-bar-text {
            opacity: 1 !important;
        }

        #top-bar {
            position: fixed;
            top: 14px;
            right: 14px;
            left: auto;
            transform: none;
            display: flex;
            align-items: center;
            gap: 6px;
            background: transparent !important;
            border: none !important;
            border-radius: 0;
            padding: 0 !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
            z-index: 10000;
        }

        #bottom-bar {
            position: fixed;
            bottom: 12px;
            left: 50%;
            right: auto;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 8px;
            background: transparent !important;
            border: none !important;
            border-radius: 0;
            padding: 0 !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
            z-index: 10000;
        }

        .hud-group {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .hud-group-divider {
            width: 1px;
            height: 24px;
            background: rgba(255, 255, 255, 0.15);
            margin: 0 2px;
            border-radius: 1px;
        }

        .icon-btn {
            background-color: rgba(0, 0, 0, 0.5) !important;
            background: rgba(0, 0, 0, 0.5) !important;
            border: 1px solid rgba(255, 255, 255, 0.15) !important;
            box-shadow: none !important;
            color: #fff;
            font-size: 20px;
            width: 38px;
            height: 38px;
            border-radius: 6px !important;
            cursor: pointer !important;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
            position: relative;
            backdrop-filter: blur(4px) !important;
        }
        .icon-btn:hover {
            border-color: rgba(255, 255, 255, 0.4) !important;
            background-color: rgba(0, 0, 0, 0.75) !important;
            background: rgba(0, 0, 0, 0.75) !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
            transform: translateY(-2px) scale(1.05) !important;
        }
        .icon-btn:active, .icon-btn.active {
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
            transform: translateY(0) scale(0.95) !important;
            background-color: rgba(0, 0, 0, 0.85) !important;
            background: rgba(0, 0, 0, 0.85) !important;
        }
        .icon-btn:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; border-radius: 4px; }
        .icon-btn .tooltip {
            position: absolute;
            top: -40px;
            background: #000;
            color: #fff;
            font-size: 13px;
            padding: 6px 10px;
            border-radius: 4px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            white-space: nowrap;
        }

        /* Quest Tracker Floating Overlay */
        #ui-quests,
        #quests-header,
        #quests-body {
            background: transparent !important;
            background-color: transparent !important;
            border: none !important;
            box-shadow: none !important;
            backdrop-filter: none !important;
        }

        #ui-quests,
        #quests-header,
        #quests-body,
        #quest-active-text,
        #quest-active-text * {
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 2px 2px 4px rgba(0,0,0,0.8) !important;
        }
        .attr-plus {
            background: #2a3546;
            border: 1px solid #4e6384;
            color: #fff;
            width: 20px;
            height: 20px;
            border-radius: 3px;
            margin-right: 8px;
            cursor: pointer;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            line-height: 1;
            transition: background 0.1s, transform 0.1s, filter 0.1s;
        }
        .attr-plus:hover { background: #3b4b61; }
        .attr-plus:active { transform: scale(0.9); filter: brightness(1.2); }
        .attr-plus:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }
        .attr-plus:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); transform: none; }
        .icon-btn:hover .tooltip, .icon-btn:focus-visible .tooltip { opacity: 1; z-index: 10001; }

        #status-panel { position: fixed; left: 20px; top: 120px; z-index: 1100; display: none; width: 250px; background: rgba(10, 15, 20, 0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); backdrop-filter: blur(12px); color: #e4eeff;  overflow-y: auto; max-height: 85vh; }
        .color-picker-input {
            border: 1px solid #4a5c78;
            border-radius: 4px;
            background: #11141a;
            cursor: pointer;
            width: 32px;
            height: 24px;
            padding: 0;
            outline: none;
            vertical-align: middle;
            transition: all 0.2s ease;
        }
        .color-picker-input:hover {
            border-color: #3498db;
            box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
            transform: scale(1.05);
        }
        .color-picker-input:focus-visible {
            outline: 2px solid #3498db;
            outline-offset: 2px;
            box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
        }

        #guild-panel { left: 280px; top: 120px; }
        #social-panel { left: 540px; top: 120px; }
        #skills-panel {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 15000;
            background: rgba(12, 15, 23, 0.7);
            backdrop-filter: blur(8px);
            color: #e4eeff;
            flex-direction: column;
            box-sizing: border-box;
            border: none;
            border-radius: 0;
            box-shadow: none;
            padding: 0;
            overflow: hidden;
        }

        #skills-panel .panel-header {
            background-color: #1a1a1a !important;
            padding: 15px 30px !important;
            border-bottom: 4px solid #333 !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            font-family: 'Press Start 2P', monospace !important;
            font-size: 16px !important;
            color: #f1c40f !important;
            border-radius: 0 !important;
            cursor: default !important;
        }

        #skills-panel .panel-body {
            flex: 1 !important;
            display: flex !important;
            flex-direction: row !important;
            padding: 20px !important;
            gap: 20px !important;
            background: transparent !important;
            box-sizing: border-box !important;
            height: calc(100vh - 60px) !important;
            overflow: hidden !important;
            box-shadow: none !important;
            border-radius: 0 !important;
        }

        .skill-tree-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            justify-items: center;
            align-items: center;
            position: relative;
            z-index: 3;
        }

        /* Path of Exile HTML5 Canvas Skill Tree Container & Styles */
        #skill-tree-container {
            background-color: rgba(3, 5, 9, 0.4);
            background-image: 
                radial-gradient(circle at 50% 30%, rgba(120, 53, 15, 0.12) 0%, rgba(69, 10, 10, 0.08) 50%, rgba(2, 4, 8, 0.98) 100%),
                radial-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px);
            background-size: 100% 100%, 32px 32px;
            background-position: center;
            border: 1px solid rgba(217, 119, 6, 0.2);
            border-radius: 8px;
            box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.98), 0 0 30px rgba(0, 0, 0, 0.7);
            position: relative;
            flex: 1;
            overflow: hidden;
            user-select: none;
            touch-action: none;
        }

        #skill-tree-canvas {
            display: block;
            width: 100%;
            height: 100%;
            cursor: grab;
        }
        #skill-tree-canvas:active {
            cursor: grabbing;
        }

        /* Sleek Glassmorphic PoE Tooltip */
        .poe-tooltip-card {
            background: rgba(10, 15, 26, 0.92);
            border: 1.5px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.12);
            backdrop-filter: blur(16px);
            max-width: 320px;
            padding: 14px;
            color: #f1f5f9;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            font-size: 11px;
            line-height: 1.5;
            pointer-events: none;
            z-index: 20000;
            transition: opacity 0.15s ease, transform 0.15s ease;
        }
        .poe-tooltip-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            margin-bottom: 10px;
        }
        .poe-tooltip-title {
            font-family: system-ui, -apple-system, sans-serif;
            font-weight: 700;
            font-size: 13px;
            letter-spacing: 0.5px;
            color: #fbbf24;
            margin: 0;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
        }
        .poe-tag-container {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-bottom: 8px;
        }
        .poe-tag-pill {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #38bdf8;
            font-size: 9px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 4px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }


        @keyframes linePulseAvail {
            0% { opacity: 0.6; filter: drop-shadow(0 0 4px rgba(52, 152, 219, 0.7)); }
            50% { opacity: 1; filter: drop-shadow(0 0 6px rgba(52, 152, 219, 0.9)); }
            100% { opacity: 0.6; filter: drop-shadow(0 0 4px rgba(52, 152, 219, 0.7)); }
        }

        @keyframes skill-pulse-blue {
            0% { box-shadow: 0 0 6px rgba(52, 152, 219, 0.4); border-color: #3498db; }
            100% { box-shadow: 0 0 14px rgba(52, 152, 219, 0.85); border-color: #5dade2; }
        }
        #class-panel { position: fixed; left: 850px; top: 120px; z-index: 1100; display: none; width: 340px; background: rgba(10, 15, 20, 0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); color: #e4eeff;  overflow: hidden; backdrop-filter: blur(12px); }
        
        .class-selection-container { padding: 5px; }
        
        .class-card {
            background: rgba(10, 15, 20, 0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 14px;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }
        
        .class-card:hover {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.3);
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        }
        
        .class-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        
        .class-icon { font-size: 24px; }
        .class-name { font-size: 18px; font-weight: bold; color: #fff; }
        
        .class-details p {
            font-size: 12px;
            color: #bdc3c7;
            margin: 0 0 8px 0;
            line-height: 1.4;
        }
        
        .class-stats {
            list-style: none;
            padding: 0;
            margin: 0 0 12px 0;
            font-size: 11px;
            color: #ecf0f1;
        }
        
        .class-stats li { margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
        .class-stats li strong { color: #f1c40f; min-width: 80px; }
        
        .select-class-btn {
            width: 100%;
            border: none;
            padding: 10px;
                        color: white;
            font-weight: 500;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 13px;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
            background: rgba(255,255,255,0.1);
        }
        
        .select-class-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.02); }
        .select-class-btn:active { transform: scale(0.98); }

        .warrior-card { border-left: 4px solid #c0392b; }
        .mage-card { border-left: 4px solid #2980b9; }
        .ranger-card { border-left: 4px solid #27ae60; }
        
        .draggable-panel {
            background-color: #1a1a1a !important;
            border: 4px solid #555 !important;
            box-shadow: inset -4px -4px 0px 0px #000, inset 4px 4px 0px 0px #777, 8px 8px 0px 0px rgba(0,0,0,0.5) !important;
            border-radius: 0 !important;
            backdrop-filter: none !important;
            flex-direction: column !important;
        }
        .draggable-panel .panel-header, #status-panel .panel-header, #guild-panel .panel-header, #social-panel .panel-header, #skills-panel .panel-header, #class-panel .panel-header, #inventory-header {
            background-color: #000 !important;
            padding: 10px !important;
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            border-bottom: 4px solid #555 !important;
            font-family: 'Press Start 2P', monospace !important;
            font-size: 10px !important;
            color: #fff !important;
            border-radius: 0 !important;
        }
        .panel-close-btn {
            background-color: #555 !important;
            border: 4px solid #777 !important;
            box-shadow: inset -2px -2px 0px 0px #222, inset 2px 2px 0px 0px #999 !important;
            color: #fff !important;
            border-radius: 0 !important;
            width: 24px !important;
            height: 24px !important;
            cursor: pointer !important;
            transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
            font-family: 'Press Start 2P', monospace !important;
            font-size: 10px !important;
        }
        .panel-close-btn:hover { background: rgba(231, 76, 60, 0.8) !important; color: white !important; transform: scale(1.15) !important; border-color: #e74c3c !important; }
        .panel-close-btn:active {
            box-shadow: inset 2px 2px 0px 0px #222, inset -2px -2px 0px 0px #999 !important;
            transform: translate(2px, 2px) scale(0.95) !important;
        }
        .panel-close-btn:focus-visible { outline: 2px solid #3498db !important; outline-offset: 2px !important; }
        .draggable-panel .panel-body, #status-panel .panel-body, #guild-panel .panel-body, #social-panel .panel-body { padding: 15px; font-size: 10px; line-height: 1.5; }
        .stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 4px; }
        
        #health-bar-container, #mana-bar-container { width: 100%; height: 16px; background: rgba(0,0,0,0.4); border-radius: 8px; margin-bottom: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); position: relative; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
        #health-bar-fill, #mana-bar-fill { height: 100%; width: 100%; transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
        #health-bar-fill { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
        #mana-bar-fill { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
        #health-text, #mana-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: white; text-shadow: 1px 1px 2px black; pointer-events: none; }

        .atlas-paths-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            min-height: 380px;
        }
        .atlas-account-grid {
            display: grid;
            grid-template-columns: 2fr 3fr;
            gap: 20px;
            align-items: stretch;
        }

        @media (max-width: 600px) {
            #atlas-panel {
                width: 95vw !important;
                height: 85vh !important;
                left: 2.5vw !important;
                top: 8vh !important;
                max-width: none !important;
            }
            .atlas-paths-grid {
                grid-template-columns: 1fr !important;
                gap: 12px !important;
                min-height: auto !important;
            }
            .atlas-account-grid {
                grid-template-columns: 1fr !important;
                gap: 12px !important;
            }
            #atlas-milestones-list {
                grid-template-columns: 1fr !important;
            }

            #ui-quests { display: none !important; }
            #ui-leaderboard { right: 10px; top: 10px; left: auto; width: 180px; transform: scale(0.8); transform-origin: top right; }
            #skills-panel { width: 94vw; left: 3vw; top: 5vh; }
            #status-panel, #guild-panel, #social-panel { width: 280px; left: 10px; top: 10px; }
            #status-panel .panel-body, #guild-panel .panel-body, #social-panel .panel-body { padding: 10px; font-size: 11px; }
            #mobile-controls { display: flex; }
            #mini-map-wrap { right: 8px; top: 10px; transform: scale(0.7); transform-origin: top right; }
            #mini-map { width: 140px; height: 140px; }
            #inspect-panel { width: 220px; right: 10px; top: 10px; }
            #world-map-panel { width: 96vw; height: 86vh; }
            #world-map-content { grid-template-columns: 1fr; }
            #world-map-legend { border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.05); }
        }

        @media (pointer: coarse) {
            #mobile-controls { display: flex; }
            .icon-btn .tooltip { display: none; }
        }

        /* SKILL BAR STYLES */
        #skill-bar {
            position: fixed;
            bottom: 60px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            z-index: 10001;
            pointer-events: auto;
            background: transparent;
            padding: 0;
            border-radius: 0;
            border: none;
            backdrop-filter: none;
            box-shadow: none;
        }

        .skill-slot {
            width: 52px;
            height: 52px;
            background-color: rgba(0, 0, 0, 0) !important;
            background: rgba(0, 0, 0, 0) !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
            box-shadow: none !important;
            border-radius: 6px !important;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            position: relative;
            transition: all 0.15s ease !important;
            user-select: none;
        }
        .skill-slot.is-empty,
        .skill-slot:not(.has-skill) {
            background-color: rgba(0, 0, 0, 0) !important;
            background: rgba(0, 0, 0, 0) !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
            box-shadow: none !important;
        }
        .skill-slot.has-skill {
            background-color: rgba(0, 0, 0, 0.5) !important;
            background: rgba(0, 0, 0, 0.5) !important;
            border: 1px solid rgba(255, 255, 255, 0.35) !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
        }
        .skill-slot.dodge-slot {
            background: rgba(14, 18, 25, 0.75) !important;
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
            margin-right: 6px !important;
        }
        .skill-slot.dodge-slot:hover {
            border-color: rgba(255, 255, 255, 0.65) !important;
            background: rgba(255, 255, 255, 0.1) !important;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.25) !important;
        }
        .skill-slot.dodge-slot .skill-slot-key {
            font-size: 7px !important;
            color: #ffffff !important;
            font-weight: bold !important;
            background: rgba(0, 0, 0, 0.5);
            padding: 1px 2px;
            border-radius: 2px;
        }
        .skill-slot:hover, .skill-slot:focus-visible {
            border-color: rgba(255, 255, 255, 0.6) !important;
            background-color: rgba(255, 255, 255, 0.1) !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.2) !important;
        }
        .skill-slot:active, .skill-slot.active {
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
            transform: translate(1px, 1px) !important;
            background-color: rgba(0, 0, 0, 0.3) !important;
        }
        .skill-slot-key {
            position: absolute;
            bottom: 2px;
            right: 3px;
            font-size: 8px !important;
            font-family: 'Press Start 2P', monospace;
            color: #fff;
            text-shadow: 1px 1px 0px #000;
        }

        .skill-slot.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .skill-slot-content {
            width: 46px;
            height: 46px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            font-size: 20px;
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(0,0,0,0.7);
            position: relative;
        }

        .skill-slot-key {
            position: absolute;
            bottom: 2px;
            right: 3px;
            font-size: 10px;
            color: #888;
            font-weight: bold;
        }

        .skill-cooldown {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 0%;
            background: rgba(0, 0, 0, 0.72);
            border-radius: 0 0 8px 8px;
            pointer-events: none;
            z-index: 5;
            transition: height 0.1s linear;
        }

        .skill-cooldown-timer {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 13px;
            font-weight: bold;
            color: #fff;
            text-shadow: 0 1px 3px rgba(0,0,0,0.9);
            z-index: 6;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .skill-slot.on-cooldown .skill-cooldown-timer {
            opacity: 1;
        }

        @keyframes skill-ready-pulse {
            0% { box-shadow: 0 0 0 0 rgba(122, 200, 255, 0.6); }
            70% { box-shadow: 0 0 12px 4px rgba(122, 200, 255, 0); }
            100% { box-shadow: 0 0 0 0 rgba(122, 200, 255, 0); }
        }

        @keyframes skill-queued-pulse {
            0% { border-color: #38bdf8 !important; box-shadow: 0 0 8px #38bdf8 !important; }
            50% { border-color: #00ffff !important; box-shadow: 0 0 16px #00ffff !important; }
            100% { border-color: #38bdf8 !important; box-shadow: 0 0 8px #38bdf8 !important; }
        }

        .skill-slot.skill-ready-flash {
            animation: skill-ready-pulse 0.6s ease-out;
        }

        .skill-slot.skill-queued {
            animation: skill-queued-pulse 0.6s infinite ease-in-out !important;
        }

        /* Skill Selection Modal */
        #skill-selection-modal {
            display: none;
        }

        #skill-selection-modal.open {
            display: flex !important;
        }

        .skill-option {
            background: linear-gradient(180deg, #2a3f52 0%, #1a2532 100%);
            border: 1px solid #3a4453;
                        padding: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
            color: #e4eeff;
        }

        .skill-option:hover {
            border-color: #7ac8ff;
            background: linear-gradient(180deg, #3a5f72 0%, #2a4542 100%);
            box-shadow: 0 0 8px rgba(122,200,255,0.3);
        }

        .skill-option-name {
            font-weight: bold;
            font-size: 14px;
            color: #fff;
            margin-bottom: 4px;
        }

        .skill-option-desc {
            font-size: 11px;
            color: #a4b7d1;
            line-height: 1.3;
        }

        /* Responsive adjustments for mobile */
        @media (max-width: 600px) {
            #skill-bar {
                bottom: 60px;
                padding: 8px 10px;
            }

            .skill-slot {
                width: 44px;
                height: 44px;
            }

            .skill-slot-content {
                width: 40px;
                height: 40px;
                font-size: 18px;
            }

            .skill-slot-key {
                font-size: 8px;
            }
        }
/* GAME UI VISIBILITY */
body:not(.in-game) #ui,
body:not(.in-game) #top-bar,
body:not(.in-game) #bottom-bar,
body:not(.in-game) #skill-bar,
body:not(.in-game) #mobile-controls,
body:not(.in-game) #mini-map-wrap,
body:not(.in-game) .draggable-panel,
body:not(.in-game) .draggable-container {
    display: none !important;
}


        /* Minimalist Floating Chat Overlay (like Quest Tracker) */
        #chat-container {
            position: absolute;
            bottom: 80px;
            left: 10px;
            width: 320px;
            max-height: 240px;
            display: flex;
            flex-direction: column;
            pointer-events: none;
            z-index: 10000;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            backdrop-filter: none !important;
            padding: 0 !important;
        }
        #chat-header {
            pointer-events: auto;
            cursor: grab;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 2px 4px !important;
            font-family: 'Press Start 2P', monospace;
            font-size: 9px !important;
            font-weight: normal;
            color: rgba(200, 220, 255, 0.5) !important;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 1px 3px rgba(0,0,0,0.9) !important;
            letter-spacing: 0.5px;
            margin-bottom: 3px !important;
            user-select: none;
            transition: color 0.2s ease;
            width: fit-content;
        }
        #chat-header:hover {
            color: rgba(255, 255, 255, 0.95) !important;
        }
        #chat-messages {
            pointer-events: auto;
            flex-grow: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            margin-bottom: 4px;
            padding: 0 2px;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 2px 4px rgba(0,0,0,0.95) !important;
            font-size: 12px;
            line-height: 1.35;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
        }
        #chat-messages::-webkit-scrollbar {
            width: 4px;
        }
        #chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        #chat-messages::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }
        #chat-messages::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.4);
        }
        .chat-msg {
            color: #fff !important;
            margin: 2px 0 !important;
            padding: 1px 0 !important;
            opacity: 0.95;
            transition: opacity 1s ease-out;
            word-wrap: break-word;
            font-weight: 500;
            background: transparent !important;
            border: none !important;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 2px 4px rgba(0,0,0,0.95) !important;
        }
        .chat-msg span {
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 2px 4px rgba(0,0,0,0.95) !important;
        }
        .chat-msg.fade-out {
            opacity: 0;
        }
        #chat-input {
            pointer-events: auto;
            background: rgba(10, 15, 25, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #fff;
            padding: 5px 8px;
            border-radius: 6px;
            outline: none;
            opacity: 0.6;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
            font-size: 11px;
            backdrop-filter: blur(4px);
            text-shadow: 0 1px 2px #000;
        }
        #chat-input::placeholder {
            color: rgba(200, 215, 235, 0.55);
            font-size: 11px;
        }
        #chat-input:hover {
            opacity: 0.85;
            background: rgba(10, 15, 25, 0.65);
            border-color: rgba(255, 255, 255, 0.3);
        }
        #chat-input:focus {
            opacity: 1;
            background: rgba(10, 15, 25, 0.85);
            border-color: rgba(59, 130, 246, 0.8);
            box-shadow: 0 0 10px rgba(59, 130, 246, 0.35), 0 2px 8px rgba(0,0,0,0.5);
        }
        #chat-input:focus-visible {
            outline: none;
        }
        body:not(.in-game) #chat-container {
            display: none !important;
        }

/* EQUIPPED ITEM SLOT GLOWS */
.slot.equipped-common {
    border-color: rgba(236, 240, 241, 0.4);
    background: rgba(236, 240, 241, 0.03);
}
.slot.equipped-uncommon {
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.45), inset 0 0 8px rgba(46, 204, 113, 0.2);
    background: rgba(46, 204, 113, 0.05);
}
.slot.equipped-rare {
    border-color: #3498db;
    box-shadow: 0 0 14px rgba(52, 152, 219, 0.55), inset 0 0 10px rgba(52, 152, 219, 0.25);
    background: rgba(52, 152, 219, 0.06);
}
.slot.equipped-epic {
    border-color: #9b59b6;
    box-shadow: 0 0 18px rgba(155, 89, 182, 0.75), inset 0 0 14px rgba(155, 89, 182, 0.35);
    background: rgba(155, 89, 182, 0.08);
    animation: slot-pulse-epic 2s infinite alternate;
}
.slot.equipped-legendary {
    border-color: #f1c40f;
    box-shadow: 0 0 24px rgba(241, 196, 15, 0.85), inset 0 0 18px rgba(241, 196, 15, 0.45);
    background: rgba(241, 196, 15, 0.1);
    animation: slot-pulse-legendary 2s infinite alternate;
}

@keyframes slot-pulse-epic {
    0% { border-color: rgba(155, 89, 182, 0.6); box-shadow: 0 0 10px rgba(155, 89, 182, 0.5), inset 0 0 10px rgba(155, 89, 182, 0.25); }
    100% { border-color: rgba(155, 89, 182, 1.0); box-shadow: 0 0 22px rgba(155, 89, 182, 0.9), inset 0 0 18px rgba(155, 89, 182, 0.45); }
}

@keyframes slot-pulse-legendary {
    0% { border-color: rgba(241, 196, 15, 0.6); box-shadow: 0 0 12px rgba(241, 196, 15, 0.6), inset 0 0 12px rgba(241, 196, 15, 0.35); }
    100% { border-color: rgba(241, 196, 15, 1.0); box-shadow: 0 0 28px rgba(241, 196, 15, 1.0), inset 0 0 22px rgba(241, 196, 15, 0.55); }
}

@keyframes reveal-glow-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 1; }
}

.screen-shake {
    animation: shake-anim 0.15s ease-in-out;
}

#crit-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    box-shadow: inset 0 0 90px rgba(255, 190, 0, 0.4);
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
#crit-vignette.active {
    opacity: 1;
}

@keyframes shake-anim {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-4px, 3px); }
    40% { transform: translate(4px, -3px); }
    60% { transform: translate(-3px, -2px); }
    80% { transform: translate(3px, 2px); }
    100% { transform: translate(0, 0); }
}

.spark {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffaa00;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 0 6px #ff5500;
    animation: spark-drift 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes spark-drift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.2);
        opacity: 0;
    }
}

/* General Helper Tips */
.helper-tip {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 11px;
    color: #bdc3c7;
    line-height: 1.5;
}
.helper-tip b { color: #ffffff; }



/* Suggestion Bubble */
.suggestion-bubble {
    position: fixed;
    background: rgba(10, 14, 24, 0.95);
    border: 2px solid #3498db;
        padding: 12px 16px;
    color: #ecf0f1;
    
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    z-index: 11000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: auto;
    max-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.suggestion-bubble-close {
    position: absolute;
    top: 4px;
    right: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #95a5a6;
    line-height: 1;
    transition: color 0.2s;
}
.suggestion-bubble-close:hover {
    color: #e74c3c;
}
.suggestion-bubble.show {
    opacity: 1;
    transform: translateY(0);
}
.suggestion-bubble-title {
    font-weight: bold;
    color: #f1c40f;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.3);
    padding-bottom: 4px;
}
.suggestion-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}
.suggestion-bubble.left .suggestion-arrow {
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 10px;
    border-color: transparent transparent transparent #3498db;
}
.suggestion-bubble.right .suggestion-arrow {
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 10px 8px 0;
    border-color: transparent #3498db transparent transparent;
}
.suggestion-bubble.top .suggestion-arrow {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 8px 0 8px;
    border-color: #3498db transparent transparent transparent;
}
.suggestion-bubble.bottom .suggestion-arrow {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 10px 8px;
    border-color: transparent transparent #3498db transparent;
}

        /* SHOP UI STYLES */
        .shop-item-row {
            background: rgba(0,0,0,0.4);
            border: 1px solid rgba(255,255,255,0.05);
            border-radius: 6px;
            padding: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        .shop-item-row:hover {
            background: rgba(255,255,255,0.08);
            border-color: rgba(255,255,255,0.2);
            transform: translateX(2px);
        }
        .shop-action-btn {
            border: none;
            border-radius: 6px;
            padding: 6px 12px;
            font-weight: 500;
            font-size: 12px;
            min-width: 60px;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        .shop-action-btn.can-afford {
            background: rgba(230, 126, 34, 0.9);
            color: #fff;
            cursor: pointer;
        }
        .shop-action-btn.cannot-afford {
            background: rgba(80, 80, 80, 0.6);
            color: #ccc;
            cursor: not-allowed;
            opacity: 0.7;
        }
        .shop-action-btn.can-afford:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
        .shop-action-btn.can-afford:active { transform: translateY(0) scale(0.95); }

/* Auth Screen UX Enhancements */
.auth-input {
    padding: 12px;
    font-size: 16px;
        border: 1px solid rgba(255,255,255,0.1);
    outline: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    background: rgba(10, 15, 20, 0.4);
    color: #fff;
    backdrop-filter: blur(8px);
}
.auth-input:focus {
    border-color: rgba(52, 152, 219, 0.6);
    background: rgba(10, 15, 20, 0.8);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}
.auth-select {
    padding: 12px;
    font-size: 14px;
        border: 1px solid rgba(255,255,255,0.1);
    background: rgba(10, 15, 20, 0.6);
    color: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    backdrop-filter: blur(8px);
}
.auth-select {
    transition: all 0.2s ease;
}
.auth-select:focus, .auth-select:focus-visible {
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}
.auth-select:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}
.auth-btn {
    padding: 12px 20px;
    font-size: 16px;
        border: none;
    cursor: pointer;
    color: white;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    backdrop-filter: blur(4px);
}
.auth-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.auth-btn:active {
    transform: translateY(0) scale(0.98);
}
.auth-btn:focus-visible {
    outline: 2px solid #f1c40f;
    outline-offset: 2px;
}

/* Blacksmithing Minigame Spark Particle */
.spark {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffcc00;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 0 4px #ffcc00, 0 0 8px #ff3300;
    animation: spark-animation 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes spark-animation {
    0% {
        transform: translate(0, 0) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* Screen Shake Effect */
.screen-shake {
    animation: shake-animation 0.15s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake-animation {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* Sweet spot zone pulsing glow */
#mini-sweet-spot {
    animation: sweet-spot-glow-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes sweet-spot-glow-pulse {
    0% {
        background: rgba(46, 204, 113, 0.3);
        box-shadow: inset 0 0 4px rgba(46, 204, 113, 0.5);
    }
    100% {
        background: rgba(46, 204, 113, 0.6);
        box-shadow: inset 0 0 12px rgba(46, 204, 113, 0.9);
    }
}

/* Draggable Skill Visuals */
.skill-node.draggable-skill {
    cursor: grab !important;
}
.skill-node.draggable-skill:active {
    cursor: grabbing !important;
}
.skill-node.draggable-skill.dragging {
    opacity: 0.4;
}

/* Milestone Cards Visual Refinement */
.milestone-card {
        padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
    overflow: hidden;
}

.milestone-card.milestone-pending {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.milestone-card.milestone-pending:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.milestone-card.milestone-completed {
    background: rgba(241, 196, 15, 0.06);
    border: 1px solid rgba(241, 196, 15, 0.35);
    animation: gold-pulse-border 2.5s infinite alternate;
}
.milestone-card.milestone-completed:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: rgba(241, 196, 15, 0.55);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.2);
    transform: translateY(-2px);
}

.milestone-card.milestone-claimed {
    background: rgba(46, 204, 113, 0.03);
    border: 1px solid rgba(46, 204, 113, 0.25);
}
.milestone-card.milestone-claimed:hover {
    background: rgba(46, 204, 113, 0.06);
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
}

@keyframes gold-pulse-border {
    0% {
        border-color: rgba(241, 196, 15, 0.25);
        box-shadow: 0 0 4px rgba(241, 196, 15, 0.05);
    }
    100% {
        border-color: rgba(241, 196, 15, 0.5);
        box-shadow: 0 0 10px rgba(241, 196, 15, 0.15);
    }
}

/* Gold Spark Particle */
.gold-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #f1c40f;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 0 6px #f1c40f, 0 0 12px #f39c12;
    animation: gold-spark-animation 1.0s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes gold-spark-animation {
    0% {
        transform: translate(0, 0) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* CRAFTING UI REVAMP */
.craft-recipe-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.craft-recipe-list::-webkit-scrollbar { width: 6px; }
.craft-recipe-list::-webkit-scrollbar-track { background: transparent; }
.craft-recipe-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 6px; }

.craft-recipe-card {
    background: #111;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

.craft-recipe-card:hover {
    background: #1a1a1a;
    border-color: #555;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0,0,0,0.6);
}

.craft-recipe-card.selected {
    background: #1a2530;
    border-color: #3498db;
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px rgba(0,0,0,0.6), inset 0 0 10px rgba(52, 152, 219, 0.2);
}

.craft-recipe-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.craft-recipe-icon svg {
    width: 100%;
    height: 100%;
    display: inline-block;
    filter: drop-shadow(1px 1px 0px rgba(0,0,0,0.8));
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.craft-recipe-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.craft-recipe-name {
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    margin-bottom: 6px;
    text-shadow: 1px 1px 0px #000;
}

.craft-recipe-level {
    font-size: 8px;
    color: #a4b7d1;
    font-family: 'Press Start 2P', monospace;
}

.craft-material-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.craft-material-badge {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.craft-material-badge.met {
    border-color: rgba(46, 204, 113, 0.5);
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.05);
}

.craft-material-badge.missing {
    border-color: rgba(231, 76, 60, 0.5);
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.craft-btn-premium {
    flex: 1;
    padding: 10px;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.craft-btn-auto {
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    border: 1px solid #2980b9;
}
.craft-btn-auto:hover {
    background: linear-gradient(180deg, #5dade2 0%, #3498db 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.craft-btn-auto:active { transform: translateY(0); }

.craft-btn-manual {
    background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
    border: 1px solid #d35400;
}
.craft-btn-manual:hover {
    background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.craft-btn-manual:active { transform: translateY(0); }

/* Rarity classes for cards */
.craft-recipe-card.rarity-Legendary { border-color: rgba(241, 196, 15, 0.4); background: rgba(241, 196, 15, 0.05); }
.craft-recipe-card.rarity-Epic { border-color: rgba(155, 89, 182, 0.4); background: rgba(155, 89, 182, 0.05); }
.craft-recipe-card.rarity-Rare { border-color: rgba(52, 152, 219, 0.4); background: rgba(52, 152, 219, 0.05); }

/* RETRO UI THEME */
.retro-panel {
    background-color: #1a1a1a !important;
    border: 4px solid #555 !important;
    box-shadow: inset -4px -4px 0px 0px #000, inset 4px 4px 0px 0px #777, 4px 4px 0px 0px #000 !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
}



.retro-header {
    background-color: #000 !important;
    border-bottom: 4px solid #555 !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 10px !important;
    color: #fff !important;
    border-radius: 0 !important;
}

.retro-btn {
    background-color: #555 !important;
    border: 4px solid #777 !important;
    box-shadow: inset -2px -2px 0px 0px #222, inset 2px 2px 0px 0px #999 !important;
    color: #fff !important;
    padding: 8px 12px !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 10px !important;
    border-radius: 0 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}


.retro-btn:hover {
    background-color: #666 !important;
    border-color: #888 !important;
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.retro-btn:focus-visible {
    outline: 2px solid #3498db !important;
    outline-offset: 2px !important;
}

.retro-btn:active {
    box-shadow: inset 2px 2px 0px 0px #222, inset -2px -2px 0px 0px #999 !important;
    transform: translate(2px, 2px) !important;
}

.retro-slot {
    background-color: #222 !important;
    border: 2px solid #555 !important;
    box-shadow: inset -2px -2px 0px 0px #000, inset 2px 2px 0px 0px #777 !important;
    border-radius: 0 !important;
}

.retro-bar-container {
    background-color: #000 !important;
    border: 4px solid #555 !important;
    box-shadow: inset 2px 2px 0px 0px #000 !important;
    border-radius: 0 !important;
}

.forge-category-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; background: #111; color: #aaa; border: 2px solid #333; font-family: 'Press Start 2P', monospace; font-size: 10px; cursor: pointer; transition: all 0.1s ease-in-out; margin-bottom: 8px; border-radius: 4px; }
.forge-category-btn:hover { background: #1a1a1a; border-color: #555; }
.forge-category-btn.active { background: #1a2530; color: #fff; border-color: #e67e22; border-left-width: 6px; box-shadow: inset 0 0 10px rgba(230, 126, 34, 0.2); transform: translateX(4px); }
.forge-category-btn:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }

@keyframes forgeGlow { 0% { box-shadow: inset 0 0 50px rgba(230, 126, 34, 0.1); background-color: #0c0f17; } 50% { box-shadow: inset 0 0 150px rgba(230, 126, 34, 0.15); background-color: #121622; } 100% { box-shadow: inset 0 0 50px rgba(230, 126, 34, 0.1); background-color: #0c0f17; } }

/* =============================================
   FORGE MINIGAME UI OVERHAUL
   ============================================= */

/* Backdrop overlay */
.forge-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    z-index: 20002;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: background-color 0.3s;
}

/* Main container */
.forge-container {
    width: 500px;
    background: #0a0d14;
    border: 2px solid #e67e22;
    border-radius: 14px;
    padding: 0;
    box-shadow:
        0 0 40px rgba(230, 126, 34, 0.25),
        0 0 120px rgba(230, 126, 34, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #fff;
    position: relative;
    overflow: hidden;
    animation: forge-border-pulse 3s ease-in-out infinite alternate;
}

@keyframes forge-border-pulse {
    0% { border-color: rgba(230, 126, 34, 0.6); box-shadow: 0 0 30px rgba(230, 126, 34, 0.2), 0 0 100px rgba(230, 126, 34, 0.06); }
    100% { border-color: rgba(230, 126, 34, 1.0); box-shadow: 0 0 50px rgba(230, 126, 34, 0.35), 0 0 140px rgba(230, 126, 34, 0.12); }
}

/* Header bar */
.forge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(230, 126, 34, 0.12) 0%, transparent 100%);
    border-bottom: 1px solid rgba(230, 126, 34, 0.2);
}

.forge-header-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #e67e22;
    text-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
    letter-spacing: 1px;
}

.forge-header-recipe {
    font-size: 10px;
    color: #a4b7d1;
    font-family: 'Press Start 2P', monospace;
}

.forge-close-btn {
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 6px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
}
.forge-close-btn:hover {
    background: rgba(231, 76, 60, 0.4);
    border-color: #e74c3c;
    transform: scale(1.1);
}

/* HUD stats row */
.forge-hud-row {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
}

/* Smelting Progress Bar styling */
.forge-progress-wrapper {
    padding: 0 18px 12px;
    animation: forge-fade-in 0.25s ease-out;
}
@keyframes forge-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.forge-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.forge-progress-title {
    font-size: 7px;
    font-family: 'Press Start 2P', monospace;
    color: #8a9cb7;
    letter-spacing: 0.5px;
}
.forge-progress-pct {
    font-size: 8px;
    font-family: 'Press Start 2P', monospace;
    color: #e67e22;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(230, 126, 34, 0.4);
}
.forge-progress-track {
    width: 100%;
    height: 8px;
    background: #06090e;
    border: 1px solid #161c28;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}
.forge-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #d35400 0%, #e67e22 50%, #f1c40f 100%);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.6);
    border-radius: 4px;
    transition: width 0.15s ease-out;
}

/* Flaw dot warnings */
.forge-flaws-container {
    display: flex;
    gap: 5px;
    align-items: center;
}
.flaw-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #15181e;
    border: 1px solid #282f3c;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.flaw-dot.active {
    background: #e74c3c;
    border-color: #ff6b6b;
    box-shadow: 0 0 6px #e74c3c, 0 0 12px #e74c3c;
    transform: scale(1.15);
    animation: flaw-pulse 1s ease-in-out infinite alternate;
}
@keyframes flaw-pulse {
    0% { box-shadow: 0 0 4px #e74c3c, 0 0 8px #e74c3c; }
    100% { box-shadow: 0 0 8px #e74c3c, 0 0 16px #e74c3c; }
}

.forge-hud-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
        padding: 10px 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.forge-hud-card-label {
    font-size: 9px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.forge-hud-card-label svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.forge-hud-card-value {
    font-size: 15px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
}

.forge-hud-card-value.phase-value { color: #f39c12; }
.forge-hud-card-value.strikes-value { color: #2ecc71; }
.forge-hud-card-value.flaws-value { color: #e74c3c; }

/* Main forge area: heat gauge + canvas */
.forge-main-area {
    display: flex;
    gap: 12px;
    padding: 0 18px 14px;
    align-items: stretch;
}

/* Heat gauge (vertical) */
.forge-heat-gauge {
    position: relative;
    width: 50px;
    min-height: 260px;
    background: #080b12;
    border: 2px solid #1a2030;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
    flex-shrink: 0;
}

.forge-heat-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(0deg, #ff3300 0%, #ff6600 40%, #ffcc00 100%);
    transition: height 0.12s linear;
    z-index: 0;
    box-shadow: 0 -4px 15px rgba(255, 51, 0, 0.6);
}

.forge-sweet-spot {
    position: absolute;
    width: 100%;
    background: rgba(46, 204, 113, 0.35);
    border-top: 2px solid rgba(46, 204, 113, 0.8);
    border-bottom: 2px solid rgba(46, 204, 113, 0.8);
    z-index: 1;
    transition: bottom 0.25s ease, height 0.25s ease;
    animation: forge-sweet-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes forge-sweet-pulse {
    0% { background: rgba(46, 204, 113, 0.25); box-shadow: inset 0 0 6px rgba(46, 204, 113, 0.4); }
    100% { background: rgba(46, 204, 113, 0.5); box-shadow: inset 0 0 15px rgba(46, 204, 113, 0.7); }
}

.forge-sweet-label {
    font-size: 7px;
    font-family: 'Press Start 2P', monospace;
    color: #2ecc71;
    text-align: center;
    line-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-shadow: 0 0 4px #000;
    letter-spacing: 0.5px;
}

.forge-heat-ticks {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Canvas wrapper */
.forge-canvas-wrapper {
    flex: 1;
    position: relative;
    background: #050710;
    border: 2px solid #1a2030;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
    min-height: 260px;
}

.forge-canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Controls bar */
.forge-controls {
    display: flex;
    gap: 8px;
    padding: 0 18px 14px;
}

.forge-btn {
    flex: 1;
    padding: 12px 8px;
    font-weight: bold;
    border: none;
        cursor: pointer;
    font-size: 11px;
    font-family: 'Press Start 2P', monospace;
    transition: all 0.12s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.forge-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.forge-btn-label {
    font-size: 10px;
}

.forge-btn-key {
    font-size: 7px;
    opacity: 0.6;
    letter-spacing: 0.3px;
}

/* Strike button (green) */
.forge-btn-strike {
    background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.forge-btn-strike:hover {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.4);
}
.forge-btn-strike:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

/* Bellows button (amber/red) */
.forge-btn-bellows {
    background: linear-gradient(180deg, #c0392b 0%, #96281b 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.forge-btn-bellows:hover {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.4);
}
.forge-btn-bellows:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.3);
}

/* Quench button (blue) */
.forge-btn-quench {
    background: linear-gradient(180deg, #2980b9 0%, #1f6fa3 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.forge-btn-quench:hover {
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.4);
}
.forge-btn-quench:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(41, 128, 185, 0.3);
}

/* Hint text at bottom */
.forge-hint {
    text-align: center;
    padding: 0 18px 14px;
    font-size: 9px;
    color: #5a6576;
    font-family: 'Press Start 2P', monospace;
    line-height: 1.6;
}

/* Float-up strike feedback text */
@keyframes forge-float-up {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -180%) scale(1.3); }
}

.forge-strike-text {
    position: absolute;
    left: 50%; top: 40%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    animation: forge-float-up 1.2s ease-out forwards;
}

/* Phase transition flash */
@keyframes forge-phase-flash {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

.forge-phase-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255,200,50,0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: 50;
    animation: forge-phase-flash 0.8s ease-out forwards;
}

/* Destiny Atlas Cosmic Redesign */
#atlas-panel {
    background: rgba(11, 15, 25, 0.82) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    border: 2px solid rgba(241, 196, 15, 0.35) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(241, 196, 15, 0.15), inset 0 0 35px rgba(0, 0, 0, 0.95) !important;
    position: relative;
    overflow: hidden;
    border-radius: 12px !important;
}

#atlas-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(rgba(255,255,255,0.08) 1.5px, transparent 40px),
        radial-gradient(rgba(255,255,255,0.05) 1px, transparent 30px);
    background-size: 300px 300px, 200px 200px;
    background-position: 0 0, 50px 70px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

#atlas-panel .panel-header {
    background: rgba(5, 7, 10, 0.9) !important;
    border-bottom: 2px solid rgba(241, 196, 15, 0.5) !important;
    color: #f1c40f !important;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.3) !important;
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.atlas-path-column {
    background-color: rgba(18, 23, 33, 0.5) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    border-radius: 10px !important;
}

.atlas-path-column h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px !important;
    margin: 0;
    padding-bottom: 10px;
    text-align: center;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.8px;
}

.atlas-path-column.combat {
    border-color: rgba(231, 76, 60, 0.2) !important;
    box-shadow: inset 0 0 15px rgba(231, 76, 60, 0.05), 0 4px 15px rgba(0,0,0,0.5) !important;
}
.atlas-path-column.combat h3 {
    color: #ff6b6b !important;
    border-bottom-color: rgba(231, 76, 60, 0.2);
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.35);
}

.atlas-path-column.gathering {
    border-color: rgba(46, 204, 113, 0.2) !important;
    box-shadow: inset 0 0 15px rgba(46, 204, 113, 0.05), 0 4px 15px rgba(0,0,0,0.5) !important;
}
.atlas-path-column.gathering h3 {
    color: #2ecc71 !important;
    border-bottom-color: rgba(46, 204, 113, 0.2);
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.35);
}

.atlas-path-column.crafting {
    border-color: rgba(155, 89, 182, 0.2) !important;
    box-shadow: inset 0 0 15px rgba(155, 89, 182, 0.05), 0 4px 15px rgba(0,0,0,0.5) !important;
}
.atlas-path-column.crafting h3 {
    color: #a29bfe !important;
    border-bottom-color: rgba(155, 89, 182, 0.2);
    text-shadow: 0 0 8px rgba(155, 89, 182, 0.35);
}

/* Hover scales on path columns */
.atlas-path-column:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2) !important;
    background-color: rgba(23, 29, 41, 0.6) !important;
}
.atlas-path-column.combat:hover {
    box-shadow: inset 0 0 20px rgba(231, 76, 60, 0.15), 0 8px 25px rgba(231, 76, 60, 0.25) !important;
}
.atlas-path-column.gathering:hover {
    box-shadow: inset 0 0 20px rgba(46, 204, 113, 0.15), 0 8px 25px rgba(46, 204, 113, 0.25) !important;
}
.atlas-path-column.crafting:hover {
    box-shadow: inset 0 0 20px rgba(155, 89, 182, 0.15), 0 8px 25px rgba(155, 89, 182, 0.25) !important;
}

/* Progress bars inside paths */
.atlas-bar-track {
    background: #05070a !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
    height: 12px;
    width: 100%;
    margin: 6px 0;
    overflow: hidden;
    position: relative;
    border-radius: 6px !important;
}
.atlas-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    background-size: 20px 20px;
    animation: atlas-progress-scroll 1.2s linear infinite;
}

/* Dynamic glow head spark on progress bars */
.atlas-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
    background-color: #fff;
    box-shadow: 0 0 8px #fff, 0 0 4px currentColor;
    animation: atlas-bar-pulse 0.8s ease-in-out infinite alternate;
}

.atlas-bar-fill.combat { 
    background-color: #e74c3c; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}
.atlas-bar-fill.mining { 
    background-color: #f1c40f; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}
.atlas-bar-fill.woodcutting { 
    background-color: #2ecc71; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}
.atlas-bar-fill.collecting { 
    background-color: #3498db; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
}
.atlas-bar-fill.skinning { 
    background-color: #e67e22; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
}
.atlas-bar-fill.crafting { 
    background-color: #9b59b6; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
}
.atlas-bar-fill.woodworking { 
    background-color: #1abc9c; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(26, 188, 156, 0.4);
}
.atlas-bar-fill.tailoring { 
    background-color: #e84393; 
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    box-shadow: 0 0 8px rgba(232, 67, 147, 0.4);
}

/* Sub-cards inside paths */
.atlas-sub-card {
    background: rgba(10, 14, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.25s cubic-bezier(0.215, 0.610, 0.355, 1);
}
.atlas-sub-card:hover {
    background: rgba(18, 24, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.class-level-badge {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 4px 8px;
    transition: all 0.2s ease;
    align-items: center;
}
.class-level-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}


/* Info Box / Rule box */
.atlas-info-box {
    background-color: rgba(7, 10, 16, 0.7) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    padding: 12px;
    font-size: 8px !important;
    line-height: 1.6;
    color: #8a9cb7;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 8px !important;
    font-family: inherit;
}
.atlas-info-box-title {
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    font-size: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    margin-bottom: 4px;
    font-family: 'Press Start 2P', monospace;
}

/* Account Level Panel */
.atlas-account-panel {
    background-color: rgba(25, 20, 12, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    border: 2px solid rgba(241, 196, 15, 0.3) !important;
    box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.1), 0 6px 20px rgba(0,0,0,0.6) !important;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 15px;
    border-radius: 10px !important;
}
.atlas-level-badge {
    background: rgba(7, 10, 16, 0.8) !important;
    border: 1px solid rgba(241, 196, 15, 0.4);
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.15);
    padding: 8px 12px;
    font-size: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px !important;
}
.atlas-acct-box {
    background: rgba(8, 12, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 8px !important;
}
.atlas-acct-box h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 9px;
    font-family: 'Press Start 2P', monospace;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    letter-spacing: 0.6px;
}

/* Gold Bar track for account level progress */
.atlas-gold-bar-track {
    background: #05070a !important;
    border: 1px solid rgba(241, 196, 15, 0.4);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
    height: 14px;
    width: 100%;
    margin-top: 6px;
    overflow: hidden;
    position: relative;
    border-radius: 6px !important;
}
.atlas-gold-bar-fill {
    background-color: #f1c40f;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: atlas-progress-scroll 1s linear infinite;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}
.atlas-gold-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
    background-color: #fff;
    box-shadow: 0 0 10px #fff, 0 0 6px #f1c40f;
    animation: atlas-bar-pulse 0.8s ease-in-out infinite alternate;
}

/* Benefit slots */
.atlas-benefit-slot {
    background-color: rgba(6, 9, 14, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
    padding: 10px;
    font-size: 8px;
    border-radius: 6px !important;
    transition: all 0.2s ease;
}
.atlas-benefit-slot:hover {
    border-color: rgba(241, 196, 15, 0.3);
    background-color: rgba(14, 18, 26, 0.95) !important;
}
.atlas-benefit-slot-label {
    color: #8a9cb7;
    font-size: 7px;
    margin-bottom: 4px;
}
.atlas-benefit-slot-val {
    font-size: 9px;
    font-weight: bold;
}

/* Milestones box and cards */
.atlas-milestones-box {
    background: rgba(6, 9, 14, 0.6);
    border: 1px solid rgba(241, 196, 15, 0.2);
    padding: 14px;
    border-radius: 8px !important;
    box-shadow: inset 0 0 10px rgba(241, 196, 15, 0.03) !important;
}
.atlas-milestone-card {
    padding: 10px;
    background: rgba(12, 16, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    font-size: 8px;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 6px !important;
}
.atlas-milestone-card.unlocked {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.12) 0%, rgba(212, 143, 0, 0.04) 100%) !important;
    border-color: rgba(241, 196, 15, 0.5) !important;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.15), inset 0 0 8px rgba(241, 196, 15, 0.08) !important;
}
.atlas-milestone-card.unlocked .milestone-title {
    color: #fff !important;
    text-shadow: 0 0 6px rgba(241, 196, 15, 0.35);
}
.atlas-milestone-card.unlocked .milestone-reward {
    color: #f1c40f !important;
    font-weight: bold;
}

/* Advanced Destiny Atlas Animations */
@keyframes atlas-progress-scroll {
    from { background-position: 0 0; }
    to { background-position: 20px 0; }
}

@keyframes atlas-icon-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes atlas-val-pulse {
    0% { opacity: 0.8; text-shadow: 0 0 1px currentColor; }
    100% { opacity: 1; text-shadow: 0 0 8px currentColor; }
}

@keyframes atlas-bar-pulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Hover scales on milestone cards */
.atlas-milestone-card {
    cursor: help;
}
.atlas-milestone-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5) !important;
}
.atlas-milestone-card.unlocked:hover {
    border-color: rgba(241, 196, 15, 0.8) !important;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3), inset 0 0 8px rgba(241, 196, 15, 0.12) !important;
}

/* Benefit values pulsing */
.atlas-benefit-slot-val {
    animation: atlas-val-pulse 1.5s ease-in-out infinite alternate;
    display: inline-block;
}

/* Header spin on hover */
.draggable-panel:hover .ui-icon[data-icon="cosmic-star-core"] svg {
    animation: atlas-icon-spin 10s linear infinite;
}

/* ==========================================
   MONSTER GRIMOIRE (GRIMÓRIO DE MONSTROS)
   ========================================== */

/* Outer Grimoire panel using a thick wood-leather border and dark mahogany leather */
.draggable-panel.grimoire-panel {
    background-color: #26140f !important;
    border: 4px solid #6b4035 !important;
    box-shadow: inset -4px -4px 0px 0px #110806, 
                inset 4px 4px 0px 0px #522d1f, 
                8px 8px 0px 0px rgba(0,0,0,0.6) !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    width: 440px !important;
}

/* Header styled as book binding/header */
.grimoire-panel .panel-header {
    background-color: #1a0c08 !important;
    border-bottom: 4px solid #6b4035 !important;
    color: #ffd700 !important; /* Gold title */
    text-shadow: 2px 2px 0px #000 !important;
    padding: 12px 10px !important;
    font-size: 8px !important;
    font-weight: bold;
}

/* Tabs container resembling top edge of book pages */
.grimoire-tabs-container {
    display: flex;
    gap: 8px;
    background-color: #1a0c08;
    border-bottom: 4px solid #6b4035;
    padding: 8px;
}

/* Individual tab designed as a medieval leather tag */
.grimoire-tab {
    flex: 1;
    padding: 8px 4px !important;
    border: 2px solid #5a3a2a !important;
    background: #361f17 !important;
    color: #c3b091 !important;
    box-shadow: inset -2px -2px 0px 0px #110806, 
                inset 2px 2px 0px 0px #522d1f !important;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px !important;
    cursor: pointer;
    text-align: center;
    border-radius: 0 !important;
    transition: all 0.15s ease;
}

.grimoire-tab:hover {
    background: #4a2d22 !important;
    color: #fff !important;
    border-color: #7c4b31 !important;
}

.grimoire-tab.active {
    background: #7c4b31 !important;
    color: #ffd700 !important; /* Gold text */
    border-color: #ffd700 !important;
    box-shadow: inset 2px 2px 0px 0px #110806, 
                inset -2px -2px 0px 0px #522d1f !important;
}

/* Grimoire body container */
.grimoire-body {
    padding: 12px !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #160f0d !important;
    height: 400px !important;
    overflow-y: auto !important;
}

/* Custom retro scrollbars for Grimoire */
.grimoire-body::-webkit-scrollbar {
    width: 6px;
}
.grimoire-body::-webkit-scrollbar-track {
    background: #110a08;
}
.grimoire-body::-webkit-scrollbar-thumb {
    background: #5a3a2a;
    border: 1px solid #110a08;
}
.grimoire-body::-webkit-scrollbar-thumb:hover {
    background: #7c4b31;
}

/* Golden active set bonuses panel */
.grimoire-bonus-box {
    background: rgba(212, 175, 55, 0.05) !important;
    border: 2px solid #b8860b !important;
    box-shadow: inset -1px -1px 0px 0px #4d3803, 
                inset 1px 1px 0px 0px #ffd700, 
                0 0 6px rgba(184, 134, 11, 0.15) !important;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 0 !important;
}

.grimoire-bonus-title {
    font-size: 8px;
    font-family: 'Press Start 2P', monospace;
    color: #ffd700;
    margin-bottom: 6px;
    text-shadow: 1px 1px 0px #000;
    text-transform: uppercase;
}

.grimoire-bonus-tip {
    font-size: 7px;
    color: #8c7e6c;
    line-height: 1.4;
}

.grimoire-bonus-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.grimoire-bonus-item {
    color: #2ecc71;
    font-size: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 1px 1px 0px #000;
    animation: grimoire-text-glow 1.5s ease-in-out infinite alternate;
}

.grimoire-bonus-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #2ecc71;
    box-shadow: 0 0 4px #2ecc71;
}

@keyframes grimoire-text-glow {
    from { opacity: 0.9; text-shadow: 0 0 1px rgba(46, 204, 113, 0.2), 1px 1px 0px #000; }
    to { opacity: 1; text-shadow: 0 0 4px rgba(46, 204, 113, 0.6), 1px 1px 0px #000; }
}

/* Slots and cards rows */
.grimoire-slot-row {
    background: #231612 !important;
    border: 2px solid #4e3025 !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #352119 !important;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0 !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.grimoire-slot-row:hover {
    background: #2d1d18 !important;
    border-color: #7c4b31 !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #4e3025,
                0 4px 10px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-2px);
}

/* Card slot frame */
.grimoire-icon-wrap {
    width: 36px;
    height: 36px;
    background: #0d0908 !important;
    border: 2px solid #4a342a !important;
    box-shadow: inset 2px 2px 0px #000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0 !important;
    flex-shrink: 0;
}

.grimoire-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.grimoire-slot-title {
    font-weight: bold;
    font-size: 8px;
    color: #fff;
    text-shadow: 1px 1px 0px #000;
}

.grimoire-card-title {
    font-weight: bold;
    font-size: 8px;
    text-shadow: 1px 1px 0px #000;
}

.grimoire-card-desc {
    color: #c3b091;
    font-size: 7px;
    line-height: 1.4;
    text-shadow: 1px 1px 0px #000;
}

.grimoire-card-kills {
    font-size: 6px;
    text-shadow: 1px 1px 0px #000;
    margin-top: 1px;
}

/* Selector input dropdown styling */
.grimoire-select {
    background: #160f0d !important;
    border: 2px solid #5a3a2a !important;
    color: #ffd700 !important;
    padding: 4px 6px;
    font-size: 7px !important;
    font-family: 'Press Start 2P', monospace;
    outline: none;
    cursor: pointer;
    border-radius: 0 !important;
    max-width: 180px;
    box-shadow: inset 1px 1px 0px #000;
}

.grimoire-select option {
    background: #160f0d;
    color: #ffd700;
}

.grimoire-select:focus {
    border-color: #ffd700 !important;
}

/* Grimoire button styling */
.grimoire-btn {
    background-color: #4a2d22 !important;
    border: 2px solid #7c4b31 !important;
    box-shadow: inset -2px -2px 0px #1c0f0a, 
                inset 2px 2px 0px #a0674c !important;
    color: #ffd700 !important;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px !important;
    padding: 6px 10px !important;
    cursor: pointer;
    border-radius: 0 !important;
    text-shadow: 1px 1px 0px #000;
    transition: none;
}

.grimoire-btn:hover {
    background-color: #5a382b !important;
    border-color: #ffd700 !important;
    color: #fff !important;
}

.grimoire-btn:active {
    box-shadow: inset 2px 2px 0px #1c0f0a, 
                inset -2px -2px 0px #a0674c !important;
    transform: translate(1px, 1px);
}

.grimoire-btn-danger {
    background-color: #7c2d22 !important;
    border: 2px solid #b83c2e !important;
    box-shadow: inset -2px -2px 0px #3c120e, 
                inset 2px 2px 0px #df6e60 !important;
    color: #ff8a80 !important;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px !important;
    padding: 6px 10px !important;
    cursor: pointer;
    border-radius: 0 !important;
    text-shadow: 1px 1px 0px #000;
}

.grimoire-btn-danger:hover {
    background-color: #9c362a !important;
    border-color: #ff8a80 !important;
    color: #fff !important;
}

.grimoire-btn-danger:active {
    box-shadow: inset 2px 2px 0px #3c120e, 
                inset -2px -2px 0px #df6e60 !important;
    transform: translate(1px, 1px);
}

.grimoire-action-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.grimoire-empty-tip {
    font-size: 7px;
    color: #8c7e6c;
    text-shadow: 1px 1px 0px #000;
    margin-top: 2px;
}

.grimoire-empty-msg {
    text-align: center;
    padding: 24px;
    color: #8c7e6c;
    font-size: 8px;
    line-height: 1.6;
    text-shadow: 1px 1px 0px #000;
}

/* Status tags for items */
.grimoire-status-tag {
    font-size: 6px;
    font-family: 'Press Start 2P', monospace;
    padding: 3px 6px;
    border-radius: 0 !important;
    text-shadow: 1px 1px 0px #000;
    flex-shrink: 0;
}

.grimoire-status-tag.equipped {
    background: rgba(46, 204, 113, 0.15) !important;
    color: #2ecc71 !important;
    border: 2px solid #2ecc71 !important;
    box-shadow: 0 0 4px rgba(46,204,113,0.2) !important;
}

.grimoire-status-tag.owned {
    background: rgba(52, 152, 219, 0.15) !important;
    color: #3498db !important;
    border: 2px solid #3498db !important;
    box-shadow: 0 0 4px rgba(52,152,219,0.2) !important;
}

.grimoire-status-tag.locked {
    background: rgba(0,0,0,0.3) !important;
    color: #555 !important;
    border: 2px solid #3c3230 !important;
    opacity: 0.6;
}

/* Grimoire filters bar */
.grimoire-filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    background: #1a0c08;
    padding: 6px;
    border: 2px solid #5a3a2a;
}

/* Golden Book corner reinforcements */
.grimoire-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #d4af37 !important; /* Gold */
    border: 2px solid #8a6d1c !important; /* Dark Gold/Bronze border */
    box-shadow: inset -1px -1px 0px 0px #4d3803, inset 1px 1px 0px 0px #fff !important;
    z-index: 10002;
    pointer-events: none;
}
.grimoire-corner-lt { top: -2px; left: -2px; border-right-color: transparent !important; border-bottom-color: transparent !important; }
.grimoire-corner-rt { top: -2px; right: -2px; border-left-color: transparent !important; border-bottom-color: transparent !important; }
.grimoire-corner-lb { bottom: -2px; left: -2px; border-right-color: transparent !important; border-top-color: transparent !important; }
.grimoire-corner-rb { bottom: -2px; right: -2px; border-left-color: transparent !important; border-top-color: transparent !important; }

/* Inset metallic rivets inside the corner pieces */
.grimoire-corner::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 2px;
    height: 2px;
    background: #4d3803;
    border-radius: 50%;
}

/* Red bookmark ribbon hanging out of the tome */
.grimoire-bookmark-ribbon {
    position: absolute;
    bottom: -24px;
    left: 40px;
    width: 14px;
    height: 28px;
    background: #c0392b !important; /* Crimson bookmark ribbon */
    border-left: 2px solid #7c120e;
    border-right: 2px solid #7c120e;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.5) !important;
    z-index: 9999;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 75%, 0% 100%);
    pointer-events: none;
    transition: transform 0.3s ease;
}

/* Subtle swing animation on ribbon when the grimoire panel is hovered */
.grimoire-panel:hover .grimoire-bookmark-ribbon {
    transform: rotate(5deg) scaleY(1.05);
    transform-origin: top center;
}

/* 3D page flipping animation */
@keyframes grimoire-page-turn {
    0% { transform: rotateY(0deg); opacity: 1; filter: brightness(1); }
    45% { transform: rotateY(-90deg); opacity: 0.3; filter: brightness(0.6); }
    55% { transform: rotateY(-90deg); opacity: 0.3; filter: brightness(0.6); }
    100% { transform: rotateY(0deg); opacity: 1; filter: brightness(1); }
}

.grimoire-body {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.grimoire-body.page-flipping {
    animation: grimoire-page-turn 0.35s ease-in-out;
}

/* Glow effects for rarity tiers on card slots hover */
.grimoire-slot-row.common:hover {
    border-color: #95a5a6 !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #4e3025, 
                0 0 10px rgba(149, 165, 166, 0.25) !important;
}

.grimoire-slot-row.rare:hover {
    border-color: #3498db !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #4e3025, 
                0 0 12px rgba(52, 152, 219, 0.45) !important;
}

.grimoire-slot-row.epic:hover {
    border-color: #9b59b6 !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #4e3025, 
                0 0 14px rgba(155, 89, 182, 0.55) !important;
}

.grimoire-slot-row.legendary:hover {
    border-color: #f1c40f !important;
    box-shadow: inset -2px -2px 0px 0px #160e0c, 
                inset 2px 2px 0px 0px #4e3025, 
                0 0 16px rgba(241, 196, 15, 0.65) !important;
}

/* Pulse socket energy on active card row hover */
@keyframes grimoire-socket-pulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
    100% { transform: scale(1); filter: brightness(1); }
}

.grimoire-slot-row:hover .grimoire-icon-wrap {
    animation: grimoire-socket-pulse 1s infinite ease-in-out;
}


.forge-btn:focus-visible, .forge-close-btn:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }

/* ==========================================
   CONTEXTUAL INTERVENTION BANNER
   ========================================== */

#intervention-container {
    position: fixed;
    right: 16px;
    bottom: 80px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 340px;
}

.intervention-banner {
    background: linear-gradient(135deg, rgba(10,14,24,0.98) 0%, rgba(15,22,38,0.98) 100%);
    border: 1px solid rgba(52, 152, 219, 0.6);
    border-left: 3px solid #3498db;
        box-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 0 1px rgba(52,152,219,0.1);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    pointer-events: all;
    cursor: default;
    animation: intervention-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    max-width: 340px;
}

.intervention-banner.intervention-exit {
    animation: intervention-slide-out 0.35s ease-in forwards;
}

@keyframes intervention-slide-in {
    from {
        transform: translateX(110%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes intervention-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
        max-height: 120px;
    }
    to {
        transform: translateX(110%);
        opacity: 0;
        max-height: 0;
    }
}

.intervention-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    animation: intervention-dot-pulse 1.8s ease-in-out infinite;
    box-shadow: 0 0 6px currentColor;
}

@keyframes intervention-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.85); }
}

.intervention-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.intervention-text {
    font-size: 11px;
    color: #d4e0f0;
    line-height: 1.5;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
}

.intervention-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 2px;
}

.intervention-action-btn {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #3498db;
    font-size: 8px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.intervention-action-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #fff;
}

.intervention-dismiss-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    color: #4a5568;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}

.intervention-dismiss-btn:hover {
    color: #e74c3c;
}

.intervention-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(52, 152, 219, 0.4);
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

/* ==========================================
   HELPER PANEL IMPROVEMENTS
   ========================================== */

.htab-btn {
    border-radius: 6px 6px 0 0;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    font-weight: bold;
    transition: all 0.2s ease;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.htab-btn.active {
    background: rgba(52, 152, 219, 0.2) !important;
    border: 1px solid #3498db !important;
    border-bottom: none !important;
    color: #fff !important;
    box-shadow: 0 -2px 8px rgba(52, 152, 219, 0.15);
}

.htab-btn.inactive {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-bottom: none !important;
    color: #7f8c8d !important;
}

.htab-btn.inactive:hover {
    color: #bdc3c7 !important;
    background: rgba(255,255,255,0.04) !important;
}

.helper-badge {
    display: inline-block;
    font-size: 7px;
    font-family: 'Press Start 2P', monospace;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.helper-badge.hotkey {
    background: rgba(241, 196, 15, 0.15);
    border: 1px solid rgba(241, 196, 15, 0.4);
    color: #f1c40f;
}

.helper-badge.combat {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #e74c3c;
}

.helper-badge.coleta {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.35);
    color: #2ecc71;
}

.helper-badge.dica {
    background: rgba(52, 152, 219, 0.12);
    border: 1px solid rgba(52, 152, 219, 0.35);
    color: #3498db;
}

.helper-tip {
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 6px 8px;
    border-left: 2px solid rgba(255,255,255,0.08);
    line-height: 1.7;
    font-size: 11px;
    transition: background 0.15s;
}

.helper-tip:hover {
    background: rgba(52, 152, 219, 0.06);
    border-left-color: rgba(52, 152, 219, 0.3);
}

.helper-link-btn {
    display: inline-block;
    margin-top: 4px;
    font-size: 9px;
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.helper-link-btn:hover {
    color: #5dade2;
}

/* Search results all-tabs mode */
.helper-search-result-tab {
    font-size: 8px;
    font-family: 'Press Start 2P', monospace;
    color: #f1c40f;
    margin: 10px 0 4px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.2);
    text-transform: uppercase;
}

/* History tab (recent interventions) */
#hcontent-history .history-empty {
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 10px;
    font-style: italic;
}

.history-entry {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(52,152,219,0.12);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 10px;
    color: #a4b7d1;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.history-entry-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

/* Helper scroll-to-top button */
#helper-scroll-top {
    position: sticky;
    bottom: 8px;
    right: 8px;
    float: right;
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: #3498db;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

#helper-scroll-top.visible {
    display: flex;
}

#helper-scroll-top:hover {
    background: rgba(52, 152, 219, 0.35);
    color: #fff;
}

/* --- Party Leave Button UX Polish --- */
.party-leave-btn {
    background: transparent;
    color: #e74c3c;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    transition: all 0.2s ease;
}

.party-leave-btn:hover, .party-leave-btn:focus-visible {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    outline: none;
}

.party-leave-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.4);
}

.party-leave-btn:active {
    transform: scale(0.95);
    background: rgba(231, 76, 60, 0.3);
}

/* ==========================================
   BEGINNER'S JOURNEY (JORNADA) STYLES
   ========================================== */

.helper-journey-card {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.08) 0%, rgba(10, 14, 24, 0.8) 100%);
    border: 1px solid rgba(255, 159, 67, 0.25);
        padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.journey-header-title {
    font-size: 11px;
    font-family: 'Press Start 2P', monospace;
    color: #ff9f43;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 159, 67, 0.3);
}

.journey-progress-container {
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.journey-progress-track {
    background: rgba(0, 0, 0, 0.6);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 159, 67, 0.15);
    position: relative;
}

.journey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9f43 0%, #ff6b6b 50%, #2ecc71 100%);
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

.journey-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.journey-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
        padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.journey-item:hover {
    background: rgba(255, 159, 67, 0.03);
    border-color: rgba(255, 159, 67, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.journey-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

.journey-checkbox .checkmark-svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.journey-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.journey-title {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    transition: color 0.2s;
}

.journey-desc {
    font-size: 9px;
    color: #a4b7d1;
    line-height: 1.4;
    transition: color 0.2s;
}

/* Completed item styling */
.journey-item.completed {
    background: rgba(46, 204, 113, 0.04);
    border-color: rgba(46, 204, 113, 0.3);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.05);
}

.journey-item.completed .journey-checkbox {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.2);
}

.journey-item.completed .journey-checkbox .checkmark-svg {
    opacity: 1;
    transform: scale(1);
}

.journey-item.completed .journey-title {
    color: #95a5a6;
    text-decoration: line-through;
}

.journey-item.completed .journey-desc {
    color: #7f8c8d;
}

/* --- Map Beautification Phase 2 --- */

/* Atmospheric Weather Overlays */
#weather-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: screen;
    overflow: hidden;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

#weather-layer.weather-fog {
    mix-blend-mode: screen;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.015" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.15" fill="white"/></svg>');
    animation: driftFog 60s linear infinite;
}

#weather-layer.weather-godrays {
    mix-blend-mode: screen;
    background: radial-gradient(circle at 50% 0%, rgba(255, 250, 220, 0.15) 0%, transparent 60%);
    animation: pulseRays 10s ease-in-out infinite alternate;
}

#weather-layer.weather-rain {
    mix-blend-mode: screen;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 20px 100px;
    animation: fallRain 0.6s linear infinite;
    transform: rotate(15deg) scale(1.5);
}

@keyframes driftFog {
    from { background-position: 0 0; }
    to { background-position: -2000px 1000px; }
}
@keyframes pulseRays {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}
@keyframes fallRain {
    from { background-position: 0 0; }
    to { background-position: -50px 1000px; }
}

/* Screen Shake for Crits/Big Damage */
.screen-shake {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate3d(-4px, 2px, 0); }
    20%, 40%, 60%, 80% { transform: translate3d(4px, -2px, 0); }
}

/* Bouncy Damage Text classes (added via JS to DOM text) */
.floating-text {
    position: absolute;
    pointer-events: none;
    z-index: 2000;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    animation: floatUpBounce 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.floating-text.heal { color: #2ecc71; text-shadow: 1px 1px 4px #000; }
.floating-text.crit { color: #f1c40f; font-size: 1.5em; animation: floatUpCrit 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.floating-text.damage { color: #e74c3c; }
.floating-text.mana { color: #3498db; }

@keyframes floatUpBounce {
    0% { opacity: 1; transform: translateY(0) scale(0.5); }
    20% { transform: translateY(-20px) scale(1.2); }
    50% { transform: translateY(-10px) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) scale(1); }
}
@keyframes floatUpCrit {
    0% { opacity: 1; transform: translateY(0) scale(0.5) rotate(-5deg); }
    20% { transform: translateY(-25px) scale(1.5) rotate(5deg); }
    50% { transform: translateY(-15px) scale(1.2) rotate(-2deg); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.2) rotate(0); }
}
.login-input {
padding: 10px;
font-size: 12px;
border-radius: 5px;
border: 1px solid transparent;
outline: none;
transition: all 0.2s ease;
}
.login-input:focus, .login-input:focus-visible {
border-color: #3498db;
box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
outline: 2px solid #3498db;
outline-offset: 2px;
}

/* MARKET TABS */
.market-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: #aaa;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.market-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ddd;
}

.market-tab.active {
    color: #fff;
    border-bottom: 2px solid #f1c40f;
}

.market-tab:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

/* --- Class Select Button UX Polish --- */
/* --- Class Select & Loadout UX Polish --- */
.class-location-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.class-location-badge.in-town {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}
.class-location-badge.in-wilderness {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #f39c12;
}
.class-location-badge .location-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.class-selection-card {
    background: rgba(22, 27, 34, 0.85);
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}
.class-selection-card:hover {
    border-color: #58a6ff;
    background: rgba(30, 38, 48, 0.95);
}
.class-selection-card.active-class {
    border-color: #f1c40f;
    background: rgba(38, 35, 20, 0.6);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.15);
}

.class-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.class-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.class-card-icon.warrior-theme { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.4); }
.class-card-icon.mage-theme { background: rgba(52, 152, 219, 0.15); border-color: rgba(52, 152, 219, 0.4); }
.class-card-icon.ranger-theme { background: rgba(46, 204, 113, 0.15); border-color: rgba(46, 204, 113, 0.4); }

.class-card-info {
    flex: 1;
}
.class-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.class-lvl-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: #334155;
    color: #e2e8f0;
}
.class-card-sub {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

#trade-btn-accept {
    width: 100%;
    padding: 8px;
    background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3), inset 0 -2px 0 rgba(0,0,0,0.2);
}
#trade-btn-accept:hover {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.4);
}
#trade-btn-accept:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}
#trade-btn-accept:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.class-select-btn {
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
    border: 1px solid transparent;
}
.class-select-btn.warrior-btn { background: #c0392b; border-color: #e74c3c; }
.class-select-btn.mage-btn { background: #2980b9; border-color: #3498db; }
.class-select-btn.ranger-btn { background: #27ae60; border-color: #2ecc71; }
.class-select-btn.current-btn { background: #334155; border-color: #475569; color: #94a3b8; cursor: default; }

.class-select-btn:hover:not(:disabled):not(.current-btn) {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.class-select-btn:active:not(:disabled):not(.current-btn) {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.class-select-btn:disabled:not(.current-btn) {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}
.class-select-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* --- Advanced Stats Toggle Button UX Polish --- */
#toggle-advanced-stats-btn:hover {
    background: rgba(52, 152, 219, 0.25) !important;
    border-color: rgba(52, 152, 219, 0.6) !important;
    transform: translateY(-1px);
}
#toggle-advanced-stats-btn:active {
    transform: translateY(1px);
    background: rgba(52, 152, 219, 0.15) !important;
}
#toggle-advanced-stats-btn:focus-visible {
    outline: 2px solid #3498db !important;
    outline-offset: 2px;
}

/* --- Game Prompt Buttons UX Polish --- */
.game-prompt-btn {
    flex: 1;
    padding: 12px;
    color: #fff;
    font-weight: bold;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.game-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.game-prompt-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.game-prompt-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}
.game-prompt-btn.confirm-btn {
    background: #2ecc71;
}
.game-prompt-btn.confirm-btn:hover {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}
.game-prompt-btn.cancel-btn {
    background: #e74c3c;
}
.game-prompt-btn.cancel-btn:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* --- Helper Buttons UX Polish --- */
.htab-btn:focus-visible,
#helper-scroll-top:focus-visible,
.helper-link-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

#helper-scroll-top:active {
    transform: scale(0.9);
}

/* --- Market Inputs UX Polish --- */
.market-input {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #4a5c78;
    background: rgba(0,0,0,0.5);
    color: white;
    outline: none;
    font-size: 12px;
    transition: all 0.2s ease;
}
input#market-search.market-input {
    width: 140px;
}
select#market-sort.market-input {
    cursor: pointer;
}
.market-input:hover {
    border-color: #3498db;
    background: rgba(0,0,0,0.7);
}
.market-input:focus, .market-input:focus-visible {
    border-color: #3498db;
    background: rgba(10, 15, 20, 0.8);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ─── GAME CONFIGURATIONS & HIGH QUALITY CHAT / SHADOWS ─── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}
.toggle-switch input:checked + .slider {
    background-color: #2563eb;
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* Minimalist High Quality Chat Styling (floating, transparent, quest-tracker aesthetic) */
#chat-container.high-quality-chat {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}

#chat-container.high-quality-chat #chat-header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: rgba(96, 165, 250, 0.7) !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 9px !important;
    letter-spacing: 0.5px !important;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 2px 4px rgba(0,0,0,0.9) !important;
    margin-bottom: 3px !important;
    padding: 2px 4px !important;
}

#chat-container.high-quality-chat .chat-msg {
    animation: chatMsgSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 1px 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    margin-bottom: 2px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px 2px 4px rgba(0,0,0,0.95) !important;
}

#chat-container.high-quality-chat #chat-input {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    backdrop-filter: blur(6px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    font-size: 11px !important;
    opacity: 0.65 !important;
}

#chat-container.high-quality-chat #chat-input:hover {
    opacity: 0.9 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

#chat-container.high-quality-chat #chat-input:focus {
    opacity: 1 !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

@keyframes chatMsgSlideIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────
   MOBILE PORT RESPONSIVE UI SCALING
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px), (pointer: coarse) {
    html, body {
        touch-action: none; /* Prevent scroll on touch devices to make joystick work */
        overflow: hidden;
        height: 100dvh;
    }

    /* Hide top and bottom bars entirely on mobile to declutter the screen */
    #top-bar, #bottom-bar {
        display: none !important;
    }

    /* On Android mobile, display only the fullscreen button in the top bar */
    body.android-device #top-bar {
        display: flex !important;
    }
    body.android-device #top-bar > button:not(#fullscreen-btn) {
        display: none !important;
    }

    /* HUD elements */
    #ui {
        transform: scale(0.58) !important;
        transform-origin: top left !important;
        left: 5px !important;
        top: 5px !important;
        pointer-events: none; /* Let clicks pass through if empty */
    }
    #ui * { pointer-events: auto; } /* Buttons inside UI are clickable */

    #ui-quests {
        display: none !important;
    }

    #ui-leaderboard {
        transform: scale(0.7) !important;
        transform-origin: top right !important;
        top: 5px !important;
        right: 5px !important;
        pointer-events: none;
    }

    /* Mini-map */
    #mini-map-wrap {
        transform: scale(0.6) !important;
        transform-origin: top right !important;
        top: 50px !important;
        right: 5px !important;
    }

    /* Convert hotbar to a premium radial menu in the bottom-right corner */
    #skill-bar {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        width: 240px !important;
        height: 240px !important;
        display: block !important; /* switch from flex to absolute block container */
        pointer-events: none !important;
        z-index: 100000 !important;
        background: transparent !important;
        border: none !important;
    }

    #potion-bar {
        display: contents !important;
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Style hotbar slots as round, sleek touch targets */
    #skill-bar .skill-slot {
        position: absolute !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 2px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6) !important;
        pointer-events: auto !important;
        left: auto !important;
        top: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        transition: opacity 0.2s ease, transform 0.15s ease !important;
    }

    #skill-bar .skill-slot-content {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: auto !important;
    }

    /* Lower default opacity (0.3) for empty/unused skill slots so they don't block world visibility */
    #skill-bar .skill-slot.is-empty,
    #skill-bar .skill-slot:not(.has-skill) {
        opacity: 0.3 !important;
    }
    #skill-bar .skill-slot.has-skill,
    #skill-bar .skill-slot:active,
    #skill-bar .skill-slot:hover {
        opacity: 0.9 !important;
    }

    /* Hide keyboard shortcut keybind overlays (R, T, numbers) on touch controls */
    .skill-slot-key,
    .skill-slot .skill-slot-key,
    #potion-bar .skill-slot-key,
    #skill-bar .skill-slot-key {
        display: none !important;
    }

    /* Arrange 6 skill slots & 2 potions in a clean radial arc framing the main attack button */
    #skill-bar .skill-slot[data-slot="0"] { position: absolute !important; bottom: 112px !important; right: 18px !important; }
    #skill-bar .skill-slot[data-slot="1"] { position: absolute !important; bottom: 108px !important; right: 65px !important; }
    #skill-bar .skill-slot[data-slot="2"] { position: absolute !important; bottom: 88px !important; right: 106px !important; }
    #skill-bar .skill-slot[data-slot="3"] { position: absolute !important; bottom: 58px !important; right: 138px !important; }
    #skill-bar .skill-slot[data-slot="4"] { position: absolute !important; bottom: 15px !important; right: 168px !important; }
    #skill-bar .skill-slot[data-slot="5"] { position: absolute !important; bottom: 162px !important; right: 18px !important; }

    #skill-bar button[onclick*="health_potion"] { position: absolute !important; bottom: 155px !important; right: 65px !important; border-color: #e74c3c !important; }
    #skill-bar button[onclick*="mana_potion"] { position: absolute !important; bottom: 135px !important; right: 108px !important; border-color: #3498db !important; }

    /* Adjust potion counts to fit round buttons elegantly */
    #skill-bar .skill-slot #hp-potion-count,
    #skill-bar .skill-slot #mp-potion-count {
        position: absolute !important;
        bottom: 2px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        font-size: 10px !important;
        line-height: 1 !important;
        color: #ffffff !important;
        text-shadow: 1px 1px 2px #000, -1px -1px 2px #000 !important;
        z-index: 5 !important;
    }

    #skill-bar .skill-slot svg {
        width: 24px !important;
        height: 24px !important;
    }

    /* Shift chat container up to avoid overlapping with the joystick move-pad */
    #chat-container {
        transform: scale(0.7) !important;
        transform-origin: bottom left !important;
        bottom: 140px !important;
        left: 5px !important;
    }

    /* Modals / Panels */
    .draggable-panel {
        transform: translate(-50%, -50%) scale(0.85) !important;
        transform-origin: center center !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        left: 50% !important;
        top: 50% !important;
        margin: 0 !important;
        position: fixed !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    .draggable-panel .panel-body,
    #inventory-ui .panel-body,
    #bank-ui .panel-body,
    #skills-panel .panel-body,
    #status-panel .panel-body,
    #crafting-ui .panel-body,
    #shop-ui .panel-body,
    #market-panel .panel-body {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    #item-tooltip {
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
        font-size: 8px !important;
        padding: 10px 12px !important;
        z-index: 100005 !important;
        pointer-events: none !important;
    }

    .panel-close-btn {
        min-width: 32px !important;
        min-height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 11px !important;
    }

    .context-menu-btn {
        min-height: 38px !important;
        padding: 10px 14px !important;
        font-size: 12px !important;
    }

    #inventory-ui, #bank-ui, #market-panel, #crafting-ui, #shop-ui, #skills-panel, #status-panel, #guild-panel, #social-panel {
        transform: translate(-50%, -50%) scale(0.85) !important;
    }

    #inventory-ui {
        min-width: 0 !important;
        width: 95vw !important;
        max-width: 480px !important;
    }

    #inventory-body {
        flex-direction: column !important;
        align-items: center !important;
        padding: 10px !important;
        gap: 12px !important;
        max-height: 75vh !important;
        overflow-y: auto !important;
    }

    #craft-panel {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    #craft-panel .panel-header {
        padding: 10px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #craft-panel .panel-header h1 {
        font-size: 14px !important;
    }

    #craft-panel .panel-body {
        flex-direction: column !important;
        padding: 10px !important;
        gap: 10px !important;
        overflow-y: auto !important;
    }

    #craft-panel .panel-body > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .draggable-panel.grimoire-panel {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    /* Mobile Controls: make them large and at the very front */
    #mobile-controls {
        display: flex !important;
        z-index: 99999 !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        padding: 0 !important;
        justify-content: space-between !important;
        align-items: flex-end !important;
        pointer-events: none !important; /* Allow clicks in dead space to pass to game world */
    }
    #move-pad {
        width: 110px !important;
        height: 110px !important;
        pointer-events: auto !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
        display: block !important;
        opacity: 0.4 !important;
        transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease !important;
        background: rgba(15, 23, 42, 0.4) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
    }
    #move-pad:active,
    #move-pad.active {
        opacity: 0.85 !important;
        background: rgba(15, 23, 42, 0.75) !important;
        border-color: rgba(56, 189, 248, 0.6) !important;
    }
    #move-knob {
        width: 46px !important;
        height: 46px !important;
    }
    #mobile-actions {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        width: 240px !important;
        height: 240px !important;
        display: block !important; /* override grid */
        pointer-events: none !important;
        z-index: 99999 !important;
    }

    /* Hide redundant buttons on mobile since they are now in the primary Menu overlay */
    #mobile-inventory-btn, #mobile-map-btn {
        display: none !important;
    }

    /* Large, premium main Attack button */
    #mobile-attack-btn {
        position: absolute !important;
        bottom: 10px !important;
        right: 10px !important;
        width: 80px !important;
        height: 80px !important;
        border-radius: 50% !important;
        background: radial-gradient(circle, #e74c3c 0%, #c0392b 100%) !important;
        border: 3px solid rgba(255, 255, 255, 0.25) !important;
        box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5) !important;
        color: #fff !important;
        font-family: 'Press Start 2P', monospace !important;
        font-size: 10px !important;
        text-shadow: 1px 1px 0px #000 !important;
        pointer-events: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
    }
    #mobile-attack-btn:active {
        background: #e74c3c !important;
        transform: scale(0.92) !important;
    }

    /* Ergonomic Coleta / Collect button situated perfectly with spacing */
    #mobile-collect-btn {
        position: absolute !important;
        bottom: 10px !important;
        right: 105px !important;
        width: 54px !important;
        height: 54px !important;
        border-radius: 50% !important;
        background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4) !important;
        color: #fff !important;
        font-family: 'Press Start 2P', monospace !important;
        font-size: 8px !important;
        text-shadow: 1px 1px 0px #000 !important;
        pointer-events: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
    }
    #mobile-collect-btn:active {
        background: #2ecc71 !important;
        transform: scale(0.92) !important;
    }

    /* Unified Mobile Dodge Button */
    #mobile-dodge-btn {
        position: absolute !important;
        bottom: 100px !important;
        right: 10px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        background: radial-gradient(circle, #334155 0%, #1e293b 100%) !important;
        border: 2px solid rgba(255, 255, 255, 0.35) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
        color: #fff !important;
        font-family: 'Press Start 2P', monospace !important;
        font-size: 7.5px !important;
        text-shadow: 1px 1px 0px #000 !important;
        pointer-events: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
        transition: transform 0.1s ease, filter 0.2s ease !important;
    }
    #mobile-dodge-btn:active {
        transform: scale(0.92) !important;
        background: #475569 !important;
    }
    #mobile-dodge-btn.on-cooldown {
        opacity: 0.55 !important;
        filter: grayscale(60%) !important;
    }
    #mobile-dodge-btn .mobile-btn-cd {
        font-size: 8px !important;
        color: #fef08a !important;
        font-weight: bold !important;
        margin-top: 1px;
    }

    /* Mobile Quick Skill 1 Button */
    #mobile-skill-btn {
        position: absolute !important;
        bottom: 78px !important;
        right: 78px !important;
        width: 54px !important;
        height: 54px !important;
        border-radius: 50% !important;
        background: radial-gradient(circle, #8b5cf6 0%, #6d28d9 100%) !important;
        border: 2px solid rgba(255, 255, 255, 0.25) !important;
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4) !important;
        color: #fff !important;
        font-family: 'Press Start 2P', monospace !important;
        font-size: 8px !important;
        text-shadow: 1px 1px 0px #000 !important;
        pointer-events: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
    }
    #mobile-skill-btn:active {
        background: #8b5cf6 !important;
        transform: scale(0.92) !important;
    }

    /* Mobile Menu styles */
    #mobile-menu-btn {
        display: block !important;
        position: fixed !important;
        top: 10px !important;
        left: 160px !important;
        right: auto !important;
        z-index: 10002 !important;
        font-size: 10px !important;
        padding: 6px 12px !important;
        background: rgba(14, 18, 26, 0.92) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 6px !important;
        color: #f1f5f9 !important;
        font-family: 'Press Start 2P', monospace !important;
        cursor: pointer !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        text-shadow: 1px 1px 0px #000 !important;
        transition: all 0.15s ease !important;
    }
    #mobile-menu-btn:active {
        background: rgba(30, 41, 59, 0.95) !important;
        border-color: #38bdf8 !important;
        transform: scale(0.95) !important;
    }

    #mobile-menu-overlay {
        background: rgba(14, 18, 26, 0.96) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 10px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
    }
    #mobile-menu-overlay .panel-header {
        background: rgba(255, 255, 255, 0.03) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    #mobile-menu-overlay .panel-body > div {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important;
        gap: 8px !important;
    }

    /* Minimalist Dark Glass Scrollbars for mobile panels */
    .draggable-panel ::-webkit-scrollbar {
        width: 4px !important;
        height: 4px !important;
    }
    .draggable-panel ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 4px !important;
    }
    .draggable-panel ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.18) !important;
        border-radius: 4px !important;
    }
    .draggable-panel ::-webkit-scrollbar-thumb:hover {
        background: rgba(56, 189, 248, 0.5) !important;
    }

    .mobile-menu-item {
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 8px !important;
        padding: 10px 4px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
        outline: none !important;
        min-height: 56px !important;
        touch-action: manipulation !important;
        text-shadow: 1px 1px 0px #000 !important;
    }
    .mobile-menu-item:hover, .mobile-menu-item:focus-visible {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(56, 189, 248, 0.4) !important;
        transform: translateY(-1px) !important;
    }
    .mobile-menu-item:focus-visible {
        outline: 2px solid #3498db !important;
        outline-offset: 2px !important;
    }
    .mobile-menu-item:active {
        transform: scale(0.94) !important;
        background: rgba(56, 189, 248, 0.15) !important;
        border-color: rgba(56, 189, 248, 0.5) !important;
    }

    .mobile-menu-label {
        font-size: 8px !important;
        color: #cbd5e1 !important;
        text-align: center !important;
        margin-top: 4px !important;
        display: block !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
    }
}

/* Default hidden menu buttons for desktop */
#mobile-menu-btn {
    display: none;
}



/* --- HUD Guest Upgrade Button UX Polish --- */
#btn-hud-guest-upgrade {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border: 2px solid #f1c40f;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.5);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#btn-hud-guest-upgrade:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.7);
    filter: brightness(1.1);
}

#btn-hud-guest-upgrade:active {
    transform: translateX(-50%) translateY(1px);
    box-shadow: 0 2px 10px rgba(241, 196, 15, 0.4);
}

#btn-hud-guest-upgrade:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* --- iOS PWA Fullscreen Tooltip --- */
#ios-pwa-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 380px;
    background: rgba(14, 18, 25, 0.95);
    border: 2px solid #f1c40f;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    color: #cbd5e1;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    line-height: 1.6;
    padding: 12px 16px;
    z-index: 15000;
    box-sizing: border-box;
    text-shadow: 1px 1px 0px #000;
}

#ios-pwa-tooltip .tooltip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#ios-pwa-tooltip .tooltip-close {
    background: transparent;
    border: none;
    color: #f1c40f;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    text-shadow: 1px 1px 0px #000;
}

#ios-pwa-tooltip .tooltip-close:hover {
    color: #fff;
}

#ios-pwa-tooltip .tooltip-close:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

#ios-pwa-tooltip .tooltip-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #f1c40f;
}

/* Premium Guild UI Styles */
.guild-info-card {
    background: rgba(10, 15, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    text-align: left;
}

.guild-info-card h3 {
    margin: 0 0 6px 0;
    color: #f1c40f;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guild-motd-box {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid #3498db;
    padding: 8px 10px;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: #cbd5e1;
    font-size: 11px;
    margin: 8px 0;
    position: relative;
}

.guild-motd-edit-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 10px;
}

.guild-motd-edit-btn:hover {
    color: #38bdf8;
}

.guild-xp-track {
    background: #1e293b;
    border: 1px solid #0f172a;
    height: 10px;
    border-radius: 4px;
    width: 100%;
    margin-top: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
    overflow: hidden;
}

.guild-xp-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.guild-members-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 6px;
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.guild-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
    border-radius: 4px;
}

.guild-member-row:hover {
    background: rgba(255,255,255,0.05);
}

.guild-member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #f1f5f9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.status-dot.offline {
    background: #64748b;
    box-shadow: none;
}

.guild-invite-box {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

.guild-invite-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    outline: none;
}

.guild-invite-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.guild-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
    text-transform: uppercase;
}

.guild-action-btn.blue { background: #2563eb; border: 1px solid #3b82f6; }
.guild-action-btn.blue:hover { background: #1d4ed8; transform: translateY(-1px); }

.guild-action-btn.green { background: #16a34a; border: 1px solid #22c55e; }
.guild-action-btn.green:hover { background: #15803d; transform: translateY(-1px); }

.guild-action-btn.red { background: #dc2626; border: 1px solid #ef4444; }
.guild-action-btn.red:hover { background: #b91c1c; transform: translateY(-1px); }

.guild-action-btn.orange { background: #d97706; border: 1px solid #f59e0b; }
.guild-action-btn.orange:hover { background: #b45309; transform: translateY(-1px); }

/* GUILD MISSIONS */
.guild-mission-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.guild-mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guild-mission-title {
    font-weight: bold;
    color: #f1c40f;
    font-size: 14px;
}

.guild-mission-desc {
    font-size: 12px;
    color: #94a3b8;
}

.guild-mission-progress-bg {
    background: rgba(0, 0, 0, 0.5);
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.guild-mission-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    transition: width 0.3s ease;
}

.guild-mission-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
    line-height: 1;
}

.guild-mission-claim-btn {
    align-self: flex-end;
    padding: 4px 12px;
    font-size: 11px;
    margin-top: 4px;
}
.guild-mission-claim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #475569;
    border-color: #334155;
}

/* DISCONNECT MODAL */
#disconnect-modal {
    animation: fadeInDisconnect 0.25s ease-out;
}
@keyframes fadeInDisconnect {
    from { opacity: 0; }
    to { opacity: 1; }
}
.disconnect-card {
    animation: slideInDisconnect 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInDisconnect {
    from { transform: scale(0.92) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
#btn-disconnect-reconnect:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}
#btn-disconnect-reload:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #64748b;
    color: #fff;
}

/* GAME STARTUP LOADING SCREEN */
#game-loading-screen {
    user-select: none;
    -webkit-user-select: none;
}
#loading-bar-fill {
    background-size: 30px 30px;
    background-image: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    animation: loadingBarStripes 1s linear infinite;
}
@keyframes loadingBarStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}
