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: 100vh; image-rendering: auto; transform: translate3d(0, 0, 0); will-change: transform; backface-visibility: hidden; }
        #ui { position: absolute; top: 10px; left: 10px; z-index: 10; font-size: 14px; background: rgba(10,15,20,0.4); padding: 8px 12px; border-radius: 12px; pointer-events: none; border: 1px solid rgba(255,255,255,0.05); backdrop-filter: blur(8px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

        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;
            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-ferramenta_sobrevivencia_desastrosa { 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-left: 1px solid #3a4454; padding-left: 18px; flex: 1; min-width: 0; }

        #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: 400px;
            max-width: 100vw;
            height: 100vh;
            background: rgba(10, 14, 23, 0.88);
            border-left: 1.5px solid rgba(255, 255, 255, 0.14);
            box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(16px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            box-sizing: border-box;
        }
        .auth-card {
            width: 100%;
            height: 100%;
            padding: 32px 28px;
            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;
        }
        #auth-ui input { padding: 10px 14px; font-size: 11px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12); background: rgba(30, 41, 59, 0.9); color: white; transition: all 0.2s; outline: none; width: 100%; box-sizing: border-box; }
        #auth-ui input:focus { border-color: #3b82f6; box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); }
        #auth-ui button { transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); }
        #auth-ui button:hover { transform: translateY(-2px); filter: brightness(1.15); box-shadow: 0 4px 15px rgba(0,0,0,0.4); }
        #auth-ui button:active { transform: translateY(0); }
        #auth-ui button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
        #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; }

        #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.08); padding-left: 18px; }

        .context-menu-btn {
            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);
            
            font-size: 14px;
        }
        .context-menu-btn:last-child {
            border-bottom: none;
        }
        .context-menu-btn:hover {
            background: rgba(255,255,255,0.08);
            padding-left: 18px;
        }
        .context-menu-btn:focus-visible {
            outline: 2px solid #3498db;
            outline-offset: -2px;
            background: rgba(255,255,255,0.08);
        }

        #inspect-panel {
            position: absolute;
            right: 16px;
            top: 16px;
            z-index: 1100;
            display: none;
            width: 280px;
            background: rgba(10, 15, 20, 0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            backdrop-filter: blur(12px);
            padding: 12px;
            color: #dce8ff;
            font-size: 12px;
            line-height: 1.45;
            white-space: pre-line;
            
        }

        #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: 1400;
            display: none;
            background: rgba(5, 7, 10, 0.74);
            align-items: center;
            justify-content: center;
        }
        #world-map-panel {
            width: min(920px, 92vw);
            height: min(640px, 88vh);
            background: rgba(10, 15, 20, 0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            box-shadow: 0 16px 40px rgba(0,0,0,0.55);
            backdrop-filter: blur(12px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            
        }
        #world-map-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            color: #e4eeff;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.6px;
        }
        #world-map-header button {
            background: #3b4f6d;
            border: 1px solid #60789b;
            color: #f0f6ff;
            border-radius: 6px;
            padding: 4px 8px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
        }
        #world-map-header button:hover {
            background: #4a6388;
            transform: translateY(-1px);
        }
        #world-map-header button:active {
            transform: translateY(1px);
            background: #2f405c;
        }
        #world-map-header button:focus-visible {
            outline: 2px solid #3498db;
            outline-offset: 2px;
        }
        #world-map-content {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 220px;
            min-height: 0;
        }
        #world-map-canvas {
            width: 100%;
            height: 100%;
            display: block;
            background: #0e1520;
        }
        #world-map-legend {
            border-left: 1px solid #3f516b;
            padding: 10px;
            color: #d5e2f8;
            font-size: 12px;
            overflow-y: auto;
        }
        .legend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
        .legend-swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.35); }

        #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 {
            background: rgba(10, 15, 20, 0.4);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 50%;
            width: 65px;
            height: 65px;
            color: #bdc3c7;
            font-size: 11px;
            font-weight: bold;
            
            text-transform: uppercase;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            backdrop-filter: blur(12px);
            transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
            user-select: none;
        }
        #mobile-actions button:active { transform: translateY(2px) scale(0.95); box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
        #mobile-actions button:hover { background: rgba(52, 152, 219, 0.15); border-color: rgba(52, 152, 219, 0.5); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(52, 152, 219, 0.3); }
        #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: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10000;
        }

        #bottom-bar {
            position: fixed;
            bottom: 20px;
            left: 50%;
            right: auto;
            transform: translateX(-50%);
            z-index: 10000;
        }
        .icon-btn {
            background-color: #333 !important;
            border: 4px solid #555 !important;
            box-shadow: inset -2px -2px 0px 0px #111, inset 2px 2px 0px 0px #777 !important;
            color: #fff;
            font-size: 24px;
            width: 50px;
            height: 50px;
            border-radius: 0 !important;
            cursor: pointer !important;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: none !important;
            position: relative;
            backdrop-filter: none !important;
        }
        .icon-btn:hover {
            border-color: #fff !important;
            background-color: #444 !important;
            transform: none !important;
        }
        .icon-btn:active, .icon-btn.active {
            box-shadow: inset 2px 2px 0px 0px #111, inset -2px -2px 0px 0px #777 !important;
            transform: translate(2px, 2px) !important;
            background-color: #222 !important;
        }
        .icon-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 16px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.2); }
        .icon-btn:active { transform: translateY(0) scale(0.95); }
        .icon-btn.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1); transform: translateY(-2px); background: rgba(255,255,255,0.15); }
        .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;
        }
        .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 { opacity: 1; }

        #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: #0c0f17;
            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: #0c0f17 !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;
        }

        /* Starry Blueprint grid pattern background for the talent tree container */
        #skill-tree-container {
            background-color: #080b11;
            background-image: 
                linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
            background-size: 20px 20px;
            background-position: center;
            border: 4px solid #1a1f29;
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
        }

        .skill-node {
            position: relative;
            width: 80px;
            height: 86px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            cursor: pointer;
            z-index: 5;
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-sizing: border-box;
            background: transparent;
            border: none;
            box-shadow: none;
        }

        .skill-node:hover {
            transform: scale(1.1) translateY(-3px);
            z-index: 10;
        }

        .skill-node-icon-wrapper {
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease-out;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
            flex-shrink: 0;
        }

        /* Active skills: Rounded Squares (WoW active style) with thick retro bevel borders */
        .skill-node.active-type .skill-node-icon-wrapper {
            border: 3px solid #222;
            border-radius: 6px;
            background: linear-gradient(135deg, #1b2230 0%, #0d121c 100%);
            box-shadow: inset -3px -3px 0px 0px #0c0f16, inset 3px 3px 0px 0px #4a5d7c, 0 4px 8px rgba(0,0,0,0.6);
        }

        /* Passive skills: Circles (WoW passive style) with round retro bevel borders */
        .skill-node.passive-type .skill-node-icon-wrapper {
            border: 3px solid #222;
            border-radius: 50%;
            background: linear-gradient(135deg, #241a30 0%, #110c17 100%);
            box-shadow: inset -3px -3px 0px 0px #0e0a14, inset 3px 3px 0px 0px #614682, 0 4px 8px rgba(0,0,0,0.6);
        }

        .skill-node-name {
            font-family: 'Press Start 2P', monospace;
            font-size: 7px;
            font-weight: bold;
            color: #8a9cb7;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
            margin-top: 5px;
            line-height: 1.2;
            text-shadow: 1px 1px 0px #000;
            pointer-events: none;
            transition: color 0.2s;
        }

        /* Locked State */
        .skill-node.locked {
            cursor: not-allowed;
        }
        .skill-node.locked .skill-node-icon-wrapper {
            filter: grayscale(1) brightness(0.28);
            border-color: #1a1e26;
            box-shadow: inset -3px -3px 0px 0px #0b0d10, inset 3px 3px 0px 0px #2f3642, 0 4px 8px rgba(0,0,0,0.6);
        }
        .skill-node.locked .skill-node-name {
            color: #4f5e73;
        }

        /* Available state */
        .skill-node.available .skill-node-icon-wrapper {
            border-color: #3498db;
            background: linear-gradient(135deg, #153248 0%, #1a4261 100%);
            box-shadow: inset -3px -3px 0px 0px #1a5a8f, inset 3px 3px 0px 0px #6ebcf0, 0 0 12px rgba(52, 152, 219, 0.5), 0 4px 8px rgba(0,0,0,0.6);
            animation: skill-pulse-blue 1.5s infinite alternate;
        }
        .skill-node.available .skill-node-name {
            color: #3498db;
            text-shadow: 0 0 4px rgba(52,152,219,0.4), 1px 1px 0px #000;
        }

        /* Learned Active State (Wow Gold style) */
        .skill-node.learned.active-type .skill-node-icon-wrapper {
            border-color: #f1c40f;
            background: linear-gradient(135deg, #2a2408 0%, #453a0f 100%);
            box-shadow: inset -3px -3px 0px 0px #9b7e0c, inset 3px 3px 0px 0px #fce26d, 0 0 15px rgba(241, 196, 15, 0.6), 0 4px 10px rgba(0,0,0,0.7);
        }
        .skill-node.learned.active-type .skill-node-name {
            color: #f1c40f;
            text-shadow: 0 0 4px rgba(241,196,15,0.4), 1px 1px 0px #000;
        }

        /* Learned Passive State (Wow Purple style) */
        .skill-node.learned.passive-type .skill-node-icon-wrapper {
            border-color: #9b59b6;
            background: linear-gradient(135deg, #1a0f26 0%, #2f1945 100%);
            box-shadow: inset -3px -3px 0px 0px #63337a, inset 3px 3px 0px 0px #d687f5, 0 0 15px rgba(155, 89, 182, 0.6), 0 4px 10px rgba(0,0,0,0.7);
        }
        .skill-node.learned.passive-type .skill-node-name {
            color: #9b59b6;
            text-shadow: 0 0 4px rgba(155,89,182,0.4), 1px 1px 0px #000;
        }

        /* Points / Level Badge absolute positioned at bottom-right corner of the icon */
        .skill-node-badge {
            position: absolute;
            bottom: 26px;
            left: 46px;
            background: #000;
            border: 2px solid #555;
            font-size: 6px;
            font-family: 'Press Start 2P', monospace;
            font-weight: bold;
            color: #fff;
            padding: 2px 4px;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 2px 4px rgba(0,0,0,0.8);
            z-index: 12;
            transition: all 0.2s;
        }
        
        .skill-node.locked .skill-node-badge {
            color: #666;
            border-color: #333;
            background: #0c0f16;
        }

        .skill-node.available .skill-node-badge {
            color: #6ebcf0;
            border-color: #3498db;
            box-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 4px rgba(52,152,219,0.4);
        }

        .skill-node.learned.active-type .skill-node-badge {
            color: #fce26d;
            border-color: #f1c40f;
            box-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 4px rgba(241,196,15,0.4);
        }

        .skill-node.learned.passive-type .skill-node-badge {
            color: #d687f5;
            border-color: #9b59b6;
            box-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 4px rgba(155,89,182,0.4);
        }

        @keyframes linePulse {
            0% { opacity: 0.8; filter: drop-shadow(0 0 5px rgba(241, 196, 15, 0.9)) drop-shadow(0 0 10px rgba(241, 196, 15, 0.5)); }
            50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(241, 196, 15, 1)) drop-shadow(0 0 15px rgba(241, 196, 15, 0.8)); }
            100% { opacity: 0.8; filter: drop-shadow(0 0 5px rgba(241, 196, 15, 0.9)) drop-shadow(0 0 10px rgba(241, 196, 15, 0.5)); }
        }

        @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;
            border-radius: 8px;
            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 { left: 10px; top: 10px; transform: scale(0.85); transform-origin: top left; }
            #ui-quests { left: 10px; top: 130px; width: calc(100vw - 20px); max-width: 300px; }
            #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 #3f516b; }
        }

        @media (pointer: coarse) {
            #mobile-controls { display: flex; }
            .icon-btn .tooltip { display: none; }
        }

        /* SKILL BAR STYLES */
        #skill-bar {
            background: transparent;
            padding: 10px 15px;
            border-radius: 12px;
            border: none;
            backdrop-filter: none;
            box-shadow: none;
        }

        .skill-slot {
            width: 52px;
            height: 52px;
            background-color: #222 !important;
            border: 4px 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;
            cursor: pointer;
            position: relative;
            transition: none !important;
            user-select: none;
        }
        .skill-slot:hover, .skill-slot:focus-visible {
            border-color: #fff !important;
            box-shadow: inset -2px -2px 0px 0px #aaa, inset 2px 2px 0px 0px #fff !important;
            transform: none !important;
            background-color: #444 !important;
        }
        .skill-slot:active, .skill-slot.active {
            box-shadow: inset 2px 2px 0px 0px #000, inset -2px -2px 0px 0px #777 !important;
            transform: translate(2px, 2px) !important;
            background-color: #111 !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); }
        }

        .skill-slot.skill-ready-flash {
            animation: skill-ready-pulse 0.6s ease-out;
        }

        /* 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;
            border-radius: 8px;
            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: 10px;
                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;
}


        #chat-container { position: absolute; bottom: 80px; left: 10px; width: 320px; max-height: 250px; display: flex; flex-direction: column; pointer-events: none; z-index: 10000;  }
        #chat-header { pointer-events: auto; cursor: grab; background: rgba(10, 15, 20, 0.4); border: 1px solid rgba(255,255,255,0.05); border-bottom: none; border-radius: 10px 10px 0 0; padding: 8px 10px; font-size: 12px; font-weight: bold; color: #cfdcff; backdrop-filter: blur(8px); transition: background 0.2s, color 0.2s; }
        #chat-header:hover { background: rgba(10, 15, 20, 0.6); color: #fff; }
        #chat-messages { pointer-events: auto; flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; margin-bottom: 5px; text-shadow: 0 1px 2px rgba(0,0,0,0.8); font-size: 13px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
        #chat-messages::-webkit-scrollbar { width: 6px; }
        #chat-messages::-webkit-scrollbar-track { background: transparent; }
        #chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 6px; }
        #chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
        .chat-msg { color: #fff; margin: 3px 0; opacity: 0.95; transition: opacity 1s ease-out; word-wrap: break-word; font-weight: 500; }
        .chat-msg.fade-out { opacity: 0; }
        #chat-input { pointer-events: auto; background: rgba(10, 15, 20, 0.5); border: 1px solid rgba(255, 255, 255, 0.05); color: #fff; padding: 8px 12px; border-radius: 8px; outline: none; opacity: 0; transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); font-size: 13px; backdrop-filter: blur(8px); }
        #chat-input:hover { opacity: 0.8; }
        #chat-input:focus { opacity: 1; background: rgba(10, 15, 20, 0.8); border-color: rgba(52, 152, 219, 0.5); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
        #chat-input:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }
        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;
}

@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;
    border-radius: 8px;
    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-radius: 8px;
    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-radius: 8px;
    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-radius: 8px;
    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 {
    border-radius: 8px;
    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);
    border-radius: 8px;
    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;
    border-radius: 8px;
    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;
    border-radius: 8px;
    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;
    border-radius: 8px;
    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);
    border-radius: 8px;
    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);
    border-radius: 8px;
    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-btn {
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}
.class-select-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.class-select-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.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);
}

/* High Quality Chat Styling */
#chat-container.high-quality-chat {
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
    padding: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#chat-container.high-quality-chat #chat-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(15, 23, 42, 0.4) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #60a5fa !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5) !important;
    margin-bottom: 6px !important;
}

