/* css/inventory.css - Styles for Inventory, Tetris Grid, Paperdoll Gear, Crafting, and Shop */

.inventory-container {
    overflow: visible !important;
    max-width: 1360px;
    margin: 4.5rem auto 2rem;
    padding: 0 1.5rem 4rem;
    box-sizing: border-box;
}

@media (max-width: 1400px) {
    .inventory-container {
        max-width: 100%;
        padding: 0 1rem 3rem;
    }
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
    padding: 2rem;
    margin: 5rem 1rem 1rem;
}

.login-overlay h2 {
    color: var(--gold, #d4af37);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.login-overlay p {
    color: var(--text-soft, #94a3b8);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.inventory-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 0.1rem;
    background: linear-gradient(to right, #d6b46a, #f0ddaf, #d6b46a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.inventory-subtitle {
    color: var(--text-soft, #94a3b8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.currency-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-panel, #1e1b2e);
    border: 2px solid var(--gold, #d4af37);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(214, 180, 106, 0.12);
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.65rem;
    background: var(--bg-muted, #14121f);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    min-width: 160px;
}

.currency-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.currency-info {
    text-align: left;
}

.currency-name {
    color: var(--text-soft, #94a3b8);
    font-size: 0.75rem;
    line-height: 1.1;
}

.currency-amount {
    color: var(--gold-soft, #f0ddaf);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
}

.inventory-layout {
    display: flex;
    gap: 1.25rem;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 2rem;
    box-sizing: border-box;
}

.inventory-sidebar-left {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-panel, #1e1b2e);
    border: 2px solid var(--border, #332d4a);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-height: 400px;
    box-sizing: border-box;
}

.inventory-sidebar-right {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    flex: 0 0 320px;
    background: var(--bg-panel, #1e1b2e);
    border: 2px solid var(--border, #332d4a);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    margin-bottom: 2rem;
    box-sizing: border-box;
}

.sidebar-section-title,
.inventory-sidebar-right h3 {
    color: var(--gold, #d4af37);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    border-bottom: 1px solid rgba(214, 180, 106, 0.2);
    padding-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-vitals-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.status-stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-stat-title {
    color: var(--text-soft, #94a3b8);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-stat-val {
    color: var(--gold-soft, #f0ddaf);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: monospace;
}

.bar-container {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    height: 14px;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.energy-bar {
    background: linear-gradient(90deg, #059669, #10b981, #34d399);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.hunger-bar {
    background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.thirst-bar {
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.gear-paperdoll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.gear-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.gear-slot {
    width: 62px;
    height: 62px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed rgba(214, 180, 106, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gear-slot:hover,
.gear-slot.active-hover {
    border-color: var(--gold, #d4af37);
    background: rgba(214, 180, 106, 0.15);
    box-shadow: 0 0 10px rgba(214, 180, 106, 0.3);
}

.gear-slot::before {
    content: attr(data-label);
    position: absolute;
    bottom: 3px;
    font-size: 0.65rem;
    color: var(--text-faint, #718096);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    pointer-events: none;
    font-weight: 600;
}

.gear-slot[data-slot="Head"]::after { content: '🪖'; font-size: 1.6rem; opacity: 0.3; pointer-events: none; margin-bottom: 8px; }
.gear-slot[data-slot="Chest"]::after { content: '🦺'; font-size: 1.6rem; opacity: 0.3; pointer-events: none; margin-bottom: 8px; }
.gear-slot[data-slot="MainHand"]::after { content: '⚔️'; font-size: 1.6rem; opacity: 0.3; pointer-events: none; margin-bottom: 8px; }
.gear-slot[data-slot="OffHand"]::after { content: '🛡️'; font-size: 1.6rem; opacity: 0.3; pointer-events: none; margin-bottom: 8px; }
.gear-slot[data-slot="Accessory"]::after { content: '💍'; font-size: 1.6rem; opacity: 0.3; pointer-events: none; margin-bottom: 8px; }

.gear-slot .tetris-item {
    position: absolute !important;
    inset: -2px !important;
    width: calc(100% + 4px) !important;
    height: calc(100% + 4px) !important;
    border-radius: 8px !important;
    font-size: 1.8rem;
    margin: 0;
    cursor: grab;
    z-index: 5;
    background: rgba(30, 27, 46, 0.95);
}

.error-msg {
    color: #ff4a4a;
    font-weight: bold;
    text-align: center;
    margin-top: 0.4rem;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.error-msg.show {
    opacity: 1;
}

.backpack-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.backpack-header h2 {
    color: var(--gold, #d4af37);
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.weight-limit {
    font-size: 1rem;
    color: var(--text-soft, #94a3b8);
    font-weight: normal;
}

.sort-controls select {
    background: var(--bg-muted, #14121f);
    color: var(--text-soft, #94a3b8);
    border: 1px solid var(--border, #332d4a);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    min-width: 130px;
    transition: border-color 0.2s ease;
}

.sort-controls select:hover {
    border-color: var(--gold-soft, #f0ddaf);
}

.inventory-main {
    display: flex;
    flex-direction: column;
    user-select: none;
    flex-shrink: 0;
    overflow: visible;
}

.tetris-grid {
    box-sizing: content-box !important;
    position: relative;
    background-color: var(--bg-panel, #1e1b2e);
    border: 2px solid var(--border, #332d4a);
    border-radius: 8px;
    background-image: linear-gradient(var(--bg-muted, #14121f) 1px, transparent 1px), linear-gradient(90deg, var(--bg-muted, #14121f) 1px, transparent 1px);
    background-size: 60px 60px;
    width: 480px;
    height: 480px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
    transition: height 0.3s ease;
}

.inventory-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    background-color: var(--bg-muted, #14121f);
    color: var(--text, inherit);
    border: 2px solid var(--border, #332d4a);
    padding: 8px 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 125px;
    text-align: center;
}

.tab-btn:hover {
    border-color: var(--gold-soft, #f0ddaf);
    background-color: rgba(214, 180, 106, 0.08);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(180deg, rgba(214, 180, 106, 0.15), var(--bg-panel, #1e1b2e));
    color: var(--gold, #d4af37);
    border-color: var(--gold, #d4af37);
    box-shadow: 0 2px 12px rgba(214, 180, 106, 0.25);
}

.crafting-layout {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 1200px) { .recipe-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .recipe-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .recipe-grid { grid-template-columns: 1fr; } }

.recipe-card {
    background-color: var(--bg-panel, #1e1b2e);
    border: 1px solid var(--border, #332d4a);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recipe-card.disabled {
    opacity: 0.6;
}

.recipe-card .item-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.recipe-card .item-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gold, #d4af37);
    margin-bottom: 10px;
}

.ingredients {
    text-align: left;
    margin-bottom: 15px;
    font-size: 0.95rem;
    background: var(--bg-muted, #14121f);
    padding: 10px;
    border-radius: 4px;
}

.ingredient {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.ingredient.missing { color: #ff4a4a; }
.ingredient.have { color: #2ecc71; }

.craft-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background 0.2s;
}

.craft-btn:disabled {
    background-color: var(--bg-muted, #14121f);
    color: var(--text-faint, #718096);
    cursor: not-allowed;
}

.craft-btn:hover:not(:disabled) {
    background-color: #2ecc71;
}

#message-box {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    max-width: 620px;
    width: calc(100% - 32px);
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 12px;
    display: none;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    line-height: 1.5;
    animation: toastPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastPopIn {
    from {
        opacity: 0;
        transform: translate(-50%, -15px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

#message-box.success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    color: #ecfdf5;
    border: 1px solid #10b981;
}

#message-box.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #b91c1c 100%);
    color: #fef2f2;
    border: 1px solid #ef4444;
}

#message-box.critical-success {
    background: linear-gradient(135deg, #78350f 0%, #92400e 50%, #b45309 100%);
    color: #fffbeb;
    border: 1px solid #f59e0b;
}

.message-box-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}

.message-box-body {
    flex: 1;
    min-width: 0;
    text-align: left;
    word-break: break-word;
}

.message-box-close-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    line-height: 1;
    padding: 0;
}

.message-box-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.modal-alert-success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    border: 1px solid #10b981;
    color: #ecfdf5;
}

.modal-alert-error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid #ef4444;
    color: #fef2f2;
}

.tetris-item {
    position: absolute;
    background: rgba(214, 180, 106, 0.15);
    border: 1px solid var(--gold, #d4af37);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-size: 2.5rem;
    color: var(--text, #f8fafc);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.tetris-item:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(214, 180, 106, 0.3);
}

.tetris-item span {
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tetris-item:active {
    cursor: grabbing;
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.tetris-item.invalid { background: rgba(222, 74, 74, 0.4); border-color: #ff4a4a; }
.tetris-item.dragging { background: rgba(46, 204, 113, 0.4) !important; border-color: #2ecc71 !important; z-index: 1000 !important; }
.tetris-item.dragging.invalid { background: rgba(231, 76, 60, 0.4) !important; border-color: #e74c3c !important; }
.tetris-item.locked {
    background: rgba(255, 215, 0, 0.35);
    border-color: #fff;
    box-shadow: 0 0 12px rgba(214, 180, 106, 0.8), inset 0 0 10px rgba(214, 180, 106, 0.5);
    z-index: 10;
}

.tetris-tooltip-name {
    font-size: 0.72rem;
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 1px 6px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    max-width: calc(100% - 8px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-sizing: border-box;
}

.info-panel-content {
    color: var(--text-soft, #94a3b8);
    font-size: 0.85rem;
    line-height: 1.6;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    color: var(--gold, #d4af37);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border, #332d4a);
}

.info-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.4rem;
}

.info-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
}

.info-label {
    font-weight: 600;
    color: var(--text-soft, #94a3b8);
}

/* Shop Layout inside Inventory */
.shop-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 900px) { .shop-container { grid-template-columns: 1fr; } }

.shop-main {
    background: var(--bg-panel, #1e1b2e);
    border: 1px solid var(--border, #332d4a);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
    min-width: 0;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #332d4a);
    padding-bottom: 12px;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-muted, #14121f);
    padding: 4px;
    border-radius: 8px;
}

.shop-tab {
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-soft, #94a3b8);
    transition: all 0.2s;
    user-select: none;
}

.shop-tab.active {
    background: var(--gold, #d4af37);
    color: #0b0f19;
    box-shadow: 0 2px 8px rgba(214, 180, 106, 0.4);
}

.shop-cat-btn {
    background: var(--bg-muted, #14121f);
    border: 1px solid var(--border, #332d4a);
    color: var(--text-soft, #94a3b8);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.shop-cat-btn:hover {
    background: rgba(214, 180, 106, 0.15);
    color: var(--text, #f8fafc);
    border-color: var(--gold, #d4af37);
}

.shop-cat-btn.active {
    background: var(--gold, #d4af37);
    color: #0b0f19;
    font-weight: bold;
    border-color: var(--gold, #d4af37);
    box-shadow: 0 2px 8px rgba(214, 180, 106, 0.3);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
    box-sizing: border-box;
}

.shop-item {
    background: var(--bg-card, var(--bg-panel, #1e1b2e));
    border: 1px solid var(--border, #332d4a);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    min-height: 120px;
    box-sizing: border-box;
}

.shop-item:hover {
    border-color: var(--gold, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 180, 106, 0.2);
    background: rgba(214, 180, 106, 0.08);
}

.shop-item.selected {
    border-color: var(--gold, #d4af37);
    background: rgba(214, 180, 106, 0.18);
    box-shadow: 0 0 12px rgba(214, 180, 106, 0.4);
}

.shop-item .item-icon { font-size: 1.9rem; margin-bottom: 5px; line-height: 1; }
.shop-item .item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text, #1a1a2a);
    margin-bottom: 4px;
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
    max-width: 100%;
}
.shop-item .item-price { font-size: 0.8rem; font-weight: bold; color: var(--gold, #d4af37); }
.shop-item .equip-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #3b82f6;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-item .equip-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    white-space: nowrap;
    z-index: 10;
}

.shop-item .equip-indicator:hover .equip-tooltip { display: block; }

.info-panel {
    background: var(--bg-panel, #1e1b2e);
    border: 1px solid var(--border, #332d4a);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    min-width: 0;
}

.info-panel h3 {
    color: var(--gold, #d4af37);
    margin: 0 0 10px;
    border-bottom: 1px solid var(--border, #332d4a);
    padding-bottom: 8px;
    text-align: center;
}

.info-panel .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.info-panel .stat-label { color: var(--text-soft, #94a3b8); }
.info-panel .stat-val { color: var(--text, #f8fafc); font-weight: 600; }

.buy-btn, .sell-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.buy-btn { background: #10b981; color: #fff; }
.buy-btn:hover:not(:disabled) { background: #059669; }
.sell-btn { background: #ef4444; color: #fff; }
.sell-btn:hover:not(:disabled) { background: #dc2626; }
.buy-btn:disabled, .sell-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: var(--bg-panel, #1e1b2e);
    border: 2px solid var(--border, #332d4a);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #332d4a);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.modal-header h3 { color: var(--gold, #d4af37); margin: 0; font-size: 1.2rem; }
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-soft, #94a3b8);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text, #f8fafc); }

/* Embedded Mode inside Exploration Iframe */
body.is-embedded .navbar,
body.is-embedded footer,
body.is-embedded .inventory-title,
body.is-embedded .inventory-subtitle,
body.is-embedded .inventory-header h1,
body.is-embedded .inventory-header p {
    display: none !important;
}

body.is-embedded .inventory-container {
    margin: 0 auto !important;
    padding: 0.5rem 0.75rem !important;
    box-shadow: none !important;
    max-width: 100% !important;
}

body.is-embedded .currency-bar {
    margin-bottom: 0.5rem !important;
    padding: 0.3rem 0.6rem !important;
}

body.is-embedded .inventory-tabs {
    margin-bottom: 0.5rem !important;
}

body.is-embedded .tab-btn {
    padding: 6px 18px !important;
    font-size: 0.95rem !important;
    min-width: 90px !important;
}

body.is-embedded .inventory-layout {
    margin-bottom: 0.5rem !important;
}

.global-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--gold, #d4af37);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 0.85rem;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: none;
}
.global-tooltip h4 {
    margin: 0 0 8px 0;
    color: var(--gold, #d4af37);
    font-size: 1rem;
}
.global-tooltip p {
    margin: 4px 0;
    color: var(--text-soft, #94a3b8);
}
.global-tooltip .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}
