/* Minimap Styles */
.minimap-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999999 !important;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
}

.minimap-container>* {
    pointer-events: auto;
}


/* Fullscreen Map Modal */
.fullscreen-map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Make click-through possible */
}

.fullscreen-map-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Wrapper for canvas and close button */
.fullscreen-map-wrapper {
    position: relative;
    display: inline-block;
    pointer-events: none; /* Allow click-through to game */
}

#fullscreen-map-canvas {
    width: 600px;
    height: 450px;
    max-width: 90vw;
    max-height: 85vh;
    background: rgba(15, 20, 30, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: block;
    pointer-events: none; /* Make canvas click-through */
}

/* Close button inside map corner */
.fullscreen-map-close-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fullscreen-map-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: auto;
}

.fullscreen-map-close-btn:hover {
    transform: scale(1.1);
}

.fullscreen-map-close-btn:active {
    transform: scale(0.9);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #fullscreen-map-canvas {
        width: 320px;
        height: 240px;
        border-radius: 8px;
    }

    .fullscreen-map-close-btn {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
    }

    .fullscreen-map-close-btn img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    #fullscreen-map-canvas {
        width: 280px;
        height: 210px;
        border-radius: 8px;
    }

    .fullscreen-map-close-btn {
        top: 4px;
        right: 4px;
        width: 24px;
        height: 24px;
    }

    .fullscreen-map-close-btn img {
        width: 18px;
        height: 18px;
    }
}

/* Buttons around minimap */
.minimap-button {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(100, 100, 100, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(150, 150, 150, 0.4);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(100, 100, 100, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    z-index: 1000 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
}

.minimap-button:hover {
    background: rgba(150, 150, 150, 0.4);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(150, 150, 150, 0.4);
}

.minimap-button:active {
    transform: scale(0.95);
}

/* Minimap Button Labels */
.minimap-button-label {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 9px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
    pointer-events: none;
    z-index: 100;
    font-family: 'Outfit', 'Inter', Arial, sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.minimap-button:hover .minimap-button-label {
    color: #ffe49c;
}

/* Inventory button - top level next to nạp đầu */
.inventory-btn.minimap-button {
    position: relative;
    font-size: 18px;
    width: 60px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 99998;
    overflow: visible !important;
}

.inventory-btn.minimap-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.1);
}

.inventory-btn.minimap-button:active {
    background: transparent !important;
    transform: scale(0.95);
}

.inventory-btn.minimap-button img {
    display: block;
    line-height: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Inventory notification dot */
.inventory-btn.minimap-button::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100001;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
}

.inventory-btn.minimap-button.has-notification::after {
    opacity: 1;
    visibility: visible;
}

/* Chat button - to the right of inventory button at bottom */
.chat-toggle.minimap-button {
    bottom: -10px;
    left: 35px;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

/* Chat notification dot */
#chat-toggle.menu-dropdown-item::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
}

#chat-toggle.menu-dropdown-item.has-notification::after {
    opacity: 1;
    visibility: visible;
}

/* Check-in notification dot */
#checkin-toggle.menu-dropdown-item::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
}

#checkin-toggle.menu-dropdown-item.has-notification::after {
    opacity: 1;
    visibility: visible;
}

/* Settings button - to the right of chat button at bottom */
.settings-toggle.minimap-button {
    bottom: -10px;
    left: 80px;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle.minimap-button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Menu Dropdown Container - Left of Minimap */
.menu-dropdown-container {
    position: relative;
    z-index: 9999999 !important;
}

/* Menu Dropdown Toggle Button */
.menu-dropdown-toggle.minimap-button {
    position: relative;
    font-size: 18px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.menu-dropdown-toggle.minimap-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.1);
}

.menu-dropdown-toggle.minimap-button:active {
    background: transparent !important;
    transform: scale(0.95);
}

/* Menu Dropdown Toggle notification dot */
.menu-dropdown-toggle.minimap-button {
    overflow: visible;
    /* Ensure badge is visible */
}

.menu-dropdown-toggle.minimap-button::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100000;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
    /* Don't interfere with clicks */
}

.menu-dropdown-toggle.minimap-button.has-notification::after {
    opacity: 1;
    visibility: visible;
}

.menu-icon {
    display: block;
    line-height: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.menu-icon img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Menu Dropdown */
.menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 9999999 !important;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: auto;
    width: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 99999;
}

.menu-dropdown-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.menu-dropdown-container.active .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Menu Dropdown Items - Icon only buttons */
.menu-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    position: relative;
    z-index: 99999;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    -webkit-user-select: none;
    user-select: none;
}

.menu-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.menu-dropdown-item:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.menu-item-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.menu-item-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Đảm bảo emoji fallback không hiển thị trên mobile */
.menu-item-icon span.menu-item-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    font-size: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
}

.menu-item-text {
    display: none !important;
    /* Hide text, only show icon */
    visibility: hidden !important;
    opacity: 0 !important;
    font-size: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Guide button - now inside dropdown, remove old positioning */
.guide-toggle.minimap-button {
    display: none;
    /* Hide old guide button */
}

.guide-toggle.menu-dropdown-item {
    display: flex;
    /* Show in dropdown */
}

/* Battle Pass button - now inside dropdown, remove old positioning */
.battlepass-toggle.minimap-button {
    display: none;
    /* Hide old battlepass button */
}

.battlepass-toggle.menu-dropdown-item {
    display: flex;
    /* Show in dropdown */
}

/* Battle Pass notification dot */
.battlepass-toggle.menu-dropdown-item::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    animation: pulse-dot 2s ease-in-out infinite;
}

.battlepass-toggle.menu-dropdown-item.has-reward::after {
    opacity: 1;
    visibility: visible;
}

/* Pet button - now inside dropdown */
.pet-toggle.menu-dropdown-item {
    display: flex;
    /* Show in dropdown */
    position: relative;
}

/* Pet notification dot */
.pet-toggle.menu-dropdown-item::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    animation: pulse-dot 2s ease-in-out infinite;
}

.pet-toggle.menu-dropdown-item.has-new-pet::after {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 8px rgba(231, 76, 60, 1), 0 0 16px rgba(231, 76, 60, 0.8);
    }
}

