/* ============================================
   FarmBrawl — Bazar P2P + Herrería (v2)
   ============================================ */

/* ─── Panel shells ─── */
.bazaar-panel {
    padding: 0 0 2rem;
    position: relative;
}

.bazaar-panel > * {
    position: relative;
    z-index: 1;
}

.bazaar-panel::after {
    content: '';
    position: absolute;
    inset: -0.5rem;
    border-radius: 2rem;
    border: 3px solid rgba(253, 224, 71, 0.45);
    pointer-events: none;
    z-index: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}

.forge-panel-wrap {
    padding: 0.5rem 0 2rem;
    background:
        radial-gradient(ellipse 70% 45% at 80% 0%, rgba(251, 146, 60, 0.12), transparent 50%),
        radial-gradient(ellipse 50% 40% at 10% 100%, rgba(234, 88, 12, 0.08), transparent 45%),
        linear-gradient(180deg, rgba(255, 247, 237, 0.06) 0%, transparent 35%),
        #0c0f1a;
    border-radius: 1.25rem;
}

/* ─── Sub-nav Mercado — game quest tabs ─── */
.market-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
    border: 3px solid #fcd34d;
    border-radius: 2rem;
    box-shadow: 0 4px 0 #d97706, 0 12px 32px -12px rgba(180, 83, 9, 0.25);
    position: relative;
}

.market-subnav::before {
    content: '⚔️ Mercado del Valle';
    position: absolute;
    top: -0.65rem;
    left: 1.25rem;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #92400e;
    background: #fef3c7;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    border: 2px solid #fcd34d;
}

.market-sub-btn {
    flex: 1;
    min-width: 148px;
    padding: 0.75rem 1.35rem;
    border: 2px solid transparent;
    border-radius: 1.5rem;
    font-weight: 800;
    font-size: 0.84rem;
    color: #78350f;
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34,1.4,0.64,1), background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.market-sub-btn i {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: linear-gradient(145deg, #fecdd3, #fda4af);
    color: #9f1239;
}

.market-sub-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.5);
}

.market-sub-btn.market-sub-active {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 0 #15803d, 0 8px 20px -6px rgba(22, 163, 74, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.market-sub-btn.market-sub-active i {
    background: rgba(255,255,255,0.95);
    color: #15803d;
}

#market-sub-bazaar.market-sub-active {
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 50%, #6d28d9 100%);
    box-shadow: 0 4px 0 #4c1d95, 0 8px 20px -6px rgba(124, 58, 237, 0.5);
}

#market-sub-bazaar.market-sub-active i {
    background: rgba(255,255,255,0.95);
    color: #6d28d9;
}

#market-sub-bazaar i {
    background: linear-gradient(145deg, #ddd6fe, #c4b5fd);
    color: #5b21b6;
}

/* ─── Bazar shell ─── */
#market-panel-bazaar {
    animation: mfPanelIn 0.45s cubic-bezier(0.34, 1.15, 0.64, 1);
}

#content-forge {
    animation: mfPanelIn 0.45s cubic-bezier(0.34, 1.15, 0.64, 1);
}

@keyframes mfPanelIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Escrow recovery banner ─── */
.bazaar-escrow-banner {
    margin: 0.75rem 1rem 0;
}

.bazaar-escrow-recover-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bazaar-escrow-recover-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

.bazaar-escrow-recover-btn:active {
    transform: scale(0.985);
}

/* ─── Bazar Hero (cinematic) ─── */
.bazaar-hero-cinematic {
    position: relative;
    border-radius: 1.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid #92400e;
    box-shadow: 0 6px 0 #78350f, 0 20px 48px -14px rgba(120, 53, 15, 0.4);
}

.bazaar-hero-awning {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.1rem;
    z-index: 4;
    background: repeating-linear-gradient(
        90deg,
        #dc2626 0px, #dc2626 18px,
        #fef3c7 18px, #fef3c7 36px
    );
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.bazaar-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("../assets/bazaar-hero-bg.png") center 35% / cover no-repeat;
    transform: scale(1.02);
}

.bazaar-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            105deg,
            rgba(28, 15, 8, 0.88) 0%,
            rgba(45, 24, 12, 0.62) 38%,
            rgba(55, 30, 18, 0.38) 62%,
            rgba(20, 12, 30, 0.45) 100%
        ),
        linear-gradient(180deg, transparent 55%, rgba(15, 10, 8, 0.55) 100%);
    pointer-events: none;
}

.bazaar-hero-mesh {
    display: none;
}

.bazaar-hero-grid-pattern {
    display: none;
}

