/* Trade — aligned with Moodboard / Neodex / Account */

body.page-trade .shop_content {
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
    gap: 0;
}

body.page-trade .market-categories-bleed {
    overflow-x: clip;
}

body.page-trade {
    --mk-border: #e8e6ec;
    --mk-border-strong: #c8c4d0;
    --mk-surface: var(--bg-surface);
    --mk-muted: var(--text-muted);
    --mk-ink: var(--text-ink);
}

html[data-theme="dark"] body.page-trade {
    --mk-border: var(--border-soft);
    --mk-border-strong: var(--border-neutral);
}

.page-flower-bg .market-home-header {
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: clamp(1rem, 3vw, 2rem);
    margin-top: clamp(2.75rem, 4vw + 1.5rem, 4rem);
    padding-bottom: 0;
}

.page-flower-bg .market-home-header .shop_header_texts {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
}

.market-subtitle {
    margin: 0.55rem 0 0;
    max-width: 34rem;
    line-height: 1.35;
    opacity: 0.85;
}

.market-header__cta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 0.15rem;
}

.market-header__cta .save-settings-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.market-hint {
    margin: 0;
    text-align: right;
}

/* Categories — single row, bleed right, arrow nav like account rewards */

.market-categories-wrap {
    margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
    overflow: visible;
}

.market-categories-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 clamp(1rem, 4vw, 2.5rem);
    margin-bottom: 0.45rem;
    position: relative;
    z-index: 2;
}

.market-categories-arrow {
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--mk-ink);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.market-categories-arrow:hover:not(:disabled) {
    background: color-mix(in srgb, var(--mk-ink) 8%, var(--mk-surface));
}

.market-categories-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.market-categories-bleed {
    overflow: visible;
    width: 100%;
}

.market-categories-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: calc(100% + max(0px, (100vw - 100%) / 2));
    margin-right: calc(-1 * max(0px, (100vw - 100%) / 2));
    padding-right: max(1.25rem, calc((100vw - 100%) / 2));
    padding-left: clamp(1rem, 4vw, 2.5rem);
    padding-top: 0.15rem;
    padding-bottom: 0.35rem;
}

.market-categories-scroll::-webkit-scrollbar {
    display: none;
}

.market-filter-pill {
    appearance: none;
    flex: 0 0 auto;
    white-space: nowrap;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    background: color-mix(in srgb, var(--mk-ink) 8%, var(--mk-surface));
    color: var(--mk-ink);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.market-filter-pill:hover {
    background: color-mix(in srgb, var(--mk-ink) 12%, var(--mk-surface));
}

.market-filter-pill.is-active {
    background: var(--mk-ink);
    color: #fff;
    box-shadow: 0 4px 14px rgba(44, 18, 59, 0.12);
}

html[data-theme="dark"] .market-filter-pill.is-active {
    background: rgba(255, 255, 255, 0.92);
    color: #1a1024;
}

/* Offers list — cards with character showcase */

.market-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 3.5rem;
    box-sizing: border-box;
    overflow: visible;
}

.market-empty {
    margin: 2.5rem auto;
    text-align: center;
    opacity: 0.72;
}

.market-offers {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 2.2vw, 1.4rem);
    padding-top: 0.55rem;
    padding-bottom: 0.65rem;
    overflow: visible;
}

.market-offer {
    --heat-accent: var(--accent, #765696);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-accent) 12%, #fff);

    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
    border: 2px solid var(--mk-border);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(44, 18, 59, 0.06);
    overflow: visible;
    isolation: isolate;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Soft tinted fill — lighter than apps cards, keyed to heat / border color */
.market-offer__ambient {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background:
        linear-gradient(
            168deg,
            color-mix(in srgb, #fff 94%, var(--heat-accent-pastel)) 0%,
            color-mix(in srgb, var(--heat-accent-pastel) 30%, var(--mk-surface)) 38%,
            color-mix(in srgb, var(--heat-accent) 2.5%, var(--mk-surface)) 100%
        );
}

.market-offer__ambient::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        155deg,
        color-mix(in srgb, #fff 26%, transparent) 0%,
        transparent 42%
    );
    pointer-events: none;
}

.market-offer__ambient::after {
    content: '';
    position: absolute;
    top: -18%;
    right: 14%;
    width: 44%;
    height: 72%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--heat-accent) 7%, transparent) 0%,
        transparent 68%
    );
    filter: blur(2px);
    pointer-events: none;
}

