.market-screen {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.market-screen.active {
    display: block;
}

#market-loader.market-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 62vh;
    text-align: center;
}

.market-loader-lock {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.market-loader-lock-icon {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.95;
}

.market-hint {
    margin: -2px 4px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.market-preview {
    display: block;
    width: 100%;
    height: 86px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 10px;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.25));
}

.market-preview-empty {
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.market-card-meta {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(225, 231, 244, 0.78);
}

.market-skins-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-skin-card {
    text-align: left;
    padding: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    contain: layout paint;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.market-skin-card::before {
    display: none;
}

.market-skin-card img {
    width: 100%;
    height: 95px;
    object-fit: contain;
    margin-bottom: 8px;
}

.market-skin-title {
    font-size: 14px;
    line-height: 1.35;
    min-height: 34px;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
}

.market-skin-meta {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.market-rarity-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.market-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 24px 6px;
    font-size: 14px;
}

#market-tracking-list.grid-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#market-tracking-list .tracking-course-card {
    width: 100%;
    box-sizing: border-box;
}

.market-quality-wrap {
    margin: 0 0 12px 0;
    text-align: left;
}

.market-quality-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 8px 2px;
}

.market-quality-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.market-quality-chip {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-quality-chip:active {
    transform: scale(0.97);
}

.market-quality-chip.is-active {
    border-color: rgba(123, 178, 255, 0.9);
    background: rgba(88, 140, 235, 0.24);
    box-shadow: 0 0 0 1px rgba(123, 178, 255, 0.35);
}

#market-modal-price-chips.is-hidden {
    display: none;
}

.market-notify-wrap {
    margin-top: 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
}

.market-notify-wrap.is-hidden {
    display: none;
}

.market-notify-title {
    font-size: 13px;
    font-weight: 700;
    color: #f3f7ff;
    margin-bottom: 8px;
}

.market-notify-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.market-notify-wrap .notify-sources {
    margin: 12px 0;
    padding: 2px 0;
}

.market-notify-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-notify-input {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 13px;
    box-sizing: border-box;
}

.market-notify-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.25);
}

#market-modal-img {
    display: block;
    margin: 0 auto 10px;
    width: 100%;
    max-width: 220px;
    object-fit: contain;
    object-position: center;
    background: radial-gradient(circle, rgba(199, 44, 65, 0.15) 0%, transparent 70%);
}

#market-modal-title {
    margin-top: 0;
}

.market-global-search-wrap {
    margin-bottom: 25px;
}

#market-search-input,
#market-global-search-input {
    width: 100%;
    padding: 14px 45px 14px 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#market-search-input:focus,
#market-global-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(76, 139, 245, 0.2);
}

.market-search-result-meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
    text-align: center;
}

/* Mobile Lite mode: simplify market visuals on phones to reduce rendering cost. */
@media (hover: none) and (pointer: coarse) {
    .market-screen {
        animation: none !important;
    }

    .market-preview {
        filter: none !important;
    }

    .market-quality-chip {
        transition: none !important;
    }

    .market-quality-chip.is-active,
    .market-notify-input:focus {
        box-shadow: none !important;
    }
}
