:root {
    /* Color Palette */
    --bg-base: #030305;
    --accent-primary: #4F46E5;
    --accent-glow: rgba(79, 70, 229, 0.5);
    --accent-secondary: #EC4899;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #52525B;
    
    /* UI Elements */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(24px) saturate(150%);
    
    /* Badges */
    --badge-new-bg: rgba(79, 70, 229, 0.2);
    --badge-new-text: #818CF8;
    --badge-new-border: rgba(79, 70, 229, 0.3);
    
    --badge-resume-bg: rgba(16, 185, 129, 0.2);
    --badge-resume-text: #34D399;
    --badge-resume-border: rgba(16, 185, 129, 0.3);

    /* Animations */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    overscroll-behavior-y: none;
}

/* Ambient Background Orbs */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.orb-1 {
    position: absolute;
    top: -10vw;
    right: -10vw;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}
.orb-2 {
    position: absolute;
    bottom: -20vw;
    left: -20vw;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: float 12s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(20px) scale(1.1); }
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

/* Header / Nav */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 20px;
    background: rgba(3, 3, 5, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-wrap {
    display: flex;
    flex-direction: column;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.logo .highlight {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Player Section */
.hero-section {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #18181b 0%, #000000 100%);
}

#videoPlayer {
    width: 100%;
    height: 100%;
    display: none; /* hidden until played */
    z-index: 2;
}

#player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.player-placeholder-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 0 20px var(--accent-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.player-placeholder-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Server Controls */
.server-controls {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    padding: 16px;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.server-controls::-webkit-scrollbar {
    display: none;
}
.server-controls[hidden] {
    display: none !important;
}

.server-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-right: 12px;
}
.server-label::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: var(--glass-border);
}

.server-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Outfit';
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.server-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(79, 70, 229, 0.1);
}
.server-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Content Section */
.content-section {
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Episode Cards */
.ep-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ep-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ep-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: var(--transition-smooth);
}

.ep-card:active {
    transform: scale(0.98);
}

.ep-card.playing {
    background: linear-gradient(to right, rgba(79, 70, 229, 0.1), var(--glass-bg));
    border-color: rgba(79, 70, 229, 0.4);
}
.ep-card.playing .ep-visual-overlay {
    opacity: 1;
    background: rgba(0,0,0,0.5);
}

.ep-visual {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #18181b;
}



.ep-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.ep-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.badge.new {
    background: var(--badge-new-bg);
    color: var(--badge-new-text);
    border: 1px solid var(--badge-new-border);
}

.badge.resume {
    background: var(--badge-resume-bg);
    color: var(--badge-resume-text);
    border: 1px solid var(--badge-resume-border);
}

.ep-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Skeleton Loading */
.skeleton-card {
    height: 104px; /* Matches normal card size */
    background: linear-gradient(90deg,
            #18181b 25%,
            #27272a 50%,
            #18181b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#loader {
    display: flex;
}

/* Toast / Snack bar */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(3, 3, 5, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 14px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: var(--transition-smooth);
    z-index: 1000;
    pointer-events: none;
}
.toast.show {
    bottom: 30px;
    pointer-events: auto;
}

.toast-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive max-width constraint for desktop use */
@media (min-width: 768px) {
    .app-container {
        max-width: 500px;
        margin: 0 auto;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(40px);
        border-left: 1px solid var(--glass-border);
        border-right: 1px solid var(--glass-border);
        box-shadow: 0 0 100px rgba(0,0,0,0.5);
    }
}