/* ============================================================
   RedditListen — "Night Radio" theme (Oct 2026)
   Loaded after style.css. Restyles surfaces, type and key
   components without touching markup or JS hooks.
   Warm ink surfaces, Reddit-orange as the on-air signal, and an
   editorial serif for thread titles: these are stories, read aloud.
   ============================================================ */

:root {
    --bg: #0e0c0b;
    --surface: #151210;
    --surface2: #1b1714;
    --surface3: #24201c;
    --border: rgba(255, 236, 220, 0.075);
    --border-strong: rgba(255, 236, 220, 0.14);
    --text: #f6f1ec;
    --text-secondary: #b3aaa1;
    --text-muted: #7a7068;
    --accent: #ff5a1f;
    --accent2: #ff7a3d;
    --accent-glow: rgba(255, 90, 31, 0.16);
    --accent-soft: rgba(255, 90, 31, 0.10);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 9px;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-story: 'Fraunces', Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body {
    font-family: var(--font-ui);
    background:
        radial-gradient(1200px 600px at 70% -10%, rgba(255, 90, 31, 0.07), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-feature-settings: "cv11", "ss01";
}

/* The three blurred blobs cost paint time on every scroll and fight the
   content; the single radial wash above replaces them. */
.bg-glow { display: none !important; }

::selection { background: rgba(255, 90, 31, 0.35); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Sidebar ---------- */
#sidebar {
    background: rgba(17, 14, 12, 0.92);
    border-right: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--surface3) transparent;
}

.sidebar-header {
    padding: 22px 14px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo { padding: 0 8px; gap: 10px; }

.logo h1 {
    font-family: var(--font-story);
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: var(--text);
}
.logo h1 .faded { color: var(--accent); font-style: italic; font-weight: 500; }

/* Stations become a calm nav list instead of seven glowing pills */
.quick-stations { gap: 2px; margin-top: 18px; }

.btn-quick {
    justify-content: flex-start;
    gap: 12px;
    padding: 9px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    animation: none;
}
.btn-quick:hover {
    background: var(--surface2);
    border-color: transparent;
    color: var(--text);
    transform: none;
}
.btn-quick .cat-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--surface2);
    font-size: 0.9rem;
}
.btn-quick:hover .cat-icon { background: var(--surface3); }

.btn-campfire-hot {
    color: var(--text);
    background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
    border-color: rgba(255, 90, 31, 0.18);
    animation: none;
}
.btn-campfire-hot .cat-icon { background: rgba(255, 90, 31, 0.18); animation: none; }
.btn-campfire-hot::after {
    content: "LIVE";
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 90, 31, 0.12);
}
.btn-campfire-hot:hover { background: linear-gradient(90deg, rgba(255, 90, 31, 0.16), transparent 85%); }

.sidebar-section { padding: 18px 16px; }
.sidebar-section h3 {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 0 2px;
}

.sidebar-list li {
    border-radius: 9px;
    font-size: 0.86rem;
    color: var(--text-secondary);
}
.sidebar-list li:hover { background: var(--surface2); color: var(--text); }
.sidebar-list li.active { background: var(--accent-soft); color: var(--text); }

.sidebar-add-btn {
    border-radius: 10px;
    border: 1px dashed var(--border-strong);
    color: var(--text-secondary);
}
.sidebar-add-btn:hover { border-color: var(--accent); color: var(--text); }

.account-signin-btn { border-radius: 10px; font-weight: 600; }

.stepper-btn, .sleep-timer-select {
    background: var(--surface2);
    border-color: var(--border);
}

/* ---------- Header ---------- */
#main-header {
    background: rgba(14, 12, 11, 0.72);
    backdrop-filter: saturate(140%) blur(18px);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    border-bottom: 1px solid var(--border);
}

.header-actions-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    box-shadow: none;
}
.pill-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: var(--text-secondary);
}
.pill-btn:hover { background: var(--surface3); color: var(--text); }
.pill-btn.active { background: var(--accent-soft); color: var(--accent); }
.pill-divider { background: transparent; width: 2px; }

