/* PULSE - Terminal Aesthetic Dashboard */

:root {
    --bg-primary: #F5F5F5;
    --bg-secondary: #EFEFEF;
    --bg-panel: #F5F5F5;
    --border-color: #cccccc;
    --text-primary: #1a1a18;
    --text-secondary: #1a1a18;
    --text-dim: #4a4a48;
}

/* ===========================================
   LOADING OVERLAY - Shows spinner on initial load
   =========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================================
   HOMEPAGE MODE - Header replacement
   =========================================== */
.homepage-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 8px;
}

.homepage-toggle:hover {
    opacity: 1;
}

/* Header homepage mode elements */
.header-homepage {
    display: none;
    align-items: center;
    height: 204px; /* Match logo height */
    width: 100%;
}

body.homepage-mode .header-homepage {
    display: flex;
}

body.homepage-mode #headerDefault {
    display: none;
}

.header-day,
.header-year,
.header-ampm {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* Day - left justified */
.header-day {
    flex: 1;
    text-align: left;
}

/* Date - centered between day and year */
.header-date {
    flex: 2;
    text-align: left;
    font-family: 'Futura', 'Futura PT', 'Century Gothic', 'Arial Black', sans-serif;
    font-size: 151px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Year - dead center */
.header-year {
    flex: 1;
    text-align: center;
}

/* Time - centered between year and ampm */
.header-time {
    flex: 2;
    text-align: center;
    font-family: 'Futura', 'Futura PT', 'Century Gothic', 'Arial Black', sans-serif;
    font-size: 151px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

/* AM/PM - right justified */
.header-ampm {
    flex: 1;
    text-align: right;
}

/* Music note rotation for section labels */
.music-note {
    display: inline-block;
    transform: rotate(0deg);
    margin-left: 0;
}

@media (max-width: 768px) {
    .music-note {
        font-size: 140%;
    }
}

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

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
    padding-left: 140px;
    padding-right: 140px;
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border-bottom: 3px solid var(--text-primary);
    margin-bottom: 16px;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.logo {
    height: 204px;
    width: auto;
    display: block;
}

.subtitle {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.update-time {
    color: var(--text-dim);
    font-size: 13px;
}

.refresh-btn {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.refresh-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.refresh-btn:active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.refresh-btn.loading {
    color: var(--text-dim);
    border-color: var(--text-dim);
    cursor: wait;
}

/* Trending Section - 2 rows of 5 at top */
.trending-section {
    margin-bottom: 0;
    padding-bottom: 16px;
}

.trending-grid {
    max-width: 100%;
}

/* Steam Section - same layout as Google Trends */
.steam-section {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    margin-top: 24px;
}

.steam-section .trend-image {
    object-position: center 20%;
}

/* People Section */
.people-section {
    margin-top: 24px;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
}

.people-row-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 16px;
}

.person-card {
    text-align: center;
    min-width: 0;
}

.person-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
}

.person-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-known-for {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Category Grid Layout */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: var(--bg-panel);
    min-width: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.panel-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.panel-source {
    font-size: 13px;
    color: var(--text-dim);
}

.panel-content {
    padding: 8px 0;
}

/* Rankings List */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 3px 0;
    min-height: 36px;
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-number {
    width: 24px;
    flex-shrink: 0;
    font-weight: 400;
    color: var(--text-dim);
    font-size: 13px;
    text-align: right;
    padding-right: 6px;
}

.rank-number.rank-1 {
    color: var(--text-primary);
    font-weight: 700;
}

.rank-number.rank-2,
.rank-number.rank-3 {
    color: var(--text-secondary);
}

.rank-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
}

.rank-content {
    flex: 1;
    min-width: 0;
}

.rank-title {
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-title-link {
    color: var(--text-primary);
    text-decoration: none;
}

.rank-title-link:hover {
    text-decoration: underline;
}

.rank-1 .rank-title {
    font-weight: 700;
}

.rank-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-stats {
    width: 50px;
    flex-shrink: 0;
    text-align: right;
    font-size: 12px;
    color: var(--text-dim);
    margin-left: 4px;
}

.rank-delta {
    font-size: 13px;
    margin-left: 4px;
}

.rank-delta.up {
    color: var(--text-dim);
}

.rank-delta.down {
    color: var(--text-dim);
}

.rank-delta.new {
    color: var(--text-dim);
}

/* Trending Items - Grid Card Layout */
.trend-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--bg-panel);
    min-width: 0;
    overflow: hidden;
}

.trend-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.trend-link:hover {
    opacity: 0.8;
}

.trend-link:hover .trend-title {
    text-decoration: underline;
}

.trend-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    min-width: 0;
    overflow: hidden;
}

.trend-rank {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dim);
}