/* Zone button - top right corner of minimap (badge style) */
.zone-btn.minimap-button {
    top: -15px;
    right: -10px;
    font-size: 13px;
    width: auto;
    min-width: 55px;
    height: 28px;
    font-weight: bold;
    border-radius: 6px;
    padding: 0 8px;
}

/* Dungeon UI - Next to zone button in minimap */
.dungeon-ui {
    position: absolute;
    top: -5px;
    left: -200px;
    /* Position to the left of zone button */
    z-index: 901;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    pointer-events: auto;
    /* Ensure clicks work */
}

.dungeon-timer {
    background: linear-gradient(180deg, #8B0000 0%, #5A0000 100%);
    border: 2px solid #3A0000;
    border-bottom: 3px solid #1A0000;
    border-radius: 6px;
    padding: 4px 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    /* Match zone button height */
    white-space: nowrap;
}

.dungeon-wave {
    background: linear-gradient(180deg, #008B8B 0%, #005A5A 100%);
    border: 2px solid #004d4d;
    border-bottom: 3px solid #002b2b;
    border-radius: 6px;
    padding: 4px 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    white-space: nowrap;
}

.dungeon-wave-label {
    opacity: 0.9;
}

.dungeon-wave-value {
    color: #ffd700;
    font-size: 16px;
}

#large-dungeon-wave-notice {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    text-align: center;
    pointer-events: none;
    font-family: 'Outfit', 'Inter', 'Arial Black', sans-serif;
    animation: mapIntroSequence 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#large-dungeon-wave-notice.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#large-dungeon-wave-notice .notice-inner {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

#large-dungeon-wave-notice .notice-title {
    font-size: clamp(48px, 6vw, 84px);
    font-weight: 900;
    color: #ffcc00;
    text-transform: uppercase;
    letter-spacing: 12px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 4px 15px rgba(255, 204, 0, 0.6),
        0 0 30px rgba(255, 204, 0, 0.4),
        3px 3px 0 #990000, -2px -2px 0 #990000;
    margin-bottom: 12px;
    animation: pulseNotice 2s infinite alternate;
}

#large-dungeon-wave-notice .notice-subtitle {
    font-size: clamp(16px, 2vw, 24px);
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(255, 255, 255, 0.4);
    opacity: 0.95;
}

@keyframes waveNoticeIntro {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.7);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

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

    100% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(1.15);
    }
}

@keyframes pulseNotice {
    0% {
        text-shadow: 0 0 15px rgba(255, 204, 0, 0.8), 0 3px 0 #990000;
    }

    100% {
        text-shadow: 0 0 30px rgba(255, 255, 255, 1), 0 3px 0 #ff0000;
    }
}

.dungeon-timer-label {
    opacity: 0.9;
}

.dungeon-timer-value {
    color: #ffffff;
    font-size: 16px;
}

.dungeon-exit-btn {
    background: linear-gradient(180deg, #9B8158 0%, #7A6342 100%);
    border: 2px solid #5A4A32;
    border-bottom: 3px solid #3A2A12;
    border-radius: 6px;
    padding: 4px 12px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    height: 28px;
    /* Match zone button height */
    white-space: nowrap;
}

.dungeon-exit-btn:hover {
    background: linear-gradient(180deg, #B59968 0%, #8A7352 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dungeon-exit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Combat Power Display - top left corner (above time indicator) */
#combat-power-display {
    position: fixed;
    top: 10px;
    left: 2px;
    width: auto;
    min-width: 80px;
    height: 22px;
    border-radius: 4px;
    background-image: url('../assets/icon/ui/uikhung.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    z-index: 902;
    box-sizing: border-box;
}

#combat-power-display:hover {
    opacity: 0.9;
}

#combat-power-label {
    color: #ffffff;
    font-weight: bold;
    font-weight: 600;
    font-size: 12px;
}

#combat-power-amount {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 0;
}

/* Player Health Bar (below combat power, top left) */
#player-health-bar {
    position: fixed;
    top: 38px;
    left: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    z-index: 901;
    pointer-events: none;
}

.player-health-frame {
    position: relative;
    width: 120px;
    height: 18px;
    background-image: url('../assets/icon/dautruong/khungmau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.player-health-fill-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.player-health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-image: url('../assets/icon/dautruong/mau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: width 0.3s ease-out;
    width: 100%;
}

.player-health-text {
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
    margin-left: 2px;
}

/* Player Info Display (below health bar) */
.player-info-display {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 2px;
}

.player-info-name {
    color: #ffd700;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.player-info-level {
    color: #4CAF50;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* Time indicator - top left column */
#time-indicator {
    position: fixed;
    top: 110px;
    left: 10px;
    width: auto;
    min-width: 80px;
    height: 28px;
    border-radius: 4px;
    background-image: url('../assets/icon/ui/uikhung.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    z-index: 900;
    box-sizing: border-box;
}

/* Gold display - left column under time indicator (simple flat style) */
#gold-display {
    position: fixed;
    top: 138px;
    /* 110px (time top) + 28px (time height) = 138px */
    left: 10px;
    width: auto;
    min-width: 80px;
    height: 28px;
    border-radius: 4px;
    background-image: url('../assets/icon/ui/uikhung.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    z-index: 901;
    box-sizing: border-box;
}

#gold-display:hover {
    opacity: 0.9;
}

#gold-display span {
    color: #f1c40f;
    font-weight: 600;
    font-size: 13px;
}

/* Ruby display - stacked under gold, same left column (simple flat style) */
#ruby-display {
    position: fixed;
    top: 166px;
    /* 138px (gold top) + 28px (gold height) = 166px */
    left: 10px;
    width: auto;
    min-width: 80px;
    height: 28px;
    border-radius: 4px;
    background-image: url('../assets/icon/ui/uikhung.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    z-index: 901;
    box-sizing: border-box;
}

#ruby-display span {
    color: #ff0000;
    font-weight: 600;
    font-size: 13px;
}

#ruby-display:hover {
    opacity: 0.9;
}


