.theme-mercado,
.mercado-wrap {
    --mercado-accent: var(--sculk-cyan, #00ddff);
}

.mercado-wrap {
    padding-bottom: 28px;
    animation: mercadoPageIn 0.45s ease-out;
}

@keyframes mercadoPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mercado-hero {
    border: 2px solid var(--launcher-border);
    background:
        linear-gradient(120deg, rgba(0, 221, 255, 0.08) 0%, transparent 55%),
        linear-gradient(135deg, rgba(12, 18, 24, 0.98), rgba(8, 10, 14, 0.98));
    padding: 22px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.mercado-hero::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(0, 221, 255, 0.16) 0%, transparent 70%);
    animation: mercadoGlowDrift 6s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes mercadoGlowDrift {
    from { transform: translate(0, 0); opacity: 0.55; }
    to { transform: translate(-12px, -8px); opacity: 1; }
}

.mercado-hero h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.2rem;
}

.mercado-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    max-width: 720px;
}

.mercado-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.72rem;
    padding: 4px 10px;
    border: 1px solid var(--mercado-accent);
    color: var(--mercado-accent);
}

.mercado-live-pill.offline {
    border-color: #64748b;
    color: #94a3b8;
}

.mercado-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: mercadoPulse 1.8s infinite;
}

@keyframes mercadoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.mercado-search-box {
    position: relative;
    z-index: 80;
    margin-bottom: 18px;
    animation: mercadoFadeUp 0.5s ease-out 0.05s both;
}

.mercado-search-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.mercado-search-row .mercado-search-input {
    flex: 1;
    min-width: 0;
}

.mercado-search-submit {
    flex-shrink: 0;
    align-self: stretch;
    padding: 0 18px;
    white-space: nowrap;
}

@keyframes mercadoFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mercado-search-input {
    width: 100%;
    background: #101010;
    border: 2px solid var(--launcher-border);
    color: #fff;
    padding: 12px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mercado-search-input:focus {
    border-color: var(--mercado-accent);
    box-shadow: 0 0 0 2px rgba(0, 221, 255, 0.15);
}

.mercado-search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow-y: auto;
    background: #0c0c0c;
    border: 2px solid var(--mercado-accent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 200;
    display: none;
    animation: mercadoDropIn 0.2s ease-out;
}

@keyframes mercadoDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.mercado-search-dropdown.active {
    display: block;
}

.mercado-search-option {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--launcher-border);
    color: #fff;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.mercado-search-option:hover {
    background: rgba(0, 221, 255, 0.08);
    transform: translateX(3px);
}

.mercado-item-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    image-rendering: pixelated;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--launcher-border);
    padding: 4px;
}

.mercado-item-icon--xl {
    width: 64px;
    height: 64px;
    padding: 6px;
    border: 2px dashed var(--mercado-accent);
    background: rgba(0, 221, 255, 0.06);
    animation: mercadoIconFloat 3s ease-in-out infinite;
}

@keyframes mercadoIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.mercado-search-option .mercado-item-icon {
    width: 44px;
    height: 44px;
}

.mercado-stat-item .mercado-item-icon {
    width: 52px;
    height: 52px;
}

#mercado-home-root {
    position: relative;
    z-index: 1;
}

.mercado-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.mercado-stat-card {
    border: 2px solid var(--launcher-border);
    background: var(--launcher-card);
    padding: 14px;
    min-width: 0;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    animation: mercadoFadeUp 0.5s ease-out both;
    position: relative;
    z-index: 1;
}

.mercado-stat-card:nth-child(1) { animation-delay: 0.08s; }
.mercado-stat-card:nth-child(2) { animation-delay: 0.14s; }
.mercado-stat-card:nth-child(3) { animation-delay: 0.2s; }

.mercado-stat-card:hover {
    border-color: var(--mercado-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 221, 255, 0.08);
}

.mercado-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mercado-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mercado-stat-item h3 {
    margin: 0;
    font-size: 0.92rem;
}

.mercado-stat-item .mercado-price-line {
    margin: 3px 0 0;
    font-size: 0.78rem;
    color: var(--mercado-accent);
}

.mercado-spotlight-head h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
}

.mercado-spotlight-meta {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.mercado-spotlight-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mercado-spotlight-copy {
    flex: 1;
    min-width: 160px;
}

.mercado-spotlight-title-row .mercado-item-icon {
    width: 48px;
    height: 48px;
}

.mercado-spotlight-cta {
    margin-left: auto;
}

.mercado-chart-card {
    border: 2px solid var(--launcher-border);
    background: var(--launcher-card);
    padding: 14px;
    margin-bottom: 14px;
    animation: mercadoFadeUp 0.55s ease-out 0.12s both;
}

.mercado-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.mercado-chart-head h4 {
    margin: 0;
    font-size: 0.85rem;
    color: #fff;
}

.mercado-chart-canvas {
    width: 100% !important;
    max-height: 260px;
    min-height: 220px;
}

.mercado-chart-canvas--mini {
    max-height: 200px;
    min-height: 160px;
}

.mercado-btn {
    border: 2px solid var(--mercado-accent);
    background: rgba(0, 221, 255, 0.1);
    color: #fff;
    padding: 8px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.mercado-btn:hover {
    background: rgba(0, 221, 255, 0.22);
    transform: translateY(-1px);
}

.mercado-btn-ghost {
    border-color: var(--launcher-border);
    background: rgba(0, 0, 0, 0.25);
}

.mercado-item-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
}

.mercado-item-hero {
    border: 2px solid var(--launcher-border);
    background:
        linear-gradient(145deg, rgba(0, 221, 255, 0.06), transparent 60%),
        var(--launcher-card);
    padding: 18px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mercado-item-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mercado-item-title h2 {
    margin: 0;
    font-size: 1.25rem;
}

.mercado-item-title .mercado-item-id {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.mercado-range-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mercado-range-tab {
    border: 1px solid var(--launcher-border);
    background: #101010;
    color: var(--text-muted);
    padding: 5px 10px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.15s;
}

.mercado-range-tab:hover {
    border-color: var(--mercado-accent);
    color: #fff;
}

.mercado-range-tab.active {
    border-color: var(--mercado-accent);
    color: #000;
    background: var(--mercado-accent);
    font-weight: bold;
}

.mercado-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mercado-metric {
    border: 1px solid var(--launcher-border);
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    font-size: 0.75rem;
    transition: border-color 0.2s;
}

.mercado-metric:hover {
    border-color: rgba(0, 221, 255, 0.35);
}

.mercado-metric strong {
    display: block;
    font-size: 1rem;
    color: #fff;
    margin-top: 4px;
}

.mercado-insight-box {
    border: 2px dashed var(--launcher-border);
    background: rgba(0, 0, 0, 0.22);
    padding: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.text-up { color: #22c55e; }
.text-down { color: #ef4444; }

@media (max-width: 900px) {
    .mercado-cards-grid,
    .mercado-item-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .launcher-profile-wrap .player-hero {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        min-width: 0;
    }

    .launcher-profile-wrap .player-skin-stage {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .launcher-profile-wrap .player-identity {
        width: 100%;
        min-width: 0;
    }

    .launcher-profile-wrap .player-identity h1,
    .launcher-profile-wrap .player-subtitle {
        word-break: break-word;
    }
}
