@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,700;0,900;1,400&display=swap');

:root {
    --accent: #e8605a;
    --accent-strong: #d44840;
    --accent-soft: rgba(232, 96, 90, 0.15);
    --bg-base: #0c0a0e;
    --bg-elevated: #131118;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.10);
    --border-soft: rgba(255, 255, 255, 0.09);
    --text-primary: #f5f0f0;
    --text-secondary: rgba(235, 225, 225, 0.75);
    --text-tertiary: rgba(235, 225, 225, 0.45);
    --glass: rgba(255, 255, 255, 0.07);
    --glass-heavy: rgba(12, 10, 14, 0.80);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --gold: #c8a96a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(900px 600px at 50% -120px, rgba(232, 96, 90, 0.12), transparent 65%),
        radial-gradient(600px 500px at 95% 5%, rgba(120, 70, 160, 0.14), transparent 60%),
        linear-gradient(180deg, #131118 0%, #0c0a0e 40%, #090810 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.tab-container {
    flex: 1 1 auto;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03), transparent 20%),
        radial-gradient(circle at 85% 10%, rgba(232, 96, 90, 0.06), transparent 18%);
    opacity: 0.8;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0c0a0e;
}

::-webkit-scrollbar-thumb {
    background: rgba(232, 96, 90, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 96, 90, 0.6);
}

/* ===== CATALOG PAGE ===== */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 18px 18px 44px;
    min-width: 0;
}

.tab-container {
    padding-top: 0;
}

/* details.html and other pages without bottom tabs: avoid one cramped header row on mobile */
@media (max-width: 767px) {
    .container:not(.tab-container) .header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .container:not(.tab-container) .header-left,
    .container:not(.tab-container) .header-right {
        grid-column: unset;
        width: 100%;
        justify-content: center;
    }

    .container:not(.tab-container) #authControls {
        justify-content: center;
    }

    .container:not(.tab-container) .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.auth-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

#authControls {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    width: 100%;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
}

.header-auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.header-controls > *,
.header-auth-actions > * {
    flex-shrink: 0;
}

.auth-btn {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--surface);
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 0.28s ease;
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-btn:hover {
    background: var(--surface-strong);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(255, 107, 129, 0.28);
}

.auth-btn.primary:hover {
    box-shadow: 0 16px 28px rgba(255, 107, 129, 0.34);
}

/* ===== CATALOG HEADER BUTTONS (.btn system) ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s ease;
    white-space: nowrap;
    line-height: 1;
    border: none;
    flex-shrink: 0;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.btn-solid {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(232, 96, 90, 0.28);
}

.btn-solid:hover {
    box-shadow: 0 12px 28px rgba(232, 96, 90, 0.4);
    filter: brightness(1.08);
}

.btn-solid:active,
.btn-outline:active {
    transform: scale(0.96);
}

.episode-locked {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.3);
}

.lock-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.8;
}

.header {
    position: sticky;
    top: 10px;
    z-index: 980;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-height: 78px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 14px;
    margin-bottom: 24px;
    background: rgba(12, 10, 14, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left {
    grid-column: 1;
}

.header-center {
    grid-column: 2;
    min-width: 0;
}

.header-right {
    grid-column: 3;
    justify-content: flex-end;
    min-width: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.logo-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.logo-wordmark,
.footer-wordmark {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
}

.logo-wordmark span,
.footer-wordmark span {
    color: var(--accent);
}

.logo-subtitle {
    max-width: 260px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(232, 96, 90, 0.10));
}

.logo-img-auth {
    height: clamp(72px, 12vw, 108px);
    max-width: min(220px, 100%);
    width: auto;
    display: block;
    margin: 0 auto 20px;
    object-fit: contain;
}

.hero-section {
    position: relative;
    margin: 0 0 28px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-lg);
}

.upcoming-section {
    position: relative;
    min-height: clamp(480px, 72vh, 720px);
}

.hero-feature {
    position: relative;
    min-height: inherit;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
}

.hero-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 2, 20, 0.98) 0%, rgba(11, 2, 20, 0.94) 28%, rgba(11, 2, 20, 0.58) 62%, rgba(11, 2, 20, 0.92) 100%),
        linear-gradient(180deg, rgba(11, 2, 20, 0.02) 0%, rgba(11, 2, 20, 0.86) 100%);
}

.hero-backdrop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: blur(22px) saturate(1.15);
    opacity: 0.34;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr) minmax(160px, 220px);
    gap: clamp(18px, 4vw, 40px);
    width: 100%;
    padding: clamp(24px, 4vw, 48px);
    align-items: center;
}

.hero-poster {
    position: relative;
    justify-self: center;
    width: min(100%, 320px);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.hero-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, 0.34) 100%);
}

.hero-poster-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: block;
    object-fit: cover;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

.hero-chip,
.catalog-kicker,
.hero-side-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-title,
.catalog-section-title {
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.02em;
    color: #fff;
}

.hero-title {
    font-size: clamp(2.4rem, 4.5vw, 5rem);
    line-height: 0.95;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    align-items: center;
}

.hero-meta-separator {
    opacity: 0.44;
}

.hero-description {
    max-width: 60ch;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 8px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease;
}

.hero-btn:hover {
    transform: translateY(-2px);
}

.hero-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(255, 107, 129, 0.22);
}

.hero-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hero-side-rail {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
}

.upcoming-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-mini-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 4 / 5;
    min-height: 96px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.upcoming-mini-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(8, 2, 15, 0.8) 100%);
}

.upcoming-mini-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upcoming-fallback {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: inherit;
    padding: 48px 24px;
    text-align: center;
}

.upcoming-fallback h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.2rem, 4vw, 4rem);
    letter-spacing: -0.05em;
}

/* ===== UPCOMING RAIL SECTION ===== */