/* Mobile: Minimap nhỏ hơn */
@media (max-width: 768px) {

    /* Combat Power Display - Mobile: top left */
    #combat-power-display {
        top: 10px !important;
        left: 2px !important;
        min-width: 70px !important;
        height: 28px !important;
        gap: 4px !important;
        padding: 4px 8px !important;
    }

    /* Time Indicator - Mobile: giữ vị trí ban đầu */
    #time-indicator {
        top: 110px !important;
        min-width: 70px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }

    /* Gold Display - Mobile: sát dưới time indicator */
    #gold-display {
        top: 138px !important;
        /* 110px + 28px = 138px */
        left: 10px !important;
        min-width: 70px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }

    /* Ruby Display - Mobile: sát dưới gold */
    #ruby-display {
        top: 166px !important;
        /* 138px + 28px = 166px */
        left: 10px !important;
        min-width: 70px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }

    /* Notification Container - Mobile: bên dưới gold + ruby */
    #notification-container {
        top: 212px !important;
        left: 10px !important;
        max-width: 200px !important;
    }

    .minimap-container {
        width: 100px;
        height: 100px;
        top: 10px;
        right: 10px;
    }

    #minimap-canvas {
        border-width: 2px;
    }

    #minimap-canvas:hover {
        transform: scale(1.02);
    }

    .minimap-button {
        width: 35px;
        height: 35px;
    }

    .chat-toggle.minimap-button {
        font-size: 14px;
        left: 30px;
        width: 35px;
        height: 35px;
    }

    .settings-toggle.minimap-button {
        font-size: 14px;
        left: 68px;
        width: 35px;
        height: 35px;
    }

    .guide-toggle.minimap-button {
        font-size: 14px;
        bottom: 30px;
        left: 68px;
        width: 35px;
        height: 35px;
    }

    .zone-btn.minimap-button {
        font-size: 10px;
        min-width: 45px;
        height: 22px;
        padding: 0 5px;
        top: -5px;
        right: -5px;
    }



    .gold-display span {
        font-size: 11px;
    }

    .gold-display.minimap-button img {
        width: 14px;
        height: 14px;
    }


    .chat-toggle.minimap-button img {
        width: 20px;
        height: 20px;
    }

    .settings-toggle.minimap-button img {
        width: 20px;
        height: 20px;
    }
}

/* Very small mobile screens */
@media (max-width: 400px) {
    #time-indicator {
        top: 110px !important;
        min-width: 65px !important;
        height: 26px !important;
        padding: 4px 6px !important;
        font-size: 11px !important;
    }

    #gold-display {
        top: 136px !important;
        /* 110px + 26px = 136px */
        min-width: 65px !important;
        height: 26px !important;
        font-size: 10px !important;
        padding: 4px 6px !important;
    }

    /* Ruby very small mobile – giống gold */
    #ruby-display {
        top: 162px !important;
        /* 136px + 26px = 162px */
        min-width: 65px !important;
        height: 26px !important;
        padding: 4px 6px !important;
    }

    /* Notification Container - Very small mobile */
    #notification-container {
        top: 180px !important;
        max-width: 160px !important;
    }

    .gold-display.minimap-button img {
        width: 12px;
        height: 12px;
    }
}

/* Màn hình rất nhỏ */
@media (max-width: 480px) {

    /* Time và Gold display cho màn hình nhỏ */
    #time-indicator {
        top: 110px !important;
        min-width: 65px !important;
        height: 26px !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    #gold-display {
        top: 136px !important;
        /* 110px + 26px = 136px */
        min-width: 65px !important;
        height: 26px !important;
        padding: 4px 8px !important;
    }

    #ruby-display {
        top: 162px !important;
        /* 136px + 26px = 162px */
        min-width: 65px !important;
        height: 26px !important;
        padding: 4px 8px !important;
    }


    /* Notification Container - Small mobile */
    #notification-container {
        top: 185px !important;
        max-width: 180px !important;
    }

    .gold-display span {
        font-size: 11px !important;
    }

    .minimap-container {
        width: 80px;
        height: 80px;
    }

    .minimap-button {
        width: 30px;
        height: 30px;
    }

    .chat-toggle.minimap-button {
        font-size: 12px;
        left: 25px;
        width: 30px;
        height: 30px;
    }

    .settings-toggle.minimap-button {
        font-size: 12px;
        left: 58px;
        width: 30px;
        height: 30px;
    }

    .zone-btn.minimap-button {
        font-size: 9px;
        min-width: 38px;
        height: 18px;
        padding: 0 4px;
        top: -3px;
        right: -3px;
    }


    .chat-toggle.minimap-button img {
        width: 18px;
        height: 18px;
    }

    .settings-toggle.minimap-button img {
        width: 18px;
        height: 18px;
    }
}

/* Time Indicator - Desktop: xuống thấp hơn (chỉ áp dụng cho màn hình > 1644px) */
@media (min-width: 1645px) {
    #time-indicator {
        top: 130px !important;
        min-width: 80px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }

    /* Gold & Ruby Display - Desktop: xếp thành cột cố định bên trái dưới time indicator */
    #gold-display {
        position: fixed !important;
        top: 158px !important;
        /* 130px + 28px = 158px */
        left: 10px !important;
        min-width: 80px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }

    #ruby-display {
        position: fixed !important;
        top: 186px !important;
        /* 158px + 28px = 186px */
        left: 10px !important;
        min-width: 80px !important;
        height: 28px !important;
        padding: 4px 8px !important;
    }
}

/* Notification Container - Desktop: bên dưới gold + ruby display */
#notification-container {
    top: 240px !important;
    left: 10px !important;
}

/* Proximity Notifications */
@keyframes proximitySlideIn {
    0% {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes proximitySlideOut {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
}

@keyframes proximityIndicatorPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translateX(-50%) scale(1.05);
        opacity: 1;
    }
}

@keyframes damageFlash {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
    }
}

/* Experience Bar - Ultra Compact */
.exp-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 18, 22, 0.4);
    padding: 0;
    z-index: 800;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.exp-bar-info {
    display: none;
    /* Hide text to make it ultra compact */
}

.exp-level {
    display: none;
}

.exp-text {
    display: none;
}

.exp-percent {
    display: none;
}

