/* ========================================
   ZzBox Player - Static Version
   GitHub Pages Compatible
======================================== */

:root {
    --primary: #FF5500;
    --primary-dark: #cc4400;
    --bg: #050505;
    --surface: #121212;
    --surface-light: #1a1a1a;
    --text: #ffffff;
    --text-muted: #888888;
    --border: rgba(255, 255, 255, 0.05);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --app-height: 100vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: var(--app-height);
    overflow-x: hidden;
}

/* ========================================
   Loading Screen
======================================== */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 100px;
    height: auto;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ========================================
   Screens
======================================== */

.screen {
    display: none;
    min-height: var(--app-height);
}

.screen[hidden] {
    display: none !important;
}

.screen.active {
    display: flex;
}

/* ========================================
   Login Screen
======================================== */

#login-screen {
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(128px);
    animation: pulse 4s ease-in-out infinite;
}

.glow-orb.top-left {
    top: -100px;
    left: 25%;
    background: color-mix(in srgb, var(--primary) 20%, transparent);
}

.glow-orb.bottom-right {
    bottom: -100px;
    right: 25%;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(180deg, white, transparent);
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 96px;
    height: auto;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    animation: fadeIn 0.5s ease-out 0.1s backwards;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary) 50%, transparent);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: fadeIn 0.5s ease-out 0.2s backwards;
}

.version {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: color-mix(in srgb, var(--primary) 20%, transparent);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 4px;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 2rem;
    animation: slideUp 0.5s ease-out 0.3s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Inputs */
.input-group {
    margin-bottom: 1rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-on-primary, white);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Status Message */
.status-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* ========================================
   Dashboard
======================================== */

#dashboard-screen {
    display: none;
}

#dashboard-screen.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: var(--app-height);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--border);
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 40px;
    height: auto;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-left: 3px solid var(--primary);
}

.user-info {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.user-details {
    flex: 1;
    min-width: 80px;
}

.user-username {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-expiry {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.logout-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* User Actions in Sidebar */
.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sidebar-account-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-account-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.sidebar-account-btn svg {
    width: 16px;
    height: 16px;
}

/* Sidebar Bottom Actions */
.sidebar-bottom-actions {
    padding: 0.75rem 1rem;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Install PWA Button */
.sidebar-install-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-install-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--text);
}

.sidebar-install-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-install-btn span {
    flex: 1;
    text-align: left;
}

/* Sidebar Activate Banner (legacy support) */
.sidebar-activate-banner {
    padding: 0.75rem 1rem;
    margin-top: auto;
}

.sidebar-activate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark, #ff8c00));
    border: none;
    border-radius: 10px;
    color: var(--text-on-primary, white);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.sidebar-activate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sidebar-activate-btn:hover::before {
    left: 100%;
}

.sidebar-activate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 85, 0, 0.4);
}

.sidebar-activate-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-activate-btn span {
    flex: 1;
    text-align: left;
}

.activate-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: var(--app-height);
    display: flex;
    flex-direction: column;
}

.content-header {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9375rem;
    outline: none;
    transition: all 0.3s;
}

#search-input:focus {
    border-color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* Content Views */
.content-view {
    display: none;
    padding: 2rem;
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.content-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInView 0.2s ease-out;
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    animation: fadeInCard 0.25s ease-out backwards;
    touch-action: manipulation;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 10%, transparent);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.category-name {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* Load More Indicator for Infinite Scroll */
.load-more-indicator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.load-more-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeInCard 0.25s ease-out backwards;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.content-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 10%, transparent);
}

.content-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--surface-light);
    object-fit: cover;
}

.content-poster.landscape {
    aspect-ratio: 16/9;
}

.content-info {
    padding: 0.75rem;
}

.content-title {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 5;
    opacity: 0;
}

.content-card {
    position: relative;
}

.content-card:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn svg {
    width: 16px;
    height: 16px;
    color: #fbbf24;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    opacity: 1;
    background: rgba(251, 191, 36, 0.2);
}

.favorite-btn.active svg {
    color: #fbbf24;
}

