/* ═══════════════════════════════
   MARKETPLACE PAGE
═══════════════════════════════ */
/* Built on account.css (tabs, coins, vaults, item grid) and dressed like the Nightmare Shop:
   a hero on top, a sticky menu of tabs, rounded panels with a gold edge and pill buttons. */
.marketplace-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

/* The site styles every <button> as a full-width form button with a red wipe on hover. The
   buttons here draw themselves, so that is taken off them. */
/* :where() keeps this as weak as the site's own rule, so any button class below still wins. */
:where(.marketplace-wrapper, .mp-modal) button {
    width: auto;
    margin-top: 0;
}

:where(.marketplace-wrapper, .mp-modal) button::before { content: none; }

/* ═══════════════════════════════
   HERO
═══════════════════════════════ */
.mp-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1.8rem 2rem;
    background:
        radial-gradient(ellipse 45% 120% at 0% 0%, rgba(187,24,24,0.3) 0%, transparent 70%),
        radial-gradient(ellipse 35% 100% at 100% 100%, rgba(184,134,11,0.14) 0%, transparent 70%),
        linear-gradient(135deg, rgba(24,18,28,0.92) 0%, rgba(10,8,13,0.94) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

.mp-hero-text { min-width: 0; }

.mp-hero-title {
    margin: 0.6rem 0 0.4rem;
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--text-bright);
}

.mp-hero-lead {
    max-width: 560px;
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
}

.mp-hero-side {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.mp-wallet-label {
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Wallet ── */
.mp-balance-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.mp-balance-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-gold);
    border-radius: 999px;
}

.mp-balance-item .coin-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.8rem;
}

.mp-balance-data {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.mp-balance-value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-bright);
}

.mp-balance-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Jewel bank ── */
.mp-jewel-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.mp-jewel-bar:empty { display: none; }

.mp-jewel-item {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
}

/* The jewel pictures have a lot of empty border, so they are drawn larger and clipped. */
.mp-jewel-icon-wrap {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(187,24,24,0.3) 0%, rgba(7,5,10,0.9) 75%);
    border-radius: 50%;
    overflow: hidden;
}

.mp-jewel-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.8);
}

.mp-jewel-val {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-bright);
}

.mp-jewel-lbl {
    font-size: 0.66rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mp-jewel-item.is-empty { opacity: 0.45; }

/* ═══════════════════════════════
   TABS
═══════════════════════════════ */
/* The look comes from account.css; here they stay in view under the top bar (its offset is set
   from the bar's real height). */
.mp-nav {
    position: sticky;
    top: 84px;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ═══════════════════════════════
   FILTERS
═══════════════════════════════ */
.mp-filters {
    margin-bottom: 1.25rem;
    padding: 1.2rem 1.4rem;
    background: linear-gradient(160deg, rgba(24,18,28,0.95) 0%, rgba(12,9,15,0.96) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.4);
}

.mp-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.mp-filter-row + .mp-filter-row,
.mp-filter-row + .mp-filter-more { margin-top: 0.9rem; }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label,
.mp-form label {
    display: block;
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input,
.mp-form input:not([type="checkbox"]),
.mp-form select {
    min-width: 150px;
    padding: 0.65rem 0.85rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text-bright);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus,
.filter-group input:focus,
.mp-form input:not([type="checkbox"]):focus,
.mp-form select:focus {
    border-color: var(--gold);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 0 3px rgba(184,134,11,0.15);
}

.filter-search { flex: 1; min-width: 220px; }

.mp-search-input { position: relative; }

.mp-search-input i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 0.8rem;
    pointer-events: none;
}

.mp-search-input input {
    width: 100%;
    padding-left: 38px;
}

.filter-range .range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-range .range-inputs input {
    width: 90px;
    min-width: 0;
}

.filter-range .range-inputs span { color: var(--text-muted); }

/* The checkboxes are toggle chips: the box hides, the chip lights up when it is on. */
.mp-filter-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 13px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.filter-check::before {
    content: '';
    flex: none;
    width: 12px;
    height: 12px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
}

.filter-check:hover { border-color: var(--border-gold); color: var(--text-bright); }

.filter-check:has(input:checked) {
    background: rgba(184,134,11,0.16);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.filter-check:has(input:checked)::before {
    background: var(--gold-bright);
    border-color: var(--gold-bright);
    box-shadow: inset 0 0 0 2px #1a1207;
}

.filter-check:has(input:focus-visible) { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* ── More filters ── */
.mp-filter-more {
    border-top: 1px solid var(--border-dim);
    padding-top: 0.8rem;
}

.mp-filter-more summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
}

.mp-filter-more summary::-webkit-details-marker { display: none; }
.mp-filter-more-caret { font-size: 0.65rem; transition: transform 0.25s; }
.mp-filter-more[open] .mp-filter-more-caret { transform: rotate(180deg); }

.mp-filter-more-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.9rem;
}

/* ── Search button ── */
.btn-mp-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1.4rem;
    background: linear-gradient(135deg, var(--red-bright), var(--red-blood));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--red-glow);
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.btn-mp-filter:hover {
    color: #fff;
    background: linear-gradient(135deg, #e52a2a, var(--red));
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 26px var(--red-glow-lg);
    transform: translateY(-1px);
}

/* ═══════════════════════════════
   LISTINGS GRID
═══════════════════════════════ */
.mp-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.mp-listings-grid > .loading-state,
.mp-listings-grid > .empty-state { grid-column: 1 / -1; }

/* ── Listing card ── */
/* Like a skin card of the shop: a stage with the item, its name and tags, then the price and
   the buttons at the bottom. */
.mp-listing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, rgba(24,18,28,0.95) 0%, rgba(12,9,15,0.97) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.mp-listing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(184,134,11,0.45);
    box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 30px rgba(187,24,24,0.15);
}

.mp-listing-img {
    position: relative;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 55% 55% at 50% 52%, rgba(187,24,24,0.28) 0%, rgba(110,10,10,0.12) 45%, transparent 75%),
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(184,134,11,0.12) 0%, transparent 70%),
        #07050a;
    border-bottom: 1px solid var(--border-dim);
    overflow: hidden;
    cursor: help;
}