.bazaar-hero-glow {
    position: absolute;
    top: -40%;
    right: -10%;
    width: 55%;
    height: 140%;
    z-index: 2;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 60%);
    pointer-events: none;
    animation: bazaarGlowPulse 6s ease-in-out infinite;
}

.bazaar-hero-glow--2 {
    top: auto;
    bottom: -50%;
    left: -5%;
    right: auto;
    width: 45%;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.12) 0%, transparent 62%);
    animation-delay: 2.5s;
}

.bazaar-hero-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 12px #fbbf24, 0 0 24px rgba(251, 191, 36, 0.4);
    animation: bazaarSparkle 2.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

.bazaar-hero-sparkle.s1 { top: 1.2rem; right: 2.5rem; }
.bazaar-hero-sparkle.s2 { top: 3rem; right: 6rem; animation-delay: 0.7s; }
.bazaar-hero-sparkle.s3 { bottom: 3.5rem; left: 2.5rem; animation-delay: 1.4s; }
.bazaar-hero-sparkle.s4 { top: 2rem; left: 45%; animation-delay: 2.1s; width: 4px; height: 4px; }

.bazaar-hero-inner {
    position: relative;
    z-index: 5;
    padding: 1.65rem 1.85rem 1.35rem;
}

.bazaar-hero-text {
    position: relative;
    max-width: 34rem;
}

.bazaar-hero-text::before {
    content: '';
    position: absolute;
    inset: -0.5rem -0.75rem;
    background: linear-gradient(105deg, rgba(20, 10, 6, 0.38) 0%, transparent 72%);
    border-radius: 1rem;
    pointer-events: none;
    z-index: -1;
}

.bazaar-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d1fae5;
    background: rgba(6, 78, 59, 0.55);
    border: 1px solid rgba(110, 231, 183, 0.45);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.bazaar-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #10b981;
    animation: bazaarLivePulse 1.8s ease-in-out infinite;
}

@keyframes bazaarLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.bazaar-hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.bazaar-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fef9c3;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.45rem;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}

.bazaar-hero-kicker i {
    color: #fcd34d;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
}

.bazaar-hero-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: clamp(1.85rem, 3.8vw, 2.55rem);
    font-weight: 900;
    margin: 0 0 0.55rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.bazaar-hero-title-text {
    color: #ffffff;
    -webkit-text-stroke: 1.5px rgba(69, 26, 3, 0.75);
    paint-order: stroke fill;
    text-shadow:
        0 2px 0 rgba(69, 26, 3, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 28px rgba(255, 255, 255, 0.1);
}

.bazaar-hero-title-emoji {
    display: inline-block;
    font-size: 0.92em;
    line-height: 1;
    animation: bazaarFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.bazaar-hero-desc {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.96);
    max-width: 32rem;
    line-height: 1.6;
    margin: 0;
    letter-spacing: 0.01em;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.7),
        0 3px 14px rgba(0, 0, 0, 0.4);
}

.bazaar-hero-highlight,
.bazaar-hero-desc strong {
    font-weight: 800;
    color: #6ee7b7;
    background: linear-gradient(180deg, #d1fae5 0%, #34d399 42%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 12px rgba(52, 211, 153, 0.35));
}

.bazaar-hero-visual {
    position: relative;
    flex-shrink: 0;
}

.bazaar-hero-orbit {
    position: relative;
    width: 148px;
    height: 148px;
}

.bazaar-hero-orbit-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.18);
    animation: bazaarOrbitSpin 18s linear infinite;
}

.bazaar-hero-orbit-ring--2 {
    inset: 12px;
    border-style: solid;
    border-color: rgba(253, 230, 138, 0.3);
    animation-direction: reverse;
    animation-duration: 12s;
}

@keyframes bazaarOrbitSpin {
    to { transform: rotate(360deg); }
}

.bazaar-hero-art-ring {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, rgba(255,255,255,0.28), rgba(251, 191, 36, 0.18) 50%, rgba(40, 24, 12, 0.45) 100%);
    border: 2px solid rgba(253, 230, 138, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 40px -10px rgba(0,0,0,0.45);
    animation: bazaarFloat 5s ease-in-out infinite;
}

.bazaar-hero-art {
    width: 72px;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.4));
}

.bazaar-hero-art-fallback {
    font-size: 3.5rem;
    line-height: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}

.bazaar-fee-strip {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem;
    background: rgba(20, 12, 8, 0.72);
    border-top: 1px solid rgba(253, 230, 138, 0.2);
    font-size: 0.74rem;
    font-weight: 800;
    color: #fde68a;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.bazaar-fee-strip strong { color: #fff; }

.bazaar-fee-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
}