.trend-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-image {
    width: 100%;
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    margin-bottom: 8px;
}

/* Cards without images (e.g., Reddit when thumbnails unavailable) */
.trend-card.no-image {
    /* Make text-only cards look intentional */
    min-height: 100px;
}

.trend-card.no-image .trend-context {
    /* Give more room for the title when no image */
    -webkit-line-clamp: 4;
}

.trending-section .trend-image {
    object-position: center 20%;
}

.trend-context {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hide empty context lines */
.trend-context:empty {
    display: none;
}

.trend-divider {
    grid-column: 1 / -1;
    height: 2px;
    background: var(--text-primary);
    margin: 8px 0;
}

/* Section Labels - bold labels in left margin */
.section-label {
    position: absolute;
    left: -130px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    font-family: 'Futura', 'Futura PT', 'Century Gothic', 'Arial Black', sans-serif;
    font-size: 70px;
    font-weight: 700;
    color: #e8e8e8;
    text-transform: uppercase;
    letter-spacing: -0.08em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

/* Row wrapper - contains label + content */
.trending-row-wrapper {
    position: relative;
}

.charts-wrapper {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
}

.trending-row-wrapper {
    margin-bottom: 16px;
}

.trending-row-wrapper:last-child {
    margin-bottom: 0;
}

.section-divider {
    height: 2px;
    background: var(--text-primary);
    margin: 8px 0 16px 0;
}

.trending-row-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .trending-row-content {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
}

@media (max-width: 900px) {
    .trending-row-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .trending-row-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

.trending-section {
    position: relative;
}

.main-content {
    position: relative;
}

/* Legacy trend-item styles (keep for fallback) */
.trend-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px dotted var(--border-color);
    position: relative;
    cursor: default;
}

.trend-item:last-child {
    border-bottom: none;
}

.trend-bullet {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.trend-text {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.trend-source {
    display: none;
}

/* Upcoming Items */
.upcoming-item {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-date {
    width: 70px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 700;
}

.upcoming-content {
    flex: 1;
}

.upcoming-title {
    color: var(--text-primary);
    font-size: 12px;
}

.upcoming-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 1px;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 0; /* Hide the text */
}

.loading::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Error State */
.error {
    color: var(--text-dim);
    font-size: 13px;
    padding: 10px;
    text-align: center;
}

/* Footer */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-top: 3px solid var(--text-primary);
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-dim);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-link {
    color: var(--text-dim);
    text-decoration: none;
}

.footer-link:hover {
    color: var(--text-primary);
}

#statusIndicator {
    color: var(--text-dim);
}

#statusIndicator.fetching {
    color: var(--text-secondary);
}

#statusIndicator.error {
    color: var(--text-dim);
}


/* ASCII Decorations */
.ascii-border {
    color: var(--border-color);
    font-size: 12px;
}