.market-offer:hover {
    transform: translateY(-2px);
}

/* Timer bubble — sticker style like downloads page */

.market-offer__timer {
    --timer-tilt: -6deg;

    position: absolute;
    top: -0.7rem;
    right: clamp(0.85rem, 2.2vw, 1.35rem);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.48rem 0.9rem;
    border-radius: 10px;
    background: var(--mk-ink);
    color: #fff;
    font-size: clamp(0.75rem, 1.6vw, 0.88rem);
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    transform: rotate(var(--timer-tilt));
    transform-origin: center center;
    box-shadow:
        0 2px 0 color-mix(in srgb, var(--mk-ink) 72%, black),
        0 4px 14px -4px color-mix(in srgb, var(--mk-ink) 40%, transparent);
}

html[data-theme="dark"] .market-offer__timer {
    background: rgba(255, 255, 255, 0.94);
    color: #1a1024;
    box-shadow:
        0 2px 0 color-mix(in srgb, #fff 55%, black),
        0 4px 16px -4px rgba(255, 255, 255, 0.28);
}

.market-offer--heat-classic {
    border-color: var(--mk-border);
    box-shadow: 0 4px 16px rgba(44, 18, 59, 0.06);
}

.market-offer--heat-classic:hover {
    border-color: var(--accent-light, #d4c4e8);
    box-shadow: 0 8px 22px rgba(44, 18, 59, 0.1);
}

.market-offer--heat-classic.market-offer--mine {
    border-color: var(--mk-border-strong);
}

/* Heat tiers — animated glowing borders */

@keyframes market-heat-pulse {
    0%, 100% {
        box-shadow:
            0 4px 16px var(--heat-shadow, rgba(44, 18, 59, 0.08)),
            0 0 0 0 var(--heat-glow, transparent);
    }
    50% {
        box-shadow:
            0 8px 24px var(--heat-shadow-strong, rgba(44, 18, 59, 0.14)),
            0 0 14px 2px var(--heat-glow, transparent);
    }
}

@keyframes market-heat-border {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.market-offer[class*="market-offer--heat-"]:not(.market-offer--heat-classic) {
    border-color: transparent;
    background-clip: padding-box;
}

.market-offer[class*="market-offer--heat-"]:not(.market-offer--heat-classic)::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(
        120deg,
        var(--heat-a),
        var(--heat-b),
        var(--heat-c),
        var(--heat-a)
    );
    background-size: 200% 100%;
    animation: market-heat-border var(--heat-speed, 4s) linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

.market-offer[class*="market-offer--heat-"]:not(.market-offer--heat-classic)::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    pointer-events: none;
    z-index: -1;
    animation: market-heat-pulse var(--heat-pulse-speed, 3s) ease-in-out infinite;
}

.market-offer--heat-cool {
    --heat-a: #7eb4dc;
    --heat-b: #a8d4f0;
    --heat-c: #5a9fd0;
    --heat-accent: var(--heat-b);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-b) 22%, #fff);
    --heat-glow: rgba(72, 142, 196, 0.35);
    --heat-shadow: rgba(72, 142, 196, 0.14);
    --heat-shadow-strong: rgba(72, 142, 196, 0.22);
    --heat-speed: 5s;
    --heat-pulse-speed: 4s;
}

.market-offer--heat-fresh {
    --heat-a: #5ec0c8;
    --heat-b: #8ee0e6;
    --heat-c: #3fafb8;
    --heat-accent: var(--heat-b);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-b) 22%, #fff);
    --heat-glow: rgba(58, 168, 176, 0.38);
    --heat-shadow: rgba(58, 168, 176, 0.14);
    --heat-shadow-strong: rgba(58, 168, 176, 0.24);
    --heat-speed: 4.5s;
    --heat-pulse-speed: 3.5s;
}