/* Stats row */
.bazaar-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.bazaar-stat-card {
    background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
    border: 3px solid #fde68a;
    border-radius: 1.35rem;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 0 #fcd34d, 0 10px 28px -12px rgba(180, 83, 9, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bazaar-stat-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 0 6px 0 #fcd34d, 0 16px 36px -12px rgba(180, 83, 9, 0.28);
}

.bazaar-stat-icon {
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bazaar-stat-icon--wallet {
    background: linear-gradient(135deg, #dbeafe, #7dd3fc);
    color: #0369a1;
}

.bazaar-stat-icon--vault {
    background: linear-gradient(135deg, #ede9fe, #c4b5fd);
    color: #6d28d9;
}

.bazaar-stat-icon--trade {
    background: linear-gradient(135deg, #d1fae5, #6ee7b7);
    color: #047857;
}

.bazaar-stat-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
}

.bazaar-stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #312e81;
    line-height: 1.1;
}

.bazaar-stat-sub {
    font-size: 0.68rem;
    font-weight: 700;
    color: #a78bfa;
    margin-top: 0.1rem;
}

@keyframes bazaarGlowPulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes bazaarSparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.25); }
}

@keyframes bazaarFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

/* ─── Bazar layout ─── */
.bazaar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.35rem;
}

@media (min-width: 1024px) {
    .bazaar-layout {
        grid-template-columns: 300px 1fr;
        align-items: start;
    }
}

.bazaar-main {
    min-width: 0;
}

.bazaar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, rgba(254,243,199,0.9), rgba(255,255,255,0.95));
    border: 2px solid #fde68a;
    border-radius: 1.15rem;
    box-shadow: 0 3px 0 #fcd34d;
}

.bazaar-section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #78350f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.bazaar-section-title i {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.7rem;
    background: linear-gradient(145deg, #fde68a, #fbbf24);
    color: #92400e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 0 #d97706;
}

.bazaar-section-sub {
    font-size: 0.72rem;
    font-weight: 800;
    color: #b45309;
    background: rgba(255,255,255,0.7);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #fde68a;
}

/* Inventory vault */
.bazaar-inv-panel {
    background: linear-gradient(180deg, #fff 0%, #fef3c7 100%);
    border: 3px solid #d97706;
    border-radius: 1.6rem;
    padding: 0;
    box-shadow: 0 5px 0 #92400e, 0 16px 40px -14px rgba(120, 53, 15, 0.3);
    position: sticky;
    top: 5.5rem;
    overflow: hidden;
}

.bazaar-inv-head {
    padding: 1.15rem 1.2rem 0.9rem;
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-bottom: 3px solid #fcd34d;
}

.bazaar-inv-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.08rem;
    color: #fef3c7;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bazaar-inv-title i {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    background: linear-gradient(145deg, #fde68a, #fbbf24);
    color: #78350f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    box-shadow: 0 3px 0 #b45309;
}

.bazaar-inv-capacity-label {
    color: #fde68a;
}

.bazaar-inv-capacity-bar {
    height: 7px;
    border-radius: 999px;
    background: #ede9fe;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.bazaar-inv-capacity-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #a78bfa, #7c3aed);
    transition: width 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.35);
}

.bazaar-inv-body {
    padding: 0.85rem 1rem 1.1rem;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c4b5fd transparent;
}

.bazaar-inv-body::-webkit-scrollbar { width: 5px; }
.bazaar-inv-body::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 999px;
}

.bazaar-inv-empty {
    text-align: center;
    padding: 2rem 0.85rem 1.5rem;
    color: #94a3b8;
    font-size: 0.84rem;
}

.bazaar-inv-empty-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.85rem;
    border-radius: 1.25rem;
    background: linear-gradient(145deg, #ede9fe, #ddd6fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.35);
}

.bazaar-inv-empty p {
    font-weight: 800;
    color: #5b21b6;
    font-size: 0.98rem;
    margin: 0 0 0.3rem;
}

.bazaar-inv-empty span {
    display: block;
    line-height: 1.45;
    font-size: 0.78rem;
}

.bazaar-my-listings {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
    border: 2px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 4px 14px -8px rgba(234, 88, 12, 0.25);
}

.bazaar-my-listings-title {
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #9a3412;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bazaar-my-listing-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.55rem;
    background: #fff;
    border-radius: 0.85rem;
    border: 1px solid #fed7aa;
    margin-bottom: 0.45rem;
}

.bazaar-my-listing-row:last-child { margin-bottom: 0; }

