/* ============================================================
   MARKETPLACE — Estilos do mercado de personagens
   ============================================================ */

/* ---- Seção principal ---- */
#marketplace {
    padding: 40px 0 80px;
    position: relative;
    z-index: 1;
}

.marketplace-header {
    text-align: center;
    margin-bottom: 44px;
    padding: 48px 20px 44px;
    position: relative;
    overflow: hidden;
}

/* Brilho radial atrás do título */
.marketplace-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(226,201,126,0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Linha decorativa superior */
.marketplace-header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.marketplace-header-ornament .orn-line {
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(226,201,126,0.5));
}

.marketplace-header-ornament .orn-line.right {
    background: linear-gradient(to left, transparent, rgba(226,201,126,0.5));
}

.marketplace-header-ornament .orn-diamond {
    display: flex;
    gap: 6px;
    align-items: center;
}

.marketplace-header-ornament .orn-diamond span {
    width: 5px;
    height: 5px;
    background: #e2c97e;
    transform: rotate(45deg);
    display: block;
    opacity: 0.7;
}

.marketplace-header-ornament .orn-diamond span:first-child,
.marketplace-header-ornament .orn-diamond span:last-child {
    width: 3px;
    height: 3px;
    opacity: 0.4;
}

.marketplace-header h1 {
    font-family: var(--font-accent-bold, 'Cinzel', serif);
    font-size: 2.6rem;
    color: #e2c97e;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin: 0 0 6px;
    line-height: 1;
    position: relative;
    /* Shimmer animado */
    background: linear-gradient(100deg,
        #c9a84c 0%,
        #f5e199 35%,
        #e2c97e 50%,
        #f5e199 65%,
        #c9a84c 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: mp-title-shimmer 4s linear infinite;
}

@keyframes mp-title-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* Subtítulo com linha separadora */
.marketplace-header-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
}

.marketplace-header-sub .sub-line {
    width: 40px;
    height: 1px;
    background: rgba(226,201,126,0.3);
}

.marketplace-header-sub p {
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin: 0;
}

/* ---- Barra de filtros ---- */
.marketplace-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 20px;
}

.marketplace-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.marketplace-filters label {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.marketplace-filters .form-control {
    flex: 1;
    padding: 9px 14px;
    font-size: 0.875rem;
}

.filter-count {
    color: rgba(255,255,255,0.35);
    font-size: 0.85rem;
    margin-left: auto;
    white-space: nowrap;
}

/* ---- Grid de cards ---- */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    overflow: visible;
}

/* ---- Card de personagem ---- */
.char-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: visible; /* tooltip precisa sair do card */
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}

.char-card:hover {
    border-color: rgba(226,201,126,0.35);
    transform: translateY(-2px);
    z-index: 10;
}

.char-card-header {
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.char-card-class-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

/* No new layout this is handled by .char-card-top + .char-card-info */

.char-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: #e2c97e;
    font-weight: 700;
    line-height: 1.2;
}

.char-card-level {
    background: rgba(226,201,126,0.15);
    color: #e2c97e;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-noblesse {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(109,40,217,0.15));
    border: 1px solid rgba(139,92,246,0.45);
    color: #c4b5fd;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Filtro Noblesse — toggle pill */
.filter-group--toggle {
    flex: 0 0 auto;
    min-width: auto;
}
.filter-noblesse-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.3);
    color: rgba(196,181,253,0.6);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(139,92,246,0.05);
}
.filter-noblesse-label:hover {
    border-color: rgba(139,92,246,0.6);
    color: #c4b5fd;
    background: rgba(139,92,246,0.12);
}
.filter-noblesse-label.active {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.7);
    color: #c4b5fd;
}

.char-card-class {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.char-card-stats {
    display: flex;
    gap: 14px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.char-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.char-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.char-stat-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ---- Equipamentos no card ---- */
.char-card-equipment {
    padding: 12px 18px;
    flex: 1;
    overflow: visible;
}

.equipment-title {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.equipment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---- Ícone de item com tooltip ---- */
.item-icon-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    cursor: pointer;
}

.item-icon-wrap img {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.4);
    display: block;
}

.item-icon-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    border: 1px dashed rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
    font-size: 10px;
}

.item-enchant-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(226,201,126,0.9);
    color: #1a1505;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px 0 4px 0;
    line-height: 1;
    min-width: 14px;
    text-align: center;
}