.market-offer--heat-warm {
    --heat-a: #e8b04a;
    --heat-b: #f5d078;
    --heat-c: #d99a28;
    --heat-accent: var(--heat-b);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-b) 22%, #fff);
    --heat-glow: rgba(210, 148, 48, 0.42);
    --heat-shadow: rgba(210, 148, 48, 0.16);
    --heat-shadow-strong: rgba(210, 148, 48, 0.28);
    --heat-speed: 3.5s;
    --heat-pulse-speed: 3s;
}

.market-offer--heat-hot {
    --heat-a: #f07838;
    --heat-b: #ffaa66;
    --heat-c: #e85e18;
    --heat-accent: var(--heat-b);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-b) 22%, #fff);
    --heat-glow: rgba(232, 108, 48, 0.48);
    --heat-shadow: rgba(232, 108, 48, 0.18);
    --heat-shadow-strong: rgba(232, 108, 48, 0.3);
    --heat-speed: 3s;
    --heat-pulse-speed: 2.5s;
}

.market-offer--heat-blazing {
    --heat-a: #e84d58;
    --heat-b: #ff8a92;
    --heat-c: #d42e3c;
    --heat-accent: var(--heat-b);
    --heat-accent-pastel: color-mix(in srgb, var(--heat-b) 22%, #fff);
    --heat-glow: rgba(220, 58, 72, 0.55);
    --heat-shadow: rgba(220, 58, 72, 0.2);
    --heat-shadow-strong: rgba(220, 58, 72, 0.34);
    --heat-speed: 2.2s;
    --heat-pulse-speed: 2s;
}

.market-offer--heat-cool:hover,
.market-offer--heat-fresh:hover,
.market-offer--heat-warm:hover,
.market-offer--heat-hot:hover,
.market-offer--heat-blazing:hover {
    transform: translateY(-3px);
}

.market-offer__head,
.market-offer__trade {
    position: relative;
    z-index: 1;
}

.market-offer__action {
    position: absolute;
    right: clamp(1.35rem, 3.2vw, 1.95rem);
    bottom: -0.45rem;
    z-index: 12;
    min-width: 0 !important;
    width: auto;
    padding: 0.5rem 1.05rem !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 25px !important;
    border: none;
    cursor: pointer;
    overflow: visible !important;
}

.market-offer__action.save-settings-btn:not(:disabled):not(.loading),
.market-offer__action.privacy-consent-button--reject {
    --btn-3d-shadow: color-mix(in srgb, var(--accent) 76%, black);
    box-shadow: 0 var(--btn-3d-md-depth) 0 var(--btn-3d-shadow);
}

.market-offer__action.privacy-consent-button--reject {
    --btn-3d-shadow: #b0b5c7;
}

.market-offer__action.save-settings-btn:not(:disabled):not(.loading):hover,
.market-offer__action.privacy-consent-button--reject:hover {
    transform: translateY(var(--btn-3d-md-lift-hover));
    box-shadow: 0 var(--btn-3d-md-depth-hover) 0 var(--btn-3d-shadow);
}

.market-offer__action.save-settings-btn:not(:disabled):not(.loading):active,
.market-offer__action.privacy-consent-button--reject:active {
    transform: translateY(var(--btn-3d-md-lift-active));
    box-shadow: 0 var(--btn-3d-md-depth-active) 0 var(--btn-3d-shadow);
}

.market-offer__action.save-settings-btn:not(:disabled):not(.loading):hover {
    background: var(--accent-gradient-135-hover);
}

.market-offer__action.save-settings-btn:disabled {
    background: #e0e3ee !important;
    border: 1px solid #c3c7d5 !important;
    color: #685C8F !important;
    opacity: 1;
    cursor: not-allowed;
    --btn-3d-shadow: #b0b5c7;
    box-shadow: 0 var(--btn-3d-md-depth) 0 var(--btn-3d-shadow) !important;
    transform: none !important;
}

html[data-theme="dark"] .market-offer__action.save-settings-btn:disabled {
    background: #3d3850 !important;
    border-color: #524d66 !important;
    color: color-mix(in srgb, var(--mk-ink) 62%, transparent) !important;
    --btn-3d-shadow: #2a2638;
    box-shadow: 0 var(--btn-3d-md-depth) 0 var(--btn-3d-shadow) !important;
}

html[data-theme="dark"] .market-offer--heat-classic {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .market-offer__ambient {
    background:
        linear-gradient(
            168deg,
            color-mix(in srgb, var(--heat-accent) 6%, var(--mk-surface)) 0%,
            color-mix(in srgb, var(--heat-accent) 2.5%, var(--mk-surface)) 45%,
            var(--mk-surface) 100%
        );
}

html[data-theme="dark"] .market-offer__ambient::before {
    background: linear-gradient(
        155deg,
        color-mix(in srgb, #fff 5%, transparent) 0%,
        transparent 38%
    );
}

html[data-theme="dark"] .market-offer__ambient::after {
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--heat-accent) 5%, transparent) 0%,
        transparent 68%
    );
}