.upcoming-rail-section {
    margin-bottom: 24px;
    padding: 24px 24px 14px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.upcoming-rail-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

/* ===== SKELETON LOADING ===== */

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.series-card--skeleton {
    pointer-events: none;
    user-select: none;
}

.series-card--skeleton .series-card-media {
    aspect-ratio: 2 / 3;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.10) 50%,
        rgba(255, 255, 255, 0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-line {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.10) 50%,
        rgba(255, 255, 255, 0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-line--title {
    height: 13px;
    width: 78%;
    margin-bottom: 8px;
    animation-delay: 0.08s;
}

.skeleton-line--meta {
    height: 10px;
    width: 52%;
    animation-delay: 0.16s;
}

/* ===== UPCOMING RAIL ===== */

.upcoming-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 24px;
    scrollbar-width: none;
}

.upcoming-rail::-webkit-scrollbar {
    display: none;
}

.upcoming-card {
    position: relative;
    flex: 0 0 clamp(130px, 28vw, 190px);
    aspect-ratio: 2 / 3;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: rgba(30, 20, 45, 0.5);
    transition: transform 0.28s ease, border-color 0.28s ease;
}

.upcoming-card:hover {
    transform: scale(1.04);
    border-color: rgba(255, 255, 255, 0.18);
}

.upcoming-card > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.upcoming-card:hover > img {
    transform: scale(1.07);
}

.upcoming-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    background: linear-gradient(180deg, transparent 38%, rgba(4, 1, 8, 0.94) 100%);
}

.upcoming-badge {
    display: inline-block;
    width: fit-content;
    padding: 4px 10px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.upcoming-title {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-shell {
    position: relative;
    overflow: hidden;
    padding: 28px 24px 14px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-lg);
}

.catalog-shell::before {
    content: '';
    position: absolute;
    inset: -30% auto auto -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 129, 0.16) 0%, rgba(255, 107, 129, 0) 70%);
    pointer-events: none;
}

.catalog-section-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.catalog-section-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-section-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    line-height: 1;
}

.catalog-section-subtitle {
    max-width: 420px;
    color: var(--text-tertiary);
    line-height: 1.65;
    text-align: right;
}

.catalog {
    position: relative;
    z-index: 1;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: 8px;
}

.series-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.series-card-media {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(60, 40, 80, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
    transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
}

.series-card:hover .series-card-media {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 28px 44px rgba(0, 0, 0, 0.36);
}

.series-card-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: block;
    object-fit: cover;
    background: #1d112d;
    transition: transform 0.55s ease;
}

.series-card:hover .series-card-image {
    transform: scale(1.06);
}

.series-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(11, 2, 20, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffe082;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.series-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, rgba(4, 1, 8, 0) 34%, rgba(4, 1, 8, 0.94) 100%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.series-card:hover .series-card-overlay {
    opacity: 1;
}

.series-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.series-card-tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1;
}

.series-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(255, 107, 129, 0.22);
}

.series-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 6px 2px;
}

.series-card-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.series-card:hover .series-card-title {
    color: var(--accent);
}

.series-card-description {
    color: var(--text-tertiary);
    font-size: 0.84rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--text-tertiary);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.series-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loading,
.empty-state {
    grid-column: 1 / -1;
    padding: 56px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h2 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.65rem;
}

.empty-state p {
    max-width: 36ch;
    margin: 0 auto;
    color: var(--text-tertiary);
}

@media (min-width: 768px) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 1120px) {
    .hero-content {
        grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    }

    .hero-side-rail {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .upcoming-mini-grid {
        flex-direction: row;
    }

    .upcoming-mini-card {
        flex: 0 0 150px;
        min-height: 130px;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 12px 14px 36px;
    }

    .header {
        gap: 12px;
        min-height: 72px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 14px;
        margin-bottom: 22px;
        border-radius: 22px;
    }

    .logo-img {
        height: 38px;
    }

    .logo-copy {
        gap: 3px;
    }

    .logo-wordmark {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        display: none;
    }

    .hero-section {
        margin-bottom: 20px;
        border-radius: 18px;
    }

    .upcoming-section {
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        padding: 22px 18px 20px;
    }

    .hero-poster {
        width: min(100%, 280px);
    }

    .hero-copy {
        gap: 14px;
        text-align: center;
        align-items: center;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .hero-meta {
        justify-content: center;
    }

    .hero-actions {
        width: 100%;
        justify-content: center;
    }

    .hero-btn {
        flex: 1 1 100%;
    }

    .hero-side-rail {
        gap: 10px;
    }

    .hero-side-label {
        align-self: flex-start;
    }

    .catalog-shell {
        padding: 20px 16px 10px;
        border-radius: 18px;
    }

    .catalog-section-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 22px;
    }

    .catalog-section-subtitle {
        max-width: none;
        text-align: left;
    }

    .series-grid {
        gap: 14px;
    }

    .series-card-title {
        font-size: 0.92rem;
    }

    .series-card-description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

/* ===== PLAYER PAGE ===== */

.player-body {
    overflow: hidden;
    background: #000;
    color: #fff;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
    /* Prevent pull-to-refresh and bounce on mobile */
    position: fixed;
    top: 0;
    left: 0;
}


.player-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    outline: none;
    overscroll-behavior-y: contain;
    /* Prevent overscroll bounce that causes snap-back to top */
}

.player-container::-webkit-scrollbar {
    display: none;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
    background: #000;
}

.start-screen-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.1);
}

.start-screen-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
    max-width: 500px;
    animation: fadeIn 0.8s ease-out;
}

.start-screen h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.start-screen p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Locked Overlay Premium Styles */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.locked-content-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.locked-icon-wrapper {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.2), rgba(255, 45, 85, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 45, 85, 0.2);
    box-shadow: 0 0 20px rgba(255, 45, 85, 0.2);
}

.locked-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    font-size: 32px;
    margin: 0;
    line-height: 1;
    color: inherit;
    /* Override previous */
    animation: lockShake 3s infinite;
}

.locked-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes lockShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    5% {
        transform: rotate(-10deg);
    }

    10% {
        transform: rotate(10deg);
    }

    15% {
        transform: rotate(-10deg);
    }

    20% {
        transform: rotate(0deg);
    }
}

.locked-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.locked-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    line-height: 1.5;
}

.unlock-btn {
    background: linear-gradient(135deg, #ff2d55 0%, #ff5e7e 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 45, 85, 0.4);
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.unlock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 45, 85, 0.5);
    filter: brightness(1.1);
}

.unlock-btn:active {
    transform: translateY(-1px);
}

.video-item {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    scroll-snap-stop: always;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-item audio {
    display: none;
}

/* Video Loading Spinner */
.video-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-loader.visible {
    opacity: 1;
}

.video-loader-spinner {
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: loaderPulse 2s ease-in-out infinite;
}

.video-loader-spinner svg {
    width: 100%;
    height: 100%;
    animation: loaderRotate 1s linear infinite;
}

.video-loader-spinner svg circle {
    stroke: rgba(255, 255, 255, 0.9);
    stroke-linecap: round;
    stroke-dasharray: 80, 200;
    stroke-dashoffset: 0;
    animation: loaderDash 1.5s ease-in-out infinite;
}

@keyframes loaderRotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loaderDash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -125;
    }
}

.video-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.video-loader-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

@keyframes loaderPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.06);
    }
}

/* Video Retry Overlay */
.video-retry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.video-retry-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.retry-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    width: min(92vw, 560px);
    padding: 24px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.retry-content svg {
    opacity: 0.8;
}