/* Empty State */
.empty-state {
    color: var(--text-dim);
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

/* Coming Soon Header */
.coming-soon-header {
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    padding: 8px 0 4px 24px;
    margin-top: 4px;
}

/* Media Popup (Movies, Videos, etc.) */
.media-item {
    cursor: pointer;
}

.media-item:hover {
    background: var(--bg-secondary);
}

.media-popup {
    position: absolute;
    z-index: 1000;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.media-popup-image {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
}

.media-popup-text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--bg-primary);
}

/* Web Traffic Section */
.web-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.web-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px 20px;
}

@media (max-width: 1400px) {
    .web-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .web-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .web-grid {
        grid-template-columns: 1fr;
    }
}

/* YouTube Section */
.youtube-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

.youtube-section .trend-title {
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Reddit Section */
.reddit-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Reddit: Subreddit on top - same size as YouTube */
.reddit-section .trend-title {
    font-size: 12px;
    letter-spacing: 0.5px;
}

.reddit-section .trend-context {
    font-size: 11px;
    line-height: 1.2;
}

.reddit-section .trend-image {
    object-position: center top;
}

/* Out of the Loop Section */
.ootl-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 24px;
}

.ootl-header {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ootl-card .trend-title {
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* OOTL Answer Popup */
.ootl-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.ootl-popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.ootl-popup {
    background: var(--bg-primary);
    max-width: 600px;
    max-height: 80vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--text-primary);
}

.ootl-popup-header {
    padding: 16px 20px;
    border-bottom: 2px solid var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ootl-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}

.ootl-popup-close {
    background: none;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    padding: 4px 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.ootl-popup-close:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.ootl-popup-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ootl-popup-answer {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.ootl-popup-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
}

.ootl-popup-author {
    font-weight: 700;
}

.ootl-popup-score {
    color: var(--text-secondary);
}

.ootl-popup-link {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-dim);
}

.ootl-popup-link:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.ootl-popup-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 12px;
}

.ootl-popup-error {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 12px;
}

/* TikTok Hashtags Section */
.tiktok-hashtags-section {
    position: relative;
    border-top: none;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Viral Products Section */
.products-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

.products-section .product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.products-section .product-card.has-image {
    min-height: 180px;
}

.products-section .product-image {
    width: 100%;
    height: 120px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fff;
    border-radius: 4px;
    margin-bottom: 8px;
}

.products-section .product-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.products-section .product-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.products-section .product-why {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-section .product-price {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Songs Section (grid layout with thumbnails) */
.songs-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Viral Section (songs going viral on TikTok) */
.viral-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

/* KYM Section (Know Your Meme) */
.kym-section {
    position: relative;
    border-top: 3px solid var(--text-primary);
    padding-top: 16px;
    padding-bottom: 16px;
}

/* KYM square thumbnails and smaller font */
.kym-section .trend-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

.kym-section .trend-title {
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* KYM two rows of 8 grid layout */
.kym-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kym-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.tiktok-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.tiktok-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tiktok-card:hover .tiktok-thumbnail img {
    transform: scale(1.05);
}

.tiktok-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: var(--bg-secondary);
    overflow: hidden;
}

.tiktok-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.tiktok-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 7px;
    color: var(--text-dim);
}

.tiktok-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.tiktok-card:hover .tiktok-play-overlay {
    opacity: 1;
}

.tiktok-play-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tiktok-play-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid var(--text-primary);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-left: 2px;
}

.tiktok-info {
    padding: 4px 0;
    height: 30px;
    overflow: hidden;
}

.tiktok-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 14px;
    line-height: 14px;
}

.tiktok-stats {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 1px;
    height: 12px;
    line-height: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TikTok Sound Cards (for trending sounds) */
.tiktok-sound-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}

.tiktok-sound-card:hover {
    background: var(--bg-tertiary);
}

.tiktok-sound-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 24px;
    text-align: center;
}

.tiktok-sound-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tiktok-sound-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tiktok-sound-author {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.tiktok-sound-stats {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

.tiktok-sound-icon {
    font-size: 18px;
    color: var(--text-dim);
    opacity: 0.5;
}

/* ===========================================
   AD ROW - Desktop Only
   =========================================== */
.ad-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-primary);
}