.bazaar-my-listing-art {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    background: #fff7ed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.bazaar-my-listing-art img,
.bazaar-my-listing-art .bazaar-inv-berry {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bazaar-my-listing-info {
    flex: 1;
    min-width: 0;
}

.bazaar-my-listing-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bazaar-my-listing-price {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ea580c;
}

.bazaar-my-listing-unlist {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.bazaar-my-listing-unlist:hover {
    background: #f8fafc;
    color: #475569;
    transform: translateY(-1px);
}

.bazaar-inv-forge-btn {
    margin-top: 1rem;
    padding: 0.55rem 1.35rem;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    border: none;
    border-radius: 1rem;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 14px -4px rgba(234, 88, 12, 0.5);
    transition: transform 0.15s;
}

.bazaar-inv-forge-btn:hover { transform: translateY(-2px); }

.bazaar-inv-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem;
    border-radius: 1.15rem;
    background: #fff;
    border: 1.5px solid #f1f5f9;
    margin-bottom: 0.55rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 10px -6px rgba(0,0,0,0.08);
}

.bazaar-inv-card:hover {
    transform: translateX(4px);
    border-color: #c4b5fd;
    box-shadow: 0 10px 24px -10px rgba(124, 58, 237, 0.28);
}

.bazaar-inv-art {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.95rem;
    background: linear-gradient(145deg, #faf5ff, #ede9fe);
    border: 1.5px solid rgba(167, 139, 250, 0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.bazaar-inv-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.bazaar-inv-berry svg { width: 2.2rem; height: 2.2rem; }
.bazaar-inv-emoji { font-size: 1.65rem; line-height: 1; }

.bazaar-inv-info { flex: 1; min-width: 0; }

.bazaar-inv-name {
    font-weight: 800;
    font-size: 0.82rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bazaar-inv-stats {
    font-size: 0.68rem;
    color: #7c3aed;
    font-weight: 700;
    margin-top: 0.1rem;
}

.bazaar-inv-actions { display: flex; gap: 0.3rem; }

.bazaar-inv-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 0.7rem;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s, box-shadow 0.14s;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06);
}

.bazaar-inv-btn:active { transform: scale(0.9); }
.bazaar-inv-btn--plant { background: linear-gradient(180deg, #d1fae5, #a7f3d0); color: #047857; }
.bazaar-inv-btn--equip { background: linear-gradient(180deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.bazaar-inv-btn--sell { background: linear-gradient(180deg, #fef3c7, #fde68a); color: #b45309; }

/* Filters toolbar */
.bazaar-filters-wrap {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.4rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 8px 28px -12px rgba(0,0,0,0.08);
}

.bazaar-filters-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}

.bazaar-filters-toolbar-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bazaar-filters-toolbar-title i {
    color: #7c3aed;
}

.bazaar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.bazaar-filter-btn {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 800;
    font-size: 0.78rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.bazaar-filter-btn:hover {
    border-color: #c4b5fd;
    color: #6d28d9;
    background: #faf5ff;
    transform: translateY(-1px);
}

.bazaar-filter-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px -6px rgba(124, 58, 237, 0.55);
}

.bazaar-sort-select {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    font-weight: 800;
    font-size: 0.76rem;
    color: #475569;
    background: #f8fafc;
    cursor: pointer;
}

.bazaar-filters-meta {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.bazaar-listing-count {
    font-size: 0.72rem;
    font-weight: 800;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    white-space: nowrap;
}

/* Listing cards — premium marketplace */
.bazaar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.bazaar-listing-card {
    background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
    border: 3px solid #e2e8f0;
    border-radius: 1.35rem;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.25s, border-color 0.25s;
    animation: bazaarCardIn 0.55s cubic-bezier(0.34,1.15,0.64,1) backwards;
    box-shadow: 0 4px 0 #e2e8f0, 0 8px 20px -10px rgba(0,0,0,0.1);
}

.bazaar-listing-card--plant {
    --bazaar-accent: #059669;
    --bazaar-accent-soft: #ecfdf5;
    --bazaar-rarity: #34d399;
}

.bazaar-listing-card--trap {
    --bazaar-accent: #ea580c;
    --bazaar-accent-soft: #fff7ed;
    --bazaar-rarity: #fb923c;
}

.bazaar-listing-card--plant {
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 4px 0 #6ee7b7, 0 10px 24px -10px rgba(5, 150, 105, 0.2);
}

.bazaar-listing-card--trap {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 4px 0 #fdba74, 0 10px 24px -10px rgba(234, 88, 12, 0.2);
}

.bazaar-listing-card:hover {
    transform: translateY(-10px) rotate(-0.5deg);
    box-shadow: 0 8px 0 var(--bazaar-rarity, #c4b5fd), 0 22px 40px -14px rgba(0,0,0,0.18);
}

.bazaar-card-mine {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 3;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #312e81, #4c1d95);
    color: #e9d5ff;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px -4px rgba(49, 46, 129, 0.5);
}

.bazaar-card-top {
    position: relative;
    padding: 1rem 1rem 0.75rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.5), transparent),
        linear-gradient(180deg, var(--bazaar-accent-soft, #faf5ff) 0%, #fff 100%);
    border-bottom: 2px dashed rgba(0,0,0,0.06);
}

.bazaar-card-slot {
    position: absolute;
    inset: 0.5rem;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 1rem;
    pointer-events: none;
    opacity: 0.5;
}

.bazaar-card-price-num {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #b45309;
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 0 rgba(255,255,255,0.8);
}

.bazaar-card-price-num::before {
    content: '🪙';
    font-size: 1.1rem;
    margin-right: 0.2rem;
    vertical-align: middle;
}

.bazaar-card-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 1rem;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 50%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 4px 0 #4c1d95, 0 10px 20px -8px rgba(124, 58, 237, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.12s, box-shadow 0.12s;
}

.bazaar-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #fff;
    color: var(--bazaar-accent, #7c3aed);
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 8px -4px rgba(0,0,0,0.1);
}

.bazaar-card-age {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.62rem;
    font-weight: 800;
    color: #94a3b8;
    background: rgba(255,255,255,0.85);
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
}

.bazaar-listing-card--mine .bazaar-card-age {
    right: 5.5rem;
}

.bazaar-card-art {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.65rem 0 0;
    position: relative;
}

.bazaar-card-art::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
}

.bazaar-card-img {
    max-height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.14));
    position: relative;
    z-index: 1;
}

.bazaar-card-berry svg {
    width: 68px;
    height: 68px;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12));
    position: relative;
    z-index: 1;
}

.bazaar-card-mid {
    padding: 0.85rem 1.1rem 0.65rem;
    flex: 1;
    text-align: left;
}

.bazaar-card-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 0.25rem;
}

.bazaar-card-stats {
    font-size: 0.72rem;
    color: #7c3aed;
    font-weight: 700;
    margin: 0 0 0.65rem;
    line-height: 1.35;
}

.bazaar-card-seller {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.85rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.bazaar-seller-avatar {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #9945ff, #14f195);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.bazaar-seller-wallet {
    font-size: 0.7rem;
    color: #475569;
    font-family: ui-monospace, monospace;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bazaar-seller-verified {
    color: #22c55e;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.bazaar-card-bottom {
    padding: 0.85rem 1.1rem 1.1rem;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
    border-top: 1px solid #f1f5f9;
}

.bazaar-card-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.bazaar-card-price-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.bazaar-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.bazaar-card-price-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #059669;
    background: #d1fae5;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.bazaar-card-fee {
    font-size: 0.66rem;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.bazaar-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #4c1d95, 0 14px 24px -8px rgba(124, 58, 237, 0.55);
}

.bazaar-card-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4c1d95;
}

.bazaar-card-btn--cancel {
    background: #fff;
    color: #64748b;
    border: 2px solid #e2e8f0;
    box-shadow: 0 3px 0 #e2e8f0;
}

.bazaar-card-btn--cancel:hover {
    background: #f8fafc;
    box-shadow: 0 4px 0 #e2e8f0;
}

.bazaar-filter-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border-radius: 1.4rem;
    border: 2px dashed #e2e8f0;
    color: #94a3b8;
}

.bazaar-filter-empty i {
    font-size: 2rem;
    color: #c4b5fd;
    margin-bottom: 0.65rem;
    display: block;
}

.bazaar-filter-empty p {
    font-weight: 800;
    color: #64748b;
    margin: 0 0 1rem;
}

.bazaar-filter-reset {
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    box-shadow: 0 4px 14px -6px rgba(124, 58, 237, 0.45);
}

@keyframes bazaarCardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Empty state */
.bazaar-empty {
    text-align: center;
    padding: 3.25rem 1.75rem 3rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.65rem;
    border: 2px dashed rgba(167, 139, 250, 0.4);
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 36px -16px rgba(124, 58, 237, 0.15);
}

.bazaar-empty::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(167,139,250,0.14), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(56,189,248,0.06), transparent 40%);
    pointer-events: none;
}

.bazaar-empty-visual {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 1rem;
    border-radius: 1.5rem;
    background: linear-gradient(145deg, #ede9fe, #c4b5fd);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    box-shadow: 0 14px 32px -10px rgba(124, 58, 237, 0.4);
    animation: bazaarFloat 4s ease-in-out infinite;
}

.bazaar-empty-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #312e81;
    margin: 0 0 0.45rem;
    position: relative;
}

.bazaar-empty-desc {
    font-size: 0.88rem;
    color: #64748b;
    max-width: 22rem;
    margin: 0 auto 1.5rem;
    line-height: 1.55;
    position: relative;
}

.bazaar-empty-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.bazaar-empty-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: #f5f3ff;
    border: 1.5px solid rgba(167, 139, 250, 0.3);
    font-size: 0.74rem;
    font-weight: 800;
    color: #5b21b6;
}