.retry-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

.video-debug-panel {
    display: none;
    width: 100%;
    max-height: min(30vh, 280px);
    overflow: auto;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 238, 241, 0.96);
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.45;
}

.video-debug-panel:not([hidden]) {
    display: block;
}

.retry-content button {
    background: linear-gradient(135deg, #ff2d55, #ff5e7e);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-content button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(255, 45, 85, 0.5);
}

.retry-content button:active {
    transform: scale(0.97);
}

/* Per-video overlay container */
.video-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* Ensure no background blocks scrolling */
}

/* Center Play/Pause/Locked Icon */
.video-overlay-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Changed from auto to none to allow scrolling/clicks to video */
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.center-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Show icon when paused or state active */
.video-overlay-center.visible .center-icon {
    opacity: 1;
    transform: scale(1);
}

.center-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.audio-unlock-btn {
    position: absolute;
    left: 20px;
    bottom: 120px;
    z-index: 24;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 8, 12, 0.72);
    color: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.audio-unlock-btn[hidden] {
    display: none;
}

/* Info Overlay (TikTok Bottom Left Style) */
.video-overlay-info {
    position: absolute;
    bottom: 50px;
    /* Moved up to avoid progress bar */
    left: 0;
    width: 85%;
    padding: 0 20px 10px 20px;
    background: transparent;
    color: white;
    text-align: left;
    pointer-events: none;
    z-index: 25;
}

.info-content .video-title {
    font-size: 1.1rem;
    /* Slightly larger */
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: #fff;
}

.info-content .video-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    max-width: 90%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.music-marquee {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}


/* Bottom Progress Bar (Minimalist) */
.bottom-progress-container {
    position: absolute;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    /* Added safe area and moved up */
    left: 0;
    width: 100%;
    height: 20px;
    /* Slightly larger hit area */
    z-index: 100;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

.video-progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    outline: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.video-progress-slider:hover {
    height: 6px;
}

.video-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 2px;
    height: 12px;
    background: #fff;
    border-radius: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.video-progress-slider:hover::-webkit-slider-thumb {
    width: 4px;
}

.video-progress-slider:active::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: scale(1.2);
}

/* Locked Overlay Styles */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.locked-icon {
    margin-bottom: 20px;
    color: var(--accent);
}

.locked-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.locked-create {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    max-width: 300px;
}

.unlock-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 45, 85, 0.3);
    transition: transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.unlock-btn:hover {
    transform: scale(1.05);
}



/* Auto-hide Controls */
.video-overlay-info,
.bottom-progress-container,
.video-overlay-center {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    opacity: 1;
    visibility: visible;
}

.video-overlay-info.ui-hidden,
.bottom-progress-container.ui-hidden,
.video-overlay-center.ui-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Custom exception for progress bar: keep a tiny sliver visible? 
   Actually, TikTok hides it, so we'll follow that. */


.video-item {
    background: #000;
}


.back-button {
    position: fixed;
    top: calc(max(20px, env(safe-area-inset-top, 20px)));
    left: 20px;
    z-index: 500;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.back-button:active {
    transform: scale(0.95);
}



.nav-hints {
    position: fixed;
    right: 15px;
    bottom: 40px;
    z-index: 160;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hint {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .info-overlay {
        padding-bottom: 20px;
    }

    .start-screen h1 {
        font-size: 2rem;
    }
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== DETAILS PAGE ===== */

.details-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 16px;
    transition: background 0.2s, color 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.details-back-button:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

/* ===== DETAILS PAGE: HERO ===== */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-lg);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) saturate(1.2) brightness(0.38);
    transform: scale(1.12);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(12, 10, 14, 0.88) 0%, rgba(12, 10, 14, 0.35) 55%, rgba(12, 10, 14, 0.75) 100%),
        linear-gradient(180deg, rgba(12, 10, 14, 0) 30%, rgba(12, 10, 14, 0.98) 100%);
}

/* Override 3-col catalog grid for details (2-col: poster + meta) */
.hero > .hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 320px;
    gap: clamp(20px, 3.5vw, 44px);
    padding: clamp(28px, 4vw, 52px) clamp(20px, 3vw, 40px);
    align-items: flex-start;
}

.hero > .hero-content > .hero-poster {
    width: 190px;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    flex-shrink: 0;
}

.hero > .hero-content > .hero-poster > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Vertical meta column inside details hero */
.hero > .hero-content > .hero-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 2px;
    /* Override catalog's row layout */
    flex-wrap: unset;
    font-size: unset;
    color: unset;
    justify-content: center;
}

.hero > .hero-content > .hero-aside {
    min-width: 0;
}

.hero-description {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 64ch;
}

.hero-meta-panels {
    display: grid;
    gap: 12px;
    margin-top: 0;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-panel--stats,
.hero-panel--dub {
    padding: 10px 14px;
}

.hero-panel--actions {
    padding: 10px;
}

/* Details hero: stats + dub (no single card block) */
.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: inherit;
    align-items: flex-start;
}

.hero-stat-line {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.45;
}

.hero-dub-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    align-self: stretch;
}

.hero-dub-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.dub-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.dub-chips .btn {
    padding: 5px 12px !important;
    font-size: 0.76rem;
    min-width: unset;
}

.hero-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-title-en {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: -6px;
}

/* ===== DETAILS PAGE: ACTION BAR ===== */

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: start;
    margin-top: 0;
}

.action-bar .btn {
    min-height: 42px;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
}

/* Details-specific button variants (extend .btn base) */
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(232, 96, 90, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 12px 28px rgba(232, 96, 90, 0.45);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-ghost:active {
    transform: scale(0.97);
}

/* ===== DETAILS PAGE: BODY LAYOUT ===== */

.details-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 24px;
    align-items: start;
    margin-top: 28px;
}

/* details-main without sidebar (direct child of detailsContent) */
.details-content > .details-main {
    margin-top: 0;
}

.details-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 820px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    margin-top: 24px;
}

.details-main .section-title:first-child {
    margin-top: 0;
}

.description {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.78;
}

/* ===== DETAILS PAGE: SIDEBAR ===== */

.details-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 18px 20px;
}

.sidebar-card h4 {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 12px;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row .label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.detail-row .value {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* ===== DETAILS PAGE: EPISODE QUICK-NAV ===== */

.episodes-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
}

.ep-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    justify-content: center;
}

.ep-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.ep-chip--locked {
    color: var(--text-tertiary);
    border-color: rgba(255, 255, 255, 0.06);
    background: transparent;
    cursor: default;
}

.ep-chip--locked:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.09);
    transform: none;
}