.exp-bar-bg {
    position: relative;
    width: 100%;
    height: 2px;
    background: rgba(38, 50, 56, 0.3);
    border-radius: 0;
    overflow: hidden;
}

.exp-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #42a5f5 0%, #64b5f6 50%, #90caf9 100%);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(100, 181, 246, 0.5);
}

.exp-bar-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    animation: expGlow 2s linear infinite;
    pointer-events: none;
}

@keyframes expGlow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes khiFloat {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(1.2);
    }
}

/* Adjust bottom-actions to be above exp bar */
.bottom-actions {
    bottom: 5px;
    /* Ultra minimal space */
}

.proximity-notification {
    pointer-events: none;
    user-select: none;
}

/* Game Screen - Full screen map */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

/* Level Bar Container - Collapsed Button */
.level-bar-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.level-bar-toggle {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border: none;
    outline: none;
}

.level-bar-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.level-bar-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.level-bar-dropdown {
    position: fixed;
    top: 20px;
    left: 80px;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    z-index: 99999 !important;
    width: auto;
}

.level-bar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-content {
    padding: 12px;
    color: white;
}

.player-info {
    display: none;
}

.player-name-full {
    display: none;
}

.level-text-full {
    display: none;
}

.player-count-full {
    display: none;
}

.dropdown-actions {
    border-top: none;
    padding: 0;
}

.player-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-guild-tag {
    font-weight: 800;
    margin-left: 6px;
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.player-guild-tag.premium {
    border: 1px solid #ffd700;
    border-radius: 6px;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.level-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-count {
    font-size: 14px;
    color: white;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.logout-btn {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.8) 0%, rgba(192, 57, 43, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    width: 100%;
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 1) 0%, rgba(192, 57, 43, 1) 100%);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.logout-btn:active {
    opacity: 0.9;
}

/* Stats Button - REMOVED (now in inventory tab) */
.stats-section {
    display: none !important;
}

.stats-btn {
    display: none !important;
}

/* Stats Modal - Hidden but kept for backward compatibility */
.stats-modal {
    display: none !important;
}

.stats-modal.active {
    display: none !important;
}

.stats-modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.stats-modal.active .stats-modal-content {
    transform: scale(1);
}

.stats-header {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.party-invite-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* First Top-Up Features */
.first-topup-btn.minimap-button {
    position: relative;
    font-size: 18px;
    width: 60px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 99998;
    overflow: visible !important;
    animation: topup-fomo-pulse 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}

.first-topup-btn.minimap-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
    filter: drop-shadow(0 0 16px rgba(241, 196, 15, 1)) drop-shadow(0 0 24px rgba(231, 76, 60, 0.6)) !important;
    animation-play-state: paused !important;
    /* Pause heartbeat on hover for stable clicking */
}

.first-topup-btn.minimap-button:active {
    background: transparent !important;
    transform: scale(0.95) !important;
}

@keyframes topup-fomo-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.6));
    }

    14% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 14px rgba(241, 196, 15, 0.95)) drop-shadow(0 0 20px rgba(231, 76, 60, 0.5));
    }

    28% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.7));
    }

    42% {
        transform: scale(1.12);
        filter: drop-shadow(0 0 16px rgba(241, 196, 15, 0.95)) drop-shadow(0 0 24px rgba(231, 76, 60, 0.6));
    }

    56% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.6));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.6));
    }
}

/* Distinct Neon Pink/Purple pulsing effect for Recharge Milestones Button */
.recharge-milestone-btn-icon.minimap-button {
    position: relative;
    font-size: 18px;
    width: 60px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 99998;
    overflow: visible !important;
    animation: milestone-shimmer-pulse 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}

.recharge-milestone-btn-icon.minimap-button:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
    filter: drop-shadow(0 0 16px rgba(255, 102, 204, 1)) drop-shadow(0 0 24px rgba(155, 89, 182, 0.7)) !important;
    animation-play-state: paused !important;
}

.recharge-milestone-btn-icon.minimap-button:active {
    background: transparent !important;
    transform: scale(0.95) !important;
}

@keyframes milestone-shimmer-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 102, 204, 0.5));
    }

    20% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 12px rgba(255, 102, 204, 0.9)) drop-shadow(0 0 18px rgba(155, 89, 182, 0.6));
    }

    40% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 6px rgba(255, 102, 204, 0.6));
    }

    60% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 14px rgba(255, 102, 204, 0.95)) drop-shadow(0 0 20px rgba(155, 89, 182, 0.65));
    }

    80% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 102, 204, 0.5));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 102, 204, 0.5));
    }
}

.recharge-milestone-btn-icon.minimap-button img {
    display: block;
    line-height: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.recharge-milestone-btn-icon.minimap-button::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #ff3399;
    /* Pink neon notification dot */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(255, 51, 153, 1), 0 0 12px rgba(255, 51, 153, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100001;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
}

.recharge-milestone-btn-icon.minimap-button.has-notification::after {
    opacity: 1;
    visibility: visible;
}

.first-topup-btn.minimap-button img {
    display: block;
    line-height: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.first-topup-btn.minimap-button::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(231, 76, 60, 1), 0 0 12px rgba(231, 76, 60, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100001;
    animation: pulse-dot 2s ease-in-out infinite;
    pointer-events: none;
}

.first-topup-btn.minimap-button.has-notification::after {
    opacity: 1;
    visibility: visible;
}

.first-topup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    justify-content: center;
    align-items: center;
}

.first-topup-modal.active {
    display: flex;
}

.first-topup-content {
    position: relative;
    width: min(600px, 95vw, 75vh);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.first-topup-bg-wrapper {
    position: relative;
    width: 100%;
}

.first-topup-bg {
    width: 100%;
    height: auto;
    display: block;
}

.first-topup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.first-topup-close img {
    width: 30px;
    height: 30px;
}

.first-topup-rewards {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.first-topup-item {
    position: absolute;
    background: transparent;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

/* Top Row */
.first-topup-item:nth-child(1) {
    left: 14%;
    top: 38%;
    width: 22%;
    height: 26%;
}

.first-topup-item:nth-child(2) {
    left: 39%;
    top: 38%;
    width: 22%;
    height: 26%;
}

.first-topup-item:nth-child(3) {
    left: 64%;
    top: 38%;
    width: 22%;
    height: 26%;
}

/* Bottom Row */
.first-topup-item:nth-child(4) {
    left: 4%;
    top: 66%;
    width: 22%;
    height: 26%;
}

.first-topup-item:nth-child(5) {
    left: 27.5%;
    top: 66%;
    width: 22%;
    height: 26%;
}

.first-topup-item:nth-child(6) {
    left: 51%;
    top: 66%;
    width: 22%;
    height: 26%;
}

.first-topup-item:nth-child(7) {
    left: 74.5%;
    top: 66%;
    width: 22%;
    height: 26%;
}

.first-topup-item img {
    max-width: 40%;
    max-height: 40%;
    position: relative;
    z-index: 2;
}

.first-topup-item-qty {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    z-index: 3;
}

/* Enhancement effect inside slot */
@keyframes first-topup-glow {
    0% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/1.webp');
    }

    12% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/2.webp');
    }

    25% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/3.webp');
    }

    37% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/4.webp');
    }

    50% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/5.webp');
    }

    62% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/6.webp');
    }

    75% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/7.webp');
    }

    87% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/8.webp');
    }

    100% {
        background-image: url('../assets/icon/inventorynew/cuonghoa15/9.webp');
    }
}