html[data-theme="dark"] .market-offer--heat-cool {
    --heat-a: #6aa8d4;
    --heat-b: #9cc8e8;
    --heat-c: #4a98c8;
    --heat-glow: rgba(72, 142, 196, 0.45);
}

html[data-theme="dark"] .market-offer--heat-fresh {
    --heat-a: #52b4bc;
    --heat-b: #7ed4da;
    --heat-c: #3aa0a8;
    --heat-glow: rgba(58, 168, 176, 0.45);
}

html[data-theme="dark"] .market-offer--heat-warm {
    --heat-a: #d9a040;
    --heat-b: #f0c060;
    --heat-c: #c08820;
    --heat-glow: rgba(210, 148, 48, 0.5);
}

html[data-theme="dark"] .market-offer--heat-hot {
    --heat-a: #e07030;
    --heat-b: #ff9850;
    --heat-c: #c85818;
    --heat-glow: rgba(232, 108, 48, 0.52);
}

html[data-theme="dark"] .market-offer--heat-blazing {
    --heat-a: #d84450;
    --heat-b: #ff7080;
    --heat-c: #c02838;
    --heat-glow: rgba(220, 58, 72, 0.58);
}

.market-offer.is-filter-hidden,
.market-offer.is-page-hidden {
    display: none;
}

.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.15rem;
    padding-bottom: 0.25rem;
}

.market-pagination[hidden] {
    display: none !important;
}

.market-pagination__arrow {
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--mk-ink);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.market-pagination__arrow:hover:not(:disabled) {
    background: color-mix(in srgb, var(--mk-ink) 8%, var(--mk-surface));
}

.market-pagination__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.market-pagination__status {
    min-width: 3.5rem;
    text-align: center;
    opacity: 0.75;
    user-select: none;
}

.market-offer__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.65rem;
    padding-right: clamp(5.5rem, 14vw, 7rem);
}

.market-offer__user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    line-height: 1.1;
}

.market-offer--mine .market-offer__user::after {
    content: ' · yours';
    font-weight: 400;
    opacity: 0.6;
}

.market-offer__trade {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.15rem;
    padding: 0 5.75rem 0.65rem 0.55rem;
}

.market-offer__side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}