.ad-unit {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide ad row if ads haven't loaded (empty ins elements) */
.ad-row:has(.adsbygoogle[data-ad-status="unfilled"]),
.ad-row:has(.adsbygoogle:empty) {
    display: none;
}

/* Hide mobile landing slide and install slide on desktop */
.mobile-landing-slide,
.mobile-install-slide {
    display: none;
}

/* ===========================================
   MOBILE HORIZONTAL CAROUSEL EXPERIENCE
   =========================================== */

@media (max-width: 768px) {
    /* Hide Steam on mobile */
    .steam-section {
        display: none !important;
    }

    /* Use CSS variable for viewport height - accounts for URL bar in browser mode */
    :root {
        --mobile-vh: 100dvh;
    }

    /* Hide content until loaded and scrolled to prevent flash */
    body:not(.loaded) .container {
        visibility: hidden;
        opacity: 0;
    }

    body.loaded .container {
        visibility: visible;
        opacity: 1;
    }

    /* Hide desktop elements */
    .header,
    .footer,
    .section-label,
    .coming-soon-header,
    .ad-row {
        display: none !important;
    }

    /* Hide OOTL on mobile */
    .ootl-section {
        display: none !important;
    }

    /* Reset body */
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Main HORIZONTAL scroll container */
    .container {
        padding: 0;
        padding-left: 0;
        max-width: none;
        width: 100%;
        height: var(--mobile-vh);
        display: flex;
        flex-direction: row;
        scroll-snap-type: x mandatory;
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide main-content wrapper styling */
    .main-content {
        display: contents;
    }

    /* ===========================================
       PULL TO REFRESH
       =========================================== */
    .pull-to-refresh {
        position: fixed;
        top: 20px;
        left: 0;
        right: 0;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Futura', 'Futura PT', 'Century Gothic', 'Arial Black', sans-serif;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-dim);
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 999;
        pointer-events: none;
    }

    .pull-to-refresh.visible {
        opacity: 1;
    }

    /* ===========================================
       BASE MOBILE SLIDE STYLES
       =========================================== */
    .mobile-slide {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        padding: 8px;
        overflow: hidden;
    }

    /* ===========================================
       GOOGLE & X TRENDS - Each is its own horizontal slide
       =========================================== */
    .trending-section {
        display: contents !important;
    }

    .trending-section .trending-grid {
        display: contents;
    }

    .trending-section .section-divider {
        display: none;
    }

    .trending-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .trending-section .trending-row-content {
        display: contents;
    }

    .trending-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .trending-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .trending-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        object-position: center 20%;
        opacity: 0.4;
        margin: 0;
        z-index: 1;
    }

    .trending-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    .trending-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 21px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    /* X trends - centered vertical list layout */
    .trending-section .trending-row-wrapper:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px;
        gap: 0;
    }

    .trending-section .trending-row-wrapper:last-child .trending-row-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    .trending-section .trending-row-wrapper:last-child .trend-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        padding: 0;
        width: 100%;
        line-height: 1;
    }

    .trending-section .trending-row-wrapper:last-child .trend-card::before {
        display: none;
    }

    .trending-section .trending-row-wrapper:last-child .trend-header {
        flex-direction: column;
        padding: 0;
        gap: 0;
        align-items: center;
    }

    .trending-section .trending-row-wrapper:last-child .trend-rank {
        font-size: 10px;
        color: var(--text-dim);
        line-height: 1.2;
    }

    .trending-section .trending-row-wrapper:last-child .trend-title {
        font-size: 28px;
        font-weight: 700;
        padding: 0;
        white-space: nowrap;
        line-height: 1.05;
    }

    .trending-section .trending-row-wrapper:last-child .trend-context {
        display: none;
    }

    .trending-section .trending-row-wrapper:last-child .trend-image {
        display: none;
    }

    .trending-section .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.1;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       STEAM - Hidden on mobile
       =========================================== */
    .steam-section {
        display: none !important;
    }

    .steam-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .steam-section .trending-row-content {
        display: contents;
    }

    .steam-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
        border-radius: 4px;
        min-height: 0;
    }

    .steam-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0.3;
        z-index: 0;
    }

    .steam-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 20%;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .steam-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 8px;
        gap: 8px;
    }

    .steam-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.2;
        white-space: normal;
        overflow: visible;
    }

    .steam-section .trend-context {
        display: none;
    }

    /* ===========================================
       YOUTUBE - Horizontal slide
       =========================================== */
    .youtube-section {
        display: contents !important;
    }

    .youtube-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .youtube-section .trending-row-content {
        display: contents;
    }

    .youtube-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .youtube-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .youtube-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .youtube-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    .youtube-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    .youtube-section .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.1;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       REDDIT - Layout like Google but subreddit on top, title below
       =========================================== */
    .reddit-section {
        display: contents !important;
    }

    .reddit-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .reddit-section .trending-row-content {
        display: contents;
    }

    .reddit-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .reddit-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .reddit-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        object-position: center top;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .reddit-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    /* Reddit: Subreddit name - same size as YouTube */
    .reddit-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    /* Reddit: Post title - same as YouTube */
    .reddit-section .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.1;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       TIKTOK HASHTAGS - Same layout as X trends
       =========================================== */
    /* TikTok Hashtags - centered vertical list layout (same as X) */
    .tiktok-hashtags-section {
        display: contents !important;
        border: none;
    }

    .tiktok-hashtags-section .trending-grid {
        display: contents;
    }

    .tiktok-hashtags-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px;
        gap: 0;
        position: relative;
    }

    .tiktok-hashtags-section .trending-row-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    .tiktok-hashtags-section .trend-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        padding: 0;
        width: 100%;
        line-height: 1;
    }

    .tiktok-hashtags-section .trend-card::before {
        display: none;
    }

    .tiktok-hashtags-section .trend-header {
        flex-direction: column;
        padding: 0;
        gap: 0;
        align-items: center;
    }

    .tiktok-hashtags-section .trend-rank {
        font-size: 10px;
        color: var(--text-dim);
        line-height: 1.2;
    }

    .tiktok-hashtags-section .trend-title {
        font-size: 28px;
        font-weight: 700;
        padding: 0;
        white-space: nowrap;
        text-transform: uppercase;
        line-height: 1.05;
    }

    .tiktok-hashtags-section .trend-context {
        display: none;
    }

    .tiktok-hashtags-section .trend-image {
        display: none;
    }

    /* ===========================================
       VIRAL PRODUCTS - Product cards with images
       =========================================== */
    .products-section {
        display: contents !important;
        border: none;
    }

    .products-section .trending-grid {
        display: contents;
    }

    .products-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .products-section .trending-row-content {
        display: contents;
    }

    .products-section .product-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
        text-decoration: none;
        color: inherit;
    }

    .products-section .product-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 50px;
        background: #f5f5f5;
        z-index: 0;
    }

    .products-section .product-image {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 50px;
        width: 100%;
        height: auto;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        background-color: #fff;
        z-index: 1;
        border-radius: 0;
        margin: 0;
    }

    .products-section .trend-header {
        position: absolute;
        bottom: 50px;
        left: 0;
        right: 0;
        z-index: 2;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 4px 6px;
        background: rgba(245, 245, 245, 0.95);
    }

    .products-section .trend-rank {
        font-size: 14px;
        font-weight: 700;
        margin-right: 6px;
    }

    .products-section .product-title {
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .products-section .product-meta {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50px;
        background: var(--bg-primary);
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 4px 6px;
        z-index: 3;
        margin: 0;
        gap: 2px;
    }

    .products-section .product-why {
        font-size: 10px;
        color: var(--text-dim);
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .products-section .product-price {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-primary);
    }

    /* ===========================================
       SONGS - Grid layout with thumbnails (like other sections)
       =========================================== */
    .songs-section {
        display: contents !important;
        border: none;
    }

    .songs-section .trending-grid {
        display: contents;
    }

    .songs-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .songs-section .trending-row-content {
        display: contents;
    }

    .songs-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .songs-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .songs-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .songs-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    .songs-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    .songs-section .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.3;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       VIRAL - Grid layout with thumbnails (like Songs)
       =========================================== */
    .viral-section {
        display: contents !important;
        border: none;
    }

    .viral-section .trending-grid {
        display: contents;
    }

    .viral-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .viral-section .trending-row-content {
        display: contents;
    }

    .viral-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .viral-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .viral-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .viral-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    .viral-section .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    .viral-section .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.3;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       KYM - Grid layout with thumbnails (like Google Trends)
       =========================================== */
    .kym-section {
        display: contents !important;
        border: none;
    }

    .kym-section .trending-grid {
        display: contents;
    }

    .kym-section .trending-row-wrapper {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(8, 1fr);
        gap: 3px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .kym-section .trending-row-content {
        display: contents;
    }

    /* KYM grid - flatten to single 2-column grid on mobile */
    .kym-section .kym-grid {
        display: contents;
    }

    .kym-section .kym-row {
        display: contents;
    }

    .kym-section .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .kym-section .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .kym-section .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .kym-section .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 4px;
        text-align: center;
    }

    .kym-section .trend-title {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        white-space: normal;
        overflow: visible;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .kym-section .trend-context {
        display: none;
    }

    /* ===========================================
       CHARTS - Hide old structure, use new mobile slides
       =========================================== */
    .charts-wrapper,
    .main-content {
        display: none !important;
    }

    /* ===========================================
       NEW Mobile Charts Slides (Songs/Movies/Shows)
       =========================================== */
    .mobile-charts-slide {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 4px;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    .mobile-charts-slide .trending-row-content {
        display: contents;
    }

    .mobile-charts-slide .trend-card {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 0;
        min-height: 0;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .mobile-charts-slide .trend-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40px;
        background: url('fallback.png') center center / cover no-repeat;
        opacity: 0.3;
        z-index: 0;
    }

    .mobile-charts-slide .trend-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: calc(100% - 40px);
        object-fit: cover;
        opacity: 0.5;
        margin: 0;
        z-index: 1;
    }

    .mobile-charts-slide .trend-header {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 6px 0 6px;
        text-align: center;
    }

    .mobile-charts-slide .trend-title {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-bottom: 40px;
    }

    .mobile-charts-slide .trend-context {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: var(--bg-primary);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        font-size: 11px;
        color: var(--text-dim);
        line-height: 1.3;
        padding: 2px 4px;
        text-align: center;
        overflow: hidden;
        z-index: 3;
    }

    /* ===========================================
       Mobile Category Labels - Visible during swipe, fade after landing
       =========================================== */
    .mobile-category-label {
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        transform: translateY(-120%);
        font-family: 'Futura', 'Futura PT', 'Century Gothic', 'Arial Black', sans-serif;
        font-size: 22vw;
        font-weight: 700;
        color: #000000;
        text-transform: uppercase;
        text-align: center;
        letter-spacing: -0.08em;
        padding: 0;
        z-index: 10;
        pointer-events: none;
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .mobile-category-label.faded {
        opacity: 0;
    }

    .mobile-category-label .music-note {
        font-size: 0.8em;
        vertical-align: super;
    }

    /* ===========================================
       Page indicator dots (horizontal)
       =========================================== */
    .mobile-page-indicator {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 8px;
        z-index: 100;
    }

    .mobile-page-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--text-dim);
        opacity: 0.3;
        transition: opacity 0.2s, background 0.2s;
    }

    .mobile-page-dot.active {
        opacity: 1;
        background: var(--text-primary);
    }

    /* ===========================================
       MOBILE LANDING SLIDE
       =========================================== */
    .mobile-landing-slide {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-primary);
        position: relative;
    }

    .landing-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        transform: translateY(-15%);
    }

    .landing-logo {
        width: 80vw;
        max-width: 400px;
        height: auto;
    }

    .landing-arrow {
        font-family: 'JetBrains Mono', monospace;
        font-size: 18px;
        font-weight: bold;
        letter-spacing: 2px;
        color: var(--text-primary);
        margin-top: 40px;
        opacity: 0.7;
        min-height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .landing-spinner {
        width: 36px;
        height: 36px;
        border: 3px solid var(--border-color);
        border-top-color: var(--text-primary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    .landing-text {
        display: inline;
    }

    /* ===========================================
       MOBILE INSTALL SLIDE
       =========================================== */
    .mobile-install-slide {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 100vw;
        width: 100vw;
        height: var(--mobile-vh);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: url('appscreen.png') center center / cover no-repeat;
        position: relative;
    }

    .install-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 60px 40px;
        text-align: center;
        height: 100%;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
    }

    .install-header {
        flex-shrink: 0;
    }

    .install-title {
        font-family: 'JetBrains Mono', monospace;
        font-size: 22px;
        font-weight: bold;
        color: var(--text-primary);
        margin-bottom: 4px;
    }

    .install-subtitle {
        font-family: 'JetBrains Mono', monospace;
        font-size: 22px;
        font-weight: bold;
        color: var(--text-primary);
    }

    .install-instructions {
        font-family: 'JetBrains Mono', monospace;
        font-size: 13px;
        color: var(--text-secondary);
        line-height: 1.8;
        flex-shrink: 0;
    }

    .install-step {
        margin-bottom: 8px;
    }
}

/* PWA/Standalone mode - use full viewport height when installed as app */
@media (max-width: 768px) and (display-mode: standalone) {
    :root {
        --mobile-vh: 100vh;
    }

    /* Hide the install prompt when already installed as app */
    .mobile-install-slide {
        display: none !important;
    }
}

/* iOS standalone mode fallback (JS adds this class) */
@media (max-width: 768px) {
    body.standalone-mode .mobile-install-slide {
        display: none !important;
    }
}

/* Browser mode (non-app) - shift titles up to prevent cutoff at bottom */
@media (max-width: 768px) {
    body:not(.standalone-mode) .trend-title {
        margin-top: -10px;
    }
}

/* Google Trends Modal (Cmd+T) */
#trends-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.trends-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.trends-modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
}
.trends-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
}
.trends-modal-close {
    cursor: pointer;
    opacity: 0.5;
    font-size: 16px;
}
.trends-modal-close:hover {
    opacity: 1;
}
.trends-modal-body {
    overflow-y: auto;
    padding: 0;
}
.trends-modal-stats {
    padding: 12px 20px;
    font-size: 11px;
    color: #888;
    letter-spacing: 1px;
    border-bottom: 1px solid #222;
}
.trends-modal-list {
    padding: 8px 0;
}
.trends-modal-item {
    display: flex;
    align-items: baseline;
    padding: 8px 20px;
    gap: 12px;
    transition: background 0.1s;
}
.trends-modal-item:hover {
    background: #222;
}
.trends-modal-rank {
    color: #555;
    font-size: 11px;
    min-width: 24px;
    text-align: right;
}
.trends-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.trends-modal-name {
    color: #eee;
    font-size: 13px;
    text-decoration: none;
}
a.trends-modal-name:hover {
    text-decoration: underline;
}
.trends-modal-context {
    color: #777;
    font-size: 11px;
    line-height: 1.3;
}
.trends-modal-meta {
    color: #666;
    font-size: 10px;
    white-space: nowrap;
}