.ep-chip--locked svg {
    opacity: 0.5;
}

/* ===== DETAILS PAGE: EPISODES LIST ===== */

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.episode-item {
    display: grid;
    grid-template-columns: 96px 1fr 40px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.episode-thumb {
    position: relative;
    width: 96px;
    aspect-ratio: 16 / 10;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(30, 20, 40, 0.6);
    flex-shrink: 0;
}

.episode-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.episode-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.episode-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.episode-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.episode-dur {
    font-size: 0.74rem;
    color: var(--text-tertiary);
}

.episode-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(232, 96, 90, 0.34);
    transition: transform 0.18s, box-shadow 0.18s;
}

.episode-item:hover .episode-play {
    transform: scale(1.1);
    box-shadow: 0 7px 20px rgba(232, 96, 90, 0.52);
}

.episode-play svg {
    width: 15px;
    height: 15px;
    color: #fff;
    margin-left: 2px;
}

.episode-item--locked {
    opacity: 0.55;
    cursor: default;
}

.episode-item--locked:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.episode-item--locked:hover .episode-play {
    transform: none;
    box-shadow: 0 4px 14px rgba(232, 96, 90, 0.34);
}

.episode-play--locked {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

/* ===== DETAILS PAGE: RESPONSIVE ===== */

@media (max-width: 900px) {
    .details-body {
        grid-template-columns: 1fr;
    }

    .details-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .hero > .hero-content {
        grid-template-columns: 1fr;
        padding: 22px 18px 26px;
        gap: 16px;
        min-height: unset;
    }

    .hero > .hero-content > .hero-poster {
        max-width: 160px;
        margin: 0 auto;
    }

    .hero > .hero-content > .hero-main {
        align-items: stretch;
        text-align: center;
    }

    .hero > .hero-content > .hero-aside {
        text-align: center;
    }

    .hero-meta-panels {
        gap: 8px;
    }

    .hero-stats {
        align-items: center;
    }

    .hero-stat-line {
        text-align: center;
    }

    .hero-dub-row {
        align-items: center;
    }

    .hero-dub-label {
        text-align: center;
    }

    .dub-chips {
        justify-content: center;
    }

    .hero .hero-title {
        font-size: clamp(1.6rem, 6vw, 2.6rem);
    }

    .action-bar {
        flex-direction: column;
        gap: 8px;
    }

    .action-bar .btn {
        width: 100%;
        justify-content: center;
        flex: 1 1 auto;
    }

    .details-sidebar {
        grid-template-columns: 1fr;
    }

    .episode-item {
        grid-template-columns: 80px 1fr 36px;
        gap: 10px;
    }

    .episode-thumb {
        width: 80px;
    }
}

.details-header {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.details-cover {
    width: 260px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    background: #1e1a22;
}

.details-info {
    flex: 1;
    padding-top: 10px;
}

.details-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.1;
}

/* Description Truncation */
.details-description-container {
    max-width: 800px;
    margin-bottom: 20px;
}

.details-description {
    font-size: 1.1rem;
    color: #b0b0b0;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: max-height 0.3s ease;
}

.details-description.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
}

.toggle-desc-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    padding: 0;
    display: none;
    /* Hidden by default, shown via JS if needed */
}

.toggle-desc-btn:hover {
    text-decoration: underline;
}

.episodes-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.dub-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(560px, 100%);
    margin: 0 0 26px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.dub-selector-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0.2px;
}

.dub-selector-options {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dub-btn {
    min-width: 70px;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dub-btn:hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.1);
}

.dub-btn.active {
    background: linear-gradient(135deg, rgba(232, 96, 90, 0.92), rgba(212, 72, 64, 0.75));
    border-color: rgba(232, 96, 90, 0.85);
    color: #fff;
    box-shadow: 0 6px 18px rgba(232, 96, 90, 0.28);
}

/* Episodes Grid - Squares */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
}

.episode-square {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.episode-square:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(232, 96, 90, 0.35);
}

.episode-square:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .details-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .details-cover {
        width: 200px;
        margin: 0 auto;
    }

    .details-title {
        font-size: 2rem;
    }

    .details-info {
        width: 100%;
    }

    .dub-selector {
        width: 100%;
        margin: 0 0 18px;
        padding: 10px 10px 10px 12px;
    }

    .dub-selector-label {
        font-size: 0.82rem;
    }

    .dub-btn {
        min-width: 58px;
        height: 34px;
        padding: 0 12px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .episodes-grid {
        gap: 10px;
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .episode-square {
        font-size: 1rem;
        border-radius: 10px;
    }
}

/* ===== PLAYER CONTROLS ===== */

.controls-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 250;
}

.controls-layer>* {
    pointer-events: auto;
}



/* Progress Bar */
/* Progress Bar */
.progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 12px;
    pointer-events: auto;
    cursor: pointer;
    transition: height 0.2s;
    touch-action: none;
    /* Prevent scroll while seeking */
}

/* Hit area pseudo-element */
.progress-container::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    width: 100%;
    z-index: 10;
}

.progress-container:hover {
    height: 8px;
}

.progress-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.progress-buffer {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    width: 0;
    transition: width 0.2s;
}

.progress-current {
    position: absolute;
    height: 100%;
    background: var(--accent);
    width: 0;
}

.progress-handle {
    position: absolute;
    right: -6px;
    /* Center handle on end of progress */
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    /* Hidden by default, shown on hover/drag */
    transition: opacity 0.2s;
}


.progress-container:hover .progress-handle {
    opacity: 1;
}

.progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    left: 0;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Nav Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    z-index: 260;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    right: 80px;
    bottom: 120px;
    top: auto;
}

.nav-next {
    right: 20px;
    bottom: 120px;
    top: auto;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 768px) {
    .nav-prev {
        left: 20px;
        right: auto;
        top: 50%;
        bottom: auto;
    }

    .nav-next {
        right: 20px;
        top: 50%;
        bottom: auto;
    }
}

/* ===== PROFILE PAGE ===== */

.profile-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent) 0%, #a04060 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 30px rgba(232, 96, 90, 0.28);
}

.profile-username {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.plan-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.plan-free {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.plan-premium {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #4a3a00;
    box-shadow: 0 5px 15px rgba(253, 160, 133, 0.4);
}

.user-id-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-id-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-id-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: #00e676;
    word-break: break-all;
}

.premium-info-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid rgba(253, 160, 133, 0.2);
    text-align: left;
}

.premium-info-card h3 {
    color: #fda085;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.premium-price {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.premium-price span {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
}

.premium-benefits {
    list-style: none;
    margin-bottom: 25px;
}