.first-topup-item-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 65%;
    height: 65%;
    transform: translate(-50%, -50%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: first-topup-glow 0.9s steps(1) infinite;
    z-index: 3;
    /* Draw over the item to glow it nicely */
    pointer-events: none;
    mix-blend-mode: screen;
    /* Usually looks good for glows */
}

/* Footer & Button */
.first-topup-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.first-topup-claim-btn {
    background-image: url('../assets/icon/ui/button.webp');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    width: min(150px, 60%);
    height: clamp(35px, 6vh, 45px);
    color: white;
    font-size: clamp(10px, 1.8vh, 13px);
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 2px black;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    transition: transform 0.2s;
    padding: 0 10px;
}

.first-topup-claim-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.first-topup-claim-btn:disabled {
    filter: grayscale(100%);
    cursor: not-allowed;
    color: #dedede;
}

.first-topup-progress-txt {
    color: white;
    font-size: clamp(12px, 2.2vh, 16px);
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    margin-top: 5px;
}

/* Responsive adjustments for First Top-Up Icon & Inventory Icon */
@media (max-width: 1644px) and (min-width: 769px) {

    .first-topup-btn.minimap-button,
    .recharge-milestone-btn-icon.minimap-button,
    .inventory-btn.minimap-button {
        width: 50px !important;
        height: 50px !important;
    }
}

@media (max-width: 850px) and (max-height: 450px) {

    .first-topup-btn.minimap-button,
    .recharge-milestone-btn-icon.minimap-button,
    .inventory-btn.minimap-button {
        width: 45px !important;
        height: 45px !important;
    }
}



.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stats-body {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(60, 60, 60, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(100, 100, 100, 0.3);
    transition: all 0.3s ease;
    color: #ffffff;
}

.stat-item:hover {
    background: rgba(80, 80, 80, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 10px;
}

.stat-info {
    flex: 1;
}

.stat-name {
    font-size: 14px;
    color: #cccccc;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.equipped-items {
    background: rgba(60, 60, 60, 0.8);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #ffffff;
}

.equipped-items h4 {
    margin: 0 0 15px 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.equipped-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.equipped-item:last-child {
    border-bottom: none;
}

.equipped-label {
    font-weight: 600;
    color: #cccccc;
    font-size: 14px;
}

.equipped-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 14px;
}

#game-canvas {
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    line-height: 0;
}

/* Touch Controls for Mobile */
.touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    z-index: 200;
    height: 0;
    pointer-events: none;
}

.touch-controls.active {
    display: block;
    pointer-events: auto;
}

/* Bottom Action Buttons with Glassmorphism */
.bottom-actions {
    position: fixed;
    bottom: 10px;
    right: 20px;
    z-index: 300;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
}

.attack-button-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Attack Buttons Row - Contains auto toggle and attack button */
.attack-buttons-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* Auto Attack Toggle Button */
.auto-attack-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(100, 100, 100, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(150, 150, 150, 0.4);
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(100, 100, 100, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.auto-attack-toggle img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.auto-attack-toggle:hover {
    background: rgba(150, 150, 150, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(150, 150, 150, 0.4);
}

.auto-attack-toggle:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(150, 150, 150, 0.6);
}

/* Auto Attack Toggle - Active State */
.auto-attack-toggle.active {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.5);
}

.auto-attack-toggle.active:hover {
    background: rgba(46, 204, 113, 0.6);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.7);
}

/* Soru Skill Slot - Above Attack Button */
.soru-skill-slot {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    background: url('../assets/icon/ui/khungskill.webp') center/cover no-repeat;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    align-self: flex-end;
    margin-left: auto;
}