.market-offer__side-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.01em;
    font-size: 0.68rem;
    line-height: 1.2;
    background: color-mix(in srgb, var(--mk-ink) 8%, var(--mk-surface));
    border: 1px solid color-mix(in srgb, var(--mk-ink) 12%, var(--mk-border));
    color: var(--mk-ink);
    opacity: 0.88;
    white-space: nowrap;
}

html[data-theme="dark"] .market-offer__side-label {
    background: color-mix(in srgb, #fff 8%, var(--mk-surface));
    border-color: color-mix(in srgb, #fff 14%, var(--mk-border));
}

.market-offer__center {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 0.1rem;
}

.market-offer__swap-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.market-offer__swap-icon svg {
    width: clamp(1.85rem, 3.4vw, 2.25rem);
    height: clamp(1.85rem, 3.4vw, 2.25rem);
}

/* Character stage — flex row, equal gaps, depth via vertical offset */

.market-stage {
    --char-far: 24%;
    --char-side: 32%;
    --char-front: 44%;
    --char-overlap: 24%;
    --char-overlap-edge: 12%;

    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: 130px;
    min-height: 130px;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
}

.market-stage[data-count="1"] {
    justify-content: center;
}

.market-stage[data-count="1"] .market-char--front {
    --char-w: 49%;
}

.market-stage[data-count="2"] {
    --char-side: 42%;
    gap: clamp(0.5rem, 6vw, 1.35rem);
    height: 140px;
    min-height: 140px;
}

.market-stage[data-count="2"] .market-char + .market-char {
    margin-left: 0;
}

.market-char__glow {
    position: absolute;
    left: 50%;
    bottom: 10%;
    width: 50%;
    height: 50%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--char-rarity-color, #9E9E9E) 58%, transparent) 0%,
        transparent 68%
    );
    filter: blur(9px);
    pointer-events: none;
    z-index: 0;
}

.market-char--locked .market-char__glow {
    opacity: 0.5;
}

.market-char {
    position: relative;
    flex: 0 0 auto;
    width: var(--char-w);
    margin: 0;
    z-index: var(--char-z, 2);
    isolation: isolate;
}

.market-char:hover {
    --char-z: 50;
}

.market-char__name {
    position: absolute;
    left: 50%;
    bottom: 83%;
    transform: translate(-50%, -100%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
    white-space: nowrap;
    color: var(--mk-ink);
    text-shadow:
        0 1px 2px color-mix(in srgb, var(--mk-surface) 85%, transparent),
        0 0 6px color-mix(in srgb, var(--mk-surface) 70%, transparent);
}

.market-char:hover .market-char__name {
    opacity: 1;
}

.market-char + .market-char {
    margin-left: calc(-1 * var(--char-overlap));
}

.market-char--far-left + .market-char--left,
.market-char--right + .market-char--far-right {
    margin-left: calc(-1 * var(--char-overlap-edge));
}

.market-char__media {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: none;
}

.market-char__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    background: transparent;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 8px 10px rgba(44, 18, 59, 0.12));
}

.market-char--locked .market-char__image {
    filter: brightness(0) drop-shadow(0 8px 10px rgba(44, 18, 59, 0.12));
    opacity: 0.55;
}

/* cover_and_shadow_locked : empilement de calques pour neutraliser l'alpha */
.market-char--locked.market-char--locked-asset {
    isolation: isolate;
}

.market-char--locked.market-char--locked-asset .market-char__media--stacked {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    line-height: 0;
    display: block;
}

.market-char--locked.market-char--locked-asset .market-char__media--stacked .market-char__image {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    display: block;
    margin: 0;
    opacity: 1;
    background: none;
    filter: none;
}

.market-char--locked.market-char--locked-asset .market-char__media--stacked .market-char__image--layer {
    z-index: 0;
}

.market-char--locked.market-char--locked-asset .market-char__media--stacked .market-char__image--top {
    position: absolute;
    z-index: 1;
    filter: drop-shadow(0 8px 10px rgba(44, 18, 59, 0.12));
}