.mp-listing-img img {
    /* An item picture has a lot of empty border around the piece, so it is drawn larger. */
    height: 150px;
    max-width: 88%;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(212,32,32,0.4)) drop-shadow(0 8px 16px rgba(0,0,0,0.8));
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}

.mp-listing-card:hover .mp-listing-img img { transform: scale(1.08); }

.mp-listing-level {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    border-radius: 999px;
    color: #1a1207;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
}

.mp-listing-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0.9rem 1rem 0.4rem;
}

.mp-listing-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-listing-name.excellent { color: #4ade80; }
.mp-listing-name.ancient { color: #60a5fa; }

.mp-listing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mp-tag {
    padding: 2px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mp-tag.exc { color: #4ade80; border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.08); }
.mp-tag.anc { color: #60a5fa; border-color: rgba(96,165,250,0.35); background: rgba(96,165,250,0.08); }
.mp-tag.socket { color: #c084fc; border-color: rgba(192,132,252,0.35); background: rgba(192,132,252,0.08); }

.mp-listing-seller {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.mp-listing-seller i { font-size: 0.62rem; color: var(--gold); }
.mp-listing-seller span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mp-listing-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-dim);
}

.mp-listing-price {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--gold-bright);
    text-shadow: 0 0 15px rgba(184,134,11,0.35);
}

/* ── Jewel price ──
   A listing can be priced in several jewel types at once. Each one is a compact chip
   (quantity + short jewel name) so the whole price fits without stretching the card. */
.mp-listing-meta-jewels { gap: 5px; }

.mp-jewel-price {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 999px;
    white-space: nowrap;
}

.mp-jewel-qty {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold-bright);
}

.mp-jewel-name {
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
}

.mp-listing-currency {
    padding: 2px 9px;
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mp-listing-currency.ncoin { color: var(--gold-bright); border-color: rgba(184,134,11,0.4); background: rgba(184,134,11,0.08); }
.mp-listing-currency.zen { color: #60a5fa; border-color: rgba(96,165,250,0.35); background: rgba(96,165,250,0.08); }
.mp-listing-currency.jewel { color: #f59e0b; border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); }
.mp-listing-currency.brl { color: #32bcad; border-color: rgba(50,188,173,0.4); background: rgba(50,188,173,0.08); }

.mp-listing-reserved {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.4rem;
    padding: 3px 10px;
    background: rgba(184,134,11,0.1);
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    color: var(--gold-bright);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mp-listing-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mp-listing-actions {
    display: flex;
    gap: 6px;
    padding: 0.7rem 1rem 1rem;
}

/* ── Card buttons: red pill to buy, gold pill to make an offer, outline to cancel ── */
.btn-mp-buy,
.btn-mp-offer,
.btn-mp-cancel {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s, filter 0.2s;
}

.btn-mp-buy {
    background: linear-gradient(135deg, var(--red-bright), var(--red-blood));
    color: #fff;
    box-shadow: 0 6px 20px var(--red-glow);
}

.btn-mp-buy:hover {
    color: #fff;
    background: linear-gradient(135deg, #e52a2a, var(--red));
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 26px var(--red-glow-lg);
    transform: translateY(-1px);
}

.btn-mp-offer {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #1a1207;
    box-shadow: 0 6px 20px rgba(184,134,11,0.3);
}

.btn-mp-offer:hover {
    color: #1a1207;
    border-color: var(--gold-bright);
    filter: brightness(1.1);
    box-shadow: 0 8px 24px rgba(184,134,11,0.4);
    transform: translateY(-1px);
}

.btn-mp-cancel {
    background: transparent;
    border-color: var(--border-red);
    color: var(--red-bright);
}

.btn-mp-cancel:hover {
    color: var(--red-bright);
    background: var(--red-dim);
    border-color: var(--red);
    box-shadow: 0 0 18px rgba(187,24,24,0.2);
}

/* ═══════════════════════════════
   PAGINATION
═══════════════════════════════ */
.mp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-mp-page {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-mp-page:hover:not(:disabled) {
    color: var(--gold-bright);
    background: rgba(184,134,11,0.12);
    border-color: var(--gold);
    box-shadow: none;
}

.btn-mp-page:disabled { opacity: 0.3; cursor: not-allowed; }

.mp-page-info {
    min-width: 90px;
    padding: 6px 14px;
    background: rgba(184,134,11,0.1);
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

/* ═══════════════════════════════
   PANEL HEADS (My listings)
═══════════════════════════════ */
.mp-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.mp-panel-icon {
    flex: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184,134,11,0.1);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--gold-bright);
    font-size: 0.9rem;
}

.mp-panel-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: left;
    text-transform: uppercase;
    color: var(--text-bright);
}

/* ═══════════════════════════════
   CREATE LISTING
═══════════════════════════════ */
.mp-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.mp-steps li {
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.9rem;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    color: var(--text-bright);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
}

.mp-steps li > span:first-child {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    border-radius: 50%;
    color: #1a1207;
    font-size: 0.75rem;
    font-weight: 800;
}

.mu-item-storage.storage-rows8 { min-height: calc(var(--boxSize) * 8); }
.mu-item-storage.storage-rows15 { min-height: calc(var(--boxSize) * 15); }

/* ── Form (modals) ── */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group { flex: 1; min-width: 0; }
.mp-form .form-group { margin-bottom: 0; }
.mp-form label { margin-bottom: 5px; }

/* The selects were falling back to their intrinsic width while the inputs next to them
   filled the column, which left the currency picker as a small box in a wide row. */
.mp-form input:not([type="checkbox"]),
.mp-form select,
.mp-form .form-group select,
.mp-form .form-group input {
    width: 100%;
    min-width: 0;
}

/* The toggle chips of the form are labels too, but keep their chip look. */
.mp-form label.filter-check {
    display: inline-flex;
    margin: 0;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.mp-form select option {
    background: var(--surface);
    color: var(--text);
}

.mp-modal .btn-mp-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.75rem;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--red-bright), var(--red-blood));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--red-glow);
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.btn-mp-submit:hover {
    color: #fff;
    background: linear-gradient(135deg, #e52a2a, var(--red));
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 26px var(--red-glow-lg);
    transform: translateY(-1px);
}

.btn-mp-submit:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.mp-message {
    display: none;
    margin-top: 1rem;
    padding: 10px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 0.8rem;
}

.mp-message.success { border-color: rgba(34,197,94,0.4); color: var(--online); background: rgba(34,197,94,0.06); }
.mp-message.error { border-color: var(--border-red); color: #ff8a8a; background: rgba(197,34,34,0.08); }

/* ── Jewel rows ── */
.jewel-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.jewel-row .form-group { flex: 1; margin-bottom: 0; }

.mp-modal .btn-mp-remove-jewel {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0 0 1px 2px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-red);
    border-radius: 50%;
    color: var(--red-bright);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-mp-remove-jewel:hover { color: var(--red-bright); background: var(--red-dim); border-color: var(--red); box-shadow: none; }

/* Offer settings of a new listing, separated from the price fields above. */
.mp-form-offers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dim);
}

.mp-form-offers > .filter-check { align-self: flex-start; }
.mp-form-offers .mp-filter-checks { padding-top: 6px; }

.btn-mp-add-jewel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.25rem;
    padding: 7px 14px;
    background: transparent;
    border: 1px dashed rgba(245,158,11,0.5);
    border-radius: 999px;
    color: #f59e0b;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-mp-add-jewel:hover { color: #f59e0b; border-color: #f59e0b; background: rgba(245,158,11,0.08); box-shadow: none; }

/* ═══════════════════════════════
   SUB-TABS (transactions, offers)
═══════════════════════════════ */
.mp-subtabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 1rem;
    padding: 4px;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
}

.mp-subtab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mp-subtab i { font-size: 0.7rem; }
.mp-subtab:hover { color: var(--text-bright); box-shadow: none; }

.mp-subtab.active {
    background: rgba(184,134,11,0.16);
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* ═══════════════════════════════
   TRANSACTIONS
═══════════════════════════════ */
.mp-table-wrap {
    overflow-x: auto;
    background: linear-gradient(160deg, rgba(24,18,28,0.95) 0%, rgba(12,9,15,0.96) 100%);
    border: 1px solid var(--border-dim);
    border-radius: 14px;
}

.mp-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.mp-table th {
    padding: 12px 16px;
    background: rgba(9,7,12,0.8);
    border-bottom: 1px solid var(--border-gold);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: left;
    text-transform: uppercase;
}

.mp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-dim);
    color: var(--text);
    font-size: 0.82rem;
}

.mp-table tbody tr:last-child td { border-bottom: none; }
.mp-table tbody tr:hover td { background: rgba(184,134,11,0.04); }
.mp-table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.mp-table .trans-item-desc { color: var(--text-bright); font-weight: 600; }

.mp-table .trans-price {
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-weight: 700;
}

.mp-table .trans-fee { color: #f87171; }
.mp-table .trans-net { color: var(--online); font-weight: 600; }

.mp-table .trans-date {
    color: var(--text-muted);
    font-size: 0.74rem;
    white-space: nowrap;
}

/* ═══════════════════════════════
   EMPTY STATE
═══════════════════════════════ */
.marketplace-wrapper .empty-state {
    padding: 3rem 1.5rem;
    background: rgba(9,7,12,0.6);
    border: 1px dashed var(--border-gold);
    border-radius: 14px;
    font-style: normal;
}

.mp-table .empty-state { border: none; background: none; }

/* ═══════════════════════════════
   TOOLTIP (mirror from account.css)
═══════════════════════════════ */
.mu-tooltip {
    display: none;
    position: fixed;
    z-index: 9999;
    background: rgba(8,6,11,0.97);
    border: 1px solid rgba(184,134,11,0.35);
    padding: 12px 16px;
    min-width: 200px;
    max-width: 300px;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text);
    pointer-events: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    border-radius: 6px;
}
.mu-tooltip .tt-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text-bright); }
.mu-tooltip .tt-name.excellent { color: #22c55e; }
.mu-tooltip .tt-name.ancient { color: #3b82f6; }
.mu-tooltip .tt-score { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.mu-tooltip .tt-score .label { color: var(--text-muted); }
.mu-tooltip .tt-score .val { color: var(--text-bright); font-weight: 500; }
.mu-tooltip .tt-def { font-size: 11px; color: var(--text-muted); }
.mu-tooltip .tt-dur { font-size: 11px; color: var(--text-muted); }
.mu-tooltip .tt-stat { font-size: 11px; color: var(--text-muted); }
.mu-tooltip .tt-stat .val { color: var(--text-bright); font-weight: 500; }
.mu-tooltip .tt-req { font-size: 11px; color: var(--text-muted); }
.mu-tooltip .tt-req .val { color: var(--text-bright); font-weight: 500; }
.mu-tooltip .tt-class { font-size: 10px; color: var(--text-muted); font-style: italic; }
.mu-tooltip .tt-sep { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 6px 0; }
.mu-tooltip .tt-options-title {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-top: 4px;
}
.mu-tooltip .tt-opt { font-size: 11px; }
.mu-tooltip .tt-opt.normal-opt { color: #9ca3af; }
.mu-tooltip .tt-opt.uncommon-opt { color: #34d399; }
.mu-tooltip .tt-opt.epic-opt { color: #c084fc; }
.mu-tooltip .tt-opt.excellent-opt { color: #facc15; }
.mu-tooltip .tt-socket { font-size: 11px; color: var(--text-muted); }
.mu-tooltip .tt-socket .filled { color: #34d399; }
.mu-tooltip .tt-socket .empty { color: #555; }
.mu-tooltip .tt-harmony { font-size: 11px; color: #f59e0b; }


/* ═══════════════════════════════
   MODAL
═══════════════════════════════ */
.mp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(4,3,6,0.85);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mp-modal {
    width: 480px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(24,18,28,0.98) 0%, rgba(14,11,18,0.98) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.8);
    animation: modalIn 0.25s cubic-bezier(0.22,1,0.36,1);
}

@keyframes modalIn { from { opacity: 0; transform: translateY(-20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.mp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(187,24,24,0.22) 0%, transparent 70%);
    border-bottom: 1px solid var(--border-dim);
}

.mp-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-bright);
}

.mp-modal-header h3 i { color: var(--gold-bright); }

.mp-modal .mp-modal-close {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-dim);
    border-radius: 50%;
    color: var(--text-bright);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.mp-modal .mp-modal-close:hover { color: var(--red-bright); border-color: var(--red); box-shadow: none; }

.mp-modal-body { padding: 1.25rem; }

.mp-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    padding: 10px 12px;
    background: rgba(184,134,11,0.07);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
}

.mp-modal-item > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mp-modal-item-img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(187,24,24,0.28) 0%, #07050a 75%);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    cursor: default;
}

.mp-modal-item-img img {
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(212,32,32,0.4));
}

.mp-modal-item-label {
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mp-modal-item-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold-bright);
    overflow-wrap: anywhere;
}

/* ═══════════════════════════════
   OFFERS
═══════════════════════════════ */
.mp-offers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mp-offer-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background:
        radial-gradient(ellipse 40% 140% at 0% 50%, rgba(187,24,24,0.12) 0%, transparent 70%),
        rgba(9,7,12,0.75);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    transition: border-color 0.2s, transform 0.2s;
}

.mp-offer-card:hover { border-color: rgba(224,178,62,0.5); transform: translateY(-2px); }

.mp-offer-info {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mp-offer-item {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-bright);
}

.mp-offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.mp-offer-meta strong { color: var(--text); }

.mp-offer-price {
    min-width: 100px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold-bright);
    text-align: right;
    white-space: nowrap;
}

.mp-offer-status {
    padding: 4px 12px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.mp-offer-status.pending { color: #f59e0b; border: 1px solid rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.mp-offer-status.accepted { color: var(--online); border: 1px solid rgba(34,197,94,0.4); background: rgba(34,197,94,0.08); }
.mp-offer-status.rejected { color: #f87171; border: 1px solid var(--border-red); background: var(--red-dim); }

.mp-offer-actions {
    display: flex;
    gap: 6px;
}

.btn-mp-accept,
.btn-mp-reject {
    padding: 7px 16px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-mp-accept {
    background: linear-gradient(135deg, #22c55e, #15803d);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: 0 6px 18px rgba(34,197,94,0.25);
}

.btn-mp-accept:hover { color: #fff; border-color: rgba(255,255,255,0.15); filter: brightness(1.1); box-shadow: 0 8px 22px rgba(34,197,94,0.35); }

.btn-mp-reject {
    background: transparent;
    border: 1px solid var(--border-red);
    color: var(--red-bright);
}

.btn-mp-reject:hover { color: var(--red-bright); border-color: var(--red); background: var(--red-dim); box-shadow: none; }

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 760px) {
    .mp-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.3rem 1.2rem;
    }

    .mp-hero-title { font-size: 1.8rem; }
    .mp-hero-side { align-items: flex-start; }
    .mp-balance-bar { justify-content: flex-start; }

    .mp-filters { padding: 1rem; }
    .mp-filter-main { flex-direction: column; align-items: stretch; }
    .filter-search { min-width: 0; }
    .filter-group select,
    .filter-group input { min-width: 0; width: 100%; }
    .btn-mp-filter { width: 100%; }

    .mp-listings-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
    .mp-listing-img { height: 130px; }
    .mp-listing-img img { height: 115px; }
    .mp-listing-actions { flex-direction: column; }

    .form-row { flex-direction: column; gap: 0.75rem; }
    .mp-table th, .mp-table td { padding: 9px 10px; }
    .mp-offer-price { text-align: left; }
    .mp-pagination { gap: 0.5rem; }
    .btn-mp-page { padding: 8px 12px; }
}

/* ═══════════════════════════════════════
   BRL / PIX
═══════════════════════════════════════ */
/* A price in Reais is typed with centavos, so the field carries its unit next to it. */
.mp-price-input {
    display: flex;
    align-items: stretch;
}

.mp-price-input input { flex: 1; min-width: 0; }

.mp-price-prefix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: rgba(50,188,173,0.1);
    border: 1px solid var(--border-gold);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #32bcad;
    font-size: 0.82rem;
    font-weight: 700;
}

.mp-price-prefix + input { border-radius: 0 10px 10px 0; }

.mp-brl-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding: 0.7rem 0.85rem;
    background: var(--gold-dim);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.mp-brl-notice i { color: var(--gold-bright); }
.mp-brl-notice a { color: var(--gold-bright); text-decoration: underline; }

.mp-pix-modal { width: 460px; }

.mp-pix-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0.9rem 0;
}

.mp-pix-amount {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem 0.5rem;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    text-align: center;
}

.mp-pix-amount-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mp-pix-amount-value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-bright);
}

.mp-pix-amount:first-child { border-color: rgba(50,188,173,0.4); background: rgba(50,188,173,0.07); }
.mp-pix-amount:first-child .mp-pix-amount-value { color: #32bcad; }

.mp-pix-qr-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(50,188,173,0.2);
}

.mp-pix-qr { width: 210px; height: 210px; image-rendering: pixelated; }

.mp-pix-payload-group { margin-top: 0.9rem; }

.mp-pix-payload-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mp-pix-payload-group textarea {
    width: 100%;
    min-height: 0;
    padding: 0.6rem 0.7rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
    font-family: monospace;
    font-size: 0.7rem;
    line-height: 1.45;
    resize: vertical;
    word-break: break-all;
}

.mp-modal .btn-mp-copy,
.mp-modal .btn-mp-cancel-order {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.65rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, filter 0.2s;
}

.mp-modal .btn-mp-copy {
    background: linear-gradient(135deg, #32bcad, #1f8a7f);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}

.mp-modal .btn-mp-copy:hover { color: #fff; filter: brightness(1.1); box-shadow: 0 6px 18px rgba(50,188,173,0.3); }

.mp-modal .btn-mp-cancel-order {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
}

.mp-modal .btn-mp-cancel-order:hover { border-color: var(--red); color: var(--red-bright); box-shadow: none; }

.mp-pix-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.7rem;
    background: rgba(9,7,12,0.7);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.mp-pix-status .spinner-loader {
    display: inline-block;
    flex: none;
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.mp-pix-status.pix-paid { border-color: var(--border-gold); color: var(--gold-bright); }
.mp-pix-status.pix-delivered { border-color: rgba(34,197,94,0.4); color: var(--online); }
.mp-pix-status.pix-cancelled,
.mp-pix-status.pix-expired { border-color: var(--border-dim); color: var(--text-muted); }
.mp-pix-status.pix-refunded,
.mp-pix-status.pix-deliveryfailed { border-color: var(--border-red); color: var(--red-bright); }

.mp-pix-expires {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
}