.soru-skill-slot:hover {
    transform: translateY(-3px);
    filter: brightness(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.soru-skill-slot.cooldown {
    cursor: not-allowed;
    opacity: 0.5;
    filter: brightness(0.5);
}

.soru-skill-slot.cooldown:hover {
    transform: none;
    filter: brightness(0.5);
}

.soru-skill-slot.locked {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(1);
}

.soru-skill-slot .skill-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    border-radius: 50% !important;
}

.soru-skill-slot .skill-cooldown-overlay {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    pointer-events: none;
    z-index: 2;
}

.soru-skill-slot.cooldown .skill-cooldown-overlay {
    display: flex;
}

.soru-skill-slot .skill-cooldown-timer {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.soru-skill-slot .skill-cooldown-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    pointer-events: none;
    overflow: visible;
}

.soru-skill-slot .skill-cooldown-ring svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.soru-skill-slot .skill-cooldown-ring circle {
    fill: none;
    stroke: rgba(255, 215, 0, 0.8);
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 163.36;
}

.soru-skill-slot .skill-name-tooltip {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    z-index: 1000;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.soru-skill-slot:hover .skill-name-tooltip {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.soru-skill-slot.cooldown:hover .skill-name-tooltip {
    opacity: 0;
}

.attack-btn {
    width: 70px;
    height: 70px;
    border-radius: 50% !important;
    border: none !important;
    background: url('../assets/icon/ui/khungskill.webp') center/cover no-repeat;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    padding: 0;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.attack-btn img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.attack-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.attack-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    filter: brightness(1.1);
}

.attack-btn:hover::before {
    left: 100%;
}

.attack-btn:active,
.attack-btn.button-pressed {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    filter: brightness(0.85);
}


/* Text inside interaction mode button */
.attack-btn .btn-text {
    color: white;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Server Notification */
.server-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;
    pointer-events: none;
}

.server-notification.active {
    display: block;
    animation: notificationFadeIn 0.5s ease;
}

@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.server-notification-frame {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    min-width: 300px;
    max-width: 600px;
    height: 35px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    align-items: center;
}

.server-notification-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: scrollTextRightToLeft 8s linear infinite;
    display: inline-block;
    position: relative;
}

@keyframes scrollTextRightToLeft {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Map Intro Notification */
.map-intro-notification {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    text-align: center;
    opacity: 0;
}

.map-intro-notification.active {
    display: block !important;
    animation: mapIntroSequence 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.map-intro-text {
    font-size: clamp(24px, 4vw, 45px);
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 4px 10px rgba(0, 0, 0, 0.6),
        2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes mapIntroSequence {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        letter-spacing: 20px;
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        letter-spacing: 12px;
    }

    25% {
        transform: translate(-50%, -50%) scale(1);
        letter-spacing: 8px;
    }

    75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

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

/* Damage flash effect - red screen when player is hit */
@keyframes damageFlash {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Level-up glow pulse on canvas UI elements */
@keyframes levelUpGlow {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
    }

    50% {
        filter: brightness(1.4) drop-shadow(0 0 18px rgba(255, 215, 0, 1));
    }
}

/* Smooth float for overlays / skill icons */
@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-40px) scale(0.9);
        opacity: 0;
    }
}

/* === CUSTOM HUD STYLES === */
/* --- Force inner elements to stretch --- */
#combat-power-display,
#gold-display,
#ruby-display,
#player-info-display {
    background-size: 100% 100% !important;
}

#player-health-bar {
    align-items: stretch !important;
}

#player-health-bar .player-health-frame {
    width: 100% !important;
    flex: 1 !important;
}

#gold-display img,
#ruby-display img {
    height: 80% !important;
    width: auto !important;
}

/* --- Desktop / Base --- */
#combat-power-display {
    display: none !important;
}

#player-health-bar {
    display: none !important;
}

#player-info-display {
    display: none !important;
}

#gold-display {
    display: none !important;
}

#ruby-display {
    display: none !important;
}

/* khung máu */
#custom-img-134375 {
    position: fixed;
    top: -26px;
    left: -1px;
    width: 209px;
    height: 108px;
}

/* máu */
#custom-img-142519 {
    position: fixed;
    top: -48px;
    left: -1px;
    width: 183px;
    height: 153px;
}

/* text máu của người chơi */
#custom-text-182576 {
    position: fixed;
    top: 18px;
    left: 54px;
    width: 68px;
    height: 26px;
}

#custom-text-182576 .custom-text-tag {
    position: absolute !important;
    top: 0px !important;
    left: 0px !important;
    font-size: 14px !important;
    color: #ffffff !important;
}

/* khung gold */
#custom-img-592263 {
    position: fixed;
    top: 98px;
    left: 2px;
    width: 101px;
    height: 40px;
}

/* icon gold */
#custom-img-360711 {
    position: fixed;
    top: 106px;
    left: 8px;
    width: 19px;
    height: 19px;
}

/* khung ruby */
#custom-img-393455 {
    position: fixed;
    top: 128px;
    left: 2px;
    width: 101px;
    height: 40px;
}

/* icon ruby */
#custom-img-431575 {
    position: fixed;
    top: 135px;
    left: 8px;
    width: 19px;
    height: 19px;
}

/* text số vàng gold */
#custom-text-533007 {
    position: fixed;
    top: 109px;
    left: 33px;
    width: 58px;
    height: 19px;
}

#custom-text-533007 .custom-text-tag {
    position: absolute !important;
    top: 0px !important;
    left: 0px !important;
    font-size: 13px !important;
    color: #ffffff !important;
}

/* text số ruby */
#custom-text-572119 {
    position: fixed;
    top: 139px;
    left: 33px;
    width: 58px;
    height: 19px;
}

#custom-text-572119 .custom-text-tag {
    position: absolute !important;
    top: 0px !important;
    left: 0px !important;
    font-size: 13px !important;
    color: #ffffff !important;
}

/* tên người chơi */
#custom-text-673783 {
    position: fixed;
    top: 0px;
    left: 55px;
    width: 100px;
    height: 12px;
}

#custom-text-673783 .custom-text-tag {
    position: absolute !important;
    top: 0px !important;
    left: 0px !important;
    font-size: 10px !important;
    color: #ffffff !important;
}

/* Sức Chiến Đấu ( Lực Chiến ) */
#custom-text-732751 {
    position: fixed;
    top: 57px;
    left: 2px;
    width: auto;
    height: 25px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#custom-text-732751::before {
    content: "SỨC MẠNH:";
    font-size: 15px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
}

#custom-text-732751 .custom-text-tag {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    font-size: 10px !important;
    color: #ffffff !important;
}