.bazaar-empty-step-num {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bazaar-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    position: relative;
}

.bazaar-empty-cta--lab {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 4px 0 #4c1d95, 0 10px 22px -8px rgba(124, 58, 237, 0.45);
}

.bazaar-empty-cta--lab:hover {
    box-shadow: 0 5px 0 #4c1d95, 0 12px 26px -8px rgba(124, 58, 237, 0.5);
}

.bazaar-empty-cta--lab:active {
    box-shadow: 0 2px 0 #4c1d95;
}

.bazaar-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: 1.15rem;
    font-weight: 800;
    font-size: 0.88rem;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 55%, #9a3412 100%);
    box-shadow: 0 4px 0 #7c2d12, 0 10px 22px -8px rgba(234, 88, 12, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}

.bazaar-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #7c2d12, 0 12px 26px -8px rgba(234, 88, 12, 0.55);
}

.bazaar-empty-cta:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #7c2d12;
}

/* Sell modal */
.bazaar-modal-backdrop {
    backdrop-filter: blur(6px);
    animation: mfBackdropIn 0.25s ease;
}

@keyframes mfBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bazaar-sell-modal {
    animation: mfModalIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes mfModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.bazaar-sell-modal {
    background: #fff;
    border-radius: 1.5rem;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 28px 64px -16px rgba(76, 29, 149, 0.35);
    border: 2px solid rgba(167, 139, 250, 0.4);
    animation: mfModalIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.bazaar-sell-header {
    display: flex;
    gap: 0.85rem;
    padding: 1.35rem;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 45%, #c4b5fd 100%);
    align-items: flex-start;
}

.bazaar-sell-art {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.bazaar-sell-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: #6d28d9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bazaar-sell-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #312e81;
}

.bazaar-sell-stats { font-size: 0.78rem; color: #5b21b6; font-weight: 600; }

.bazaar-modal-close {
    margin-left: auto;
    border: none;
    background: rgba(255,255,255,0.55);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

.bazaar-modal-close:hover { background: rgba(255,255,255,0.9); }

.bazaar-sell-body { padding: 1.25rem; }

.bazaar-sell-label {
    font-weight: 800;
    font-size: 0.82rem;
    color: #475569;
    display: block;
    margin-bottom: 0.5rem;
}

.bazaar-sell-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.55rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    transition: border-color 0.15s;
}

.bazaar-sell-input-wrap:focus-within {
    border-color: #34d399;
    background: #fff;
}

.bazaar-sell-input {
    flex: 1;
    border: none;
    font-size: 1.55rem;
    font-weight: 900;
    color: #059669;
    outline: none;
    width: 100%;
    background: transparent;
}

.bazaar-sell-hint { font-size: 0.78rem; color: #94a3b8; margin: 0 0 1rem; }

.bazaar-sell-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: #047857;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.bazaar-sell-preview strong { font-size: 1.15rem; color: #059669; }

.bazaar-sell-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem 1.25rem;
}

.bazaar-btn-cancel {
    flex: 1;
    padding: 0.7rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}

.bazaar-btn-confirm {
    flex: 2;
    padding: 0.7rem;
    border: none;
    border-radius: 1rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.5);
}

/* ═══════════════════════════════════════
   HERRERÍA
   ═══════════════════════════════════════ */
.forge-tab-shell {
    max-width: 980px;
    margin: 0 auto;
}

.forge-hero {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    margin-bottom: 1.35rem;
    border: 2px solid rgba(251, 146, 60, 0.4);
    background: linear-gradient(145deg, #292524 0%, #431407 28%, #7c2d12 58%, #b45309 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 22px 48px -14px rgba(124, 45, 18, 0.55);
    min-height: clamp(168px, 22vw, 220px);
}

.forge-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("../assets/forge-hero-bg.png") center 42% / cover no-repeat;
    transform: scale(1.03);
}

.forge-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            105deg,
            rgba(28, 12, 6, 0.9) 0%,
            rgba(55, 22, 8, 0.68) 36%,
            rgba(68, 28, 10, 0.42) 62%,
            rgba(20, 10, 6, 0.5) 100%
        ),
        linear-gradient(180deg, transparent 52%, rgba(12, 6, 4, 0.72) 100%);
}