/* Size + depth: center lowest & foremost, sides higher, edges highest */
.market-char--front {
    --char-w: var(--char-front);
    --char-z: 30;
    margin-bottom: 0;
}

.market-char--left,
.market-char--right {
    --char-w: var(--char-side);
    --char-z: 20;
    margin-bottom: 8px;
}

.market-char--far-left,
.market-char--far-right {
    --char-w: var(--char-far);
    --char-z: 10;
    margin-bottom: 16px;
}

/* Modal actions keep legacy market-action styles */

.market-action {
    appearance: none;
    border: none;
    border-radius: 9999px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    background: var(--mk-ink);
    color: #fff;
    transition: transform 0.12s ease, opacity 0.15s ease;
    min-width: 9.5rem;
    text-align: center;
}

.market-action:not(.market-action--ghost) {
    color: #fff !important;
}

html[data-theme="dark"] .market-action:not(.market-action--ghost):not(:disabled) {
    background: rgba(255, 255, 255, 0.94);
    color: #1a1024 !important;
}

.market-action--ghost {
    background: transparent;
    color: var(--mk-ink);
    border: 2px solid var(--mk-border);
}

.market-action:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

html[data-theme="dark"] .market-action:disabled:not(.market-action--ghost) {
    background: color-mix(in srgb, #fff 55%, var(--mk-surface));
    color: color-mix(in srgb, var(--mk-ink) 65%, transparent) !important;
}

.market-action:not(:disabled):hover {
    transform: translateY(-1px);
}

/* Modal */

.market-modal[hidden] {
    display: none !important;
}

.market-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.market-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 28, 0.42);
    backdrop-filter: blur(4px);
}

.market-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    max-height: min(88vh, 760px);
    overflow: auto;
    background: var(--mk-surface);
    border: 2px solid var(--mk-border);
    border-radius: 16px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 24px 64px rgba(44, 18, 59, 0.16);
}

.market-modal__close {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    color: var(--mk-ink);
    opacity: 0.5;
}

.market-modal__close:hover {
    opacity: 0.9;
}

.market-modal__steps {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.market-step {
    opacity: 0.45;
}

.market-step.is-active {
    opacity: 1;
}

.market-modal__subtitle {
    margin: 0.35rem 0 0.85rem;
}

.market-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 0.85rem;
    padding: 11px 18px;
    border: none;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--mk-ink) 8%, var(--mk-surface));
    box-sizing: border-box;
}

.market-search-icon {
    flex-shrink: 0;
    color: var(--mk-ink);
}

.market-search {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--mk-ink);
    margin: 0;
    padding: 0;
}

.market-search:focus {
    outline: none;
}

.market-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
    gap: 0.55rem;
    max-height: min(44vh, 380px);
    overflow: auto;
    padding: 0.1rem;
}

.market-picker-item {
    appearance: none;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 12px;
    padding: 0.35rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    text-align: center;
    color: var(--mk-ink);
    transition: border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.market-picker-item:hover:not(:disabled) {
    background: color-mix(in srgb, var(--mk-ink) 5%, transparent);
}

.market-picker-item.is-selected {
    border-color: var(--mk-ink);
    background: color-mix(in srgb, var(--mk-ink) 6%, transparent);
}

.market-picker-item.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.market-picker-item.is-locked .market-picker-item__cover {
    filter: saturate(0.78);
}

.market-picker-item__cover {
    width: 4.25rem;
    height: 4.25rem;
    object-fit: contain;
}

.market-picker-item__name {
    font-size: 0.7rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

.market-picker-empty {
    margin: 0.5rem 0 0;
    text-align: center;
}

.market-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mk-border);
}

.market-modal__status {
    margin: 0.65rem 0 0;
    min-height: 1.1rem;
}

.market-modal__status.is-success {
    color: #2d7a4f;
}

.market-modal__status.is-error {
    color: #b33a3a;
}

