/* Worlds Hero */
.worlds-hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
    text-align: center;
    background: linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.06) 0%, rgba(var(--color-accent-rgb), 0.02) 50%, rgba(var(--color-accent-rgb), 0.06) 100%);
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.12);
    position: relative;
    overflow: hidden;
}

/* Decorative background shimmer */
.worlds-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(var(--color-accent-rgb), 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(var(--color-accent-rgb), 0.04) 0%, transparent 50%);
    animation: hero-shimmer 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes hero-shimmer {
    0% { transform: translate(0, 0); }
    100% { transform: translate(3%, -2%); }
}

.worlds-hero__icon {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    filter: drop-shadow(0 0 16px rgba(var(--color-accent-rgb), 0.5));
    margin-bottom: var(--space-md);
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: hero-icon-float 4s ease-in-out infinite;
}

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

.worlds-hero__title {
    font-family: var(--font-display);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    position: relative;
}

.worlds-hero__subtitle {
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    position: relative;
}

/* Toolbar */
.worlds-content {
    padding: var(--space-2xl) 0 var(--space-3xl);
}

.worlds-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.worlds-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.worlds-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.worlds-search__input {
    padding-left: 40px;
}

.worlds-search__input:focus ~ .worlds-search__icon,
.worlds-search:focus-within .worlds-search__icon {
    color: var(--color-accent);
}

.worlds-sort {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* World Cards Grid */
.worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

@keyframes world-card-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.world-card {
    background: linear-gradient(145deg, var(--color-surface), rgba(var(--color-surface-rgb), 0.6));
    border: 1px solid rgba(var(--color-accent-rgb), 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    color: var(--color-text);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: world-card-in 0.5s ease both;
}

.world-card:nth-child(1) { animation-delay: 0s; }
.world-card:nth-child(2) { animation-delay: 0.06s; }
.world-card:nth-child(3) { animation-delay: 0.12s; }
.world-card:nth-child(4) { animation-delay: 0.18s; }
.world-card:nth-child(5) { animation-delay: 0.24s; }
.world-card:nth-child(6) { animation-delay: 0.3s; }
.world-card:nth-child(n+7) { animation-delay: 0.35s; }

/* Bottom accent bar */
.world-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.world-card:hover {
    border-color: rgba(var(--color-accent-rgb), 0.25);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-6px);
}

.world-card:hover::after {
    transform: scaleX(1);
}

/* Background watermark icon */
.world-card__bg-icon {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100px;
    height: 100px;
    color: var(--color-accent);
    opacity: 0.03;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.world-card:hover .world-card__bg-icon {
    opacity: 0.08;
    transform: rotate(-8deg) scale(1.05);
}

/* Cover image */
.world-card__cover {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.world-card__cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(var(--color-surface-rgb), 0.6), transparent);
    pointer-events: none;
}

.world-card__cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.world-card:hover .world-card__cover-img {
    transform: scale(1.06);
}

/* Icon placeholder (when no cover image) */
.world-card__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.06), rgba(var(--color-accent-rgb), 0.02));
    position: relative;
}

.world-card__icon {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    filter: drop-shadow(0 0 10px rgba(var(--color-accent-rgb), 0.35));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.world-card:hover .world-card__icon {
    filter: drop-shadow(0 0 18px rgba(var(--color-accent-rgb), 0.55));
    transform: scale(1.08);
}

/* Card body */
.world-card__body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.world-card__title {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.world-card:hover .world-card__title {
    color: var(--color-accent-hover);
}

.world-card__desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(var(--font-size-sm) * 1.5 * 2);
}

.world-card__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.06);
}

.world-card__meta-icon {
    width: 14px;
    height: 14px;
}

/* Empty */
.worlds-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.worlds-empty__icon {
    width: 56px;
    height: 56px;
    opacity: 0.3;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
}

/* Responsive */
@media (max-width: 768px) {
    .worlds-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .worlds-search {
        max-width: none;
    }

    .worlds-sort {
        justify-content: center;
    }

    .worlds-grid {
        grid-template-columns: 1fr;
    }

    .worlds-hero {
        padding: var(--space-2xl) 0 var(--space-xl);
    }

    .worlds-hero__title {
        font-size: var(--font-size-xl);
    }
}

/* Light theme */
[data-theme="light"] .world-card {
    background: linear-gradient(145deg, var(--color-surface), rgba(239, 232, 250, 0.6));
}

[data-theme="light"] .world-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

[data-theme="light"] .worlds-hero {
    background: linear-gradient(135deg, rgba(var(--color-accent-rgb), 0.04) 0%, rgba(var(--color-accent-rgb), 0.01) 50%, rgba(var(--color-accent-rgb), 0.04) 100%);
}
