:root {
    --bg-dark: #0e1015;
    --bg-card: #181a24;
    --bg-hover: #222634;
    --blurple: #5865F2;
    --blurple-hover: #4752c4;
    --text-primary: #f2f3f5;
    --text-secondary: #949ba4;
    --text-muted: #6d727b;
    --accent-gold: #f5a623;
    --accent-green: #23a55a;
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-family: 'gg sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #2b2d38;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3c3f4e;
}

/* HEADER & NAVBAR */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(14, 16, 21, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--blurple);
    box-shadow: 0 0 10px rgba(88, 101, 242, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.logo-area:hover .logo-img {
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 0 16px rgba(88, 101, 242, 0.8);
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--blurple), #ec4899);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--blurple);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    width: 100%;
    max-width: 440px;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--blurple);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.95rem;
    margin-left: 8px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.lang-select:focus {
    border-color: var(--blurple);
}

.btn-return-player {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(0, 210, 157, 0.25));
    border: 1px solid var(--blurple);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: pulse-return 2.5s infinite;
    user-select: none;
}

.btn-return-player:hover {
    background: var(--blurple);
    box-shadow: 0 0 14px rgba(88, 101, 242, 0.5);
    transform: translateY(-1px);
}

@keyframes pulse-return {
    0%, 100% { border-color: var(--blurple); box-shadow: 0 0 4px rgba(88, 101, 242, 0.2); }
    50% { border-color: #00d29d; box-shadow: 0 0 10px rgba(0, 210, 157, 0.4); }
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 4px 12px 4px 6px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.user-badge:hover {
    border-color: var(--blurple);
    background: var(--bg-card-hover);
    box-shadow: 0 0 10px rgba(88, 101, 242, 0.25);
}

.user-badge img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(35, 165, 90, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(35, 165, 90, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* MAIN CONTENT */
.main-container {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* HERO BANNER */
.hero-banner {
    position: relative;
    height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14,16,21,0) 0%, rgba(14,16,21,0.6) 50%, rgba(14,16,21,0.98) 100%),
                linear-gradient(90deg, rgba(14,16,21,0.95) 0%, rgba(14,16,21,0.4) 60%, rgba(14,16,21,0) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 32px;
    max-width: 950px;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.hero-poster {
    width: 135px;
    height: 195px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.hero-poster:hover {
    transform: scale(1.04);
}

.hero-text-container {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    background: var(--blurple);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-primary {
    background: var(--blurple);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--blurple-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

/* SECTION TITLES */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
}

/* ANIME CARDS GRID */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.anime-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.anime-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(88, 101, 242, 0.4);
}

.poster-wrapper {
    position: relative;
    width: 100%;
    padding-top: 145%;
    overflow: hidden;
    background: #1e2029;
}

.poster-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.anime-card:hover .poster-wrapper img {
    transform: scale(1.05);
}

.score-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(14, 16, 21, 0.85);
    backdrop-filter: blur(4px);
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.episodes-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(88, 101, 242, 0.85);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.card-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* DETAILS & PLAYER VIEW */
.view-container {
    display: none;
}
.view-container.active {
    display: block;
}

/* PLAYER SECTION */
.player-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 75vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    margin-bottom: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botón flotante de pantalla completa sobre el reproductor */
.overlay-fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    opacity: 0;
}

.player-wrapper:hover .overlay-fullscreen-btn,
.player-wrapper.theater-fullscreen .overlay-fullscreen-btn {
    opacity: 1;
}

.overlay-fullscreen-btn:hover {
    background: var(--blurple);
    border-color: var(--blurple);
    transform: scale(1.1);
}

/* Pantalla Completa Adaptable a Discord Activity (Modo Teatro Inmersivo 100% Pantalla) */
body.player-fullscreen-mode {
    overflow: hidden !important;
    background: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.player-fullscreen-mode .navbar,
body.player-fullscreen-mode .player-header-bar {
    display: none !important;
}

body.player-fullscreen-mode .main-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
}

body.player-fullscreen-mode #playerView {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: block !important;
}

body.player-fullscreen-mode .player-wrapper {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    max-width: 100vw !important;
    aspect-ratio: auto !important;
    z-index: 2147483647 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

body.player-fullscreen-mode .video-element {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    background: #000 !important;
}

/* Barra superior elegante en pantalla completa */
.fullscreen-top-bar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 2147483647;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

body.player-fullscreen-mode .fullscreen-top-bar {
    display: flex;
}

body.player-fullscreen-mode .player-wrapper.mouse-active .fullscreen-top-bar,
body.player-fullscreen-mode .fullscreen-top-bar:hover {
    opacity: 1;
    pointer-events: auto;
}

body.player-fullscreen-mode .overlay-fullscreen-btn {
    display: none !important;
}

.fs-ep-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.btn-fs-exit {
    background: rgba(88, 101, 242, 0.85);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-fs-exit:hover {
    background: var(--blurple-hover);
    transform: scale(1.05);
}

.player-wrapper.theater-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
    z-index: 2147483647 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

.player-wrapper.theater-fullscreen .video-element {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

body.in-fullscreen {
    overflow: hidden !important;
}

.video-element {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

/* ========================================================
   CINEMA MODE & PLAYER VIEW (INSPIRADO EN ANIME7 / ANIMEFLV)
   ======================================================== */
.player-cinema-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.player-main-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.player-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 75vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-error-overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 16, 21, 0.96);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.player-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.player-nav-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cinema-nav {
    background: #181b24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f2f3f5;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-cinema-nav:hover {
    background: #252a39;
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

.player-quick-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-tag {
    font-size: 0.8rem;
    color: var(--accent-green);
    background: rgba(35, 165, 90, 0.15);
    border: 1px solid rgba(35, 165, 90, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-cinema-tool {
    background: #181b24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f2f3f5;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-cinema-tool:hover {
    background: var(--blurple);
    border-color: var(--blurple);
    color: #fff;
}

/* Panel de Servidores (SUB / DUB) */
.player-servers-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.server-channel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.server-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.badge-sub {
    background: rgba(0, 210, 157, 0.12);
    color: #00d29d;
    border: 1.5px solid #00d29d;
}

.badge-dub {
    background: rgba(88, 101, 242, 0.12);
    color: var(--blurple);
    border: 1.5px solid var(--blurple);
}

.badge-lang {
    background: rgba(88, 101, 242, 0.15);
    color: var(--blurple);
    border: 1.5px solid var(--blurple);
}

.badge-server {
    background: rgba(0, 210, 157, 0.15);
    color: #00d29d;
    border: 1.5px solid #00d29d;
}

.server-buttons-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.btn-lang-pill {
    background: #1e222e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8e97a8;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-lang-pill:hover {
    background: #282e3f;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-lang-pill.active {
    background: var(--blurple);
    color: #fff;
    border-color: var(--blurple);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.45);
}

.btn-server-pill {
    background: #1e222e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8e97a8;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-server-pill:hover {
    background: #282e3f;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-server-pill.active {
    background: #00d29d;
    color: #0e1015;
    border-color: #00d29d;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(0, 210, 157, 0.35);
}

.server-loading-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* Sidebar de Capítulos a la Derecha */
.player-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sidebar-header {
    margin-bottom: 2px;
}

.watching-label {
    color: #727a8e;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.watching-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin: 2px 0 0 0;
}

.sidebar-anime-info {
    margin-bottom: 14px;
}

.sidebar-anime-name {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-episodes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.ep-num-btn {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #181b24;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #8a93a6;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ep-num-btn:hover {
    background: #252b3d;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.ep-num-btn.active {
    border: 2px solid #00d29d;
    color: #00d29d;
    background: rgba(0, 210, 157, 0.12);
    font-weight: 800;
    box-shadow: 0 0 10px rgba(0, 210, 157, 0.25);
}

.player-header-bar {
    display: none; /* Reemplazado por el layout cine */
}

.player-ep-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.player-controls-extra {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: #2b3042;
    border-color: rgba(255,255,255,0.2);
}

/* EPISODE LIST IN DETAIL VIEW */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 14px;
}

.ep-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.ep-btn:hover {
    background: var(--blurple);
    border-color: var(--blurple);
    color: white;
}

.ep-btn.active {
    background: var(--blurple);
    border-color: var(--blurple);
    color: white;
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.4);
}

/* LOADER */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(88, 101, 242, 0.2);
    border-top-color: var(--blurple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

body.player-fullscreen-mode .player-sidebar,
body.player-fullscreen-mode .player-subbar,
body.player-fullscreen-mode .player-servers-card {
    display: none !important;
}

/* RESPONSIVE */
@media (max-width: 960px) {
    .player-cinema-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
        max-height: 260px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .search-box {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: 6px;
    }
    .nav-actions {
        gap: 8px;
    }
    .main-container {
        padding: 12px 10px;
    }
    .player-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    .player-controls-extra {
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
    }
    .player-controls-extra button,
    .player-controls-extra select {
        flex: 1 1 auto;
        font-size: 0.8rem;
        padding: 7px 10px;
        justify-content: center;
    }
    .hero-banner {
        height: 300px;
    }
    .hero-content {
        padding: 16px;
        gap: 16px;
    }
    .hero-poster {
        width: 100px;
        height: 145px;
    }
    .hero-title {
        font-size: 1.4rem;
    }
    .hero-desc {
        display: none;
    }
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}