.forge-hero-bg::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 42%;
    height: 100%;
    background: radial-gradient(circle at 75% 55%, rgba(251, 146, 60, 0.22) 0%, transparent 68%);
}

.forge-hero-embers {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.forge-ember {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 8px #f59e0b;
    animation: forgeEmber 3s ease-in-out infinite;
    opacity: 0;
}

.forge-ember.e1 { left: 15%; bottom: 20%; animation-delay: 0s; }
.forge-ember.e2 { left: 45%; bottom: 15%; animation-delay: 0.8s; }
.forge-ember.e3 { left: 70%; bottom: 25%; animation-delay: 1.6s; }
.forge-ember.e4 { left: 85%; bottom: 18%; animation-delay: 2.2s; }

@keyframes forgeEmber {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-60px) scale(0.2); }
}

.forge-hero-inner {
    position: relative;
    z-index: 3;
    padding: 1.5rem 1.75rem;
}

.forge-hero-content {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.forge-hero-text {
    flex: 1;
    min-width: min(100%, 260px);
}

.forge-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffedd5;
    background: rgba(12, 6, 4, 0.55);
    border: 1px solid rgba(251, 146, 60, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
}

.forge-hero-kicker i {
    color: #fb923c;
    font-size: 0.68rem;
}

.forge-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(251,191,36,0.35), rgba(234,88,12,0.25));
    border: 2px solid rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #fde68a;
    box-shadow: 0 8px 24px -8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: forgeHammerPulse 2.5s ease-in-out infinite;
}

