:root {
    --bg: #0a0a0f;
    --bg-elevated: #14141c;
    --card-bg: #1a1a24;
    --accent: #7c5cff;
    --accent-glow: rgba(124, 92, 255, 0.4);
    --text: #f5f5fa;
    --text-dim: #9898a8;
    --radius: 20px;
    --border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* --- Header --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.logo { font-size: 20px; font-weight: 700; }
.header-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--text-dim); }
.user-chip {
    background: var(--card-bg);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
}

/* --- Hero / Featured carousel --- */
.hero-section { padding: 24px 0 8px; }
.hero-title { font-size: 24px; font-weight: 800; padding: 0 20px 4px; }
.hero-subtitle { font-size: 14px; color: var(--text-dim); padding: 0 20px 20px; }

.featured-swiper { padding: 20px 0 40px !important; }
.featured-swiper .swiper-slide {
    width: 78vw;
    max-width: 320px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}
.featured-swiper .swiper-slide-active { opacity: 1; }

.trend-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    aspect-ratio: 9 / 14;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}
.trend-card video, .trend-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.trend-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}
.trend-card-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.trend-card-price { font-size: 13px; color: var(--text-dim); }

.sound-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(20, 20, 28, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 8px transparent; }
}
.sound-toggle.is-unmuted { animation: none; background: rgba(124, 92, 255, 0.25); }

/* --- Browse all grid --- */
.browse-link-row { padding: 8px 20px 32px; text-align: center; }
.browse-link {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-dim);
}

.trend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px 40px;
}
.trend-grid .trend-card { aspect-ratio: 9 / 13; }
.trend-grid .trend-card-title { font-size: 14px; }
.trend-grid .trend-card-price { font-size: 12px; }

/* --- Single trend page --- */
.trend-page-hero { padding: 20px; }
.trend-page-video-wrap {
    max-width: 420px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 9 / 14;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.trend-page-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.trend-page-info { max-width: 420px; margin: 20px auto 0; padding: 0 4px; }
.trend-page-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.trend-page-desc { font-size: 15px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }
.trend-page-price { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.trend-page-price .usd { color: var(--text-dim); font-size: 14px; font-weight: 400; }

.quality-tip {
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.btn-primary {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 12px auto 0;
    padding: 16px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
}

.upload-dropzone {
    max-width: 420px;
    margin: 0 auto 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
}
.upload-dropzone.has-photo { border-color: var(--accent); color: var(--text); }
.upload-dropzone img { max-width: 120px; border-radius: 12px; margin-bottom: 12px; }

.status-box {
    max-width: 420px;
    margin: 20px auto 0;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
}

.similar-section { padding: 32px 20px; }
.similar-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text-dim); }

/* --- Footer --- */
.site-footer {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 24px 20px;
    font-size: 13px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
}

/* --- Desktop: secondary, just cap width, don't redesign --- */
@media (min-width: 768px) {
    main { max-width: 480px; margin: 0 auto; width: 100%; }
}
