    @keyframes slideIn {
        from {
            transform: translateX(400px);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOut {
        from {
            transform: translateX(0);
            opacity: 1;
        }

        to {
            transform: translateX(400px);
            opacity: 0;
        }
    }

    @keyframes blink {

        0%,
        49% {
            opacity: 1;
        }

        50%,
        100% {
            opacity: 0;
        }
    }

    /* Shop Modal Styles */
    .npc-shop-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        z-index: 10001;
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        box-shadow: none;
        flex-direction: column;
        box-sizing: border-box;
    }

    /* Force flex display when shown */
    .npc-shop-modal[style*="block"] {
        display: flex !important;
    }

    .npc-shop-split-layout {
        flex: 1;
        overflow: hidden;
    }

    .npc-shop-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        border-bottom: 1px solid #444;
        padding-bottom: 6px;
    }

    .npc-shop-header h2 {
        color: #ddd;
        margin: 0;
        font-size: 16px;
    }

    .npc-shop-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        padding: 4px 10px;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
        font-size: 14px;
    }

    .npc-shop-dialogue-container {
        margin-bottom: 8px;
        padding: 6px 8px;
        background: rgba(52, 152, 219, 0.1);
        border-left: 2px solid #3498db;
        border-radius: 3px;
        min-height: 30px;
        display: flex;
        align-items: center;
    }

    .npc-dialogue-icon {
        color: #3498db;
        font-size: 16px;
        margin-right: 6px;
        margin-top: 0;
    }

    .npc-dialogue-text {
        color: #bdc3c7;
        margin: 0;
        font-size: 11px;
        font-style: italic;
        line-height: 1.3;
        flex: 1;
    }

    .npc-dialogue-cursor {
        color: #3498db;
        animation: blink 1s infinite;
    }

    .npc-shop-items {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 5px;
        max-height: calc(65vh - 130px);
        overflow-y: auto;
        padding: 3px;
    }

    .npc-shop-pagination {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #444;
    }

    .pagination-btn {
        background: #3498db;
        color: white;
        border: none;
        padding: 6px 12px;
        border-radius: 3px;
        cursor: pointer;
        font-size: 11px;
        font-weight: bold;
        transition: all 0.2s;
    }

    .pagination-btn:hover:not(:disabled) {
        background: #2980b9;
        transform: scale(1.05);
    }

    .pagination-btn:disabled {
        background: #555;
        cursor: not-allowed;
        opacity: 0.5;
    }

    .page-info {
        color: #bdc3c7;
        font-size: 11px;
        font-weight: bold;
    }

    /* Custom Confirm Modal */
    .npc-confirm-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 10002;
        justify-content: center;
        align-items: center;
    }

    .npc-confirm-content {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid #555;
        border-radius: 10px;
        padding: 18px;
        max-width: 320px;
        width: 85%;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
        animation: confirmPop 0.3s ease-out;
    }

    @keyframes confirmPop {
        0% {
            transform: scale(0.7);
            opacity: 0;
        }

        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    .npc-confirm-icon {
        font-size: 36px;
        text-align: center;
        margin-bottom: 10px;
        animation: bounce 0.5s ease-out;
    }

    @keyframes bounce {

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

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

    .npc-confirm-content h3 {
        color: #3498db;
        margin: 0 0 10px 0;
        text-align: center;
        font-size: 16px;
    }

    .npc-confirm-content p {
        color: #bdc3c7;
        margin: 0 0 15px 0;
        text-align: center;
        font-size: 12px;
        line-height: 1.4;
    }

    .npc-confirm-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .npc-btn {
        padding: 10px 16px;
        border: none;
        border-radius: 5px;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s;
    }

    .npc-btn-success {
        background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
        color: white;
    }

    .npc-btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    }

    .npc-btn-cancel {
        background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
        color: white;
    }

    .npc-btn-cancel:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(127, 140, 141, 0.4);
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .npc-shop-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            padding: 0;
        }

        .npc-shop-header h2 {
            font-size: 14px;
        }

        .npc-shop-close-btn {
            padding: 3px 8px;
            font-size: 12px;
        }

        .npc-shop-dialogue-container {
            padding: 5px 6px;
            min-height: 28px;
        }

        .npc-dialogue-icon {
            font-size: 14px;
            margin-right: 5px;
        }

        .npc-dialogue-text {
            font-size: 10px;
        }

        .npc-shop-items {
            grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
            gap: 4px;
            max-height: calc(70vh - 120px);
        }

        .pagination-btn {
            padding: 5px 10px;
            font-size: 10px;
        }

        .page-info {
            font-size: 10px;
        }

        .npc-confirm-content {
            padding: 15px;
            max-width: 85%;
        }

        .npc-confirm-icon {
            font-size: 32px;
        }

        .npc-confirm-content h3 {
            font-size: 15px;
        }

        .npc-confirm-content p {
            font-size: 11px;
        }

        .npc-btn {
            padding: 8px 14px;
            font-size: 12px;
        }
    }

    @media (max-width: 480px) {
        .npc-shop-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            padding: 0;
        }

        .npc-shop-items {
            grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
            gap: 3px;
        }

        .npc-shop-header h2 {
            font-size: 12px;
        }

        .npc-dialogue-text {
            font-size: 9px;
        }

        .pagination-btn {
            padding: 4px 8px;
            font-size: 9px;
        }

        .page-info {
            font-size: 9px;
        }

        .npc-confirm-content {
            padding: 12px;
        }

        .npc-btn {
            padding: 7px 12px;
            font-size: 11px;
        }
    }

    /* Quest Modal Styles */
    /* Quest Modal Styles */
    .npc-quest-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        z-index: 10001;
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        box-shadow: none;
        flex-direction: column;
        box-sizing: border-box;
    }

    /* Force flex display when shown */
    .npc-quest-modal[style*="block"] {
        display: flex !important;
    }

    .npc-quest-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        border-bottom: 2px solid #555;
        padding-bottom: 6px;
    }

    .npc-quest-header h2 {
        color: #ddd;
        margin: 0;
        font-size: 14px;
    }

    .npc-quest-close-btn {
        background: #1a1a1a;
        color: white;
        border: 1px solid #333;
        padding: 4px 10px;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
        font-size: 13px;
    }

    .npc-quest-close-btn:hover {
        background: #252525;
    }

    .npc-quest-dialogue-container {
        margin-bottom: 8px;
        padding: 5px 8px;
        background: rgba(20, 20, 20, 0.8);
        border-left: 3px solid #000000;
        border-radius: 3px;
        min-height: 25px;
        display: flex;
        align-items: center;
    }

    .npc-quest-list {
        max-height: 100%;
        overflow-y: auto;
        padding: 0;
        /* Ẩn scrollbar cho Chrome, Safari và Edge */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE và Edge */
    }

    .npc-quest-list::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .quest-item {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 5px;
        padding: 8px;
        margin-bottom: 6px;
        transition: all 0.2s;
    }

    .quest-item:hover {
        border-color: #000000;
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    }

    .quest-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

    .quest-icon {
        font-size: 24px;
        min-width: 30px;
        text-align: center;
    }

    .quest-info {
        flex: 1;
    }

    .quest-name {
        color: #7f8c8d;
        font-size: 12px;
        font-weight: bold;
        margin-bottom: 2px;
    }

    .quest-level {
        color: #95a5a6;
        font-size: 10px;
    }

    .quest-description {
        color: #bdc3c7;
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 6px;
        padding-left: 38px;
    }

    .quest-requirement {
        color: #7f8c8d;
        font-size: 11px;
        padding: 5px 8px;
        background: rgba(30, 30, 30, 0.8);
        border-left: 3px solid #000000;
        border-radius: 3px;
        margin-bottom: 6px;
    }

    .quest-rewards {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 8px;
    }

    .reward-item {
        background: rgba(46, 204, 113, 0.1);
        border: 1px solid #2ecc71;
        color: #2ecc71;
        padding: 3px 8px;
        border-radius: 10px;
        font-size: 10px;
        font-weight: bold;
    }

    .quest-btn {
        width: 100%;
        padding: 8px 14px;
        border: none;
        border-radius: 4px;
        font-size: 12px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s;
    }

    .quest-btn-accept {
        background: #1a1a1a;
        color: white;
        border: 1px solid #333;
    }

    .quest-btn-accept:hover {
        background: #252525;
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    }

    .quest-btn-abandon {
        background: #c0392b;
        color: white;
        border: 1px solid #962d22;
    }

    .quest-btn-abandon:hover {
        background: #d35400;
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(192, 57, 43, 0.5);
    }

    .quest-btn-disabled {
        background: #0d0d0d;
        color: #555;
        cursor: not-allowed;
        border: 1px solid #222;
    }

    /* Enhancement Modal */
    .npc-enhancement-modal {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        z-index: 10001;
        gap: 0;
        overflow-y: hidden;
        overflow-x: hidden;
        box-shadow: none;
        box-sizing: border-box;
    }

    .npc-enhancement-modal::before {
        display: none;
    }

    /* Override ALL CSS that hides or shrinks the enhancement slot */
    #npc-enhancement-modal #enhancement-item-slot {
        display: flex !important;
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        min-height: 100px !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        background: url('../assets/icon/inventorynew/common.webp') center/contain no-repeat !important;
        border: none !important;
    }

    #npc-enhancement-modal .demo-character-sprite {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 120px !important;
        height: 120px !important;
        min-width: 120px !important;
        pointer-events: auto !important;
    }

    /* Override inventory/responsive CSS that hides .empty-slot in the modal */
    #npc-enhancement-modal .empty-slot {
        display: flex !important;
        pointer-events: auto !important;
    }

    /* Tab header: black bar matching other modals */
    #npc-enhancement-modal .demo-inventory-header {
        background: rgba(0,0,0,0.8) !important;
        border: none !important;
        border-bottom: 1px solid #333 !important;
        box-shadow: none !important;
    }

    /* Tab buttons: tight spacing, no padding */
    #npc-enhancement-modal .demo-tab-btn {
        padding: 0 !important;
        margin: 0 !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
    }

    #npc-enhancement-modal .demo-tab-btn img {
        padding: 0 !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* Enhancement Tabs */
    .npc-enhancement-tabs {
        display: flex;
        gap: 4px;
        margin-top: 4px;
        margin-bottom: 2px;
    }

    .npc-enhancement-tab {
        flex: 1;
        background: rgba(40, 40, 40, 0.9);
        border: 1px solid #555;
        border-radius: 4px;
        padding: 4px 6px;
        color: #ecf0f1;
        font-size: 11px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s, transform 0.1s, border-color 0.2s;
    }

    .npc-enhancement-tab.active {
        background: linear-gradient(135deg, #444 0%, #666 100%);
        border-color: #7f8c8d;
        transform: translateY(-1px);
    }

    .npc-enhancement-tab-content {
        display: none;
        flex-direction: column;
        gap: 10px;
        flex: 1;
        overflow-x: hidden;
    }

    .npc-enhancement-tab-content.active {
        display: flex;
        overflow-x: hidden;
    }

    /* Crafting UI */
    .crafting-slots-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 8px;
    }

    .crafting-slot-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .crafting-slot-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .crafting-stone-slot {
        width: 90px;
        height: 90px;
        border-radius: 10px;
        border: 2px dashed #555;
        background: rgba(20, 20, 20, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        cursor: pointer;
        transition: all 0.15s;
    }

    .crafting-stone-slot:hover {
        border-color: #888;
        transform: translateY(-1px);
    }

    .crafting-stone-slot.empty .slot-placeholder-text {
        color: #7f8c8d;
        font-size: 24px;
        font-weight: bold;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        user-select: none;
    }

    .crafting-stone-slot img {
        width: 60px;
        height: 60px;
        object-fit: contain;
    }

    /* Điều chỉnh kích thước ô chế tạo trên màn hình nhỏ (mobile) để tránh tràn */
    @media (max-width: 600px) {
        .crafting-slot-grid {
            gap: 6px;
        }

        .crafting-stone-slot {
            width: 48px;
            height: 48px;
        }

        .crafting-stone-slot.empty .slot-placeholder-text {
            font-size: 20px;
        }

        .crafting-stone-slot img {
            width: 34px;
            height: 34px;
        }
    }

    .crafting-stone-remove {
        position: absolute;
        top: 2px;
        right: 3px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: rgba(231, 76, 60, 0.9);
        color: #fff;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .crafting-stone-count {
        position: absolute;
        bottom: 3px;
        right: 4px;
        background: rgba(0, 0, 0, 0.8);
        color: #bdc3c7;
        padding: 1px 4px;
        border-radius: 6px;
        font-size: 10px;
        font-weight: bold;
    }

    .crafting-controls {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 8px;
        background: rgba(0, 0, 0, 0.35);
        border-radius: 6px;
    }

    .crafting-stats-row {
        display: flex;
        justify-content: space-between;
        font-size: 11px;
        color: #bdc3c7;
    }

    .crafting-stats-row span:last-child {
        font-weight: bold;
        color: #7f8c8d;
    }

    .crafting-input-label {
        font-size: 11px;
        color: #bdc3c7;
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 4px;
    }

    .crafting-result-panel {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #7f8c8d;
        border-radius: 8px;
        box-shadow: 0 0 30px rgba(142, 68, 173, 0.8);
        padding: 8px 15px;
        min-width: 150px;
        animation: scaleInCraft 0.3s ease-out;
    }

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

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

    .crafting-result-title {
        font-size: 11px;
        color: #bdc3c7;
        margin-bottom: 4px;
    }

    .crafting-result-content {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .crafting-result-image {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        border: 1px solid #666;
        background: rgba(0, 0, 0, 0.6);
        object-fit: contain;
    }

    .crafting-result-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .crafting-result-name {
        font-size: 12px;
        font-weight: bold;
        color: #ecf0f1;
    }

    .crafting-result-rarity {
        font-size: 11px;
        color: #95a5a6;
    }

    .crafting-confirm-btn {
        width: 100%;
        background: linear-gradient(135deg, #444 0%, #666 100%);
        color: white;
        border: 1px solid #888;
        padding: 10px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s;
        margin-top: 4px;
    }

    .crafting-confirm-btn:hover {
        background: linear-gradient(135deg, #555 0%, #777 100%);
        transform: translateY(-1px);
    }

    .crafting-confirm-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .npc-enhancement-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
    }

    .npc-enhancement-header h2 {
        color: #ddd;
        margin: 0;
        font-size: 16px;
    }

    .npc-enhancement-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        padding: 5px 12px;
        border-radius: 5px;
        cursor: pointer;
        font-weight: bold;
    }

    .npc-enhancement-dialogue {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(100, 100, 100, 0.1);
        border-left: 3px solid #666;
        padding: 8px;
        border-radius: 4px;
    }

    .npc-enhancement-dialogue p {
        color: #bdc3c7;
        margin: 0;
        font-size: 11px;
        font-style: italic;
    }

    /* Enhancement Slots */
    .enhancement-slots-container {
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 15px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 8px;
    }

    .enhancement-slot-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        flex: 1;
    }

    .slot-label {
        color: #ecf0f1;
        font-size: 11px;
        font-weight: bold;
    }

    .enhancement-slot {
        width: 150px;
        height: 150px;
        background: rgba(20, 20, 20, 0.9);
        border: 3px dashed #555;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        pointer-events: auto;
        transition: all 0.2s;
        position: relative;
    }

    .enhancement-slot:hover {
        border-color: #888;
        transform: scale(1.05);
    }

    .enhancement-slot.empty-slot .slot-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        color: #7f8c8d;
    }

    /* Override global .empty-slot (inventory) that disabled pointer events */
    .npc-enhancement-modal .enhancement-slot.empty-slot {
        position: relative !important;
        display: flex !important;
        pointer-events: auto !important;
    }

    .enhancement-material-slot {
        width: 150px;
        height: 150px;
        background: rgba(46, 204, 113, 0.1);
        border: 3px solid #2ecc71;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px;
    }

    .enhancement-material-slot img {
        width: 80px;
        height: 80px;
    }

    .material-count {
        color: #ecf0f1;
        font-size: 12px;
        font-weight: bold;
    }

    .enhancement-arrow {
        color: #888;
        font-size: 32px;
        font-weight: bold;
        animation: pulse 2s infinite;
    }

    .slot-item-name {
        color: #7f8c8d;
        font-size: 11px;
        font-weight: bold;
        text-align: center;
        min-height: 16px;
    }

    /* Enhancement Info Panel */
    .enhancement-info-panel {
        background: rgba(30, 30, 30, 0.9);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .info-row {
        display: flex;
        justify-content: space-between;
        color: #bdc3c7;
        font-size: 11px;
    }

    .info-row.highlight {
        background: rgba(100, 100, 100, 0.1);
        padding: 6px 8px;
        border-radius: 5px;
        border-left: 3px solid #888;
    }

    .bonus-text {
        color: #2ecc71;
        font-weight: bold;
    }

    .info-arrow {
        text-align: center;
        color: #888;
        font-size: 16px;
    }

    /* Enhancement Button */
    .enhancement-confirm-btn {
        width: 100%;
        background: linear-gradient(135deg, #444 0%, #666 100%);
        color: white;
        border: 1px solid #888;
        padding: 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s;
    }

    .enhancement-confirm-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, #555 0%, #777 100%);
        transform: translateY(-2px);
    }

    .enhancement-confirm-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* Item Selection List */
    .enhancement-item-list {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 15, 15, 0.98);
        border-radius: 12px;
        display: none;
        flex-direction: column;
        overflow: hidden;
        z-index: 10002;
    }

    .item-list-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 2px solid #444;
        flex-shrink: 0;
        min-height: 60px;
    }

    .item-list-header h3 {
        color: #ecf0f1;
        margin: 0;
        font-size: 16px;
    }

    .item-list-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        font-weight: bold;
    }

    .enhancement-item-grid {
        overflow-y: auto;
        overflow-x: hidden;
        padding: 15px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
        flex: 1;
        min-height: 0;
        max-height: 100%;
    }

    /* Custom scrollbar for enhancement item grid */
    .enhancement-item-grid::-webkit-scrollbar {
        width: 8px;
    }

    .enhancement-item-grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
    }

    .enhancement-item-grid::-webkit-scrollbar-thumb {
        background: rgba(100, 100, 100, 0.6);
        border-radius: 4px;
    }

    .enhancement-item-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(150, 150, 150, 0.8);
    }

    .enhancement-grid-item {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 8px;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 100px;
        position: relative;
    }

    .enhancement-grid-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(100, 100, 100, 0.3);
    }

    /* Teleport Modal Styles */
    .npc-teleport-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(15, 15, 15, 0.98);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 15px;
        z-index: 10001;
        width: 80%;
        max-width: 500px;
        max-height: 80vh;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    }

    /* NPC Dialogue Dialog Styles - Black theme like tutorial */
    .npc-dialogue-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 9999;
        transition: opacity 0.3s ease-in;
    }

    .npc-dialogue-dialog {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-image: url('../assets/icon/ui/dialognpc.webp');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-color: transparent;
        width: 350px;
        height: 125px;
        box-sizing: border-box;
        padding: 15px 30px 10px 30px;
        z-index: 10000;
        transition: opacity 0.3s;
        image-rendering: pixelated;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
        animation: npcDialogOpenCenter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    @keyframes npcDialogOpenCenter {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scaleX(0) scaleY(0.5);
        }

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

    .npc-dialogue-dialog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        margin-bottom: 5px;
        border-bottom: none;
        text-align: center;
    }

    .npc-dialogue-dialog-title {
        margin: 0 auto;
        font-size: 14px;
        font-weight: 700;
        color: #ffffff;
        text-align: center;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .npc-dialogue-dialog-body {
        padding: 0;
        min-height: 40px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }

    .npc-dialogue-dialog-text {
        margin: 0;
        font-size: 12px;
        line-height: 1.3;
        color: #ffffff;
        text-align: center;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }

    .npc-dialogue-dialog-text.typing {
        border-right: 2px solid #ffffff;
        animation: blinkCursor 0.8s infinite;
    }

    .npc-dialogue-dialog-text.typing-complete {
        border-right: none;
    }

    .npc-dialogue-dialog-footer {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin-top: 5px;
        border-top: none;
        gap: 10px;
    }

    .npc-dialogue-ok-btn,
    .npc-dialogue-next-btn {
        padding: 4px 16px;
        border: none;
        border-radius: 5px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        min-width: 60px;
    }

    .npc-dialogue-ok-btn {
        background: rgba(0, 0, 0, 0.9);
        color: #ffffff;
        border: 1px solid rgba(0, 0, 0, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .npc-dialogue-ok-btn:hover {
        background: rgba(0, 0, 0, 1);
        border-color: rgba(0, 0, 0, 1);
    }

    .npc-dialogue-next-btn {
        background: rgba(0, 0, 0, 0.9);
        color: #ffffff;
        border: 1px solid rgba(0, 0, 0, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .npc-dialogue-next-btn:hover {
        background: rgba(0, 0, 0, 1);
        border-color: rgba(0, 0, 0, 1);
    }

    .npc-dialogue-dialog-image {
        position: absolute;
        top: -30px;
        left: -35px;
        width: 85px;
        height: 85px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        z-index: 10001;
        pointer-events: none;
        image-rendering: pixelated;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
    }

    .npc-teleport-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        border-bottom: 2px solid #555;
        padding-bottom: 10px;
    }

    .npc-teleport-header h2 {
        color: #ddd;
        margin: 0;
        font-size: 18px;
    }

    .npc-teleport-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        padding: 5px 12px;
        border-radius: 5px;
        cursor: pointer;
        font-weight: bold;
    }

    .npc-teleport-close-btn:hover {
        background: #c0392b;
    }

    .npc-teleport-dialogue-container {
        margin-bottom: 15px;
        padding: 10px;
        background: rgba(52, 152, 219, 0.1);
        border-left: 3px solid #3498db;
        border-radius: 5px;
    }

    .npc-teleport-maps {
        max-height: calc(80vh - 150px);
        overflow-y: auto;
        padding: 5px;
    }

    .teleport-map-item {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .teleport-map-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
        border-color: #3498db;
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .npc-teleport-modal {
            width: 90%;
            max-width: 90%;
            padding: 12px;
        }

        .npc-teleport-header h2 {
            font-size: 16px;
        }

        .teleport-map-item {
            padding: 12px;
        }
    }

    /* Dungeon Modal Styles */
    .npc-dungeon-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        z-index: 10001;
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        box-shadow: none;
        flex-direction: column;
        box-sizing: border-box;
        overflow-y: auto;
    }

    /* Force flex display when shown */
    .npc-dungeon-modal[style*="block"] {
        display: flex !important;
    }

    .npc-dungeon-tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 8px;
        margin-top: 4px;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    }

    .dungeon-tab {
        flex: 1;
        padding: 6px 10px;
        background: rgba(40, 40, 40, 0.9);
        border: 1px solid #555;
        border-radius: 4px;
        border-bottom: 3px solid transparent;
        color: #ecf0f1;
        font-size: 11px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    @media (max-width: 768px) {
        .dungeon-tab {
            padding: 5px 8px;
            font-size: 10px;
        }
    }

    .dungeon-tab:hover {
        background: rgba(60, 60, 60, 0.9);
        transform: translateY(-1px);
    }

    .dungeon-tab.active {
        background: linear-gradient(135deg, #444 0%, #666 100%);
        border-color: #f1c40f;
        border-bottom-color: #f1c40f;
        color: #f1c40f;
        transform: translateY(-1px);
    }

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

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

    /* Full-screen dungeon overrides */
    .npc-dungeon-modal .npc-dungeon-tabs {
        flex-shrink: 0;
        padding: 0 15px;
        margin-top: 0;
    }

    .npc-dungeon-modal .dungeon-tab-content.active {
        flex: 1;
        overflow-y: auto;
    }

    .npc-dungeon-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 2px solid #555;
    }

    .npc-dungeon-header h2 {
        color: #ecf0f1;
        margin: 0;
        font-size: 16px;
        font-weight: bold;
    }

    .npc-dungeon-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .npc-dungeon-close-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
    }

    .npc-dungeon-list {
        max-height: calc(75vh - 180px);
        overflow-y: auto;
        padding: 5px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .dungeon-item-solo {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 10px;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }

    .dungeon-item-solo:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
        border-color: #3498db;
    }

    .dungeon-image-solo {
        width: 100%;
        height: auto;
        max-height: 120px;
        object-fit: cover;
        object-position: center;
        border-radius: 6px;
    }

    @media (max-width: 1200px) {
        .dungeon-image-solo {
            max-height: 100px;
        }
    }

    @media (max-width: 768px) {
        .dungeon-image-solo {
            max-height: 80px;
        }
    }

    @media (max-width: 480px) {
        .dungeon-image-solo {
            max-height: 60px;
        }
    }

    .dungeon-item {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 15px;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .dungeon-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
        border-color: #3498db;
    }

    .dungeon-image {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
        border: 2px solid #555;
    }

    .dungeon-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .dungeon-name {
        color: #ecf0f1;
        font-size: 16px;
        font-weight: bold;
    }

    .dungeon-requirement {
        color: #95a5a6;
        font-size: 12px;
    }

    /* Rankup Modal Styles */
    .npc-rankup-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        z-index: 10001;
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        box-shadow: none;
        flex-direction: column;
        box-sizing: border-box;
    }

    /* Force flex display when shown */
    .npc-rankup-modal[style*="block"], .npc-rankup-modal[style*="flex"] {
        display: flex !important;
    }

    .npc-rankup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #555;
    }

    .npc-rankup-header h2 {
        color: #ecf0f1;
        margin: 0;
        font-size: 18px;
        font-weight: bold;
    }

    .npc-rankup-close-btn {
        background: #e74c3c;
        color: white;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .npc-rankup-close-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
    }

    .npc-rankup-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow-y: auto;
        max-height: calc(80vh - 100px);
    }

    .rankup-info-panel {
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 8px;
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .rankup-stat-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #ecf0f1;
        font-size: 14px;
    }

    .rankup-stat-row.highlight {
        color: #f39c12;
        font-weight: bold;
    }

    .rankup-value {
        color: #3498db;
        font-weight: bold;
    }

    .rankup-stat-row.highlight .rankup-value {
        color: #f39c12;
    }

    .rankup-divider {
        height: 1px;
        background: #555;
        margin: 5px 0;
    }

    .rankup-warning {
        background: rgba(231, 76, 60, 0.2);
        border: 2px solid #e74c3c;
        border-radius: 8px;
        padding: 12px;
        color: #e74c3c;
        font-size: 13px;
        text-align: center;
    }

    .rankup-warning p {
        margin: 5px 0;
    }

    .rankup-confirm-btn {
        background: url('public/assets/icon/ui/button.webp') no-repeat center;
        background-size: 100% 100%;
        color: #fff;
        border: none;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        transition: transform 0.2s, filter 0.2s, opacity 0.2s;
        width: 100%;
    }

    .rankup-confirm-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        filter: brightness(1.05);
        box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    }

    .rankup-confirm-btn:disabled {
        cursor: not-allowed;
        opacity: 0.6;
        filter: grayscale(1);
    }

    .rankup-confirm-btn.enabled {
        opacity: 1;
        filter: none;
    }

    @media (max-width: 768px) {
        .npc-dungeon-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            padding: 0;
        }

        .npc-dungeon-header h2 {
            font-size: 16px;
        }

        .dungeon-item {
            padding: 12px;
        }

        .dungeon-image {
            width: 60px;
            height: 60px;
        }

        .npc-rankup-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            padding: 0;
            transform: none !important;
        }

        .npc-rankup-header h2 {
            font-size: 14px;
        }

        .npc-rankup-close-btn {
            width: 25px;
            height: 25px;
        }

        .rankup-stat-row {
            font-size: 11px;
        }

        .rankup-info-panel {
            padding: 10px;
            gap: 8px;
        }

        .rankup-confirm-btn {
            padding: 10px 16px;
            font-size: 14px;
        }

        .npc-rankup-content {
            max-height: calc(80vh - 80px);
            overflow-y: auto;
            gap: 10px;
        }
    }

    /* Mobile Landscape (màn hình ngang) */
    @media (max-width: 1024px) and (orientation: landscape) {
        .npc-rankup-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            padding: 0;
            transform: none !important;
            max-height: none !important;
        }

        .npc-rankup-header h2 {
            font-size: 12px;
        }

        .npc-rankup-close-btn {
            width: 22px;
            height: 22px;
        }

        .npc-rankup-close-btn img {
            width: 16px;
            height: 16px;
        }

        .rankup-stat-row {
            font-size: 10px;
        }

        .rankup-info-panel {
            padding: 8px;
            gap: 6px;
        }

        .rankup-confirm-btn {
            padding: 8px 14px;
            font-size: 12px;
        }

        .npc-rankup-content {
            max-height: calc(90vh - 70px);
            gap: 8px;
        }

        .rankup-warning {
            padding: 8px;
            font-size: 11px;
        }
    }

    /* =========================================================
   MMO PREMIUM REDESIGN NEW LAYOUT CLASSES
   ========================================================= */

    /* --- Split-Panel Layouts (Shop & Quest) --- */
    .npc-shop-split-layout {
        display: flex;
        flex-direction: row;
        height: clamp(150px, 55vh, 400px);
        /* Adaptive height prevents landscape overflow */
        gap: 15px;
        margin-top: 10px;
    }

    /* Full-screen modal overrides */
    .npc-shop-modal .npc-shop-split-layout,
    .npc-quest-modal .npc-shop-split-layout,
    .npc-dungeon-modal .npc-shop-split-layout {
        flex: 1;
        height: auto !important;
        max-height: none !important;
        margin-top: 0;
        padding: 15px;
        box-sizing: border-box;
    }

    .npc-shop-left-panel {
        flex: 6;
        display: flex;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid #4a3c2c;
        border-radius: 8px;
        padding: 10px;
        overflow-y: auto;
        max-height: 100%;
        position: relative;
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    }

    .npc-shop-right-panel {
        flex: 4;
        background: linear-gradient(180deg, rgba(20, 20, 25, 0.8) 0%, rgba(10, 10, 12, 0.9) 100%);
        border: 1px solid #8b7355;
        border-radius: 8px;
        padding: 15px;
        display: flex;
        flex-direction: column;
        max-height: 100%;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.8);
    }

    /* Empty State / Details Content */
    .npc-shop-details-empty {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .npc-shop-details-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        z-index: 1;
    }

    /* Item Specifics */
    .detail-hologram {
        width: 80px;
        height: 80px;
        background: radial-gradient(circle, rgba(244, 208, 63, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 15px;
        box-shadow: 0 0 20px rgba(244, 208, 63, 0.1);
        position: relative;
    }

    .detail-hologram img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        filter: drop-shadow(0px 5px 10px rgba(0, 0, 0, 0.5));
        animation: floatItem 3s ease-in-out infinite;
    }

    @keyframes floatItem {

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

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

    #npc-shop-detail-name {
        margin: 0;
        font-size: 16px;
        font-weight: bold;
        text-align: center;
        text-transform: uppercase;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }

    .detail-rarity {
        font-size: 11px;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-top: 5px;
    }

    .detail-divider {
        width: 80%;
        height: 1px;
        background: linear-gradient(90deg, transparent, #8b7355, transparent);
        margin: 15px 0;
    }

    .detail-stats-box {
        width: 100%;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid #4a3c2c;
        border-radius: 4px;
        padding: 10px;
        font-size: 12px;
        color: #ecf0f1;
    }

    .stat-line {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
    }

    .stat-label {
        color: #95a5a6;
    }

    .stat-val {
        font-weight: bold;
        color: #fff;
    }

    .detail-price-box {
        margin: auto 0 15px 0;
        font-size: 16px;
        color: #f1c40f;
        font-weight: bold;
        text-align: center;
        padding: 8px 15px;
        background: rgba(241, 196, 15, 0.1);
        border-radius: 4px;
        border: 1px solid rgba(241, 196, 15, 0.3);
    }

    /* Modifying the Item Rows for Left Panel */
    .npc-shop-items-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .npc-shop-item-btn {
        display: flex;
        align-items: center;
        background: linear-gradient(90deg, #1e1e1e, #0a0a0a);
        border: 1px solid #333;
        border-radius: 6px;
        padding: 8px;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
        overflow: hidden;
    }

    .npc-shop-item-btn:hover {
        background: linear-gradient(90deg, #333333, #1e1e1e);
        border-color: #555;
        transform: translateX(4px);
    }

    .npc-shop-item-btn.selected {
        background: linear-gradient(90deg, #2a2a2a, #111111);
        border-color: #777;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }

    .npc-shop-item-btn.selected::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: #777;
    }

    .npc-shop-item-img {
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.5);
        border: 2px solid;
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 12px;
    }

    .npc-shop-item-img img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    .npc-shop-item-info {
        display: flex;
        flex-direction: column;
    }

    .npc-shop-item-name {
        font-size: 13px;
        font-weight: bold;
        text-shadow: 1px 1px 2px #000;
    }

    .npc-shop-item-price {
        font-size: 11px;
        color: #f1c40f;
        margin-top: 4px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .npc-shop-item-price img {
        width: 12px;
    }



    .quest-icon {
        font-size: 20px;
        width: 40px;
        text-align: center;
    }

    /* --- Forge Centered Layout --- */
    .forge-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 30px;
        margin-top: 20px;
        height: 200px;
    }

    .forge-left-panel,
    .forge-right-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .forge-center-panel {
        position: relative;
        width: 120px;
        height: 120px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .forge-halo {
        position: absolute;
        width: 150px;
        height: 150px;
        background: radial-gradient(circle, rgba(127, 140, 141, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
        border-radius: 50%;
        animation: pulseForge 2s infinite alternate;
        z-index: 0;
    }

    @keyframes pulseForge {
        0% {
            transform: scale(0.9);
            opacity: 0.5;
        }

        100% {
            transform: scale(1.1);
            opacity: 1;
            box-shadow: 0 0 30px rgba(127, 140, 141, 0.3);
        }
    }

    .forge-center-panel .enhancement-slot {
        width: 80px;
        height: 80px;
        border: 2px solid #7f8c8d;
        background: rgba(0, 0, 0, 0.8);
        box-shadow: 0 0 20px rgba(127, 140, 141, 0.5), inset 0 0 15px rgba(127, 140, 141, 0.3);
        z-index: 1;
        border-radius: 10px;
    }

    .forge-mat-box .enhancement-material-slot {
        width: 60px !important;
        height: 60px !important;
        margin: 0 auto;
        border: 2px solid #555;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 8px;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    }

    .forge-item-name {
        position: absolute;
        bottom: -30px;
        width: 150px;
        text-align: center;
        font-size: 13px;
        font-weight: bold;
        color: #f4d03f;
        text-shadow: 1px 1px 3px #000;
    }

    .forge-mat-box {
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid #555;
        padding: 10px;
        border-radius: 8px;
        width: 80px;
    }

    .info-row {
        background: rgba(0, 0, 0, 0.6);
        border-left: 3px solid #3498db;
        padding: 8px 12px;
        margin-bottom: 8px;
        border-radius: 0 4px 4px 0;
        font-size: 12px;
        color: #ecf0f1;
    }

    /* --- Crafting Nexus Layout --- */
    .crafting-nexus {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 30px auto;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(127, 140, 141, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    }

    .nexus-core {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 50px;
        height: 50px;
        background: radial-gradient(circle, rgba(127, 140, 141, 0.6) 0%, rgba(127, 140, 141, 0.2) 100%);
        border-radius: 50%;
        box-shadow: 0 0 20px rgba(127, 140, 141, 0.5);
        animation: rotateCore 4s linear infinite;
    }

    @keyframes rotateCore {
        0% {
            transform: translate(-50%, -50%) rotate(0deg);
        }

        100% {
            transform: translate(-50%, -50%) rotate(360deg);
        }
    }

    .nexus-slot {
        position: absolute;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }


    /* Star positioning condensed */
    .nexus-slot-1 {
        top: -5%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .nexus-slot-2 {
        top: 35%;
        left: 95%;
        transform: translate(-50%, -50%);
    }

    .nexus-slot-3 {
        top: 85%;
        left: 75%;
        transform: translate(-50%, -50%);
    }

    .nexus-slot-4 {
        top: 85%;
        left: 25%;
        transform: translate(-50%, -50%);
    }

    .nexus-slot-5 {
        top: 35%;
        left: 5%;
        transform: translate(-50%, -50%);
    }

    .crafting-slot-wrapper {
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .crafting-slot-wrapper .crafting-stone-slot {
        width: 60px;
        height: 60px;
        background: rgba(0, 0, 0, 0.7);
        border: 2px solid #7f8c8d;
        border-radius: 50%;
        box-shadow: inset 0 0 10px rgba(127, 140, 141, 0.5);
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        aspect-ratio: 1 / 1;
    }

    .crafting-slot-wrapper .crafting-stone-slot:hover {
        box-shadow: 0 0 15px #95a5a6, inset 0 0 10px #95a5a6;
        transform: scale(1.1);
    }

    /* --- Dungeon Grid Layout --- */
    .npc-dungeon-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 10px;
    }

    .dungeon-item-card {
        position: relative;
        border-radius: 10px;
        overflow: hidden;
        border: 2px solid #8b7355;
        transition: all 0.3s ease;
        cursor: pointer;
        background: #000;
    }

    .dungeon-item-card:hover:not(.locked) {
        border-color: #f1c40f;
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.4);
        transform: translateY(-5px);
    }

    .dungeon-card-img-wrapper {
        position: relative;
        width: 100%;
        padding-top: 60%;
        /* 16:9 aspect ratio */
    }

    .dungeon-card-img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .dungeon-card-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
        padding: 20px 10px 10px 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .dungeon-card-title {
        color: #f4d03f;
        font-weight: bold;
        font-size: 14px;
        text-shadow: 1px 1px 3px #000;
    }

    .dungeon-enter-btn {
        width: 100%;
        padding: 6px;
        font-size: 12px;
    }

    .lock-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 40px;
        opacity: 0.8;
    }

    /* --- Dungeon Rooms List Grid --- */
    .dungeon-room-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.9));
        border: 1px solid rgba(255, 170, 0, 0.15);
        border-left: 4px solid #ffaa00;
        margin-bottom: 8px;
        padding: 10px 15px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .dungeon-room-card:hover {
        background: linear-gradient(135deg, rgba(30, 25, 20, 0.9), rgba(15, 12, 10, 0.95));
        border-color: #ffaa00;
        box-shadow: 0 0 15px rgba(255, 170, 0, 0.2), 0 8px 25px rgba(0, 0, 0, 0.5);
        transform: translateY(-2px);
    }

    .room-host-name {
        color: #ffaa00;
        font-weight: 800;
        font-size: 13.5px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }

    .room-dungeon-name {
        color: rgba(255, 255, 255, 0.6);
        font-size: 11px;
        font-weight: 600;
        margin-top: 4px;
        letter-spacing: 0.3px;
    }

    .room-player-count .current-count {
        color: #2ecc71;
        font-size: 16px;
        font-weight: 800;
        text-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
    }

    .room-player-count .max-count {
        color: rgba(255, 255, 255, 0.4);
        font-size: 12px;
        font-weight: 600;
    }

    /* Modals full-screen override - DO NOT set width/max-width here */
    .npc-shop-modal,
    .npc-quest-modal,
    .npc-dungeon-modal,
    .npc-rankup-modal,
    .npc-enhancement-modal {
        width: 100vw !important;
        max-width: none !important;
        height: 100vh !important;
        max-height: none !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        background: rgba(0, 0, 0, 0.7) !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 15px !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        display: none;
        flex-direction: column;
        overflow: hidden;
    }

    /* Force flex display when shown */
    .npc-shop-modal[style*="block"],
    .npc-quest-modal[style*="block"],
    .npc-dungeon-modal[style*="block"],
    .npc-rankup-modal[style*="block"],
    .npc-enhancement-modal[style*="block"] {
        display: flex !important;
    }

    /* Force panels to fill full height of the split layout in full-screen modals */
    .npc-shop-modal .npc-shop-left-panel,
    .npc-quest-modal .npc-shop-left-panel,
    .npc-dungeon-modal .npc-shop-left-panel,
    .npc-enhancement-modal .npc-shop-left-panel,
    .npc-shop-modal .npc-shop-right-panel,
    .npc-quest-modal .npc-shop-right-panel,
    .npc-dungeon-modal .npc-shop-right-panel,
    .npc-enhancement-modal .npc-shop-right-panel {
        height: 100% !important;
        box-sizing: border-box !important;
    }

    /* Only quest lists and details needs scrollbar overrides */
    .npc-shop-left-panel::-webkit-scrollbar {
        width: 4px;
    }

    .npc-shop-left-panel::-webkit-scrollbar-thumb {
        background: #8b7355;
        border-radius: 4px;
    }

    /* Media Query overrides for mobile MMO view */
    @media (max-width: 768px) {
        .npc-shop-modal,
        .npc-quest-modal,
        .npc-dungeon-modal,
        .npc-rankup-modal,
        .npc-enhancement-modal {
            width: 100vw !important;
            max-width: none !important;
            height: 100vh !important;
            max-height: none !important;
            top: 0 !important;
            left: 0 !important;
            transform: none !important;
            border-radius: 0 !important;
            padding: 10px !important;
        }

        .npc-shop-split-layout {
            flex-direction: column !important;
            height: auto !important;
            max-height: none !important;
            min-height: auto !important;
            gap: 10px !important;
            flex: 1 !important;
        }

        .npc-shop-left-panel {
            flex: 1 !important;
            max-height: 50% !important;
            overflow-y: auto !important;
        }

        .npc-shop-right-panel {
            flex: 1 !important;
            max-height: 50% !important;
            overflow-y: auto !important;
        }

        .forge-container {
            gap: 5px;
            transform: scale(1);
            transform-origin: center center;
            height: 160px;
        }

        .forge-mat-box {
            width: 60px;
            padding: 5px;
        }

        .forge-center-panel {
            width: 100px;
            height: 100px;
        }

    }

    /* Horizontal overrides for Crafting Nexus on short or narrow screens */
    @media (max-width: 768px), (max-height: 500px) {
        .crafting-nexus {
            width: 100% !important;
            height: 100px !important;
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: wrap !important;
            justify-content: center !important;
            background: none !important;
            margin: 5px 0 !important;
            transform: scale(0.85) !important;
        }

        .crafting-nexus .nexus-slot {
            position: relative !important;
            top: 0 !important;
            left: 0 !important;
            transform: none !important;
            margin: 2px !important;
        }

        .crafting-nexus .nexus-core {
            position: absolute !important;
            top: 70px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
        }

        .crafting-animation-overlay {
            top: 70px !important;
        }
    }
    \n

    /* --- Teleport Clean Layout --- */
    .npc-teleport-modal {
        display: flex !important;
        flex-direction: column;
    }

    .npc-teleport-header {
        flex-shrink: 0;
    }

    .npc-teleport-clean-grid {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
        padding: 10px;
        height: auto !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .teleport-clean-card {
        background: linear-gradient(135deg, rgba(30, 30, 40, 0.9), rgba(15, 15, 20, 0.95));
        border: 2px solid #4a3c2c;
        border-radius: 8px;
        padding: 12px;
        cursor: pointer;
        position: relative;
        transition: all 0.2s;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .teleport-clean-card:hover:not(.current) {
        border-color: #f1c40f;
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(241, 196, 15, 0.2);
    }

    /* Special tweaks for mobile landscape to keep UI large */
    @media (max-height: 550px) and (orientation: landscape) {
        /* Removed legacy .npc-enhancement-modal mobile overrides */
    }

    .teleport-clean-card.current {
        border-color: #3498db;
        cursor: not-allowed;
        opacity: 0.8;
    }

    .teleport-card-content {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .teleport-card-title {
        color: #f1c40f;
        font-size: 14px;
        font-weight: bold;
        text-shadow: 1px 1px 2px #000;
    }

    .teleport-clean-card.current .teleport-card-title {
        color: #3498db;
    }

    .teleport-card-desc {
        color: #bdc3c7;
        font-size: 11px;
        margin-bottom: 4px;
    }

    .teleport-card-info {
        display: flex;
        justify-content: space-between;
        font-size: 10px;
        color: #95a5a6;
        background: rgba(0, 0, 0, 0.4);
        padding: 4px 6px;
        border-radius: 4px;
    }

    .teleport-current-badge {
        position: absolute;
        top: -10px;
        right: -10px;
        background: #2c3e50;
        border: 2px solid #3498db;
        color: #3498db;
        font-size: 10px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    #npc-quest-detail-desc:empty,
    #npc-main-quest-detail-desc:empty {
        display: none !important;
    }

    /* Compact layout adjustments for short screens (landscape mobile) */
    @media (max-height: 500px) {
        .npc-shop-split-layout {
            padding: 5px !important;
            gap: 8px !important;
        }

        .npc-shop-left-panel,
        .npc-shop-right-panel {
            padding: 8px !important;
        }

        .quest-item,
        .npc-shop-item-btn {
            padding: 5px 8px !important;
            margin-bottom: 4px !important;
        }

        .quest-icon {
            font-size: 16px !important;
            min-width: 24px !important;
        }

        .quest-header {
            margin-bottom: 3px !important;
        }

        .npc-shop-details-content {
            gap: 4px !important;
        }

        .npc-shop-details-content div[style*="flex-grow: 1"] {
            display: none !important;
        }

        .npc-shop-details-content .detail-divider {
            margin: 4px 0 !important;
        }

        #npc-quest-detail-desc,
        #npc-main-quest-detail-desc {
            padding: 5px 8px !important;
            font-size: 11px !important;
            margin-bottom: 2px !important;
        }

        #npc-quest-detail-reqs,
        #npc-main-quest-detail-reqs {
            padding: 4px 6px !important;
            font-size: 11px !important;
        }

        #npc-quest-detail-rewards,
        #npc-main-quest-detail-rewards {
            gap: 4px !important;
        }

        .quest-btn {
            padding: 6px 12px !important;
            font-size: 11px !important;
            margin-top: 5px !important;
        }
    }