@keyframes forgeHammerPulse {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.forge-hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.12rem;
    font-family: 'Nunito', 'Fredoka', sans-serif;
    font-size: clamp(1.85rem, 3.6vw, 2.45rem);
    font-weight: 900;
    margin: 0 0 0.4rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.forge-hero-title-text {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 1.5px rgba(69, 26, 3, 0.72);
    paint-order: stroke fill;
    text-shadow:
        0 2px 0 rgba(92, 32, 6, 0.58),
        0 4px 0 rgba(69, 26, 3, 0.42),
        0 6px 20px rgba(0, 0, 0, 0.55);
}

.forge-hero-title-accent {
    color: #fbbf24;
    text-shadow:
        0 2px 0 rgba(120, 53, 15, 0.85),
        0 4px 14px rgba(0, 0, 0, 0.65),
        0 0 18px rgba(251, 191, 36, 0.45);
}

.forge-hero-desc {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: clamp(0.92rem, 1.6vw, 1.02rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.96);
    margin: 0;
    line-height: 1.58;
    max-width: 34rem;
    letter-spacing: 0.01em;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.82),
        0 3px 14px rgba(0, 0, 0, 0.48);
}

.forge-hero-desc strong {
    font-weight: 800;
    color: #fcd34d;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.95),
        0 0 10px rgba(251, 191, 36, 0.45);
}

.forge-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.forge-resources span {
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff7ed;
    background: rgba(12, 6, 4, 0.62);
    padding: 0.48rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.forge-resources span i {
    color: #fbbf24;
    font-size: 0.78rem;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.35));
}

.forge-resources span:nth-child(2) i {
    color: #a78bfa;
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.35));
}

.forge-resources span:nth-child(3) i {
    color: #34d399;
    filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.35));
}

.forge-section-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.08rem;
    color: #334155;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.forge-section-title i {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.forge-queue-section .forge-section-title i {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #c2410c;
}

.forge-recipes-section .forge-section-title i {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

.forge-queue-section,
.forge-recipes-section {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.45rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 28px -12px rgba(0,0,0,0.08);
}

.forge-queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.forge-queue-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.86rem;
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border-radius: 1rem;
    border: 1px dashed #e2e8f0;
}

.forge-queue-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1.5px solid #fed7aa;
    border-radius: 1.1rem;
    position: relative;
    overflow: hidden;
}

.forge-queue-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #fb923c, #f59e0b);
    width: var(--forge-pct, 0%);
    transition: width 0.5s ease;
}

.forge-queue-ready {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #6ee7b7;
}

