/* === StreamFlix CSS === */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f3460;
    --accent: #e94560;
    --accent-glow: #ff6b81;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6c6c80;
    --border: #2a2a4a;
    --gold: #f5c518;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    line-height: 1.5;
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,15,26,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo-icon { font-size: 1.6rem; }
.accent { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    cursor: pointer;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-secondary); }
.nav-link.active { color: var(--accent); background: rgba(233,69,96,0.1); }

.search-box {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.search-box input {
    width: 280px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border var(--transition);
}

.search-box input:focus { border-color: var(--accent); }

.search-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.search-btn:hover { background: var(--accent-glow); transform: translateY(-1px); }

/* === Hero === */
.hero {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    padding: 80px 24px 60px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-stats span {
    padding: 8px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* === Content Sections === */
.content-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Movie Grid === */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 200px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.movie-card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.movie-card-info {
    padding: 12px;
}

.movie-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.imdb-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245,197,24,0.15);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

.imdb-badge::before { content: '⭐'; }

.year-badge {
    color: var(--text-muted);
}

.type-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-movie { background: rgba(233,69,96,0.15); color: var(--accent); }
.type-tv { background: rgba(100,149,237,0.15); color: #6495ed; }
.type-anime { background: rgba(138,43,226,0.15); color: #8a2be2; }

/* === Genre Grid === */
.genre-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-tag {
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.genre-tag:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.player-modal {
    max-width: 1400px;
    background: #000;
    padding: 0;
    border-radius: var(--radius);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover { background: var(--accent); }

/* === Detail Modal Content === */
.detail-header {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.detail-poster {
    width: 200px;
    border-radius: var(--radius);
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.detail-info { flex: 1; }

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-tagline {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-genre {
    padding: 4px 12px;
    background: var(--bg-card);
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

.detail-overview {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-play {
    background: var(--accent);
    color: white;
}

.btn-play:hover { background: var(--accent-glow); transform: translateY(-2px); }

.btn-trailer {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

/* === Cast Section === */
.detail-cast {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.detail-cast h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.cast-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.cast-card {
    flex-shrink: 0;
    width: 100px;
    text-align: center;
}

.cast-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    background: var(--bg-card);
}

.cast-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.cast-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* === Seasons (TV) === */
.seasons-section {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.seasons-section h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.season-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.season-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
}

.season-btn:hover, .season-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.episode-list {
    display: grid;
    gap: 8px;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.episode-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.episode-number {
    font-weight: 700;
    color: var(--accent);
    min-width: 40px;
}

.episode-name {
    flex: 1;
    font-weight: 500;
}

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

/* === Player === */
.player-content {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 100%;
    max-height: 80vh;
}

.player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-container {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    flex-shrink: 0;
}

.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius);
}

.player-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    gap: 12px;
}

.player-title-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.player-title {
    font-weight: 600;
}

.player-server-select {
    display: flex;
    gap: 8px;
}

.server-btn {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.server-btn:hover, .server-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* === Player Sidebar (Season/Episode Selector) === */
.player-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.season-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

#playerSeasonSelect {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

#playerSeasonSelect:focus {
    border-color: var(--accent);
}

.sidebar-episodes {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ep-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}

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

.ep-item.active {
    background: rgba(233, 69, 96, 0.15);
    border-left: 3px solid var(--accent);
}

.ep-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
    font-variant-numeric: tabular-nums;
}

.ep-item.active .ep-num {
    color: var(--accent);
}

.ep-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ep-loading, .ep-error {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ep-error {
    color: #ff4757;
}

/* === Player Inline (mobile) === */
.player-inline {
    height: 100dvh;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
}

.player-inline-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.player-inline-topbar::-webkit-scrollbar { display: none; }

.player-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.player-back-btn:hover {
    background: var(--bg-secondary);
}

.player-inline-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-inline-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
}

.player-inline-container {
    width: 100%;
    aspect-ratio: 16/9;
    flex-shrink: 0;
}

.player-inline-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.player-inline-sidebar {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.player-inline-sidebar .sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

.player-inline-sidebar .sidebar-episodes {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Hide player modal on mobile - inline player is used instead */
@media (max-width: 768px) {
    #playerModal.modal-overlay {
        display: none !important;
    }
    .player-inline-topbar {
        padding: 8px 10px;
        gap: 6px;
    }
    .server-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    .player-back-btn {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    .player-inline-title {
        font-size: 0.85rem;
    }
}

/* === Loading === */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1rem;
}

.loading-spinner::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Footer === */
.footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer p { margin-bottom: 4px; }

/* === Utilities === */
.hidden { display: none !important; }

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }

    .nav-links { order: 3; width: 100%; justify-content: center; }
    .search-box { width: 100%; }
    .search-box input { flex: 1; width: auto; }

    .hero { padding: 40px 16px 30px; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 12px; }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-poster { width: 160px; }
    .detail-actions { justify-content: center; }
    .detail-meta { justify-content: center; }
    .detail-genres { justify-content: center; }

    .modal { max-width: 100%; margin: 0; }
    .player-modal { max-width: 100%; }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .hero h1 { font-size: 1.6rem; }
    .section-title { font-size: 1.2rem; }
}

/* === Continue Watching === */
.continue-card { position: relative; }
.continue-poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    min-height: 200px;
    background: var(--bg-secondary);
}
.continue-poster-wrap .movie-card-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto;
}
.continue-label {
    padding: 2px 8px;
    background: rgba(233,69,96,0.15);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}
.continue-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; background: rgba(0,0,0,0.5); z-index: 2;
}
.continue-bar-fill {
    height: 100%; background: var(--accent);
    border-radius: 0 2px 2px 0; transition: width 0.3s;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Focus for TV navigation === */
*:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.movie-card:focus-visible, .genre-tag:focus-visible, .ep-item:focus-visible, .episode-item:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(233,69,96,0.4);
}
.movie-card:focus-visible .movie-card-poster {
    transform: scale(1.08);
}

/* === TV (1920px+) === */
@media (min-width: 1920px) {
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; }
    .content-section { max-width: 2000px; padding: 48px 40px; }
    .hero { padding: 100px 40px 70px; }
    .hero h1 { font-size: 4.5rem; }
    .hero p { font-size: 1.4rem; }
    .hero-stats span { font-size: 1.1rem; padding: 12px 28px; }
    .header-inner { max-width: 2000px; height: 80px; }
    .logo { font-size: 2rem; }
    .nav-link { font-size: 1.1rem; padding: 10px 20px; }
    .search-box input { width: 350px; font-size: 1rem; }
    .section-title { font-size: 1.8rem; }
    .player-modal { max-width: 90vw; }
}

/* === Large Desktop (1600px-1919px) === */
@media (min-width: 1600px) and (max-width: 1919px) {
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
    .content-section { max-width: 1800px; }
    .hero h1 { font-size: 4rem; }
    .header-inner { max-width: 1800px; height: 72px; }
    .logo { font-size: 1.8rem; }
}

/* === Tablet portrait (768px-1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .search-box input { width: 200px; }
    .hero h1 { font-size: 2.5rem; }
}

/* === Phone landscape (481px-767px) === */
@media (max-width: 767px) and (min-width: 481px) {
    .movie-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .content-section { padding: 24px 16px; }
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 40px 16px 30px; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
    .nav-links { order: 3; width: 100%; justify-content: center; }
    .search-box { width: 100%; } .search-box input { flex: 1; width: auto; }
    .modal { max-width: 98%; margin: 0; }
}

/* === Phone portrait (max 480px) === */
@media (max-width: 480px) {
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .content-section { padding: 20px 12px; }
    .hero { padding: 32px 12px 24px; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 0.9rem; }
    .hero-stats span { font-size: 0.8rem; padding: 6px 14px; }
    .section-title { font-size: 1.1rem; margin-bottom: 16px; }
    .header { padding: 0 12px; }
    .header-inner { height: auto; padding: 10px 0; gap: 8px; flex-wrap: wrap; }
    .nav-links { order: 3; width: 100%; justify-content: center; gap: 2px; }
    .nav-link { font-size: 0.8rem; padding: 6px 10px; }
    .search-box { width: 100%; }
    .search-box input { flex: 1; width: auto; font-size: 0.85rem; padding: 8px 12px; }
    .search-btn { padding: 8px 14px; font-size: 0.85rem; }
    .modal { padding: 12px; max-width: 100%; margin: 0; }
    .modal-overlay { padding: 8px; }
    .detail-header { padding: 16px; flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 130px; }
    .detail-title { font-size: 1.3rem; }
    .detail-actions { justify-content: center; }
    .detail-meta { justify-content: center; }
    .detail-genres { justify-content: center; }
    .detail-cast { padding: 16px; }
    .cast-grid { gap: 10px; }
    .cast-card { width: 80px; }
    .cast-photo { width: 60px; height: 60px; }
    .seasons-section { padding: 16px; }
    .episode-item { padding: 8px 12px; font-size: 0.85rem; }
    .footer { padding: 24px 16px; font-size: 0.8rem; }
    .login-container { padding: 32px 24px; margin: 0 12px; }
    .login-title { font-size: 1.4rem; }
}

/* === Touch targets on mobile === */
@media (pointer: coarse) {
    .nav-link { padding: 10px 16px; }
    .ep-item { padding: 14px 12px; }
    .server-btn { padding: 10px 16px; }
    .genre-tag { padding: 12px 24px; }
    .episode-item { padding: 14px 16px; }
    .modal-close { width: 44px; height: 44px; font-size: 1.4rem; }
}