/* ---------- Mobile Campfire CTA ---------- */
.campfire-cta {
    border-radius: var(--radius-sm);
    background: linear-gradient(110deg, rgba(255, 90, 31, 0.16), var(--surface) 70%);
    border: 1px solid rgba(255, 90, 31, 0.22);
    box-shadow: none;
    animation: none;
}
.campfire-cta-text strong { font-family: var(--font-story); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }

/* ---------- "Users listening to" strip ---------- */
.featured-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.featured-heading::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.6);
    animation: onAir 2s ease-out infinite;
}
@keyframes onAir {
    0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.55); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(255, 90, 31, 0); }
}

.featured-section { padding: 18px 0 6px; }

.featured-viewport {
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    padding: 6px 0 14px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}
.featured-viewport.dragging { cursor: grabbing; }
.featured-viewport.dragging .featured-card { pointer-events: none; }

.featured-track {
    gap: 12px;
    padding: 0 16px;
    will-change: transform;
    backface-visibility: hidden;
}

.featured-card {
    width: 268px;
    height: auto;
    min-height: 84px;
    padding: 12px 14px 12px 12px;
    align-items: center;
    gap: 12px;
    text-align: left;
    color: var(--text);
    background: linear-gradient(150deg, var(--surface2), var(--surface) 75%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: transform 0.35s var(--ease), border-color 0.25s var(--ease), box-shadow 0.35s var(--ease), background 0.25s var(--ease);
}
.featured-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 90, 31, 0.35);
    background: linear-gradient(150deg, rgba(255, 90, 31, 0.10), var(--surface) 75%);
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 90, 31, 0.08);
}
.featured-card:active { transform: translateY(-1px) scale(0.985); }

.featured-card .featured-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: rgba(255, 90, 31, 0.12);
    border: 1px solid rgba(255, 90, 31, 0.22);
    box-shadow: none;
    transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.35s var(--ease);
}
.featured-card .featured-icon svg { margin-left: 2px; }
.featured-card:hover .featured-icon {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.06);
}

.featured-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.featured-card .featured-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-family: var(--font-story);
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -0.008em;
    will-change: auto;
}
.featured-meta {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .featured-card { width: 244px; min-height: 80px; }
    .featured-viewport {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
    }
}

/* ---------- Feed header ---------- */
.section-header h2 {
    font-family: var(--font-story);
    font-weight: 600;
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }

.time-badge {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(255, 90, 31, 0.25);
    box-shadow: none;
    animation: none;
    font-weight: 600;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.feed-select {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-weight: 500;
}
.feed-select:hover { border-color: var(--border-strong); }

/* ---------- Thread cards ---------- */
#threads-container { gap: 10px; }

.thread-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 18px 14px 20px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.thread-card::before {
    top: 16px;
    bottom: 16px;
    left: 0;
    right: auto;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.thread-card:hover {
    background: var(--surface2);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}
.thread-card:active { transform: scale(0.99); }

.thread-subreddit {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--accent2);
    margin-bottom: 8px;
}

.thread-title {
    font-family: var(--font-story);
    font-size: 1.14rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.012em;
    color: var(--text);
    margin-bottom: 12px;
    text-wrap: pretty;
}

.thread-meta { font-size: 0.78rem; color: var(--text-muted); }
.thread-comments-count { color: var(--text-muted); font-weight: 500; }

/* Play is the primary action: always visible as a round "on-air" button */
.play-card-btn {
    opacity: 1;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(255, 90, 31, 0.22);
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.play-card-btn svg { margin-left: 2px; }
.thread-card:hover .play-card-btn,
.play-card-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.04);
}

.bookmark-card-btn, .share-card-btn { opacity: 0.55; padding: 6px; }
.thread-card:hover .bookmark-card-btn,
.thread-card:hover .share-card-btn { opacity: 1; }
.share-card-btn:hover { color: var(--text); background: var(--surface3); }

@media (hover: none) {
    .bookmark-card-btn, .share-card-btn { opacity: 0.8; }
}

/* Skeleton loaders in the warm palette */
.skeleton-card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}
.skeleton-line {
    background: linear-gradient(90deg, var(--surface2) 0%, var(--surface3) 50%, var(--surface2) 100%) !important;
    background-size: 200% 100% !important;
}