/* Virtual Categories */
.category-card.virtual-category {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.category-card.virtual-category .category-icon {
    background: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* ========================================
   Sports Games Section
======================================== */

.sports-disclaimer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: rgba(251, 191, 36, 0.9);
    backdrop-filter: blur(8px);
}

.disclaimer-icon {
    font-size: 1.25rem;
    animation: pulse 2s ease-in-out infinite;
}

.sports-date-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    grid-column: 1 / -1;
}

.date-btn {
    padding: 1rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.date-btn:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 15%, var(--surface));
    transform: translateY(-2px);
}

.date-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 40%, transparent);
}

.sports-games-container {
    grid-column: 1 / -1;
    width: 100%;
}

.sports-section {
    margin-bottom: 2.5rem;
}

.sports-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    background: linear-gradient(135deg, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-light) 50%, var(--surface)));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem;
    cursor: default;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(12px);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--primary));
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: color-mix(in srgb, var(--primary) 50%, transparent);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px color-mix(in srgb, var(--primary) 15%, transparent);
}

.game-card:hover::before {
    opacity: 1;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.game-time {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary) 30%, transparent);
}

.game-championship {
    font-size: 0.75rem;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary) 10%, transparent));
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 20px;
    color: var(--text);
    font-weight: 600;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem 0;
    min-height: 100px;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.team-badge {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.game-card:hover .team-badge {
    transform: scale(1.1);
}

.team-name {
    font-weight: 700;
    font-size: 0.9375rem;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.vs {
    font-weight: 900;
    font-size: 0.875rem;
    color: var(--primary);
    padding: 0.625rem 0.875rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 15%, transparent), color-mix(in srgb, var(--primary) 5%, transparent));
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 10px;
    text-shadow: 0 0 10px color-mix(in srgb, var(--primary) 30%, transparent);
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    gap: 0.75rem;
}