/* ---- Skeleton loading ---- */
.item-icon-skeleton {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border: 1px solid rgba(255,255,255,0.06);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Tooltip de item (position: fixed em document.body) ---- */
/* Fica em body para escapar de ancestor com transform (ex: char-card:hover) */
.item-tooltip {
    position: fixed;
    top: -9999px;
    left: -9999px;
    background: #111120;
    border: 1px solid rgba(226,201,126,0.25);
    border-radius: 10px;
    min-width: 230px;
    max-width: 270px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    box-shadow: 0 8px 32px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,0,0,0.5);
    overflow: hidden;
}

.item-tooltip.tt-visible {
    opacity: 1;
    visibility: visible;
}

/* Cabeçalho: ícone grande + nome/tipo/grade */
.tt-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 14px 11px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.tt-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.18);
    font-size: 11px;
}

.tt-icon img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}

.tt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tt-name-block {
    flex: 1;
    min-width: 0;
}

.tt-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2c97e;
    line-height: 1.3;
    word-break: break-word;
}

.tt-enchant {
    color: #e2c97e;
}

.tt-type {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.38);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.tt-badges {
    display: flex;
    gap: 5px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Grade badges */
.item-grade-badge {
    font-size: 0.63rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.grade-S84 { background: rgba(255,20,120,0.18); color: #ff6eb4; border: 1px solid rgba(255,20,120,0.3); }
.grade-S80 { background: rgba(255,60,160,0.15); color: #ff99cc; border: 1px solid rgba(255,60,160,0.25); }
.grade-S   { background: rgba(180,80,255,0.18); color: #cc88ff; border: 1px solid rgba(180,80,255,0.3); }
.grade-A   { background: rgba(255,160,0,0.18);  color: #ffbb55; border: 1px solid rgba(255,160,0,0.3); }
.grade-B   { background: rgba(90,170,255,0.18); color: #88ccff; border: 1px solid rgba(90,170,255,0.3); }
.grade-C   { background: rgba(70,195,70,0.18);  color: #88dd88; border: 1px solid rgba(70,195,70,0.3); }
.grade-D   { background: rgba(190,190,190,0.12);color: #cccccc; border: 1px solid rgba(190,190,190,0.2); }
.grade-none{ background: rgba(130,130,130,0.08);color: #888;    border: 1px solid rgba(130,130,130,0.15); }

/* Divisor interno */
.tt-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
}

/* Seção de Augment */
.tt-augment {
    padding: 10px 14px;
}

.tt-section-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.28);
    margin-bottom: 7px;
}

.tt-augment-name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 3px;
}

.tt-augment-kind {
    display: inline-block;
    font-size: 0.62rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 1px 6px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tt-augment-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.45;
}

/* Seção de Elemento */
.tt-elements {
    padding: 8px 14px 10px;
}

.tt-elem-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 5px;
    border-left: 3px solid;
    background: rgba(255,255,255,0.04);
}

.tt-elem-row:first-child { margin-top: 0; }

.tt-elem-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

.tt-elem-info { flex: 1; min-width: 0; }

.tt-elem-name {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.tt-elem-detail {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin-top: 1px;
}

.tt-elem-lvl {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ícone de elemento no canto superior esquerdo do ícone do card */
.item-elem-icon {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 10px;
    line-height: 1;
    background: rgba(0,0,0,0.65);
    border-radius: 0 0 4px 0;
    padding: 1px 2px;
}

/* ---- PvP: borda prata no ícone + badge no tooltip ---- */
.item-icon-wrap.item-pvp img,
.item-icon-wrap.item-pvp .item-icon-placeholder {
    outline: 2px solid rgba(192,210,230,0.75);
    outline-offset: -2px;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(180,205,230,0.45), inset 0 0 6px rgba(180,205,230,0.1);
}

.item-pvp-corner {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #b8d4ea;
    background: rgba(0,0,0,0.72);
    border-radius: 0 3px 0 4px;
    padding: 1px 3px;
    line-height: 1;
    pointer-events: none;
}

.tt-pvp-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 1px 5px;
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(160,190,220,0.2), rgba(200,220,240,0.12));
    border: 1px solid rgba(180,205,230,0.5);
    color: #b8d4ea;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}

/* enchant badge no canto do ícone do card */
.item-enchant-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(226,201,126,0.9);
    color: #1a1505;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px 0 4px 0;
    line-height: 1;
    min-width: 14px;
    text-align: center;
}

/* ---- Rodapé do card: preço + botões ---- */
.char-card-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.char-price {
    display: flex;
    flex-direction: column;
}

.char-price-value {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2c97e;
    line-height: 1;
}

.char-price-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

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

.btn-details {
    padding: 7px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-details:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.btn-buy-card {
    padding: 7px 14px;
    background: linear-gradient(135deg, #e2c97e, #c9a84c);
    border: none;
    border-radius: 6px;
    color: #1a1505;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    text-decoration: none;
}

.btn-buy-card:hover {
    opacity: 0.88;
    color: #1a1505;
    text-decoration: none;
}

/* ---- Estado vazio ---- */
.marketplace-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255,255,255,0.35);
}

.marketplace-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.marketplace-empty p {
    font-size: 1rem;
}

/* ---- Paginação ---- */
.marketplace-pagination {
    display: flex;
    justify-content: center;
    margin-top: 36px;
    gap: 6px;
}

.marketplace-pagination a,
.marketplace-pagination span {
    padding: 7px 13px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
}

.marketplace-pagination a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.marketplace-pagination .active span,
.marketplace-pagination span.active {
    background: rgba(226,201,126,0.2);
    border-color: rgba(226,201,126,0.35);
    color: #e2c97e;
    font-weight: 600;
}

/* ============================================================
   MODAL DE DETALHES — Redesign responsivo com abas
   ============================================================ */
.mp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.mp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal: altura fixa = sem scrollbar na modal inteira */
.mp-modal {
    background: #12121e;
    border: 1px solid rgba(226,201,126,0.18);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    /* Altura total controlada: header+tabs+body+footer = tela sem overflow */
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* nada vaza para fora */
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}

/* ---- Cabeçalho com hero do personagem ---- */
.mp-modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.mp-modal-hero {
    display: flex;
    gap: 14px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.mp-modal-avatar {
    width: 56px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    object-position: top center;
    border: 1px solid rgba(226,201,126,0.25);
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.mp-modal-hero-info {
    flex: 1;
    min-width: 0;
}

.mp-modal-title {
    font-family: var(--font-accent-bold, 'Cinzel', serif);
    font-size: 1.15rem;
    color: #e2c97e;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-modal-subtitle {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.mp-modal-hero-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    align-items: center;
}

.mp-modal-hero-stat {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}

.mp-modal-hero-stat strong {
    color: #fff;
    font-weight: 700;
}

/* Special skill — ícone com nível em badge */
.mp-special-skill-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
}
.mp-special-skill-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.12);
    display: block;
}
.mp-special-skill-icon--placeholder {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-special-skill-level {
    position: absolute;
    bottom: -3px;
    right: -4px;
    background: rgba(0,0,0,0.75);
    color: #e2c97e;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 3px;
    pointer-events: none;
}

.mp-modal-close {
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    padding: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
    margin-top: 2px;
}

.mp-modal-close:hover { color: #fff; }

/* Badge online/offline no hero */
.online-badge-modal {
    display: none;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.online-badge-modal.is-online  { background: rgba(239,68,68,0.18);  color: #f87171; }
.online-badge-modal.is-offline { background: rgba(34,197,94,0.12);  color: #4ade80; }

/* ---- Banner personagem online ---- */
.mp-online-banner {
    background: rgba(239,68,68,0.08);
    border-bottom: 1px solid rgba(239,68,68,0.2);
    padding: 9px 20px;
    color: #f87171;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ---- Abas ---- */
.mp-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 20px;
    gap: 2px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}

.mp-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.38);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    margin-bottom: -1px;
}

.mp-tab:hover { color: rgba(255,255,255,0.65); }

.mp-tab.active {
    color: #e2c97e;
    border-bottom-color: #e2c97e;
}

.mp-tab svg { opacity: 0.7; }
.mp-tab.active svg { opacity: 1; }

.mp-tab-badge {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.mp-tab.active .mp-tab-badge {
    background: rgba(226,201,126,0.15);
    color: #e2c97e;
}

/* ---- Corpo das abas (área com scroll interno) ---- */
.mp-modal-body {
    flex: 1;
    overflow: hidden; /* o scroll fica dentro do painel */
    position: relative;
}

.mp-tab-panel {
    display: none;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px;
    /* Scrollbar estilizada */
    scrollbar-width: thin;
    scrollbar-color: rgba(226,201,126,0.2) transparent;
}

.mp-tab-panel::-webkit-scrollbar { width: 4px; }
.mp-tab-panel::-webkit-scrollbar-track { background: transparent; }
.mp-tab-panel::-webkit-scrollbar-thumb { background: rgba(226,201,126,0.2); border-radius: 4px; }

.mp-tab-panel.active { display: block; }

/* Grid de equipamentos na modal */
.mp-equipment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Row de fonte (tempo real/snapshot) */
.mp-equip-source-row {
    margin-top: 10px;
    font-size: 0.68rem;
}

/* Grid de mochila */
.mp-inventory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inv-icon-wrap {
    width: 42px;
    height: 42px;
}

.inv-icon-wrap img {
    width: 42px;
    height: 42px;
}

/* Badge de quantidade (canto inferior esquerdo do ícone) */
.item-count-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 0 3px 0 4px;
    line-height: 1;
    min-width: 14px;
    text-align: center;
}

/* Badge de quantidade no tooltip */
.tt-qty-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(226,201,126,0.12);
    border: 1px solid rgba(226,201,126,0.25);
    color: #e2c97e;
}

.mp-loading-text {
    color: rgba(255,255,255,0.3);
    font-size: 0.82rem;
    padding: 20px 0;
    display: block;
    text-align: center;
    width: 100%;
}

/* ---- Rodapé ---- */
.mp-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}

.mp-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-modal-price {
    font-family: var(--font-accent-bold, 'Cinzel', serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: #e2c97e;
    white-space: nowrap;
}

.mp-modal-price small {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    font-family: inherit;
    font-weight: 400;
    display: block;
    margin-top: 1px;
}

.mp-modal-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-modal-meta {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.25);
}

/* ---- Responsivo ---- */
@media (max-width: 600px) {
    .mp-modal { border-radius: 12px; }
    .mp-modal-header { padding: 14px 16px 12px; }
    .mp-tab-panel { padding: 14px 16px; }
    .mp-modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .mp-modal-footer-actions { width: 100%; justify-content: flex-end; }
    .mp-tabs { padding: 0 12px; }
    .mp-tab { padding: 10px 12px; font-size: 0.72rem; }
    .mp-modal-avatar { width: 44px; height: 56px; }
}

/* ---- Estilos legados mantidos para compatibilidade ---- */
.mp-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 12px;
}

.mp-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mp-stat-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.mp-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.mp-stat-lbl {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.mp-equipment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mp-description {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.mp-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mp-modal-price {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #e2c97e;
}

.mp-modal-price small {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

/* ---- Flash messages ---- */
.marketplace-alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.marketplace-alert.success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.25);
    color: #4ade80;
}

.marketplace-alert.error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #f87171;
}

/* ---- Responsivo ---- */
@media (max-width: 1024px) {
    .marketplace-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .marketplace-grid { grid-template-columns: 1fr; }
    .marketplace-filters { gap: 8px; }
    .marketplace-filters .filter-group { min-width: 100%; }
}

/* ---- Avatar compacto inline no header ---- */
.char-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.char-card-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.35);
}

.char-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.35s ease;
}

.char-card:hover .char-card-avatar img {
    transform: scale(1.06);
}

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

.char-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* ---- Skills tab ---- */
.mp-skills-hint {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    margin: 0 0 12px;
    padding: 0 2px;
}

.mp-skills-section {
    margin-bottom: 16px;
}

.mp-skills-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226,201,126,0.55);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mp-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---- Skill icon wrap ---- */
.skill-icon-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: visible;
    cursor: default;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
}

.skill-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.skill-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
}

.skill-enchant-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg,#b8860b,#e2c97e);
    color: #000;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 2;
    white-space: nowrap;
}

/* Skill tooltip */
.skill-tooltip {
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 99999;
    min-width: 200px;
    max-width: 280px;
    background: linear-gradient(160deg,rgba(15,10,5,0.97) 0%,rgba(10,7,3,0.99) 100%);
    border: 1px solid rgba(226,201,126,0.25);
    border-radius: 8px;
    padding: 12px 14px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

.skill-tooltip.tt-visible {
    opacity: 1;
    visibility: visible;
}

.skill-tt-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.skill-tt-icon {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.skill-tt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.skill-tt-name-block {
    flex: 1;
    min-width: 0;
}

.skill-tt-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2c97e;
    line-height: 1.3;
    word-break: break-word;
}

.skill-tt-enchant {
    font-size: 0.78rem;
    color: #f59e0b;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.skill-tt-type {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.skill-tt-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 8px 0;
}

.skill-tt-desc {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
    word-break: break-word;
}