/* --- Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
    #combat-power-display {
        top: 10px !important;
        left: 2px !important;
        width: 120px;
        height: 22px;
        transform: scale(0.8);
        transform-origin: top left;
    }

    #combat-power-display #combat-power-label {
        top: -15px !important;
        left: 0px !important;
        font-size: 12px !important;
        color: #ffffff !important;
    }

    #combat-power-display #combat-power-amount {
        top: 2px !important;
        left: 10px !important;
        font-size: 13px !important;
        color: #FFD700 !important;
    }

    #player-health-bar {
        top: 38px !important;
        left: 2px !important;
        width: 120px;
        height: 40px;
    }

    #player-health-bar .player-health-fill-wrapper {
        top: 3px !important;
        left: 20px !important;
        width: 95px !important;
        height: 12px !important;
    }

    #player-health-bar #player-health-text {
        top: 18px !important;
        left: 25px !important;
        font-size: 10px !important;
        color: #ffffff !important;
    }

    #player-info-display {
        top: 72px !important;
        left: 4px !important;
        width: 90px;
        height: 22px;
    }

    #player-info-display #player-info-name {
        top: 5px !important;
        left: 5px !important;
        font-size: 12px !important;
        color: #f39c12 !important;
    }

    #player-info-display #player-info-level {
        top: 5px !important;
        left: 60px !important;
        font-size: 12px !important;
        color: #ffffff !important;
    }

    #gold-display {
        top: 138px !important;
        left: 10px !important;
        width: 100px;
        height: 28px;
        transform: scale(0.8);
        transform-origin: top left;
    }

    #gold-display .gold-icon-img {
        top: 0px !important;
        left: -8px !important;
        width: 28px !important;
        height: 28px !important;
    }

    #gold-display #gold-amount {
        top: 5px !important;
        left: 25px !important;
        font-size: 12px !important;
        color: #ffffff !important;
    }

    #ruby-display {
        top: 166px !important;
        left: 10px !important;
        width: 100px;
        height: 28px;
        transform: scale(0.8);
        transform-origin: top left;
    }

    #ruby-display .ruby-icon-img {
        top: 0px !important;
        left: -8px !important;
        width: 28px !important;
        height: 28px !important;
    }

    #ruby-display #ruby-amount {
        top: 5px !important;
        left: 25px !important;
        font-size: 12px !important;
        color: #ffffff !important;
    }
}

/* === GACHA ANIMATION === */
#gacha-animation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.gacha-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.gacha-container {
    position: relative;
    width: 600px;
    max-width: 90vw;
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    text-align: center;
}