.game-channels {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.channel-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.channel-names {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.game-location {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    opacity: 0.8;
}

/* No channel indicator */
.game-card[data-has-channel="false"] .game-footer {
    justify-content: center;
}

.game-card[data-has-channel="false"] .game-channels::after {
    content: 'Canal não definido';
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .sports-date-selector {
        flex-direction: column;
    }

    .date-btn {
        width: 100%;
        text-align: center;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-teams {
        gap: 1rem;
    }

    .team-badge {
        width: 44px;
        height: 44px;
    }

    .sports-section-title {
        font-size: 1.25rem;
    }
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.back-btn svg {
    width: 16px;
    height: 16px;
}

/* Content Loading */
.content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
    animation: fadeIn 0.15s ease-out;
}

.content-loading p {
    margin-top: 1rem;
    animation: fadeIn 0.2s ease-out 0.1s backwards;
}

/* ========================================
   Player Modal
======================================== */

.player-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
}

.player-modal.active {
    display: flex;
}

.player-container {
    width: 100%;
    height: min(100%, var(--app-height));
    max-width: 1400px;
    max-height: min(90vh, var(--app-height));
    margin: auto;
    position: relative;
}

.player-container.live-with-epg {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: min(96vh, var(--app-height));
}

.player-container.live-with-epg .player-wrapper {
    height: auto;
    min-height: 240px;
    flex: 1 1 auto;
}

.close-player {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.close-player:hover {
    background: color-mix(in srgb, var(--primary) 80%, transparent);
}

.close-player svg {
    width: 24px;
    height: 24px;
}

.player-wrapper {
    width: 100%;
    height: 100%;
    background: black;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Player Controls */
.player-controls {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.9) 0%,
            transparent 30%,
            transparent 70%,
            rgba(0, 0, 0, 0.5) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    cursor: none;
}

.player-wrapper:hover .player-controls,
.player-controls.visible {
    opacity: 1;
    pointer-events: auto;
    cursor: default;
}

/* Cursor hide when controls are hidden in fullscreen */
.player-wrapper.hide-cursor {
    cursor: none;
}

.player-wrapper.hide-cursor .player-controls {
    opacity: 0;
    pointer-events: none;
}

.player-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.player-headline {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.player-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-title {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-badge {
    padding: 0.25rem 0.75rem;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.live-epg {
    display: grid;
    gap: 0.3rem;
    max-width: min(90vw, 700px);
}

.epg-line {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-line strong {
    color: #fff;
}

.live-epg-panel {
    display: none;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
    max-height: 34vh;
    overflow: hidden;
}

.live-epg-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.live-epg-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.live-epg-channel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.live-epg-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.live-epg-list {
    display: grid;
    gap: 0.45rem;
    max-height: calc(34vh - 48px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.epg-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.6rem;
    align-items: start;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.epg-item.current {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.epg-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
    font-family: monospace;
}

.epg-content {
    min-width: 0;
}

.epg-title {
    font-size: 0.86rem;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.epg-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.progress-container {
    position: absolute;
    bottom: 70px;
    left: 1.5rem;
    right: 1.5rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.buffered-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    position: relative;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: monospace;
}

.player-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 50%;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

#speed-btn {
    width: auto;
    min-width: 52px;
    padding: 0 0.8rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

/* Track Selectors (Audio/Subtitles) */
.track-selector {
    position: relative;
}

.track-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.75rem;
    min-width: 180px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    z-index: 100;
}

.track-menu.active {
    display: block;
}

.track-menu-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.05em;
}

.track-list {
    max-height: 200px;
    overflow-y: auto;
}

.track-item {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.track-item.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 15%, transparent);
}

.track-item.active::before {
    content: '✓';
    font-weight: bold;
}

.track-item.disabled {
    color: var(--text-muted);
    font-style: italic;
}

/* Player Loading */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
}

.player-loading .spinner {
    width: 60px;
    height: 60px;
}

/* Player Error */
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    text-align: center;
}

.player-error svg {
    width: 60px;
    height: 60px;
    color: #ef4444;
    margin-bottom: 1rem;
}

.player-error p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* ========================================
   Series Modal
======================================== */

.series-modal {
    position: fixed;
    inset: 0;
    z-index: 2900;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.series-modal.active {
    display: flex;
}

.series-container {
    width: 100%;
    max-width: 1300px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-series {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.close-series:hover {
    background: rgba(255, 85, 0, 0.8);
}

.close-series svg {
    width: 20px;
    height: 20px;
}

.series-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.series-cover {
    width: 150px;
    height: 225px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--surface);
}

.series-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.series-plot {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.series-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.series-container.series-playing .series-header {
    display: none;
}

.series-container.series-playing .series-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
}

.series-player-panel {
    min-width: 0;
}

.series-player-slot {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 240px;
}

.series-container.series-playing .series-player-slot {
    min-height: clamp(300px, 54vh, 640px);
}

.series-player-slot .player-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

.series-player-placeholder {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 1rem;
    text-align: center;
}

.seasons-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.season-tab {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.season-tab:hover {
    border-color: var(--primary);
    color: var(--text);
}

.season-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.episodes-grid {
    display: grid;
    gap: 0.75rem;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.episode-card:hover {
    border-color: var(--primary);
    background: rgba(255, 85, 0, 0.05);
}

.episode-card.playing-now {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.episode-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 85, 0, 0.1);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.episode-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.episode-play {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

.episode-play svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-view {
        padding: 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .series-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .player-container {
        max-height: 100vh;
    }

    .player-wrapper {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .login-header h1 {
        font-size: 2rem;
    }
}

/* ========================================
   Global Search Results
======================================== */

.search-count {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.search-section {
    margin-bottom: 2rem;
}

.search-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#search-results-view .content-grid {
    margin-bottom: 1rem;
}

/* ========================================
   Profile Selection Screen
======================================== */

#profile-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.profile-selection-container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    z-index: 10;
}

.profile-selection-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.5s ease-out;
}

.profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 12px;
}

.profile-card:hover {
    transform: scale(1.05);
}

.profile-card:hover .profile-card-avatar {
    border-color: white;
}

.profile-card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border: 4px solid transparent;
    transition: all 0.3s ease;
    background: var(--surface-light);
}

.profile-card-name {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.profile-card:hover .profile-card-name {
    color: var(--text);
}

.profile-card.add-profile .profile-card-avatar {
    background: transparent;
    border: 3px dashed var(--border);
    font-size: 2.5rem;
    color: var(--text-muted);
}

.profile-card.add-profile:hover .profile-card-avatar {
    border-color: var(--primary);
    color: var(--primary);
}

.profile-card .edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-card.editing .edit-overlay {
    opacity: 1;
}

.profile-card.editing .profile-card-avatar {
    position: relative;
}

.manage-profiles-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.manage-profiles-btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.manage-profiles-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Profile Modal
======================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

.profile-modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
    border: 3px solid var(--primary);
}

.avatar-selector label,
.color-selector label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.avatar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.avatar-option {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--surface-light);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-option:hover {
    border-color: var(--text-muted);
}

.avatar-option.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 20%, var(--surface-light));
}

.color-options {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 10px currentColor;
}

.profile-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

.btn-small {
    padding: 0.5rem 1rem !important;
    font-size: 0.8125rem !important;
}

/* ========================================
   Account Modal
======================================== */

.account-modal-content {
    max-width: 550px;
}

.account-modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.account-section {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.account-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.account-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.account-profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.account-label {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.account-value {
    font-weight: 600;
    font-size: 0.9375rem;
}

.account-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.account-status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.account-status-badge.expired {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.days-left-warning {
    color: #f59e0b !important;
}

.days-left-danger {
    color: #ef4444 !important;
}

.account-profiles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.account-profile-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border-radius: 8px;
    font-size: 0.875rem;
}

.account-profile-item .profile-icon {
    font-size: 1.25rem;
}

/* ========================================
   Header Profile Button
======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-btn:hover {
    border-color: var(--primary);
}

.header-avatar {
    font-size: 1.25rem;
}

/* ========================================
   Continue Watching Section
======================================== */

.continue-watching-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.clear-history-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-history-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.clear-history-btn svg {
    width: 16px;
    height: 16px;
}

.continue-watching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.continue-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.continue-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 10%, transparent);
}

.continue-poster {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--surface-light);
}

.continue-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.continue-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.continue-info {
    padding: 0.75rem;
}

.continue-title {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.continue-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.continue-card:hover .continue-remove-btn {
    opacity: 1;
}

.continue-remove-btn:hover {
    background: #ef4444;
}

.continue-remove-btn svg {
    width: 14px;
    height: 14px;
}

/* Content card with progress */
.content-card .card-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.content-card .card-progress-fill {
    height: 100%;
    background: var(--primary);
}

/* ========================================
   Responsive - Profiles
======================================== */

@media (max-width: 768px) {
    .profile-selection-title {
        font-size: 1.75rem;
    }

    .profiles-grid {
        gap: 1.5rem;
    }

    .profile-card-avatar {
        width: 90px;
        height: 90px;
        font-size: 2.5rem;
    }

    .profile-card-name {
        font-size: 1rem;
    }

    .modal-content {
        max-height: 85vh;
        margin: 1rem;
    }

    .continue-watching-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ========================================
   Device Activation Styles
======================================== */

.activation-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.btn-activate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
}

.btn-activate svg {
    width: 20px;
    height: 20px;
}

.activation-modal-content {
    max-width: 400px;
}

.activation-form {
    margin-top: 1.5rem;
}

.activation-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: center;
}

.activation-form .input-group {
    margin-bottom: 1.5rem;
}

.activation-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.activation-form .input-wrapper input {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: monospace;
    font-size: 1rem;
}

.status-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.status-message:not(:empty) {
    display: block;
}

.status-info {
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}

.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Activation Modal Improvements */
.activation-modal-content {
    max-width: 550px;
    width: 95%;
}

.activation-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 10px;
}

.activation-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.activation-tab.active {
    background: var(--primary);
    color: var(--text-on-primary, white);
}

.activation-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.apps-platforms {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.platform-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.platform-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-primary, white);
}

.platform-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--text);
}