.premium-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 10px;
}

.premium-benefits li svg {
    color: #00e676;
    flex-shrink: 0;
}

.buy-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s;
    text-align: center;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(232, 96, 90, 0.4);
}

@media (max-width: 480px) {
    .profile-card {
        padding: 30px 20px;
    }
}

/* Language Switcher */
.lang-switcher {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.lang-switcher-trigger {
    min-width: 68px;
    padding-inline: 12px;
    justify-content: space-between;
    gap: 10px;
}

.lang-current {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lang-switcher-caret {
    width: 8px;
    height: 8px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.lang-switcher.is-open .lang-switcher-caret {
    transform: rotate(-135deg) translateY(-1px);
}

.lang-switcher.is-open .lang-switcher-menu {
    display: grid;
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    gap: 6px;
    min-width: 100%;
    padding: 8px;
    border-radius: 16px;
    background: rgba(12, 10, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    /* Above sticky header chrome and any sibling bars (e.g. mobile tab rail) */
    z-index: 1100;
}

.lang-switcher-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.lang-switcher-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ===== TAB BAR ===== */

.tab-bar {
    width: 100%;
}

.tab-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 2px;
}

.tab-bar-inner::-webkit-scrollbar {
    display: none;
}

.tab-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 12px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.28s ease, transform 0.28s ease;
}

.tab-bar-btn::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, #f08080 100%);
    box-shadow: 0 0 0 rgba(232, 96, 90, 0);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.tab-bar-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.78;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.tab-bar-btn span {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tab-bar-btn.active {
    color: #fff;
}

.tab-bar-btn.active::after {
    transform: scaleX(1);
    box-shadow: 0 0 14px rgba(232, 96, 90, 0.45);
}

.tab-bar-btn.active svg,
.tab-bar-btn:hover svg {
    opacity: 1;
    transform: translateY(-1px);
}

.tab-bar-btn:hover {
    color: #fff;
}

.tab-bar-btn:active {
    transform: scale(0.97);
}

@media (max-width: 767px) {
    .tab-container .header {
        /* Single row — same height as every other page */
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: none;
        row-gap: 0;
        column-gap: 10px;
        /* Extra bottom space so the floating tab bar doesn't overlap content */
        margin-bottom: 88px;
        overflow: visible;
    }

    .tab-container .header-left {
        grid-column: 1;
        grid-area: unset;
        min-width: 0;
    }

    .tab-container .header-center {
        /* Float the tab bar below the header without affecting its height */
        grid-column: unset;
        grid-area: unset;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        z-index: 979;
        background: rgba(12, 10, 14, 0.82);
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 18px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 8px;
        min-width: 0;
    }

    .tab-container .header-right {
        grid-column: 3;
        grid-area: unset;
        justify-self: end;
        min-width: 0;
        max-width: 100%;
        /* overflow-x: auto clips the language dropdown; keep visible for the menu */
        overflow: visible;
        position: relative;
        z-index: 1000;
    }

    .tab-container .logo {
        max-width: min(120px, 36vw);
    }

    .logo {
        max-width: 65vw;
    }

    .tab-container .header-controls {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 6px;
    }

    .tab-container .header-auth-actions {
        gap: 6px;
    }

    .tab-container .tab-bar-inner {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding: 0;
    }

    .tab-container .tab-bar-btn {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 12px 10px 14px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tab-container .tab-bar-btn::after {
        left: 14px;
        right: 14px;
        width: auto;
        bottom: 8px;
    }

    .tab-container .tab-bar-btn.active {
        background: rgba(232, 96, 90, 0.10);
        border-color: rgba(232, 96, 90, 0.22);
    }

    .tab-bar-btn svg {
        display: none;
    }

    .tab-container .tab-bar-btn span {
        display: block;
        font-size: 0.72rem;
        line-height: 1.25;
        letter-spacing: 0.04em;
        white-space: normal;
        text-align: center;
    }

    .lang-switcher-trigger,
    .tab-container .header-auth-actions .btn {
        padding: 8px 12px;
        font-size: 0.76rem;
    }

    .lang-current,
    .lang-switcher-option {
        font-size: 0.72rem;
    }

    .lang-switcher-menu {
        top: calc(100% + 6px);
    }
}

/* Tab Content */
.tab-content {
    display: none;
    animation: tabFadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== INLINE PROFILE TAB ===== */

.profile-tab-wrapper {
    max-width: 440px;
    margin: 30px auto;
    padding: 0 16px;
}

/* Inline Login Card */
.inline-auth-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 22px;
    padding: 34px 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: cardAppearInline 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardAppearInline {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.inline-auth-card .auth-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.15), rgba(255, 45, 85, 0.05));
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid rgba(255, 45, 85, 0.15);
}

.inline-auth-card .auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: #fff;
}

.inline-auth-card .auth-card-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-bottom: 28px;
}

.inline-auth-card .inline-form-group {
    margin-bottom: 18px;
}

.inline-auth-card .inline-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
}

.inline-auth-card .inline-input {
    width: 100%;
    padding: 14px 18px;
    padding-right: 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.inline-auth-card .inline-input:focus {
    border-color: var(--accent, #ff2d55);
    box-shadow: 0 0 12px rgba(255, 45, 85, 0.25);
    background: rgba(255, 45, 85, 0.04);
}

.inline-auth-card .inline-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent, #ff2d55);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.3);
    font-family: inherit;
}

.inline-auth-card .inline-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 45, 85, 0.45);
    filter: brightness(1.1);
}

.inline-auth-card .inline-submit-btn:active {
    transform: translateY(0);
}

.inline-auth-card .inline-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.inline-auth-card .inline-error-box {
    background: rgba(255, 45, 85, 0.1);
    border-left: 3px solid var(--accent, #ff2d55);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #ff5277;
    display: none;
    animation: shake 0.5s ease-in-out;
}

.inline-auth-card .auth-card-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
}