.gacha-header {
    font-size: 24px;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.gacha-window {
    position: relative;
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.gacha-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 30px;
    z-index: 10;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.gacha-pointer::after {
    content: "\25B2";
    /* ▲ */
    position: absolute;
    bottom: -115px;
    left: 0;
    color: #ffffff;
    font-size: 30px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.gacha-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    will-change: transform;
}

.gacha-item {
    width: 80px;
    height: 80px;
    margin: 0 10px;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.gacha-item img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.gacha-item-qty {
    position: absolute;
    bottom: 2px;
    right: 5px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.gacha-winner-glow {
    animation: gachaWinnerPulse 1s infinite alternate;
    border-color: #ffffff;
}

@keyframes gachaWinnerPulse {
    from {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        transform: scale(1);
    }

    to {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 15px rgba(255, 255, 255, 1);
        transform: scale(1.15);
    }
}

/* --- PK Mode Selector Styling --- */
#pk-mode-selector {
    position: fixed;
    top: 78px;
    left: 10px;
    z-index: 1000;
    font-family: 'fontvippro', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pk-mode-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.pk-mode-btn img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.pk-mode-btn:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.pk-mode-btn:active {
    transform: scale(0.95);
}

/* Glowing states for active button */
.pk-mode-btn.hoabinh {
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.pk-mode-btn.chiendau {
    border-color: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.pk-mode-btn.dosat {
    border-color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    animation: outlaw-pulse 1.5s infinite alternate;
}

@keyframes outlaw-pulse {
    0% {
        box-shadow: 0 0 8px rgba(231, 76, 60, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    }

    100% {
        box-shadow: 0 0 18px rgba(231, 76, 60, 0.9), inset 0 1px 3px rgba(255, 255, 255, 0.3);
    }
}

/* Dropdown styling */
.pk-mode-dropdown {
    position: absolute;
    top: 26px;
    left: 0;
    background: rgba(15, 15, 15, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: 140px;
    animation: fadeInScale 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top left;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pk-mode-option-btn {
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #b3b3b3;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.pk-mode-option-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.pk-mode-option-btn .pk-mode-label {
    font-size: 13px;
    font-weight: 600;
    text-shadow: 1px 1px 1px #000;
}

.pk-mode-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.pk-mode-option-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.pk-mode-option-btn[data-mode="hoabinh"].active {
    border-left: 3px solid #2ecc71;
}

.pk-mode-option-btn[data-mode="chiendau"].active {
    border-left: 3px solid #f1c40f;
}

.pk-mode-option-btn[data-mode="dosat"].active {
    border-left: 3px solid #e74c3c;
}

/* Inline icon for username tags */
.player-pk-icon-inline {
    animation: pk-icon-bounce 2s infinite ease-in-out;
}

@keyframes pk-icon-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* --- Diagnostics Ping & FPS Widget --- */
#diagnostics-widget {
    position: fixed;
    top: 168px;
    left: 8px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 3px 6px;
    font-family: 'Outfit', 'fontvippro', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

#ping-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 6px #2ecc71;
    transition: all 0.3s ease;
}

#ping-text {
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#fps-text {
    color: #aaaaaa;
    font-size: 10px;
    font-weight: 600;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 5px;
}

/* Position below ruby on Mobile */
@media (max-width: 768px) {
    #diagnostics-widget {
        top: 195px !important;
        left: 12px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }
}

/* ==========================================================================
   Minimap Collapse Feature Styles
   ========================================================================== */

/* 1. Collapse Toggle Button */
.minimap-collapse-btn.minimap-button {
    position: relative !important;
    align-self: center !important;
    /* Perfect vertical alignment in flex layout */
    width: 16px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    background: rgba(15, 15, 15, 0.72) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    overflow: visible !important;
    z-index: 99999 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.minimap-collapse-btn.minimap-button:hover {
    background: rgba(25, 25, 25, 0.88) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12) !important;
}

.minimap-collapse-btn.minimap-button:hover .collapse-icon {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8) !important;
}

.minimap-collapse-btn.minimap-button:active {
    transform: scale(0.95) !important;
}

.minimap-collapse-btn.minimap-button .collapse-icon {
    font-size: 11px !important;
    font-weight: bold !important;
    color: rgba(255, 255, 255, 0.72) !important;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
    /* Points right ❯ by default */
}

/* Toggle rotation on collapse state: when collapsed, points left ❮ */
.minimap-collapse-btn.minimap-button.collapsed .collapse-icon {
    transform: rotate(180deg);
}

/* 2. Collapsible Buttons Wrapper Container */
.collapsible-buttons-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    max-width: 500px;
    /* Large enough to hold all 4 buttons */
    opacity: 1;
    visibility: visible;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s ease;
    overflow: visible;
    pointer-events: none;
}

.collapsible-buttons-wrapper>* {
    pointer-events: auto;
}

/* 3. Collapsed State */
.collapsible-buttons-wrapper.collapsed {
    max-width: 0 !important;
    opacity: 0 !important;
    margin-right: -10px !important;
    /* Cancels out one of the gaps dynamically */
    visibility: hidden !important;
    overflow: hidden !important;
}

/* Cumulative Recharge Milestones Styles */
.recharge-milestone-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.recharge-milestone-modal.active {
    display: flex;
}

.recharge-milestone-content {
    position: relative;
    width: min(650px, 95vw, 92vh);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recharge-milestone-frame-wrapper {
    position: relative;
    width: 100%;
}

.recharge-milestone-frame {
    width: 100%;
    height: auto;
    display: block;
}

.recharge-milestone-close {
    position: absolute;
    top: 3%;
    right: 3%;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
}

.recharge-milestone-close:hover {
    transform: scale(1.1);
}

.recharge-milestone-close img {
    width: 32px;
    height: 32px;
}

.recharge-milestone-title {
    position: absolute;
    top: 6.5%;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: bold;
    text-shadow: 2px 2px 4px #000, 0 0 10px #ff6600;
    letter-spacing: 2px;
    z-index: 5;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.recharge-milestone-summary {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: clamp(12px, 1.8vw, 16px);
    font-weight: bold;
    text-shadow: 1px 1px 3px #000;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 204, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
}

.recharge-milestone-summary .highlight {
    color: #ff66cc;
    text-shadow: 0 0 8px rgba(255, 102, 204, 0.6);
    font-weight: bold;
}

.recharge-milestone-list {
    position: absolute;
    top: 22%;
    left: 7%;
    width: 86%;
    height: 70%;
    overflow-y: auto;
    padding-right: 5px;
    z-index: 4;
}

/* Custom Scrollbar for list */
.recharge-milestone-list::-webkit-scrollbar {
    width: 6px;
}

.recharge-milestone-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.recharge-milestone-list::-webkit-scrollbar-thumb {
    background: rgba(255, 204, 0, 0.3);
    border-radius: 3px;
}

.recharge-milestone-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 204, 0, 0.5);
}

.recharge-milestone-row {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 204, 0, 0.15);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: border-color 0.3s;
}

.recharge-milestone-row:hover {
    border-color: rgba(255, 204, 0, 0.4);
}

.recharge-milestone-row-left {
    flex: 0 0 150px;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recharge-milestone-row-name {
    color: #ffdd67;
    font-size: clamp(12px, 1.8vw, 15px);
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.recharge-milestone-row-progress-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.recharge-milestone-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.recharge-milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9900, #ffcc00);
    transition: width 0.3s ease;
}

.recharge-milestone-progress-text {
    font-size: clamp(9px, 1.2vw, 11px);
    color: #bbbbbb;
    font-weight: bold;
}

.recharge-milestone-row-mid {
    flex: 1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px;
}

.recharge-milestone-row-mid::-webkit-scrollbar {
    display: none;
}

.recharge-milestone-reward-slot {
    position: relative;
    width: min(48px, 10vw);
    height: min(48px, 10vw);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 204, 0, 0.25);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s, border-color 0.2s;
}

.recharge-milestone-reward-slot:hover {
    transform: scale(1.05);
    border-color: #ffcc00;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.recharge-milestone-reward-slot img {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
}

.recharge-milestone-reward-qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: #ffffff;
    font-size: clamp(10px, 1.5vw, 12px);
    font-weight: bold;
    text-shadow: 1px 1px 2px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.recharge-milestone-row-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.recharge-milestone-btn-claim {
    background-image: url('../assets/icon/ui/button.webp');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    width: clamp(80px, 15vw, 100px);
    height: clamp(35px, 6vw, 42px);
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    color: #ffd800;
    font-size: clamp(11px, 1.5vw, 13px);
    text-shadow: 1px 1px 1px black, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
    white-space: nowrap;
}

.recharge-milestone-btn-claim:hover:not(:disabled) {
    transform: scale(1.05);
}

.recharge-milestone-btn-claim.glowing {
    animation: claim-btn-pulse 1.5s infinite;
    color: #ffffff;
    text-shadow: 0 0 5px #2ecc71, 1px 1px 1px #000;
}

@keyframes claim-btn-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(46, 204, 113, 0.4));
    }

    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.8));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(46, 204, 113, 0.4));
    }
}

.recharge-milestone-btn-claim:disabled {
    filter: grayscale(100%);
    cursor: not-allowed;
    color: #bbbbbb;
}

/* Mobile Responsive */
@media (max-width: 768px),
(max-height: 500px) {
    .recharge-milestone-title {
        top: 7%;
    }

    .recharge-milestone-summary {
        top: 15%;
        padding: 2px 10px;
    }

    .recharge-milestone-list {
        top: 24%;
        height: 66%;
    }

    .recharge-milestone-row {
        padding: 8px;
        margin-bottom: 8px;
        gap: 6px;
    }

    .recharge-milestone-row-left {
        flex: 0 0 78px;
        min-width: 78px;
        gap: 3px;
    }

    .recharge-milestone-row-name {
        font-size: 10px;
        line-height: 1.2;
    }

    .recharge-milestone-progress-text {
        font-size: 8px;
    }

    .recharge-milestone-row-mid {
        flex: 1;
        max-width: none;
        gap: 4px;
        padding: 2px 0;
    }

    .recharge-milestone-reward-slot {
        width: 32px;
        height: 32px;
    }

    .recharge-milestone-reward-qty {
        font-size: 8px;
    }

    .recharge-milestone-btn-claim {
        width: 65px;
        height: 28px;
        font-size: 9px;
    }
}