/* Inventory System */
.inventory-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 95%;
    max-width: 900px;
    height: 90%;
    max-height: 750px;
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(50, 50, 50, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 1000;
    display: none;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(60, 60, 60, 0.6);
}

.inventory-panel.active {
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.inventory-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(60, 60, 60, 0.6);
    position: relative;
    flex-shrink: 0;
}

.inventory-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

/* Inventory Body - Contains tabs and content */
.inventory-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Vertical Tabs on Left */
.inventory-tabs-vertical {
    display: flex;
    flex-direction: column;
    width: 70px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    border-right: 2px solid rgba(60, 60, 60, 0.6);
    padding: 10px 0;
    gap: 5px;
    flex-shrink: 0;
    overflow-y: auto;
}

.inventory-tabs-vertical::-webkit-scrollbar {
    width: 6px;
}

.inventory-tabs-vertical::-webkit-scrollbar-track {
    background: #000000;
}

.inventory-tabs-vertical::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 3px;
}

.inventory-tab-vertical {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(60, 60, 60, 0.5);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    margin: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    text-align: center;
    min-height: 50px;
    width: 54px;
}

/* Notification dot for inventory vertical tabs (bag, points, titles, etc.) */
.inventory-tab-vertical::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 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: 5;
    pointer-events: none;
}

.inventory-tab-vertical.has-notification::after {
    opacity: 1;
    visibility: visible;
}

.inventory-tab-vertical:hover {
    background: rgba(40, 40, 40, 0.8);
    color: white;
    border-color: rgba(100, 100, 100, 0.7);
    transform: none;
}

.inventory-tab-vertical.active {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: rgba(100, 100, 100, 0.8);
    color: white;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.inventory-tab-vertical.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 3px 3px 0;
}

.inventory-tab-vertical .tab-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-tab-vertical .tab-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.inventory-tab-vertical .tab-text {
    display: none;
}

/* Content Wrapper on Right */
.inventory-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.inventory-tab-content {
    display: none;
    width: 100%;
    height: 100%;
    animation: none;
    position: relative;
}

.inventory-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.inventory-tab-content[data-tab-content="stats"] {
    overflow-y: auto;
}

.inventory-tab-content[data-tab-content="stats"].active {
    gap: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.inventory-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.inventory-content {
    padding: 25px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* Tab Content Styling */
.inventory-content-wrapper .inventory-tab-content {
    padding: 25px;
    height: 100%;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 25px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

.inventory-content-wrapper .inventory-tab-content.active {
    display: flex;
}

/* Custom scrollbar for inventory */
.inventory-content::-webkit-scrollbar {
    width: 8px;
}

.inventory-content::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 10px;
}

.inventory-content::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.inventory-content::-webkit-scrollbar-thumb:hover {
    background: #1a1a1a;
    background-clip: content-box;
}

/* Equipment Section */
.equipment-section {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Character Display - Desktop */
.character-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 6px 8px;
    background:
        radial-gradient(circle at center, rgba(74, 63, 42, 0.5), rgba(43, 38, 29, 0.5)),
        linear-gradient(145deg, #3a3226 0%, #2b261d 100%);
    border: 2px solid;
    border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1;
    border-radius: 10px;
    box-shadow:
        0 0 15px rgba(212, 175, 55, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 215, 0, 0.15);
    position: relative;
    width: 80px;
    min-height: 80px;
    justify-self: center;
    align-self: center;
}

.character-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1), transparent 60%);
    border-radius: 15px;
    pointer-events: none;
}

.character-display h4 {
    margin: 0;
    color: #f4e4c1;
    font-size: 0.65rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
}

.character-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #4a3f2a, #2b261d),
        linear-gradient(145deg, #3a3226 0%, #2b261d 100%);
    border: 2px solid;
    border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #f4e4c1;
    box-shadow:
        0 0 12px rgba(212, 175, 55, 0.3),
        0 3px 10px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 215, 0, 0.2);
    position: relative;
    flex-shrink: 0;
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.character-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, transparent, #d4af37);
    opacity: 0.3;
    z-index: -1;
}

.character-name {
    color: #f4e4c1;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.equipment-section h4 {
    margin: 0 0 8px 0;
    color: #f4e4c1;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.5);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #8b6914, #d4af37, #8b6914) 1;
    padding-bottom: 4px;
    position: relative;
    letter-spacing: 0.3px;
}

.equipment-section h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.equipment-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto auto auto auto auto;
    gap: 3px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
    padding: 5px;
}