/* Confirm trade modal */

.market-confirm-modal__panel {
    width: min(100%, 720px);
}

.market-confirm-modal__subtitle {
    margin: 0.4rem 0 0;
    line-height: 1.4;
    opacity: 0.85;
}

.market-confirm-modal__creator {
    margin: 0.55rem 0 0;
    opacity: 0.78;
}

.market-confirm-modal__creator[hidden] {
    display: none !important;
}

.market-confirm-modal__trade {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    margin-top: 1.15rem;
    padding: 1rem 0.85rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--mk-ink) 4%, var(--mk-surface));
    border: 1px solid var(--mk-border);
}

.market-confirm-modal__side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.market-confirm-modal__center {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding-top: 1.75rem;
}

.market-confirm-modal__chars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
}

.market-confirm-char {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: calc(50% - 0.3rem);
    max-width: 5.5rem;
    text-align: center;
}

.market-confirm-char__glow {
    position: absolute;
    left: 50%;
    bottom: 28%;
    width: 70%;
    height: 55%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--char-rarity-color, #9E9E9E) 58%, transparent) 0%,
        transparent 68%
    );
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

.market-confirm-char__cover {
    position: relative;
    z-index: 1;
    width: 4.25rem;
    height: 4.25rem;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(44, 18, 59, 0.12));
}

.market-confirm-char__name {
    position: relative;
    z-index: 1;
    font-size: 0.68rem;
    line-height: 1.2;
    color: var(--mk-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

.market-confirm-modal__footer {
    margin-top: 1.15rem;
}

.market-confirm-modal__submit {
    min-width: 10.5rem;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1.15rem;
}

.market-confirm-modal__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 560px) {
    .market-confirm-modal__trade {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.85rem 0.65rem;
    }

    .market-confirm-modal__center {
        order: 2;
        padding-top: 0;
    }

    .market-confirm-modal__side:first-child {
        order: 1;
    }

    .market-confirm-modal__side:last-child {
        order: 3;
    }

    .market-confirm-modal__center .market-offer__swap-icon {
        transform: rotate(90deg);
    }

    .market-confirm-modal__footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .market-confirm-modal__submit,
    .market-confirm-modal__footer .market-action--ghost {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .market-offer[class*="market-offer--heat-"]:not(.market-offer--heat-classic)::before,
    .market-offer[class*="market-offer--heat-"]:not(.market-offer--heat-classic)::after {
        animation: none;
    }

    .market-offer:hover,
    .market-offer--heat-cool:hover,
    .market-offer--heat-fresh:hover,
    .market-offer--heat-warm:hover,
    .market-offer--heat-hot:hover,
    .market-offer--heat-blazing:hover {
        transform: none;
    }
}

@media (max-width: 1024px) {
    .page-flower-bg .market-home-header {
        flex-wrap: wrap;
    }

    .market-header__cta {
        align-items: flex-start;
        width: 100%;
        padding-top: 0;
    }

    .market-hint {
        text-align: left;
    }

    .market-offer__trade {
        gap: 0.35rem;
    }
}

@media (max-width: 560px) {
    .market-offer__trade {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-right: 0.55rem;
        padding-bottom: 0.75rem;
    }

    .market-offer__center {
        order: 2;
    }

    .market-offer__side--wanted {
        order: 1;
    }

    .market-offer__side--offered {
        order: 3;
    }

    .market-offer__swap-icon {
        transform: rotate(90deg);
    }

    .market-offer__action {
        right: clamp(1.1rem, 3vw, 1.65rem);
        bottom: -0.35rem;
        font-size: 0.72rem !important;
        padding: 0.44rem 0.9rem !important;
    }

    .market-stage {
        height: 118px;
        min-height: 118px;
    }

    .market-stage[data-count="2"] {
        height: 128px;
        min-height: 128px;
        gap: clamp(0.35rem, 4vw, 0.85rem);
    }
}