/* ---------- Player ---------- */
#player-view {
    background:
        radial-gradient(800px 420px at 50% -120px, rgba(255, 90, 31, 0.12), transparent 70%),
        var(--bg);
    max-width: 680px;
}

.player-header {
    background: rgba(14, 12, 11, 0.8);
    backdrop-filter: saturate(140%) blur(20px);
    -webkit-backdrop-filter: saturate(140%) blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 18px 20px 16px;
}

.player-subreddit { font-size: 0.72rem; color: var(--accent2); letter-spacing: 0.01em; }

.player-thread-title {
    font-family: var(--font-story);
    font-weight: 600;
    font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 6px;
    text-wrap: balance;
}

.player-post-body {
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.65;
}
.player-post-body.active {
    background: linear-gradient(180deg, rgba(255, 90, 31, 0.10), var(--surface));
    border-color: rgba(255, 90, 31, 0.35);
    box-shadow: none;
}

.now-playing-card {
    background: linear-gradient(160deg, var(--surface2), var(--surface) 70%);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 20px 22px;
}
.voice-avatar { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
.voice-name { font-weight: 600; }

.progress-bar-bg { height: 5px; background: var(--surface3); border-radius: 99px; }
.progress-bar-fill { background: var(--accent); border-radius: 99px; }
.progress-labels { font-variant-numeric: tabular-nums; }

.control-btn { color: var(--text-secondary); }
@media (hover: hover) and (pointer: fine) {
    .control-btn:hover { background: var(--surface3); color: var(--text); }
}

.play-btn {
    width: 60px;
    height: 60px;
    background: var(--accent) !important;
    box-shadow: 0 10px 30px -6px rgba(255, 90, 31, 0.55);
}
.play-btn:hover { background: var(--accent2) !important; transform: scale(1.04); }

.speed-pill {
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.speed-pill:hover { border-color: var(--border-strong); color: var(--text); }
.speed-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Comment / segment list ---------- */
.queue-section h3 {
    font-family: var(--font-story);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.015em;
    text-transform: none;
    color: var(--text);
}

.segment-item {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.segment-item:hover { background: var(--surface); border-color: var(--border); }
.segment-item.active {
    background: linear-gradient(180deg, rgba(255, 90, 31, 0.09), var(--surface));
    border-color: rgba(255, 90, 31, 0.3);
    box-shadow: none;
}
.segment-text { line-height: 1.6; color: var(--text-secondary); }
.segment-item.active .segment-text { color: var(--text); }

/* ---------- Mini player ---------- */
#mini-player {
    background: rgba(27, 23, 20, 0.88);
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8);
}
#btn-mini-play { background: var(--accent); box-shadow: 0 6px 20px -4px rgba(255, 90, 31, 0.6); }

/* ---------- Modals, toasts, inputs ---------- */
.toast {
    background: var(--surface3);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
}

input[type="text"], input[type="url"], input[type="search"], textarea {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}
input[type="text"]:focus, input[type="url"]:focus, input[type="search"]:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (prefers-reduced-motion: reduce) {
    .featured-heading::before { animation: none; }
    .thread-card, .play-card-btn { transition: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 768px) {
    /* The drawer is up to 320px wide but was parked at left:-300px, so a 20px
       sliver of it (and the white Google button) peeked in on most phones. */
    #sidebar { left: calc(-1 * min(86vw, 320px) - 24px); background: var(--surface); }
    #sidebar.open { left: 0; }

    #main-header .logo h1 { font-size: 1.15rem; }
    .header-actions-pill { padding: 2px; }
    .pill-btn { width: 34px; height: 34px; }

    .thread-card { padding: 16px 14px 12px 16px; }
    .thread-title {
        font-size: 1.04rem;
        line-height: 1.32;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .play-card-btn { width: 38px; height: 38px; }

    .player-thread-title { font-size: 1.22rem; }
}

@media (max-width: 380px) {
    #main-header .logo h1 { font-size: 1.02rem; }
    .pill-btn { width: 32px; height: 32px; }
}