.inline-auth-card .auth-card-footer a {
    color: var(--accent, #ff2d55);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.inline-auth-card .auth-card-footer a:hover {
    text-decoration: underline;
}

/* ===== AUTH PROMPT (standalone & inline) ===== */

.auth-prompt {
    max-width: 420px;
    margin: 40px auto;
    padding: 48px 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.auth-prompt-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: rgba(232, 96, 90, 0.1);
    border: 1px solid rgba(232, 96, 90, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.auth-prompt h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.auth-prompt p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    line-height: 1.65;
    max-width: 32ch;
    margin: 0 auto 28px;
}

.auth-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-auth {
    max-width: 420px;
    margin: 40px auto;
    padding: 48px 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    text-align: center;
}

.profile-auth h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.profile-auth p {
    color: var(--text-tertiary);
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 24px;
}

/* ===== PROFILE TAB (inline catalog, .ptab-* system) ===== */

.ptab-wrapper {
    max-width: 540px;
    margin: 20px auto 32px;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ptab-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

.ptab-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 22px 20px;
}

.ptab-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #a04060 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 22px rgba(232, 96, 90, 0.3);
}

.ptab-name {
    font-size: 1.18rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ptab-sub {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 5px;
    font-family: monospace;
    letter-spacing: 0.02em;
}

.ptab-plan-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 8px;
}

.ptab-plan-chip.free {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.ptab-plan-chip.premium {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.22), rgba(200, 169, 106, 0.08));
    border: 1px solid rgba(200, 169, 106, 0.35);
    color: var(--gold);
}

.ptab-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ptab-stat {
    padding: 16px 8px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.ptab-stat:last-child {
    border-right: none;
}

.ptab-stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.ptab-stat-lbl {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ptab-actions {
    display: flex;
    flex-direction: column;
}

.ptab-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.18s;
}

.ptab-action:first-child {
    border-top: none;
}

.ptab-action:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ptab-action-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ptab-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ptab-action-icon.accent {
    background: rgba(232, 96, 90, 0.14);
    color: var(--accent);
}

.ptab-action-icon.gold {
    background: rgba(200, 169, 106, 0.14);
    color: var(--gold);
}

.ptab-action-icon.muted {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
}

.ptab-action-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.ptab-action-chevron {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.ptab-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 22px;
    background: rgba(232, 96, 90, 0.07);
    border: 1px solid rgba(232, 96, 90, 0.15);
    border-radius: 18px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.ptab-logout:hover {
    background: rgba(232, 96, 90, 0.15);
}

/* ── ptab join date ── */
.ptab-identity-info {
    flex: 1;
    min-width: 0;
}

.ptab-joined {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 5px;
}

.ptab-joined svg {
    flex-shrink: 0;
}

/* ── ptab active subscription card ── */
.ptab-sub-active {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.12), rgba(200, 169, 106, 0.04)) !important;
    border-color: rgba(200, 169, 106, 0.28) !important;
}

.ptab-sub-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.ptab-sub-icon-wrap {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #c8a96a, #e8c87a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a2800;
    box-shadow: 0 6px 16px rgba(200, 169, 106, 0.3);
}

.ptab-sub-details {
    flex: 1;
    min-width: 0;
}

.ptab-sub-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.ptab-sub-until {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.ptab-sub-until strong {
    color: #fff;
}

.ptab-sub-countdown {
    font-size: 0.74rem;
    color: var(--gold, #c8a96a);
    font-weight: 600;
    margin-top: 2px;
}

.ptab-sub-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.25), rgba(200, 169, 106, 0.1));
    border: 1px solid rgba(200, 169, 106, 0.4);
    color: var(--gold, #c8a96a);
}

/* ── ptab bookmarks ── */
.ptab-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptab-section-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
}

.ptab-bm-list {
    display: flex;
    flex-direction: column;
}

.ptab-bm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
    gap: 10px;
}

.ptab-bm-row:last-child {
    border-bottom: none;
}

.ptab-bm-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ptab-bm-title {
    font-size: 0.87rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.ptab-bm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 20px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Profile card within tab - reuse existing styles but add logout */
.profile-tab-wrapper .profile-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: cardAppearInline 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.legal-docs-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    margin-bottom: 30px;
}

.legal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-link {
    color: #999;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-link:hover {
    color: #fff;
    transform: translateX(5px);
}

.empty-state-card {
    padding: 60px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-card p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.legal-link::before {
    content: "•";
    color: var(--accent);
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 10px;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(232, 96, 90, 0.2);
}

.bookmark-cover {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}

.bookmark-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-series-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-episode {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.bookmark-action {
    flex-shrink: 0;
}

.bookmark-continue-btn {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.bookmarks-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.bookmarks-empty-sub {
    margin-top: 8px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 24px;
    font-family: inherit;
}

.logout-btn:hover {
    background: rgba(255, 45, 85, 0.1);
    border-color: rgba(255, 45, 85, 0.3);
    color: #ff5277;
}

.logout-btn:active {
    transform: scale(0.97);
}

/* ===== STANDALONE PROFILE PAGE ===== */

.profile-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
}

.profile-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(232,96,90,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.profile-hero-body {
    position: relative;
    padding: 30px 20px 26px;
    text-align: center;
}

.profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    color: rgba(255,255,255,0.55);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.profile-edit-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.profile-edit-btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.2;
}

.profile-email {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 4px;
}

.profile-joined {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.38);
    margin: 0;
}

.profile-joined svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 16px 10px;
    text-align: center;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-lbl {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* Section containers */
.section {
    margin-bottom: 20px;
}

.section-header {
    padding: 0 4px 10px;
}

.section-header .section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

/* Action list rows */
.action-list {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    overflow: hidden;
}

.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    text-decoration: none;
    color: #fff;
    transition: background 0.18s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.action-row:last-child {
    border-bottom: none;
}

.action-row:hover {
    background: rgba(255,255,255,0.05);
}

.action-left {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.action-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.6);
}

.action-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.action-icon.gold {
    background: rgba(200,169,106,0.15);
    color: var(--gold, #c8a96a);
}

.action-icon.muted {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
}

.action-row > .action-left > div > div:first-child {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.action-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.action-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: rgba(255,255,255,0.3);
}

.action-right svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    background: linear-gradient(135deg, rgba(200,169,106,0.25), rgba(200,169,106,0.1));
    border: 1px solid rgba(200,169,106,0.4);
    color: var(--gold, #c8a96a);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.danger-section {
    margin-top: 8px;
    margin-bottom: 30px;
}

/* ===== SUBSCRIPTION CARD (active premium) ===== */
.subscription-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.subscription-card--active {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.12), rgba(200, 169, 106, 0.04));
    border-color: rgba(200, 169, 106, 0.3);
}

.sub-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.sub-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.sub-expiry {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.sub-expiry strong {
    color: #fff;
}

.sub-countdown {
    font-size: 0.78rem;
    color: var(--gold, #c8a96a);
    font-weight: 600;
    margin-top: 2px !important;
}

.sub-tag {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.sub-tag--active {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.25), rgba(200, 169, 106, 0.1));
    border: 1px solid rgba(200, 169, 106, 0.4);
    color: var(--gold, #c8a96a);
}

/* ===== PREMIUM BANNER ===== */
.premium-banner-wrap {
    margin-bottom: 24px;
}

.premium-expired-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #fca5a5;
    margin-bottom: 12px;
}

.premium-banner {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.14) 0%, rgba(150, 100, 60, 0.08) 100%);
    border: 1px solid rgba(200, 169, 106, 0.28);
    border-radius: 20px;
    padding: 22px 20px 18px;
    overflow: hidden;
    position: relative;
}