.forge-queue-ready::after {
    width: 100%;
    background: linear-gradient(90deg, #34d399, #10b981);
}

.forge-queue-icon {
    font-size: 1.85rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.forge-queue-info { flex: 1; min-width: 0; }

.forge-queue-name {
    font-weight: 800;
    font-size: 0.92rem;
    color: #78350f;
}

.forge-queue-timer {
    font-size: 0.74rem;
    color: #b45309;
    font-weight: 700;
    margin-top: 0.1rem;
}

.forge-queue-ready .forge-queue-name { color: #047857; }
.forge-queue-ready .forge-queue-timer { color: #059669; }

.forge-claim-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    box-shadow: 0 3px 0 #065f46;
}

.forge-spinner {
    color: #d97706;
    font-size: 1.1rem;
    animation: forgeHammerSpin 0.75s ease-in-out infinite;
}

@keyframes forgeHammerSpin {
    0%, 100% { transform: rotate(-12deg); }
    50% { transform: rotate(12deg); }
}

.forge-recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1.1rem;
}

.forge-recipe-card {
    position: relative;
    border: 1.5px solid #e2e8f0;
    border-radius: 1.3rem;
    padding: 1.2rem 1.1rem 1.1rem;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.2s;
    overflow: hidden;
}

.forge-recipe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e2e8f0;
}

.forge-recipe-card--defense::before {
    background: linear-gradient(90deg, #fb923c, #ea580c);
}

.forge-recipe-card--farm::before {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.forge-recipe-ready {
    border-color: rgba(251, 146, 60, 0.45);
    background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}

.forge-recipe-ready:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -12px rgba(234, 88, 12, 0.3);
    border-color: #fdba74;
}

.forge-recipe-soon {
    opacity: 0.72;
    filter: grayscale(0.25);
}

.forge-soon-badge {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
    z-index: 1;
}

.forge-recipe-cat {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.forge-recipe-art-wrap {
    position: relative;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.55rem;
    background: radial-gradient(ellipse at center, rgba(255,237,213,0.5) 0%, transparent 68%);
    border-radius: 1rem;
}

.forge-recipe-art {
    max-height: 58px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
}

.forge-recipe-emoji {
    position: absolute;
    bottom: 2px;
    right: 22%;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.forge-recipe-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.forge-recipe-cost {
    font-size: 0.72rem;
    color: #64748b;
    margin: 0.4rem 0;
    font-weight: 600;
    line-height: 1.4;
}

.forge-recipe-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.7rem;
    font-weight: 700;
}

.forge-recipe-time i { margin-right: 0.2rem; }

.forge-recipe-btn {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 0.95rem;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    background: #e2e8f0;
    color: #64748b;
}

.forge-recipe-ready .forge-recipe-btn.shine-btn {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 55%, #9a3412 100%);
    color: #fff;
    box-shadow: 0 4px 0 #7c2d12, 0 8px 18px -6px rgba(234, 88, 12, 0.45);
}

.forge-recipe-ready .forge-recipe-btn.shine-btn:hover {
    transform: translateY(-1px);
}

.forge-recipe-ready .forge-recipe-btn.shine-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #7c2d12;
}

.forge-recipe-card {
    animation: forgeCardIn 0.45s cubic-bezier(0.34, 1.15, 0.64, 1) backwards;
}

@keyframes forgeCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.forge-recipe-card:nth-child(1) { animation-delay: 0ms; }
.forge-recipe-card:nth-child(2) { animation-delay: 60ms; }
.forge-recipe-card:nth-child(3) { animation-delay: 120ms; }
.forge-recipe-card:nth-child(4) { animation-delay: 180ms; }

@media (max-width: 768px) {
    .bazaar-stats-row { grid-template-columns: 1fr; }
    .bazaar-hero-inner { padding: 1.25rem 1.2rem 1.1rem; }
    .bazaar-hero-orbit { width: 110px; height: 110px; }
    .bazaar-hero-art-ring { inset: 16px; }
    .bazaar-hero-art { width: 56px; }
    .bazaar-hero-visual { display: none; }
    .bazaar-sort-select { width: 100%; }
    .bazaar-filters-meta { margin-left: 0; width: 100%; justify-content: space-between; }
    .bazaar-inv-panel { position: static; }
    .bazaar-inv-body { max-height: none; }
    .forge-hero-bg::after { display: none; }
}

@media (max-width: 359px) {
    .bazaar-modal-backdrop {
        align-items: flex-start;
        padding: 0.75rem 0.5rem;
        overflow-y: auto;
    }
    .bazaar-sell-modal {
        max-height: calc(100vh - 1.5rem);
        overflow-y: auto;
        margin: auto 0;
    }
    .bazaar-sell-header,
    .bazaar-sell-body,
    .bazaar-buy-body {
        flex-shrink: 0;
    }
}

body.offline-readonly #offline-maintenance-banner {
    z-index: 1100;
}

body.offline-readonly .bazaar-modal-backdrop,
body.offline-readonly .purchase-confirm-backdrop,
body.offline-readonly .plant-modal-panel {
    z-index: 1050;
}