.apps-list {
    display: grid;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.apps-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-muted);
}

.app-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.app-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.app-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.2);
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.app-store {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-activation {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted);
}

.activation-code {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.activation-mac {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.activation-playlist {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.app-card {
    cursor: pointer;
}

/* Upgrade Message */
.upgrade-message {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.upgrade-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.upgrade-message h3 {
    color: #ffd700;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.upgrade-message p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.upgrade-subtext {
    font-size: 0.85rem;
    opacity: 0.8;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ========================================
   Mobile Enhancements
======================================== */

/* iOS Safe Areas */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .sidebar {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .player-controls {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   Mobile Navigation Bar (Bottom)
======================================== */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + env(safe-area-inset-bottom));
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 1001;
    padding: 0 0.5rem;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 50px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active svg {
    transform: scale(1.1);
}

.mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.95);
}

/* ========================================
   Tablet Responsive Styles (1024px)
======================================== */

@media (max-width: 1024px) {

    /* Tablet: Sidebar off-canvas, main content full width */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Tablet grids */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS (768px and below)
   Complete rewrite for better UX
======================================== */
@media (max-width: 768px) {

    /* ===== LOGIN SCREEN ===== */
    #login-screen {
        padding: 1.5rem;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        /* Dynamic viewport for mobile browsers */
    }

    .login-container {
        max-width: 320px;
        width: 100%;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-header .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .glass-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .input-group {
        gap: 0.75rem;
    }

    .input-wrapper {
        margin-bottom: 0;
    }

    .input-wrapper input {
        padding: 0.9rem 1rem 0.9rem 2.75rem;
        font-size: 16px;
        /* Prevents iOS zoom */
        border-radius: 10px;
    }

    .input-icon {
        left: 0.9rem;
        width: 18px;
        height: 18px;
    }

    #login-btn {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 10px;
        margin-top: 0.5rem;
    }

    /* ===== MOBILE NAVIGATION (Show) ===== */
    .mobile-nav {
        display: flex;
    }

    /* Hide desktop sidebar button on mobile */
    .sidebar-activate-banner,
    .sidebar-bottom-actions {
        display: none;
    }

    /* ===== HEADER ===== */
    .content-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .search-container {
        flex: 1;
        max-width: none;
    }

    #search-input {
        padding: 0.6rem 0.75rem 0.6rem 2.25rem;
        font-size: 16px;
        border-radius: 10px;
        height: 40px;
    }

    .search-icon {
        width: 16px;
        height: 16px;
        left: 0.75rem;
    }

    .header-actions {
        gap: 0.375rem;
    }

    .profile-btn,
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* ===== MAIN CONTENT ===== */
    .main-content {
        margin-left: 0;
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
        /* Space for mobile nav */
    }

    .content-view {
        padding: 0.75rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    /* ===== CATEGORIES GRID ===== */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .category-card {
        padding: 0.75rem 0.5rem;
        border-radius: 10px;
        gap: 0.5rem;
    }

    .category-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .category-name {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .category-count {
        font-size: 0.6rem;
    }

    /* ===== CONTENT GRID ===== */
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .content-card {
        border-radius: 8px;
    }

    .content-poster {
        border-radius: 8px 8px 0 0;
    }

    .content-info {
        padding: 0.4rem;
    }

    .content-title {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    .content-meta {
        font-size: 0.6rem;
    }

    .favorite-btn {
        width: 28px;
        height: 28px;
        opacity: 1;
        /* Always visible on mobile */
    }

    .favorite-btn svg {
        width: 14px;
        height: 14px;
    }

    /* ===== MODALS ===== */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 20px 20px 0 0;
        margin: 0;
        padding: 1.25rem;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    .modal-header {
        margin-bottom: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-close-btn {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    /* ===== ACCOUNT MODAL ===== */
    .account-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }

    .account-label {
        font-size: 0.75rem;
    }

    .account-value {
        font-size: 0.9rem;
    }

    .account-profile-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .account-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .account-actions button {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* ===== PLAYER ===== */
    .player-container {
        max-height: 100vh;
        max-height: 100dvh;
    }

    .player-container.live-with-epg {
        gap: 0.5rem;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .player-controls {
        padding: 0.75rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    /* VOD (filmes/séries no modal): manter controles sempre dentro da área visível */
    .player-wrapper.is-vod .player-top {
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        right: 3.5rem;
        margin-bottom: 0;
        z-index: 3;
    }

    .player-wrapper.is-vod .player-bottom {
        position: absolute;
        left: 0.75rem;
        right: 0.75rem;
        bottom: max(0.6rem, env(safe-area-inset-bottom));
        z-index: 3;
    }

    .player-wrapper.is-vod .progress-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(max(0.6rem, env(safe-area-inset-bottom)) + 58px);
        z-index: 3;
    }

    .player-top {
        margin-bottom: 0.75rem;
    }

    .player-title-row {
        gap: 0.5rem;
    }

    .player-title {
        font-size: 0.85rem;
    }

    .epg-line {
        font-size: 0.72rem;
    }

    .live-epg-panel {
        max-height: 36vh;
        border-radius: 12px;
        padding: 0.6rem;
    }

    .live-epg-list {
        max-height: calc(36vh - 42px);
        gap: 0.4rem;
    }

    .epg-item {
        grid-template-columns: 82px 1fr;
        gap: 0.45rem;
        padding: 0.5rem;
    }

    .epg-title {
        font-size: 0.8rem;
    }

    .epg-desc {
        font-size: 0.72rem;
    }

    .close-player {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .controls-left,
    .controls-right {
        gap: 0.35rem;
    }

    .player-bottom {
        gap: 0.5rem;
    }

    #speed-btn {
        min-width: 48px;
        font-size: 0.78rem;
        padding: 0 0.65rem;
    }

    .volume-control {
        display: none;
    }

    .progress-bar {
        height: 6px;
    }

    .progress-bar:active {
        height: 10px;
    }

    /* ===== SERIES MODAL ===== */
    .series-container {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        max-height: 95dvh;
    }

    .series-layout,
    .series-container.series-playing .series-layout {
        grid-template-columns: 1fr;
    }

    .series-player-slot {
        min-height: 170px;
    }

    .series-player-placeholder {
        min-height: 170px;
    }

    .episodes-grid {
        max-height: none;
        overflow: visible;
    }

    .series-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .series-cover {
        width: 120px;
        height: 180px;
    }

    .series-info h2 {
        font-size: 1.25rem;
    }

    .series-info p {
        font-size: 0.85rem;
    }

    .seasons-tabs {
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .season-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .episodes-grid {
        gap: 0.5rem;
    }

    .episode-card {
        padding: 0.75rem;
    }

    /* ===== PROFILE SELECTION ===== */
    .profile-selection-container {
        padding: 1.5rem;
    }

    .profile-selection-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .profiles-grid {
        gap: 1rem;
        justify-content: center;
    }

    .profile-card {
        width: 90px;
    }

    .profile-card-avatar {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .profile-card-name {
        font-size: 0.8rem;
    }

    .manage-profiles-btn {
        font-size: 0.85rem;
        padding: 0.75rem 1.25rem;
        margin-top: 1.5rem;
    }

    /* ===== SPORTS SECTION ===== */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .game-card {
        padding: 1rem;
    }

    .game-time {
        font-size: 1rem;
    }

    .team-badge {
        width: 40px;
        height: 40px;
    }

    .team-name {
        font-size: 0.75rem;
        max-width: 80px;
    }

    /* ===== CONTINUE WATCHING ===== */
    .continue-watching-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .continue-card {
        border-radius: 10px;
    }

    .continue-info {
        padding: 0.5rem;
    }

    .continue-title {
        font-size: 0.75rem;
    }

    /* ===== ACTIVATION MODAL ===== */
    .activation-modal-content {
        max-width: 100%;
        padding: 1.25rem;
    }

    .apps-platforms {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .platform-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        padding: 0.625rem 0.5rem;
        font-size: 0.75rem;
    }

    .apps-list {
        max-height: 250px;
    }

    .app-item {
        padding: 0.75rem;
    }

    /* ===== TOUCH-FRIENDLY SIZES ===== */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        font-size: 0.9rem;
    }

    .nav-item {
        min-height: 48px;
    }

    /* ===== BACK BUTTON ===== */
    .back-btn {
        position: sticky;
        top: 0;
        background: var(--bg);
        z-index: 10;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1rem;
    }

    /* ===== SIDEBAR (OFF-CANVAS) ===== */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {

    /* Extra small screens */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .category-card {
        padding: 0.875rem;
    }

    .category-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
        border-radius: 10px;
    }

    .category-name {
        font-size: 0.8rem;
    }

    .category-count {
        font-size: 0.65rem;
    }

    .section-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .content-view {
        padding: 0.75rem;
    }

    /* Player extra small */
    .player-controls {
        padding: 0.5rem;
    }

    .player-top {
        margin-bottom: 0.5rem;
    }

    .player-title {
        font-size: 0.8rem;
    }

    .live-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .control-btn {
        width: 34px;
        height: 34px;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Profile modal small */
    .profile-avatar-preview {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .avatar-option {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .color-option {
        width: 32px;
        height: 32px;
    }

    /* Improve readability on small screens */
    .login-header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .glass-panel {
        padding: 1.25rem;
    }
}

/* Landscape mode adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 220px;
    }

    .sidebar-header {
        padding: 0.75rem 1rem;
    }

    .nav-item {
        padding: 0.75rem 1rem;
    }

    .user-info {
        padding: 0.75rem 1rem;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .player-container {
        max-height: 100vh;
    }

    .mobile-nav {
        height: 50px;
    }

    .mobile-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-item span {
        display: none;
    }
}

/* Dark mode / OLED optimization */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .glow-orb {
        display: none;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .mobile-nav,
    .player-modal,
    .modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: rgba(255, 255, 255, 0.3);
        --text-muted: #bbbbbb;
    }

    .category-card,
    .content-card {
        border-width: 2px;
    }
}

/* Hover only on devices that support it */
@media (hover: hover) and (pointer: fine) {
    .content-card:hover {
        transform: translateY(-4px);
    }

    .category-card:hover {
        transform: translateY(-4px);
    }
}

/* Touch devices - no hover transforms */
@media (hover: none) {

    .content-card:hover,
    .category-card:hover {
        transform: none;
    }

    .content-card:active,
    .category-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    /* Always show favorite button on touch */
    .favorite-btn {
        opacity: 1;
    }

    .continue-remove-btn {
        opacity: 1;
    }

    .player-controls {
        opacity: 1;
        pointer-events: auto;
        cursor: default;
    }

    .player-wrapper.hide-cursor .player-controls {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Standalone PWA mode (when installed) */
@media all and (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Hide install button when already installed */
    .pwa-install-btn {
        display: none !important;
    }

    /* Extra safe area for notch devices */
    .content-header {
        padding-top: max(1rem, env(safe-area-inset-top) + 0.5rem);
    }

    .sidebar {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Episode Navigation Controls */
#prev-ep-btn, #next-ep-btn { color: white; opacity: 0.7; transition: opacity 0.2s; }
#prev-ep-btn:hover, #next-ep-btn:hover { opacity: 1; transform: scale(1.1); }

/* Final mobile overrides (priority) */
@media (max-width: 768px) {
    .player-controls {
        opacity: 1;
        pointer-events: auto;
        cursor: default;
    }

    .player-wrapper.hide-cursor .player-controls {
        opacity: 1;
        pointer-events: auto;
    }

    .content-view {
        padding: 0.85rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .category-card {
        min-height: 116px;
        padding: 0.85rem 0.6rem;
        gap: 0.55rem;
    }

    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .category-name {
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .content-card {
        min-height: 170px;
    }

    .mobile-nav-item {
        min-width: 64px;
        min-height: 56px;
        padding: 0.5rem 0.55rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .player-controls {
        opacity: 1;
        pointer-events: auto;
    }

    .player-wrapper.is-vod .player-top {
        top: 0.5rem;
        left: 0.5rem;
        right: 3.25rem;
    }

    .player-wrapper.is-vod .player-bottom {
        left: 0.5rem;
        right: 0.5rem;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .player-wrapper.is-vod .progress-container {
        left: 0.5rem;
        right: 0.5rem;
        bottom: calc(max(0.5rem, env(safe-area-inset-bottom)) + 50px);
    }

    .category-card {
        min-height: 108px;
        padding: 0.8rem 0.55rem;
    }

    .category-icon {
        width: 38px;
        height: 38px;
    }
}

/* Player controls redesign */
.player-wrapper .player-controls {
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.72) 0%,
            rgba(0, 0, 0, 0.12) 45%,
            rgba(0, 0, 0, 0.35) 100%);
}

.player-wrapper .player-top {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    right: 0.9rem;
    margin: 0;
    z-index: 3;
}

.player-wrapper .player-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(92%, 780px);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    backdrop-filter: blur(12px);
}

.player-wrapper .progress-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(820px, calc(100% - 2rem));
    right: auto;
    bottom: 5.15rem;
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.45rem 0.55rem 0.38rem;
    backdrop-filter: blur(10px);
}

.player-wrapper .player-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100% - 1.2rem);
    bottom: 0.85rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
    backdrop-filter: blur(14px);
}

.player-wrapper .controls-left,
.player-wrapper .controls-right {
    gap: 0.32rem;
}

.player-wrapper .control-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.player-wrapper .control-btn svg {
    width: 20px;
    height: 20px;
}

.player-wrapper #speed-btn {
    min-width: 46px;
    height: 40px;
    border-radius: 12px;
    padding: 0 0.6rem;
}

@media (max-width: 768px) {
    .player-wrapper .player-top {
        top: 0.6rem;
        left: 0.6rem;
        right: 0.6rem;
    }

    .player-wrapper .player-title-row {
        max-width: calc(100% - 0.1rem);
        padding: 0.35rem 0.58rem;
    }

    .player-wrapper .progress-container {
        width: calc(100% - 1rem);
        bottom: calc(max(4.8rem, env(safe-area-inset-bottom) + 4.2rem));
        border-radius: 10px;
        padding: 0.35rem 0.45rem 0.3rem;
    }

    .player-wrapper .player-bottom {
        width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);
        justify-content: space-between;
        bottom: calc(max(3.4rem, env(safe-area-inset-bottom) + 2.8rem));
        padding: 0.3rem 0.4rem;
        gap: 0.4rem;
    }

    .player-wrapper .control-btn {
        width: 38px;
        height: 38px;
    }

    .player-wrapper #speed-btn {
        min-width: 42px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .player-wrapper .player-bottom {
        bottom: calc(max(4.2rem, env(safe-area-inset-bottom) + 3.4rem));
    }

    .player-wrapper .progress-container {
        bottom: calc(max(6rem, env(safe-area-inset-bottom) + 5.2rem));
    }
}

/* Classic player controls mode (restored) */
.player-wrapper .player-top {
    position: static;
    margin-bottom: 0;
}

.player-wrapper .player-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
}

.player-wrapper .progress-container {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    width: auto;
    transform: none;
    bottom: 70px;
    z-index: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
}

.player-wrapper .player-bottom {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: none;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
}

.player-wrapper .controls-left,
.player-wrapper .controls-right {
    gap: 1rem;
}

.player-wrapper .control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.player-wrapper .control-btn svg {
    width: 24px;
    height: 24px;
}

.player-wrapper #speed-btn {
    width: auto;
    min-width: 52px;
    height: 44px;
    border-radius: 999px;
    padding: 0 0.8rem;
}

@media (max-width: 768px) {
    .player-wrapper.is-vod .player-bottom {
        margin-bottom: calc(74px + env(safe-area-inset-bottom));
    }

    .player-wrapper.is-vod .progress-container {
        bottom: calc(74px + env(safe-area-inset-bottom) + 58px + 10px);
    }

    .player-wrapper .progress-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(max(2.25rem, env(safe-area-inset-bottom) + 1.5rem) + 58px);
    }

    .player-wrapper .player-bottom {
        margin-bottom: calc(max(1.5rem, env(safe-area-inset-bottom) + 1rem));
        justify-content: space-between;
    }

    .player-wrapper .controls-left,
    .player-wrapper .controls-right {
        gap: 0.35rem;
    }

    .player-wrapper .control-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
    }

    .player-wrapper .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .player-wrapper #speed-btn {
        min-width: 48px;
        height: 44px;
        border-radius: 999px;
        padding: 0 0.65rem;
    }
}

@media (max-width: 480px) {
    .player-wrapper.is-vod .player-bottom {
        margin-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    .player-wrapper.is-vod .progress-container {
        bottom: calc(70px + env(safe-area-inset-bottom) + 50px + 8px);
    }

    .player-wrapper .progress-container {
        left: 0.5rem;
        right: 0.5rem;
        bottom: calc(max(2rem, env(safe-area-inset-bottom) + 1.4rem) + 50px);
    }

    .player-wrapper .control-btn {
        width: 34px;
        height: 34px;
        border-radius: 50%;
    }

    .player-wrapper .control-btn svg {
        width: 16px;
        height: 16px;
    }

    .player-wrapper #speed-btn {
        min-width: 42px;
        height: 34px;
    }
}

/* Mobile nav removed: keep layout clean and rely on hamburger/sidebar only */
@media (max-width: 768px) {
    .mobile-nav {
        display: none !important;
    }

    .main-content {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}