.premium-banner::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(200, 169, 106, 0.12), transparent 70%);
    pointer-events: none;
}

.premium-banner-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.premium-banner-crown {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #c8a96a, #e8c87a);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a2800;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(200, 169, 106, 0.35);
}

.premium-banner-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.premium-banner-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.premium-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.premium-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.22s ease;
    cursor: pointer;
    text-align: center;
    gap: 4px;
}

.premium-plan-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(200, 169, 106, 0.4);
}

.premium-plan-card:active {
    transform: translateY(0);
}

.premium-plan-card.popular {
    background: linear-gradient(135deg, rgba(200, 169, 106, 0.2), rgba(200, 169, 106, 0.08));
    border-color: rgba(200, 169, 106, 0.5);
    box-shadow: 0 8px 24px rgba(200, 169, 106, 0.18);
}

.premium-plan-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #c8a96a, #e8c87a);
    color: #3a2800;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.premium-plan-days {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.premium-plan-price {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--gold, #c8a96a);
    line-height: 1;
}

.premium-plan-price span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.premium-plan-btn {
    margin-top: 8px;
    padding: 7px 18px;
    background: linear-gradient(135deg, #c8a96a, #e8c87a);
    color: #3a2800;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.premium-banner-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.45;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.premium-banner-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--gold, #c8a96a);
}

/* ===== PTAB EXTRAS (catalog profile tab) ===== */
.ptab-countdown {
    font-size: 0.7rem;
    color: var(--gold, #c8a96a);
    font-weight: 600;
    margin-top: 4px;
}

.ptab-expired-hint {
    font-size: 0.7rem;
    color: #fca5a5;
    margin-top: 4px;
}

.ptab-plan-chip.expired {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.ptab-expired-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #fca5a5;
    margin-bottom: 10px;
}

.ptab-action-sub {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Player Container - Scroll Snap */
.player-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #000;
    position: relative;
    /* Hide scrollbar for clean look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.player-container::-webkit-scrollbar {
    display: none;
}

/* Time Display & Progress Bar Improvements */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    /* Removed gap */
    width: 100%;
}

.progress-container {
    position: relative;
    flex: 1;
    height: 30px;
    /* Increased hit area */
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    /* Prevent scroll while seeking */
}

.progress-background {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    /* Thinner line */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: height 0.2s;
}

.progress-buffer {
    position: absolute;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    transition: height 0.2s;
}

.progress-current {
    position: absolute;
    left: 0;
    height: 4px;
    /* Thinner line */
    background: var(--accent);
    /* Uses theme accent */
    border-radius: 2px;
    width: 0%;
    /* JS updates this */
    pointer-events: none;
    transition: height 0.2s;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    /* Center handle on end of bar */
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    pointer-events: none;
    /* Container handles clicks */
}

/* Hover effects */
.progress-container:hover .progress-background,
.progress-container:hover .progress-buffer,
.progress-container:hover .progress-current {
    height: 6px;
}

.progress-container:hover .progress-handle {
    transform: translateY(-50%) scale(1);
}

/* ===== NEW TIMELINE SLIDER ===== */
.video-progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 200;
}

.video-progress-slider:hover {
    height: 6px;
}

/* Track (progress handled by JS gradient) */
.video-progress-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    border: none;
}

/* Thumb */
.video-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-top: 0;
    opacity: 0;
    /* Hidden by default */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-progress-slider:hover::-webkit-slider-thumb {
    opacity: 1;
    transform: scale(1.2);
}

.video-progress-slider:active::-webkit-slider-thumb {
    transform: scale(1.3);
}

/* Hover effect */
.progress-wrapper:hover .video-progress-slider {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
}

.progress-wrapper:hover .video-progress-slider::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Layout adjustments */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    pointer-events: auto;
    /* Enable interaction */
}

.player-container.is-scrubbing {
    scroll-snap-type: none;
}

.video-overlay-info {
    bottom: 98px;
}

.bottom-progress-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: block;
    height: auto;
    overflow: visible;
    z-index: 120;
    padding: 0 14px;
    pointer-events: auto;
}

.timeline-shell {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 10px 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(8, 8, 12, 0.78), rgba(8, 8, 12, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.timeline-time {
    min-width: 48px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.84);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-align: center;
    user-select: none;
}

.timeline-track {
    position: relative;
    height: 34px;
    cursor: pointer;
    touch-action: none;
    outline: none;
}

.timeline-track:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 6px;
    border-radius: 999px;
}

.timeline-rail,
.timeline-buffer,
.timeline-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    border-radius: 999px;
    transform: translateY(-50%);
    transition: height 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.timeline-rail {
    width: 100%;
    background: rgba(255, 255, 255, 0.18);
}

.timeline-buffer {
    width: 0;
    background: rgba(255, 255, 255, 0.34);
}

.timeline-fill {
    width: 0;
    background: linear-gradient(90deg, #ff5877 0%, #ff2d55 100%);
}

.timeline-track:hover .timeline-rail,
.timeline-track:hover .timeline-buffer,
.timeline-track:hover .timeline-fill,
.bottom-progress-container.dragging .timeline-rail,
.bottom-progress-container.dragging .timeline-buffer,
.bottom-progress-container.dragging .timeline-fill,
.timeline-track:focus-visible .timeline-rail,
.timeline-track:focus-visible .timeline-buffer,
.timeline-track:focus-visible .timeline-fill {
    height: 8px;
}

.bottom-progress-container.dragging .timeline-fill,
.timeline-track:focus-visible .timeline-fill {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 18px rgba(255, 45, 85, 0.24);
}

.timeline-preview-chip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 58px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(8, 8, 12, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.timeline-preview-chip[hidden] {
    display: none;
}

.bottom-progress-container.dragging .timeline-shell {
    border-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 768px) {
    .video-overlay-info {
        bottom: 114px;
        width: 100%;
        padding: 0 16px 10px;
    }

    .timeline-shell {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 18px;
    }

    .timeline-time {
        min-width: 42px;
        font-size: 0.74rem;
    }

    .timeline-track {
        height: 38px;
    }
}

/* ===== ACTION BUTTONS (TikTok Right Side) ===== */
.video-action-buttons {
    position: absolute;
    right: 12px;
    bottom: calc(15% + env(safe-area-inset-bottom, 0px));
    /* Adjusted for safe area */
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Increased gap */
    z-index: 30;
    pointer-events: auto;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    padding: 0;
}

.action-btn svg {
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.9);
}

/* Favorite active state */
.favorite-btn.active svg {
    fill: #ff2d55;
    stroke: #ff2d55;
}

.favorite-btn.active {
    background: rgba(255, 45, 85, 0.2);
}

/* Bookmark active state */
.bookmark-btn.active svg {
    fill: #ffd700;
    stroke: #ffd700;
}

.bookmark-btn.active {
    background: rgba(255, 215, 0, 0.2);
}

/* Pulse animation for button feedback */
@keyframes actionPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.action-btn.pulse {
    animation: actionPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== FAVORITES TAB ===== */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 0;
}

@media (min-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 25px;
    }
}