#chat-container.high-quality-chat .chat-msg {
    animation: chatMsgSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border-left: 2px solid rgba(59, 130, 246, 0.5) !important;
    margin-bottom: 4px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

#chat-container.high-quality-chat #chat-input {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    border-radius: 8px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 8px rgba(96, 165, 250, 0.2) !important;
    font-size: 12px !important;
}

@keyframes chatMsgSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    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;
    }

    /* scale down top and bottom bars */
    #top-bar { top: 5px !important; left: 50% !important; }
    #bottom-bar { left: 50% !important; }
    #top-bar, #bottom-bar {
        transform: translateX(-50%) scale(0.85) !important;
        transform-origin: top center;
    }
    #bottom-bar {
        transform-origin: bottom center;
        bottom: 5px !important;
    }

    /* HUD elements */
    #ui {
        transform: scale(0.7) !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 {
        transform: scale(0.7) !important;
        transform-origin: top left !important;
        top: 80px !important;
        left: 5px !important;
        pointer-events: none;
    }
    #ui-quests * { pointer-events: auto; }

    #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;
    }

    /* Skill bar */
    #skill-bar {
        transform: translateX(-50%) scale(0.7) !important;
        transform-origin: bottom center !important;
        bottom: 70px !important;
        pointer-events: auto !important;
        z-index: 1000 !important;
    }

    /* Chat */
    #chat-container {
        transform: scale(0.7) !important;
        transform-origin: bottom left !important;
        bottom: 85px !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;
    }

    #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;
    }

    /* 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;
    }
    #move-pad {
        width: 120px !important;
        height: 120px !important;
        pointer-events: auto !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
        display: block !important;
    }
    #move-knob {
        width: 50px !important;
        height: 50px !important;
    }
    #mobile-actions {
        display: grid !important;
        grid-template-columns: repeat(2, 55px) !important;
        gap: 8px !important;
        pointer-events: auto !important;
    }
    #mobile-actions button {
        width: 55px !important;
        height: 55px !important;
        font-size: 10px !important;
        touch-action: none !important;
        -webkit-user-select: none;
        user-select: none;
        display: block !important;
    }
}



/* --- 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;
}