/* Character Display ở giữa (column 2, row 3, spanning 3 rows) */
.character-display {
    grid-column: 2;
    grid-row: 2 / span 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Left Column */
.equipment-slot[data-slot="weapon"] {
    grid-column: 1;
    grid-row: 1;
}

.equipment-slot[data-slot="ao"] {
    grid-column: 1;
    grid-row: 2;
}

.equipment-slot[data-slot="quan"] {
    grid-column: 1;
    grid-row: 3;
}

.equipment-slot[data-slot="giay"] {
    grid-column: 1;
    grid-row: 4;
}

.equipment-slot[data-slot="bongtai"] {
    grid-column: 1;
    grid-row: 5;
}

/* Eye Slot (trên nhân vật, cột giữa hàng 1) */
.equipment-slot[data-slot="eye"] {
    grid-column: 2;
    grid-row: 1;
}

/* Right Column */
.equipment-slot[data-slot="nhan"] {
    grid-column: 3;
    grid-row: 1;
}

.equipment-slot[data-slot="daychuyen"] {
    grid-column: 3;
    grid-row: 2;
}

.equipment-slot[data-slot="character"] {
    grid-column: 3;
    grid-row: 3;
}

.equipment-slot[data-slot="boat"] {
    grid-column: 3;
    grid-row: 4;
}

.equipment-slot[data-slot="devilfruit"] {
    grid-column: 3;
    grid-row: 5;
}


/* Empty placeholder slots */
.equipment-slot.empty-slot-placeholder {
    visibility: hidden;
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* Devil Fruit Slot Special Style - Same as inventory */
.equipment-slot[data-slot="devilfruit"] {
    background: transparent;
    border: none;
    box-shadow: none;
}

.equipment-slot[data-slot="devilfruit"]:hover {
    border: none;
    box-shadow: none;
    transform: none;
}

.equipment-slot[data-slot="boat"] {
    background: transparent;
    border: none;
    box-shadow: none;
}

.equipment-slot[data-slot="boat"]:hover {
    border: none;
    box-shadow: none;
    transform: none;
}

.equipment-slot {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px;
    text-align: center;
    transition: none;
    min-height: 50px;
    height: 50px;
    width: 50px;
    max-width: 50px;
    max-height: 50px;
    position: relative;
    box-shadow: none;
    overflow: hidden;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
}

.equipment-slot::before {
    display: none;
}

.equipment-slot::after {
    display: none;
}

.equipment-slot:hover {
    border: none;
    transform: none;
}

.equipment-slot:hover::after {
    opacity: 0;
}

.slot-label {
    display: none;
}

.slot-content {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.slot-content .equipment-enhancement-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(243, 156, 18, 0.95);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    box-shadow:
        0 2px 6px rgba(243, 156, 18, 0.6),
        0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid #f39c12;
    z-index: 3;
    text-shadow: 0 0 4px rgba(243, 156, 18, 0.8);
    letter-spacing: 0.5px;
    pointer-events: none;
}

.slot-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: none;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
}

.slot-content img:hover {
    transform: none;
    box-shadow: none;
}

/* Equipment Sub-tabs */
.equipment-sub-tabs {
    display: flex;
    gap: 5px;
    padding: 5px 0 0 0;
    border-bottom: none;
    background: transparent;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    justify-content: center;
}

.equipment-sub-tab {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(60, 60, 60, 0.5);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
}

.equipment-sub-tab:hover {
    background: rgba(40, 40, 40, 0.8);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(80, 80, 80, 0.7);
}

.equipment-sub-tab.active {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #ffffff;
    border-color: rgba(100, 100, 100, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.equipment-sub-tab-content {
    display: none;
    padding: 15px;
    padding-top: 35px;
    /* Add top padding to account for sub-tabs */
    overflow-y: auto;
    flex: 1;
    position: relative;
}

.equipment-sub-tab-content.active {
    display: block;
}

/* Medals Section */
.medals-section {
    width: 100%;
}

.medals-section h4 {
    margin: 0 0 15px 0;
    color: #f4e4c1;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.medals-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 5px;
}

.medal-slot {
    background: transparent;
    border: 2px solid rgba(60, 60, 60, 0.5);
    border-radius: 6px;
    padding: 2px;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 40px;
    height: 40px;
    width: 40px;
    max-width: 40px;
    max-height: 40px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
}

.medal-slot:hover {
    border-color: rgba(100, 100, 100, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.medal-slot img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

.medal-slot .empty-slot {
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.3);
    border-radius: 4px;
}

.medal-slot[data-is-equipment="true"] {
    border-color: rgba(212, 175, 55, 0.5);
}

.medal-slot[data-is-equipment="true"]:hover {
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.slot-content .item-name {
    display: none;
}

.empty-slot {
    color: transparent;
    font-style: normal;
    font-size: 0;
    font-weight: normal;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    display: block;
    min-height: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Inventory Section - Updated & Optimized */
.inventory-section {
    flex: 1;
    min-height: 0;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 400px;
    padding: 15px;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto;
    /* Disable smooth scroll for better performance */
}

.inventory-grid::-webkit-scrollbar {
    width: 6px;
}

.inventory-grid::-webkit-scrollbar-track {
    background: #000000;
}

.inventory-grid::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 3px;
}

/* Inventory Pagination */
.inventory-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.pagination-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.inventory-slot {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px;
    text-align: center;
    cursor: pointer;
    transition: none;
    /* Remove all transitions for smoothness */
    position: relative;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    z-index: 1;
    color: #ffffff;
    box-sizing: border-box;
    width: 100%;
}

.inventory-slot:hover {
    border: none;
    transform: none;
    /* Remove transform on hover */
}

.inventory-slot.occupied {
    background: transparent;
    border: none;
    position: relative;
}

.inventory-slot.occupied:hover {
    border: none;
}

.inventory-slot.equipped {
    background: transparent;
    border: none;
}

.inventory-slot.equipped:hover {
    border: none;
}

/* Enhancement Effect Animation */
.enhancement-effect {
    position: absolute;
    top: 20;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
    opacity: 0.9;
    border-radius: 0;
}

/* Enhancement effect for equipment slots */
.equipment-slot .enhancement-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.equipped-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ff0000;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    box-shadow:
        0 2px 6px rgba(255, 0, 0, 0.6),
        0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid #ff0000;
    z-index: 3;
    text-shadow: 0 0 4px rgba(255, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

.enhancement-level {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(243, 156, 18, 0.95);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    box-shadow:
        0 2px 6px rgba(243, 156, 18, 0.6),
        0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid #f39c12;
    z-index: 3;
    text-shadow: 0 0 4px rgba(243, 156, 18, 0.8);
    letter-spacing: 0.5px;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.inventory-slot img {
    max-width: 40px;
    max-height: 40px;
    border-radius: 4px;
    border: none;
    z-index: 2;
    pointer-events: none;
}

.inventory-slot .item-name {
    display: none;
}

.inventory-slot .item-count {
    font-size: 0.75rem;
    color: #fff;
    background: linear-gradient(135deg, #666, #888);
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 1px;
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 10px;
    text-align: center;
    font-weight: 700;
    box-shadow:
        0 1px 4px rgba(100, 100, 100, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 3;
}

.inventory-slot .rarity-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 3;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    to {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 8px currentColor;
    }
}

.rarity-common {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: #9e9e9e;
}

.rarity-uncommon {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: #4caf50;
}

.rarity-rare {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: #2196f3;
}

.rarity-epic {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: #9c27b0;
}

.rarity-legendary {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #ff9800;
}

.rarity-mythic {
    background: linear-gradient(135deg, #ff1493, #c71585);
    color: #ff1493;
}

/* Inventory button styles are now in game.css as minimap-button */
/* This section is kept for backward compatibility but should not be used */

/* Inventory Section with Weight in Header */
.inventory-section {
    flex: 1;
    position: relative;
}

.inventory-header-with-weight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.inventory-header-with-weight h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #666, #888) 1;
    padding-bottom: 10px;
    position: relative;
}

.inventory-header-with-weight h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #666, #888);
    border-radius: 2px;
}

/* Buy inventory slot button */
.buy-slot-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.buy-slot-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.buy-slot-btn:active {
    transform: scale(0.95);
}

.buy-slot-btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.inventory-slot-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 6px;
    border: 1px solid rgba(60, 60, 60, 0.5);
    min-width: 50px;
    text-align: center;
}

/* Weight Display - Header Style */
.weight-display-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.weight-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.current-weight {
    color: #4CAF50;
    font-weight: 700;
}

.weight-separator {
    color: #888;
    font-weight: 400;
}

.max-weight {
    color: #2196F3;
    font-weight: 700;
}

.weight-bar {
    width: 150px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
}

.weight-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Removed shimmer effect for simplicity */

/* Item weight display in slots */
.inventory-slot .item-weight {
    display: none;
}

/* Tooltip weight display */
.item-weight {
    color: #4CAF50;
    font-weight: 600;
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Guild system */
.guilds-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guild-sub-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.guild-sub-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.guild-sub-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.12);
}

.guild-sub-content {
    display: none;
}

.guild-sub-content.active {
    display: block;
}

.guild-panel {
    background: rgba(18, 20, 27, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.guild-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.guild-header-text h4 {
    margin: 0;
    color: #f5f6fa;
}

.guild-gold-text {
    margin: 6px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.guild-gold-text.small {
    font-size: 12px;
    opacity: 0.75;
}

.guild-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guild-primary-btn,
.guild-secondary-btn,
.guild-card-action {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.guild-primary-btn {
    background: linear-gradient(120deg, #ff7a18, #ffb347);
    color: #141820;
    box-shadow: 0 6px 16px rgba(255, 122, 24, 0.4);
}

.guild-secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #f5f6fa;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.guild-primary-btn:hover,
.guild-secondary-btn:hover,
.guild-card-action:hover {
    transform: translateY(-1px);
}

.guild-own-container {
    margin-top: 16px;
}

.guild-design-container,
.guild-contribution-container {
    margin-top: 16px;
}

.guild-design-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.guild-design-tab {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s;
}

.guild-design-tab.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.guild-design-tab-content {
    display: none;
}

.guild-design-tab-content.active {
    display: block;
}

.guild-design-grid,
.guild-contribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.guild-design-grid.two-col {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.guild-design-card,
.guild-contribution-card {
    background: rgba(6, 8, 14, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-design-card.full {
    grid-column: 1 / -1;
}

.guild-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guild-form-group label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.guild-form-group input,
.guild-form-group textarea,
.guild-form-group select {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
}

.guild-form-group textarea {
    min-height: 90px;
}

.guild-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guild-design-note {
    margin: 0 0 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.guild-color-input {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.guild-color-code {
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.guild-logo-select {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.guild-logo-chip {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border 0.15s ease, transform 0.1s ease;
}

.guild-logo-chip img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.guild-logo-chip.selected {
    border-color: #ffb347;
    transform: translateY(-2px);
}

.guild-design-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guild-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.guild-color-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.guild-color-chip.selected {
    border-color: #ffb347;
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(255, 179, 71, 0.25);
}

.guild-color-chip.premium {
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    position: relative;
}

.guild-color-chip.premium::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffd32a, #ff6b6b, #ff00ff);
    opacity: 0.8;
    z-index: -1;
}

.guild-color-chip.premium .color-swatch {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.color-swatch {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.color-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.color-name {
    font-weight: 600;
}

.color-cost {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.guild-contribution-card h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #f5f6fa;
}

.guild-contribution-card strong {
    font-size: 20px;
    color: #ffb347;
}

.guild-contribution-card p {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.guild-contribution-card p span {
    color: #ffb347;
    font-weight: 600;
}

.guild-contribution-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.guild-contribution-actions .guild-form-group {
    flex: 1;
    min-width: 220px;
}

.guild-contribution-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
}

.guild-list {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.guild-card {
    background: rgba(11, 14, 21, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    object-fit: cover;
    background: #05070d;
}

.guild-card-title {
    margin: 0;
    font-size: 16px;
    color: #f5f6fa;
}

.guild-card-owner {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.guild-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.guild-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guild-card-action {
    flex: 1;
    text-align: center;
}

.guild-card-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.guild-card-action.join {
    background: linear-gradient(120deg, #1dd1a1, #48dbfb);
    color: #04141f;
}

.guild-card-action.leave {
    background: rgba(255, 71, 66, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 71, 66, 0.35);
}

.guild-empty {
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
}

.guild-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: #f5f6fa;
}

.guild-member-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 210px;
    overflow-y: auto;
}

.guild-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.guild-member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guild-member-name {
    font-weight: 600;
    color: #f5f6fa;
}

.guild-member-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.guild-member-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.guild-role-select {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f5f6fa;
    padding: 4px 8px;
    font-size: 12px;
}

.guild-role-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.guild-card-action.small {
    padding: 6px 10px;
    font-size: 12px;
}

.guild-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.guild-modal.active {
    display: flex;
}

.guild-modal-content {
    width: min(520px, 100%);
    background: rgba(11, 13, 20, 0.98);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.guild-modal-header,
.guild-modal-actions {
    flex-shrink: 0;
}

.guild-modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 5px;
}

/* Buy Ruby Container - Similar to Battlepass */
.buy-ruby-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none;
}

.buy-ruby-container.active {
    display: flex;
    pointer-events: auto;
}

/* Disable touch controls when buy ruby is open */
.buy-ruby-container.active~.touch-controls,
.buy-ruby-container.active+* .touch-controls,
body .buy-ruby-container.active~.touch-controls {
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 0.3;
}

.buy-ruby-container.active * {
    pointer-events: auto;
}

/* Buy Ruby Panel */
.buy-ruby-panel {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Buy Ruby Header */
.buy-ruby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.85);
}

.buy-ruby-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.buy-ruby-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.buy-ruby-close:hover {
    opacity: 0.7;
}

/* Buy Ruby Content */
.buy-ruby-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.buy-ruby-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.buy-ruby-tab {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.buy-ruby-tab:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 179, 71, 0.4);
}

.buy-ruby-tab.active {
    background: linear-gradient(135deg, #ffb347 0%, #ff8c42 100%);
    color: #1a1a1a;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(255, 179, 71, 0.35);
}

.buy-ruby-tab-content {
    display: none;
}

.buy-ruby-tab-content.active {
    display: block;
}

.buy-ruby-error-message {
    min-height: 18px;
    font-size: 13px;
    color: #ff6b6b;
    margin-top: 10px;
}

.buy-ruby-success-message {
    min-height: 18px;
    font-size: 13px;
    color: #51cf66;
    margin-top: 10px;
}

.ruby-convert-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.ruby-convert-rate {
    color: #ffb347;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 14px;
}

.ruby-convert-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.ruby-convert-package {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: all 0.25s ease;
}

.ruby-convert-package:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(52, 211, 153, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

.ruby-convert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.ruby-convert-header h4 {
    margin: 0;
    color: #f5f6fa;
    font-size: 17px;
    font-weight: 600;
}

.ruby-convert-gold {
    color: #34d399;
    font-weight: 700;
    margin-bottom: 12px;
}

.ruby-convert-btn {
    width: 100%;
    padding: 10px 12px;
    background: url('/public/assets/icon/ui/button.webp') center/cover no-repeat;
    border: none;
    border-radius: 8px;
    color: #0b0d14;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.ruby-convert-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.ruby-convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.guild-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.guild-modal-header h3 {
    margin: 0;
    color: #f5f6fa;
}

.guild-modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.guild-modal-body label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

#guild-name-input,
#guild-description-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    color: #f5f6fa;
    font-size: 14px;
}

#guild-description-input {
    min-height: 70px;
    resize: vertical;
}

.guild-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    max-height: 210px;
    overflow-y: auto;
}

.guild-logo-option {
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.guild-logo-option img {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.guild-logo-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.guild-logo-option.selected {
    border-color: #ffb347;
    box-shadow: 0 0 12px rgba(255, 179, 71, 0.35);
}

.guild-modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.guild-error-message {
    min-height: 18px;
    font-size: 13px;
    color: #ff6b6b;
}

.guild-success-message {
    min-height: 18px;
    font-size: 13px;
    color: #51cf66;
    margin-top: 10px;
}

/* Buy Ruby Modal Styles */
.buy-ruby-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.ruby-package {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ruby-package:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 179, 71, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 179, 71, 0.2);
}

.ruby-package-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ruby-package-header h4 {
    margin: 0;
    color: #f5f6fa;
    font-size: 18px;
    font-weight: 600;
}

.ruby-package-price {
    color: #ffb347;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.ruby-buy-btn {
    width: 100%;
    padding: 10px 16px;
    background: url('/public/assets/icon/ui/button.webp') center/cover no-repeat;
    border: none;
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ruby-buy-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.ruby-buy-btn:active {
    transform: scale(0.98);
}

.ruby-buy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Buy Ruby QR Modal */
.buy-ruby-qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 20px;
}

.buy-ruby-qr-modal.active {
    display: flex;
}

.buy-ruby-qr-content {
    width: min(400px, 100%);
    max-height: 90vh;
    background: rgba(11, 13, 20, 0.98);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.buy-ruby-qr-header {
    margin-bottom: 20px;
}

.buy-ruby-qr-header h3 {
    margin: 0 0 8px 0;
    color: #f5f6fa;
    font-size: 20px;
}

.buy-ruby-qr-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.buy-ruby-bank-info {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    color: #3498db;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.buy-ruby-qr-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 20px auto;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.buy-ruby-transfer-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.buy-ruby-transfer-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 8px;
    text-align: center;
}

.buy-ruby-account-name {
    color: #ffb347;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

.buy-ruby-qr-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.buy-ruby-qr-close-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #f5f6fa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.buy-ruby-qr-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.guild-bank-section {
    margin-top: 18px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-summary-row {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.guild-bank-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.guild-bank-stats strong {
    color: #f5f6fa;
}

.guild-bank-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guild-bank-actions.leader {
    margin-top: 10px;
}

.guild-contribute-input {
    flex: 1;
    min-width: 140px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
}

.guild-contribution-list {
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.guild-transfer-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.guild-transfer-select {
    flex: 1;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    padding: 8px 10px;
}

/* Guild Approval Tab Styles */
.guild-approval-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-approval-info {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.guild-approval-info strong {
    color: #ffb347;
}

.guild-card-action.approve {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.guild-card-action.approve:hover {
    background: rgba(46, 204, 113, 0.3);
}

.guild-card-action.reject {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

.guild-card-action.reject:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* Guild Upgrade Tab Styles */
.guild-upgrade-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guild-upgrade-card {
    background: rgba(11, 13, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
}

.guild-upgrade-card h5 {
    margin: 0 0 16px 0;
    color: #f5f6fa;
    font-size: 16px;
    font-weight: 600;
}

.guild-upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.guild-upgrade-info p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.guild-upgrade-info strong {
    color: #ffb347;
    font-weight: 600;
}

.guild-upgrade-current,
.guild-upgrade-next,
.guild-upgrade-cost,
.guild-upgrade-bank {
    color: rgba(255, 255, 255, 0.9) !important;
}

.guild-upgrade-max {
    color: rgba(255, 255, 255, 0.7) !important;
    font-style: italic;
}

@media (max-width: 768px) {
    .guild-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .guild-header-actions {
        width: 100%;
    }

    .guild-card-actions {
        flex-direction: column;
    }

    .guild-card-action {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .inventory-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px);
        max-width: none;
        max-height: 95vh;
        transform: translate(-50%, -50%) scale(0.80);
    }

    .inventory-panel.active {
        transform: translate(-50%, -50%) scale(0.80) !important;
    }

    .inventory-tabs-vertical {
        width: 70px;
        padding: 10px 0;
        overflow-x: hidden;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
    }

    .inventory-tabs-vertical::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .inventory-tab-vertical {
        padding: 10px;
        margin: 0 8px;
        width: 54px;
        min-height: 50px;
    }

    .inventory-tab-vertical .tab-icon {
        font-size: 1.4rem;
    }

    .inventory-tab-vertical .tab-text {
        display: none;
    }

    .inventory-content-wrapper .inventory-tab-content {
        padding: 15px;
        gap: 15px;
    }

    /* Equipment grid giữ nguyên layout và kích thước như PC - FORCE */
    .equipment-section .equipment-grid {
        display: grid !important;
        grid-template-columns: auto auto auto !important;
        grid-template-rows: auto auto auto auto auto !important;
        max-width: 280px !important;
        gap: 3px !important;
        padding: 5px !important;
        width: 100% !important;
        margin: 0 auto !important;
        align-items: center !important;
        justify-items: center !important;
    }

    /* Đảm bảo các slot ở đúng vị trí trên mobile - FORCE - giống PC */
    .equipment-section .character-display {
        grid-column: 2 !important;
        grid-row: 2 / span 3 !important;
        width: 80px !important;
        min-height: 80px !important;
        padding: 6px 8px !important;
        gap: 3px !important;
        /* Đảm bảo màu vàng giống PC */
        background:
            radial-gradient(circle at center, rgba(74, 63, 42, 0.5), rgba(43, 38, 29, 0.5)),
            linear-gradient(145deg, #3a3226 0%, #2b261d 100%) !important;
        border: 2px solid !important;
        border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1 !important;
        border-radius: 10px !important;
        box-shadow:
            0 0 15px rgba(212, 175, 55, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.4),
            inset 0 2px 4px rgba(255, 215, 0, 0.15) !important;
    }

    .equipment-section .character-display::before {
        content: '' !important;
        position: absolute !important;
        inset: 0 !important;
        background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1), transparent 60%) !important;
        border-radius: 15px !important;
        pointer-events: none !important;
    }

    .equipment-section .character-display h4 {
        color: #f4e4c1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    }

    .equipment-section .character-name {
        color: #f4e4c1 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    }

    /* Eye Slot (trên nhân vật, cột giữa hàng 1) */
    .equipment-section .equipment-slot[data-slot="eye"] {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    /* Left Column */
    .equipment-section .equipment-slot[data-slot="weapon"] {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .equipment-section .equipment-slot[data-slot="ao"] {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .equipment-section .equipment-slot[data-slot="quan"] {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    .equipment-section .equipment-slot[data-slot="giay"] {
        grid-column: 1 !important;
        grid-row: 4 !important;
    }

    .equipment-section .equipment-slot[data-slot="bongtai"] {
        grid-column: 1 !important;
        grid-row: 5 !important;
    }

    /* Right Column */
    .equipment-section .equipment-slot[data-slot="nhan"] {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }

    .equipment-section .equipment-slot[data-slot="daychuyen"] {
        grid-column: 3 !important;
        grid-row: 2 !important;
    }

    .equipment-section .equipment-slot[data-slot="character"] {
        grid-column: 3 !important;
        grid-row: 3 !important;
    }

    .equipment-section .equipment-slot[data-slot="boat"] {
        grid-column: 3 !important;
        grid-row: 4 !important;
    }

    .equipment-section .equipment-slot[data-slot="devilfruit"] {
        grid-column: 3 !important;
        grid-row: 5 !important;
    }


    .equipment-section .character-avatar {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
        /* Đảm bảo màu vàng giống PC */
        background:
            radial-gradient(circle at 30% 30%, #4a3f2a, #2b261d),
            linear-gradient(145deg, #3a3226 0%, #2b261d 100%) !important;
        border: 2px solid !important;
        border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1 !important;
        color: #f4e4c1 !important;
        box-shadow:
            0 0 12px rgba(212, 175, 55, 0.3),
            0 3px 10px rgba(0, 0, 0, 0.4),
            inset 0 2px 4px rgba(255, 215, 0, 0.2) !important;
    }

    .equipment-section .character-avatar::before {
        content: '' !important;
        position: absolute !important;
        inset: -3px !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, #d4af37, transparent, #d4af37) !important;
        opacity: 0.3 !important;
        z-index: -1 !important;
    }

    .equipment-section .character-display h4 {
        font-size: 0.65rem !important;
    }

    .equipment-section .character-name {
        font-size: 0.6rem !important;
    }

    .inventory-header-with-weight {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .weight-display-header {
        align-items: flex-start;
        width: 100%;
    }

    .weight-info {
        justify-content: flex-start;
    }

    .weight-bar {
        width: 100%;
    }

    .inventory-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        padding: 10px;
    }
}

/* phước inventory màn hình ngang trên điện thoại */
/* Màn hình ngang có chiều cao thấp (ví dụ: width ~1008, height ~434) – thu nhỏ panel + ô trang bị */
@media (max-height: 500px) and (orientation: landscape) {
    .inventory-panel {
        height: calc(100vh + 70px) !important;
        max-height: 99vh !important;
        transform: translate(-50%, -50%) scale(0.75) !important;
    }

    .inventory-panel.active {
        transform: translate(-50%, -50%) scale(0.75) !important;
    }


    .equipment-section .equipment-slot {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        padding: 4px !important;
    }
}

@media (max-width: 480px) {
    .inventory-panel {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        max-width: none;
        max-height: none;
        border-radius: 12px;
        transform: translate(-50%, -50%) scale(0.75);
    }

    .inventory-panel.active {
        transform: translate(-50%, -50%) scale(0.75) !important;
    }


    .inventory-tabs-vertical {
        flex-direction: column;
        width: 38px;
        min-width: 38px;
        padding: 3px 1px;
        gap: 2px;
        border-right: 1px solid rgba(60, 60, 60, 0.6);
        border-bottom: none;
        justify-content: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
    }

    .inventory-tabs-vertical::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .inventory-tab-vertical {
        padding: 3px;
        margin: 0 1px;
        width: 32px;
        min-width: 32px;
        min-height: 28px;
    }

    .inventory-tab-vertical .tab-text {
        display: none;
    }

    .inventory-tab-vertical .tab-icon {
        font-size: 0.85rem;
    }

    .inventory-tab-vertical .tab-icon img {
        width: 16px;
        height: 16px;
    }

    .inventory-body {
        flex-direction: row;
    }

    .inventory-content-wrapper {
        width: 100%;
    }

    .inventory-content-wrapper .inventory-tab-content {
        padding: 0;
        gap: 0;
    }

    /* Equipment grid giữ nguyên layout và kích thước như PC - FORCE */
    .equipment-section .equipment-grid {
        display: grid !important;
        grid-template-columns: auto auto auto !important;
        grid-template-rows: auto auto auto auto auto !important;
        max-width: 280px !important;
        gap: 3px !important;
        padding: 5px !important;
        width: 100% !important;
        margin: 0 auto !important;
        align-items: center !important;
        justify-items: center !important;
    }

    /* Đảm bảo các slot ở đúng vị trí trên mobile - FORCE - giống PC */
    .equipment-section .character-display {
        grid-column: 2 !important;
        grid-row: 2 / span 3 !important;
        width: 80px !important;
        min-height: 80px !important;
        padding: 4px 6px !important;
        gap: 2px !important;
        /* Đảm bảo màu vàng giống PC */
        background:
            radial-gradient(circle at center, rgba(74, 63, 42, 0.5), rgba(43, 38, 29, 0.5)),
            linear-gradient(145deg, #3a3226 0%, #2b261d 100%) !important;
        border: 2px solid !important;
        border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1 !important;
        border-radius: 10px !important;
        box-shadow:
            0 0 15px rgba(212, 175, 55, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.4),
            inset 0 2px 4px rgba(255, 215, 0, 0.15) !important;
    }

    .equipment-section .character-display::before {
        content: '' !important;
        position: absolute !important;
        inset: 0 !important;
        background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1), transparent 60%) !important;
        border-radius: 15px !important;
        pointer-events: none !important;
    }

    .equipment-section .character-display h4 {
        color: #f4e4c1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    }

    .equipment-section .character-name {
        color: #f4e4c1 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    }

    .equipment-section .equipment-slot {
        width: 70px !important;
        height: 70px !important;
        min-height: 70px !important;
        max-width: 70px !important;
        max-height: 70px !important;
        padding: 6px !important;
        aspect-ratio: 1 !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }

    /* Eye Slot (trên nhân vật, cột giữa hàng 1) */
    .equipment-section .equipment-slot[data-slot="eye"] {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    /* Left Column */
    .equipment-section .equipment-slot[data-slot="weapon"] {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .equipment-section .equipment-slot[data-slot="ao"] {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .equipment-section .equipment-slot[data-slot="quan"] {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    .equipment-section .equipment-slot[data-slot="giay"] {
        grid-column: 1 !important;
        grid-row: 4 !important;
    }

    .equipment-section .equipment-slot[data-slot="bongtai"] {
        grid-column: 1 !important;
        grid-row: 5 !important;
    }

    /* Right Column */
    .equipment-section .equipment-slot[data-slot="nhan"] {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }

    .equipment-section .equipment-slot[data-slot="daychuyen"] {
        grid-column: 3 !important;
        grid-row: 2 !important;
    }

    .equipment-section .equipment-slot[data-slot="character"] {
        grid-column: 3 !important;
        grid-row: 3 !important;
    }

    .equipment-section .equipment-slot[data-slot="boat"] {
        grid-column: 3 !important;
        grid-row: 4 !important;
    }

    .equipment-section .equipment-slot[data-slot="devilfruit"] {
        grid-column: 3 !important;
        grid-row: 5 !important;
    }

    .equipment-section .slot-content img {
        max-width: 22px !important;
        max-height: 22px !important;
    }

    .equipment-section .character-avatar {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
        /* Đảm bảo màu vàng giống PC */
        background:
            radial-gradient(circle at 30% 30%, #4a3f2a, #2b261d),
            linear-gradient(145deg, #3a3226 0%, #2b261d 100%) !important;
        border: 2px solid !important;
        border-image: linear-gradient(135deg, #8b6914, #d4af37, #8b6914) 1 !important;
        color: #f4e4c1 !important;
        box-shadow:
            0 0 12px rgba(212, 175, 55, 0.3),
            0 3px 10px rgba(0, 0, 0, 0.4),
            inset 0 2px 4px rgba(255, 215, 0, 0.2) !important;
    }

    .equipment-section .character-avatar::before {
        content: '' !important;
        position: absolute !important;
        inset: -3px !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, #d4af37, transparent, #d4af37) !important;
        opacity: 0.3 !important;
        z-index: -1 !important;
    }

    .equipment-section .character-display h4 {
        font-size: 0.55rem !important;
        color: #f4e4c1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    }

    .equipment-section .character-name {
        font-size: 0.5rem !important;
        color: #f4e4c1 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    }

    .inventory-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
        padding: 0;
        max-height: 38vh;
        max-width: 145px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .inventory-slot {
        min-height: 22px;
        padding: 0;
        box-sizing: border-box;
    }

    .inventory-slot .item-name {
        font-size: 0.24rem;
    }

    .inventory-slot .item-weight {
        font-size: 0.22rem;
        padding: 0;
    }

    .inventory-slot img {
        max-width: 12px;
        max-height: 12px;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guilds-body {
        gap: 10px;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-sub-tabs {
        width: 100%;
        padding: 4px;
        gap: 3px;
        justify-content: space-between;
        flex-wrap: nowrap;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-sub-tabs::-webkit-scrollbar {
        display: none;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-sub-tab {
        padding: 6px 8px;
        font-size: 0.7rem;
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-panel {
        padding: 12px;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-card {
        padding: 10px;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-card-title {
        font-size: 14px;
    }

    .inventory-tab-content[data-tab-content="guilds"] .guild-card-actions {
        gap: 6px;
    }
}

/* Stats Tab Styles - Compact Version */
.inventory-tab-content[data-tab-content="stats"] .stats-body {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.inventory-tab-content[data-tab-content="stats"] .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0;
    flex: 1;
    align-content: start;
}

.inventory-tab-content[data-tab-content="stats"] .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #050505;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    color: #ffffff;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.inventory-tab-content[data-tab-content="stats"] .stat-item:hover {
    background: #0a0a0a;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

.inventory-tab-content[data-tab-content="stats"] .stat-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f0f;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.inventory-tab-content[data-tab-content="stats"] .stat-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.inventory-tab-content[data-tab-content="stats"] .stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.inventory-tab-content[data-tab-content="stats"] .stat-name {
    font-size: 11px;
    color: #cccccc;
    margin-bottom: 2px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-tab-content[data-tab-content="stats"] .stat-value {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.inventory-tab-content[data-tab-content="stats"] .equipped-items {
    background: #050505;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.inventory-tab-content[data-tab-content="stats"] .equipped-items h4 {
    margin: 0 0 8px 0;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.inventory-tab-content[data-tab-content="stats"] .equipped-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.inventory-tab-content[data-tab-content="stats"] .equipped-item:last-child {
    border-bottom: none;
}

.inventory-tab-content[data-tab-content="stats"] .equipped-label {
    font-weight: 600;
    color: #cccccc;
    font-size: 12px;
}

.inventory-tab-content[data-tab-content="stats"] .equipped-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 12px;
}

/* Stat Allocation Section */
.stat-allocation-section {
    background: #050505;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.stat-allocation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-allocation-section h4 {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* Compact stat points display */
.stat-points-compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-points-compact-label {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.stat-points-compact-value {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    min-width: 20px;
    text-align: center;
}

.stat-allocation-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-allocation-item {
    background: #0a0a0a;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.stat-allocation-item:hover {
    background: #101010;
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.stat-allocation-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f0f;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-allocation-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.stat-allocation-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.stat-allocation-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-bonus-value {
    font-size: 14px;
    font-weight: 700;
    color: #4CAF50;
}

.stat-allocation-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.stat-allocation-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #000000;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-allocation-btn:hover:not(:disabled) {
    background: #1a1a1a;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.stat-allocation-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.stat-allocation-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #333333;
    box-shadow: none;
}

/* Stat Allocation Info Box */
.stat-allocation-info-box {
    background: #050505;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.info-box-header {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.info-box-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

.info-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
}

/* Responsive for stats tab */
@media (max-width: 768px) {
    .inventory-tab-content[data-tab-content="stats"] .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .inventory-tab-content[data-tab-content="stats"] .stat-item {
        padding: 6px 8px;
        gap: 6px;
    }

    .inventory-tab-content[data-tab-content="stats"] .stat-icon {
        font-size: 16px;
        width: 28px;
        height: 28px;
    }

    .inventory-tab-content[data-tab-content="stats"] .stat-name {
        font-size: 10px;
    }

    .inventory-tab-content[data-tab-content="stats"] .stat-value {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stat-allocation-item {
        padding: 10px;
        gap: 8px;
    }

    .stat-allocation-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }

    .stat-allocation-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .stat-points-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .inventory-tab-content[data-tab-content="stats"] .stats-grid {
        gap: 5px;
    }

    .inventory-tab-content[data-tab-content="stats"] .stat-item {
        padding: 5px 6px;
    }
}

/* Drag and Drop Styles */
.inventory-slot.dragging,
.equipment-slot.equipment-dragging {
    opacity: 0.5;
    cursor: grabbing !important;
    transition: none;
}

.equipment-slot[data-is-equipment="true"] {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.equipment-slot[data-is-equipment="true"]:active {
    cursor: grabbing;
}

.equipment-slot .equipment-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.inventory-slot.drop-target {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.2) !important;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5) !important;
}

/* Touch Ghost Element for Mobile Drag */
.touch-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.8;
    transition: none;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.3);
    will-change: transform;
}

.touch-ghost img {
    max-width: 40px;
    max-height: 40px;
}

/* Removed pulseGlow and ghostPulse animations for better mobile performance */

.inventory-slot.occupied {
    cursor: grab;
}

.inventory-slot.occupied:active {
    cursor: grabbing;
}

/* Prevent text selection during drag */
.inventory-slot {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Drag ghost image styling */
.inventory-slot img {
    pointer-events: none;
}

/* Skills Tab Styles */
.inventory-tab-content[data-tab-content="skills"] .skills-body {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.skills-section {
    background: #050505;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.skills-section h4 {
    margin: 0 0 10px 0;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.4);
}

/* Devil Fruit Skills Container */
.devil-fruit-skills-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-skills-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 12px;
    font-size: 12px;
}

/* Skill Item in Tab */
.skill-item-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.skill-item-tab:hover {
    background: #101010;
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

.skill-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.skill-item-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.skill-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.skill-item-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.skill-item-description {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

.skill-item-stats {
    display: flex;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.skill-stat {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.skill-stat.damage {
    background: rgba(231, 76, 60, 0.3);
    color: #ff6b6b;
}

.skill-stat.cooldown {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.skill-stat.range {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

/* Innate Skills Container */
.innate-skills-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Innate Skill Item with Toggle */
.innate-skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.innate-skill-item:hover {
    background: #101010;
    border-color: rgba(138, 43, 226, 0.5);
}

.innate-skill-item.active {
    border-color: rgba(76, 175, 80, 0.8);
    background: rgba(76, 175, 80, 0.12);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.innate-skill-hint {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 600;
    margin-top: 4px;
}

.innate-skill-hint strong {
    color: #ff9800;
    font-weight: 700;
}

.innate-skill-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(75, 0, 130, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    border: 2px solid rgba(138, 43, 226, 0.5);
}

.innate-skill-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.innate-skill-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.innate-skill-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.innate-skill-description {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

.innate-skill-toggle {
    flex-shrink: 0;
}

.innate-skill-toggle .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    overflow: hidden;
}

.innate-skill-toggle .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.innate-skill-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(100, 100, 100, 0.5);
    transition: 0.4s;
    border-radius: 26px;
    border: 2px solid rgba(100, 100, 100, 0.3);
    overflow: hidden;
}

.innate-skill-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.innate-skill-toggle input:checked+.toggle-slider {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.innate-skill-toggle input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* Locked Innate Skill */
.innate-skill-item.locked {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 15, 0.7);
}

.innate-skill-item.locked:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(18, 18, 18, 0.8);
}

.innate-skill-item.locked .innate-skill-icon {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.3), rgba(60, 60, 60, 0.3));
    border-color: rgba(100, 100, 100, 0.3);
    filter: grayscale(0.8);
}

.innate-skill-item.locked .innate-skill-toggle .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.innate-skill-item.locked .innate-skill-toggle input:disabled+.toggle-slider {
    cursor: not-allowed;
}

/* Mobile Adjustments for Skills Tab */
@media (max-width: 768px) {
    .skills-section {
        padding: 12px;
    }

    .skills-section h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .skill-item-tab,
    .innate-skill-item {
        padding: 10px;
        gap: 10px;
    }

    .skill-item-icon,
    .innate-skill-icon {
        width: 42px;
        height: 42px;
    }

    .skill-item-icon img {
        width: 32px;
        height: 32px;
    }

    .skill-item-name,
    .innate-skill-name {
        font-size: 13px;
    }

    .skill-item-description,
    .innate-skill-description {
        font-size: 11px;
    }
}

/* Enhanced empty slot for drop target */
.inventory-slot.empty.drop-target {
    background: linear-gradient(145deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
}

/* Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    animation: fadeIn 0.3s ease;
}

.confirm-modal.active {
    display: flex;
}

.confirm-modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    text-align: center;
    animation: slideInLeft 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #a8783e;
    margin-top: 100px;
    margin-left: 20px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.confirm-modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {

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

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

.confirm-modal-title {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    font-family: inherit;
}

.confirm-modal-message {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 150px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-yes {
    border: 1.5px solid #9f3538;
    background: #251717;
    color: #ff4a4a;
}

.confirm-yes:hover {
    background: #351f20;
    color: #ff6b6b;
    border-color: #ff4a4a;
}

.confirm-yes:active {
    transform: scale(0.98);
}

.confirm-no {
    border: 1.5px solid #444444;
    background: #1e1e1e;
    color: #cccccc;
}

.confirm-no:hover {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #666666;
}

.confirm-no:active {
    transform: scale(0.98);
}

/* Quantity Modal - dark & compact */
.quantity-modal-content {
    max-width: 320px;
    border-radius: 14px;
    background: radial-gradient(circle at top, #333 0%, #111 55%, #050505 100%);
    border: 1px solid rgba(0, 0, 0, 0.9);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    padding: 16px 18px;
}

/* Make header & text a bit more compact inside quantity modal */
.quantity-modal-content .confirm-modal-icon {
    font-size: 38px;
    margin-bottom: 6px;
}

.quantity-modal-content .confirm-modal-title {
    font-size: 1rem;
    margin-bottom: 6px;
}

.quantity-modal-content .confirm-modal-message {
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.quantity-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 14px 0;
}

.quantity-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #222 0%, #444 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.quantity-btn:hover {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    width: 80px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.8);
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Remove arrows from number input */
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-slider-container {
    width: 100%;
    padding: 4px 0 6px 0;
    margin-bottom: 8px;
}

.quantity-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(200, 200, 200, 0.15) 0%, rgba(220, 220, 220, 0.35) 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.quantity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #fff 0%, #aaa 40%, #444 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
}

.quantity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.7);
}

.quantity-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
}

.quantity-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.7);
}

/* Titles Tab Styles */
.inventory-tab-content[data-tab-content="titles"] .titles-body {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.titles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.title-card {
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(100, 100, 100, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.title-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
}

.title-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.title-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(145deg, #3a3a4a 0%, #2a2a3a 100%);
}

.title-card.unlocked:not(.selected):hover {
    border-color: rgba(102, 126, 234, 0.8);
}

.title-image {
    width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.title-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
    text-align: center;
}

.title-description {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.3;
}

.title-task {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-bottom: 5px;
}

.title-progress {
    margin: 8px 0;
}

.title-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.title-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.title-progress-text {
    font-size: 9px;
    color: #aaa;
    text-align: center;
}

.title-status {
    font-size: 10px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.title-status.locked {
    color: #999;
    background: rgba(100, 100, 100, 0.2);
}

.title-status.unlocked {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.2);
}

.title-status.selected {
    color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    font-weight: bold;
}

.title-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.title-rarity.common {
    background: rgba(200, 200, 200, 0.3);
    color: #ccc;
}

.title-rarity.uncommon {
    background: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.title-rarity.rare {
    background: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.title-rarity.epic {
    background: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.title-rarity.legendary {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.title-rarity.mythic {
    background: rgba(255, 20, 147, 0.3);
    color: #ff1493;
}

.loading-message {
    text-align: center;
    color: #aaa;
    padding: 40px;
    font-size: 14px;
}

/* Demo Inventory Full Screen */
#demo-inventory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    /* Darken game background */
    z-index: 800;
}

.demo-inventory-header {
    background: #000;
    height: 60px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 20px;
    box-sizing: border-box;
}

.demo-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.demo-close-btn img {
    width: 32px;
    height: 32px;
}

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

.demo-close-btn img {
    width: 30px;
    height: 30px;
}

.demo-inventory-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, 90px);
    gap: 5px;
    padding: 0px 20px 20px 20px;
    justify-content: center;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    align-content: flex-start;
    z-index: 801;
    font-family: inherit;
}

/* Custom Scrollbar for demo inventory */
.demo-inventory-slots::-webkit-scrollbar {
    width: 8px;
}

.demo-inventory-slots::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.demo-inventory-slots::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.demo-inventory-slots::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.demo-slot {
    width: 90px;
    height: 90px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: content-box;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    user-select: none;
}

.demo-slot:hover {
    transform: scale(1.08);
    /* Hover enlargement */
    filter: brightness(1.2);
    /* Brightness boost */
    z-index: 10;
    /* Float above others */
}

/* Drag over visual effect */
.demo-slot.drag-over {
    transform: scale(1.15);
    filter: brightness(1.5) drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    z-index: 20;
}

.demo-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    margin-top: 0 !important;
    filter: none !important;
    z-index: 1;
    object-fit: contain !important;
}

.demo-item-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-top: 10px;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    z-index: 2;
    position: relative;
}

.demo-qty {
    bottom: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    border: 1px solid #444;
    border-radius: 4px;
    position: absolute;
    padding: 0 4px;
    box-sizing: border-box;
}

/* Lớp này dùng khi inventory được bật lên (hiệu ứng mở) */
#demo-inventory-screen.demo-active {
    animation: demoPopup 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes demoPopup {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

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

/* Pagination Row Styling */
.demo-pagination-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 5px;
}

.demo-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}

.demo-nav-btn img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.demo-nav-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.demo-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-page-num {
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.demo-page-num:hover {
    transform: scale(1.1);
}

.demo-page-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.demo-page-text {
    position: relative;
    z-index: 2;
    color: white;
    /* or whatever contrast */
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px black;
}