/* Empty State Card  */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.empty-state-card .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.empty-state-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 280px;
    line-height: 1.5;
}

/* ===== BOOKMARKS IN PROFILE ===== */
.bookmarks-section {
    margin-top: 20px;
    width: 100%;
}

.bookmarks-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #eee;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.bookmark-cover {
    width: 48px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.bookmark-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookmark-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #333, #222);
}

.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-series-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-episode {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
}

.bookmark-action {
    flex-shrink: 0;
}

.bookmark-continue-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent, #ff2d55);
    white-space: nowrap;
}

.bookmarks-empty {
    text-align: center;
    padding: 20px 10px;
}

.bookmarks-empty p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.bookmarks-empty .bookmarks-empty-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== LOCKED EPISODE PAYWALL POPUP ===== */
.paywall-popup-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 450px at 50% -100px, rgba(255, 45, 85, 0.2), transparent 65%),
        rgba(4, 5, 8, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 18px;
    animation: authFadeIn 0.3s ease-out forwards;
}

.paywall-popup-overlay.closing {
    animation: authFadeOut 0.3s ease-in forwards;
}

.paywall-popup-card {
    width: 100%;
    max-width: 420px;
    border-radius: 26px;
    padding: 28px 22px 22px;
    text-align: center;
    background:
        radial-gradient(100% 100% at 50% 0%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
        linear-gradient(160deg, rgba(22, 23, 30, 0.98), rgba(15, 16, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.45);
    animation: authScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.paywall-popup-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd9e2;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.45), rgba(255, 127, 153, 0.22));
    border: 1px solid rgba(255, 114, 144, 0.45);
}

.paywall-popup-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(255, 45, 85, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(255, 45, 85, 0.28);
}

.paywall-popup-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

.paywall-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
}

.paywall-popup-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.74);
    margin-bottom: 18px;
}

.paywall-popup-benefits {
    display: grid;
    gap: 9px;
    margin-bottom: 22px;
    text-align: left;
}

.paywall-benefit-item {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.paywall-popup-actions {
    display: grid;
    gap: 10px;
}

.paywall-popup-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
}

.paywall-popup-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #ff2d55 0%, #ff5b7d 100%);
    box-shadow: 0 12px 26px rgba(255, 45, 85, 0.35);
}

.paywall-popup-btn.primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.paywall-popup-btn.secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.paywall-popup-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.13);
}

.paywall-popup-btn.ghost {
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.paywall-popup-btn.ghost:hover {
    color: rgba(255, 255, 255, 0.88);
}

.paywall-popup-btn:active {
    transform: scale(0.97);
}

/* ===== AUTH REQUIRED POPUP ===== */
.auth-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: authFadeIn 0.3s ease-out forwards;
}

.auth-popup-overlay.closing {
    animation: authFadeOut 0.3s ease-in forwards;
}

.auth-popup-card {
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px 30px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    animation: authScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes authScaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-popup-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffd9e2;
    line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), rgba(255, 45, 85, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(255, 45, 85, 0.18);
}

.auth-popup-icon svg {
    width: 30px;
    height: 30px;
    display: block;
}

.auth-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.auth-popup-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 30px;
}

.auth-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-popup-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-popup-btn.primary {
    background: var(--accent, #ff2d55);
    color: white;
}

.auth-popup-btn.primary:hover {
    background: #ff4d72;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.3);
}

.auth-popup-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-popup-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-popup-btn.cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    padding: 10px;
}

.auth-popup-btn.cancel:hover {
    color: rgba(255, 255, 255, 0.7);
}

.auth-popup-btn:active {
    transform: scale(0.96);
}

/* Hide browser default password reveal button */
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Explicitly hide the off-icon by default */
.password-toggle .eye-off-icon {
    display: none;
}

.password-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

.password-toggle svg {
    pointer-events: none;
}

input[type="password"],
input.password-input {
    padding-right: 48px !important;
}

/* Ensure inline inputs also respect the padding */
.inline-auth-card .inline-input {
    padding-right: 48px !important;
}

/* ===== FOOTER ===== */
.main-footer {
    position: relative;
    margin-top: 60px;
    padding: 68px 0 28px;
    background: linear-gradient(180deg, rgba(5, 1, 10, 0.9) 0%, rgba(5, 1, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-footer::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 96, 90, 0) 0%, rgba(232, 96, 90, 0.45) 50%, rgba(232, 96, 90, 0) 100%);
    opacity: 0.7;
}

.footer-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 18px;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) repeat(2, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand-mark {
    display: flex;
    align-items: center;
    gap: 18px;
}

.footer-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    width: auto;
    height: 48px;
    opacity: 0.95;
    filter: drop-shadow(0 8px 16px rgba(232, 96, 90, 0.10));
}

.footer-tagline {
    color: var(--text-tertiary);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 260px;
}

.footer-group h4,
.footer-social h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-group ul {
    list-style: none;
}

.footer-group ul li {
    margin-bottom: 14px;
}

.footer-group ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.28s ease, transform 0.28s ease;
}

.footer-group ul li a:hover {
    color: #fff;
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.social-link {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    transition: transform 0.28s ease, background 0.28s ease, color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    transform: translateY(-3px);
    background: rgba(232, 96, 90, 0.13);
    border-color: rgba(232, 96, 90, 0.28);
    color: #fff;
    box-shadow: 0 10px 22px rgba(232, 96, 90, 0.14);
}

.footer-bottom {
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.copyright {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .main-footer {
        margin-top: 40px;
        padding: 46px 0 22px;
    }

    .footer-top {
        text-align: center;
    }

    .footer-brand-mark {
        flex-direction: column;
    }

    .footer-tagline {
        max-width: none;
    }

    .social-icons {
        justify-content: center;
    }
}

/* ===== TOAST NOTIFICATION ===== */
.app-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(30, 30, 35, 0.92);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.app-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
