.card {
    flex: 0 0 clamp(140px, 16vw, 200px);
    scroll-snap-align: start;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    transition: transform var(--t-normal), box-shadow var(--t-normal);
    position: relative;
    border: 1px solid var(--border-subtle);
}
.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--border-normal);
}
.card:hover .card__overlay { opacity: 1; }
.card:hover .card__fav-btn { opacity: 1; transform: translateY(0); }
.card:hover .card__poster-img { filter: brightness(0.75); }

.card__poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-elevated);
}

.card__poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter var(--t-normal), transform var(--t-slow);
}
.card:hover .card__poster-img { transform: scale(1.04); }
.card__poster-img.img--loaded { animation: fadeIn 0.3s var(--ease-out); }

.card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 6, 14, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--t-normal);
}

.card__play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: rgba(229, 57, 53, 0.92);
    border-radius: var(--radius-full);
    color: #fff;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.5);
    transition: transform var(--t-fast), background var(--t-fast);
}
.card__play-btn:hover { transform: scale(1.12); background: var(--red); }
.card__play-btn .icon { width: 1.375rem; height: 1.375rem; }

.card__rating {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.card__rating--high { background: rgba(76, 175, 80, 0.85); color: #fff; }
.card__rating--mid  { background: rgba(255, 193, 7, 0.85); color: var(--bg-void); }
.card__rating--low  { background: rgba(229, 57, 53, 0.85); color: #fff; }
.card__rating--none { display: none; }

.card__type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: rgba(6, 6, 14, 0.8);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card__fav-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(6, 6, 14, 0.8);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--t-fast), transform var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.card__fav-btn .icon { width: 1rem; height: 1rem; }
.card__fav-btn:hover { background: rgba(6, 6, 14, 0.95); color: var(--red); }
.card__fav-btn--active { opacity: 1; transform: translateY(0); color: var(--red); }

.card__meta {
    padding: 0.75rem 0.875rem 0.875rem;
}

.card__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.card__info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.card__year { color: var(--text-muted); }
.card__genres { color: var(--text-muted); }

.card--skeleton { pointer-events: none; }

.skeleton__poster {
    position: relative;
    aspect-ratio: 2/3;
    background: var(--bg-elevated);
    overflow: hidden;
}

.skeleton__poster--sm {
    width: 44px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    overflow: hidden;
    position: relative;
}

.skeleton__line {
    height: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.skeleton__line--title { width: 80%; height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton__line--sub   { width: 55%; }

.skeleton__shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.05) 60%,
        transparent 100%
    );
    animation: shimmer 1.8s infinite;
    background-size: 200% 100%;
}

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.125rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    color: var(--text-primary);
    max-width: 340px;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity var(--t-normal), transform var(--t-normal);
    pointer-events: auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.toast--visible { opacity: 1; transform: translateX(0); }
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-lg);
    font-weight: 800;
}
.rating-badge--high { background: var(--green-glow); color: var(--green); }
.rating-badge--mid  { background: rgba(255, 193, 7, 0.12); color: #ffc107; }
.rating-badge--low  { background: var(--red-glow); color: var(--red); }

.genre-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    cursor: pointer;
    white-space: nowrap;
}
.genre-tag:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.genre-tag--active {
    background: var(--accent-muted);
    border-color: var(--border-accent);
    color: var(--accent);
}

.movie-detail {
    padding-bottom: 4rem;
}

.movie-detail__backdrop {
    position: relative;
    height: clamp(320px, 55vh, 620px);
    overflow: hidden;
    background: var(--bg-void);
}

.movie-detail__backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: brightness(0.45);
}

.movie-detail__backdrop-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(6, 6, 14, 0.2) 0%,
        rgba(6, 6, 14, 0.5) 60%,
        var(--bg-primary) 100%
    );
}

.movie-detail__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    margin-top: -80px;
    position: relative;
    z-index: 2;
}

.movie-detail__poster {
    flex-shrink: 0;
}

.movie-detail__poster-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border-normal);
}

.movie-detail__body { padding-top: 1.5rem; }

.movie-detail__title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.movie-detail__original-title {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-style: italic;
}

.movie-detail__ratings {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.movie-detail__rating-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.movie-detail__rating-label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.movie-detail__actions {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.movie-detail__meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.movie-detail__meta-item { display: flex; flex-direction: column; gap: 0.2rem; }
.movie-detail__meta-label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.movie-detail__meta-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.movie-detail__desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 2rem;
}

.movie-detail__section-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.movie-detail__section-title::before {
    content: '';
    width: 3px;
    height: 1.2em;
    background: var(--accent);
    border-radius: var(--radius-full);
    display: block;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.cast-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
}

.cast-card__photo-wrap {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 2px solid var(--border-normal);
    flex-shrink: 0;
}

.cast-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}
.cast-card:hover .cast-card__photo { transform: scale(1.08); }

.cast-card__name {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.cast-card__role {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.3;
}

.trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    transition: background var(--t-fast), border-color var(--t-fast);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.trailer-btn:hover { background: var(--bg-glass-hover); border-color: var(--border-strong); }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(6, 6, 14, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-normal), visibility var(--t-normal);
}
.modal-backdrop--visible { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.96);
    transition: transform var(--t-normal);
}
.modal-backdrop--visible .modal { transform: scale(1); }

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--t-fast), color var(--t-fast);
}
.modal__close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.modal__body { padding: 1.5rem; overflow-y: auto; }

.trailer-frame {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-void);
}
.trailer-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-wrap {
    background: var(--bg-void);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.player__iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.player--loading .player__iframe { opacity: 0; }
.player--loading .player__poster-fallback { display: flex !important; }

.player__poster-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-void);
}

.player__fallback-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.3;
}

.player__fallback-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player__fallback-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.player__fullscreen-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(6, 6, 14, 0.7);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--t-fast), color var(--t-fast);
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.player__fullscreen-btn:hover { background: rgba(6, 6, 14, 0.92); color: var(--text-primary); }

.player__trailer-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(6, 6, 14, 0.75);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10;
    pointer-events: none;
}

.player__trailer-toggle {
    position: absolute;
    top: 0.75rem;
    right: 3.5rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.player:hover .player__trailer-toggle {
    opacity: 1;
}

.player__error {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    aspect-ratio: 16/9;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}
.player__error-text { font-size: var(--text-sm); color: var(--text-muted); }
.player__platform-link { min-width: 5rem; }

.player--fullscreen { border-radius: 0; }

.episodes {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.episodes__title {
    padding: 1rem 1.25rem;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.episodes__season-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-subtle);
}
.episodes__season-tabs::-webkit-scrollbar { display: none; }

.season-tab {
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
    border: 1px solid transparent;
}
.season-tab:hover { background: var(--bg-glass); color: var(--text-secondary); }
.season-tab--active {
    background: var(--accent-muted);
    border-color: var(--border-accent);
    color: var(--accent);
}

.episodes__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.episode-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: left;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.episode-btn:hover { background: var(--bg-glass-hover); border-color: var(--border-normal); }
.episode-btn--active { background: var(--gold-muted); border-color: var(--border-gold); }

.episode-btn__num {
    font-size: var(--text-xs);
    font-weight: 800;
    color: var(--text-muted);
    min-width: 1.25rem;
}
.episode-btn--active .episode-btn__num { color: var(--accent); }

.episode-btn__name {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.episode-btn--active .episode-btn__name { color: var(--accent); }

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 16vw, 200px), 1fr));
    gap: 1.25rem;
    padding: 0;
}

.favorites-grid .card {
    flex: none;
    width: 100%;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-elevated);
    border: 3px solid var(--border-normal);
}

.profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 3px solid var(--border-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.profile-name {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-joined {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.profile-stat__value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--accent);
}

.profile-stat__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.theme-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.theme-option:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.theme-option--active { background: var(--accent-muted); border-color: var(--border-accent); color: var(--accent); }

.theme-swatch {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-normal);
}
.theme-swatch--dark  { background: #0a0a15; }
.theme-swatch--amoled { background: #000000; }
.theme-swatch--dim   { background: #1a1a2e; }

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: background var(--t-fast), border-color var(--t-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.history-item:hover { background: var(--bg-elevated); border-color: var(--border-normal); }

.history-item__poster {
    width: 48px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-elevated);
}
.history-item__poster img { width: 100%; height: 100%; object-fit: cover; }

.history-item__info { flex: 1; min-width: 0; }
.history-item__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}
.history-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.history-item__remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--t-fast), color var(--t-fast);
}
.history-item__remove:hover { background: var(--red-glow); color: var(--red); }

.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 2rem 0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    transition: color var(--t-fast);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.back-btn:hover { color: var(--text-primary); }

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.watch-main { min-width: 0; }
.watch-sidebar { min-width: 0; }

.watch-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.watch-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* ============ Profile page layout ============ */
.profile-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
    align-items: start;
}

.profile-aside { min-width: 0; }
.profile-main { min-width: 0; }

.profile-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 2px solid var(--border-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
}
.profile-card__avatar svg { width: 36px; height: 36px; }

.profile-card__body { flex: 1; min-width: 0; }

.profile-card__name-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-card__name {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-decoration: none;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.stat-card:hover { background: var(--bg-elevated); border-color: var(--border-normal); }
.stat-card__value {
    font-size: var(--text-3xl);
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.stat-card__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.profile-section { }
.profile-section__title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.theme-switcher {
    display: flex;
    gap: 0.625rem;
}

.theme-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.theme-btn:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.theme-btn--active {
    background: var(--accent-muted);
    border-color: var(--border-accent);
    color: var(--accent);
}

.history-item__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ─── Utility: hidden / visible ─────────────────────────────── */

.section--hidden { display: none; }
.btn--hidden { display: none; }
.btn--mt { margin-top: 1rem; }

/* ─── Section header flush ───────────────────────────────────── */

.section__header--flush { padding: 0 var(--container-pad); }

/* ─── Watch page ─────────────────────────────────────────────── */

.watch-page__container {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.watch-page__container .back-btn {
    margin-bottom: 1rem;
}

.watch__info { margin-top: 1.25rem; }
.watch__episodes { margin-top: 1.25rem; }

.recommend-list { }
.recommend-list__title {
    font-size: var(--text-lg);
    margin-bottom: 0.875rem;
}
.recommend-list__items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.history-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player__error {
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bg-void);
    border-radius: var(--radius-lg);
}

/* ─── Movie detail skeleton ──────────────────────────────────── */

.movie-detail__title-spacer { height: 1rem; }

.movie-detail--skeleton {
    padding-top: var(--header-h);
}

.movie-detail__skeleton-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    padding: 2rem var(--container-pad);
}

.skeleton__poster--detail {
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
}

.movie-detail__skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
}

.skeleton__line--title {
    width: 60%;
    height: 2.5rem;
    border-radius: var(--radius-md);
}

.skeleton__line--sub {
    width: 40%;
    height: 1.25rem;
}

.skeleton__line--short { width: 55%; }

/* ─── Error state page centered ─────────────────────────────── */

.state--page-centered {
    margin-top: calc(var(--header-h) + 4rem);
}

/* ─── Similar section top margin ────────────────────────────── */

.section--mt { margin-top: 2rem; }

/* ─── Favorites page ─────────────────────────────────────────── */

.favorites-page__container {
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.favorites-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.favorites-count {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.state--grid-full { grid-column: 1 / -1; }

/* ─── Profile page ───────────────────────────────────────────── */

.profile-page__container {
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

.profile-stats {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-section--mt { margin-top: 1.5rem; }

.profile__edit-form {
    display: none;
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile__edit-form--visible { display: flex; }

.profile__edit-input {
    flex: 1;
    font-size: var(--text-sm);
    padding: 0.375rem 0.75rem;
}

.profile-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-history-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
}

/* ─── Slider empty message ───────────────────────────────────── */

.slider__empty-message {
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding: 1.5rem var(--container-pad);
}

/* ============================================================
   СВЕТЛАЯ ТЕМА — переопределения компонентов
   ============================================================ */
html.theme--light .card {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
html.theme--light .card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}
html.theme--light .card__overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.70) 0%, transparent 60%);
}

html.theme--light .header--scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0 var(--border-subtle), 0 4px 24px rgba(0,0,0,0.08);
}

html.theme--light .nav__link { color: var(--text-secondary); }
html.theme--light .nav__link:hover,
html.theme--light .nav__link--active { color: var(--text-primary); }
html.theme--light .nav__link--active::after { background: var(--accent); }

html.theme--light .search-bar {
    background: rgba(0,0,0,0.06);
    border-color: var(--border-normal);
    color: var(--text-primary);
}
html.theme--light .search-bar:focus { border-color: var(--accent); }
html.theme--light .search-dropdown {
    background: var(--bg-card);
    border-color: var(--border-normal);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}

html.theme--light .section__title { color: var(--text-primary); }
html.theme--light .section__subtitle { color: var(--text-secondary); }

html.theme--light .movie-info__title { color: var(--text-primary); }
html.theme--light .movie-info__original { color: var(--text-secondary); }

html.theme--light .tab-btn { color: var(--text-secondary); }
html.theme--light .tab-btn--active { color: var(--accent); border-bottom-color: var(--accent); }

html.theme--light .badge { background: var(--bg-elevated); color: var(--text-secondary); }

html.theme--light .profile-card { background: var(--bg-card); border-color: var(--border-subtle); }
html.theme--light .stat-card { background: var(--bg-secondary); border-color: var(--border-subtle); }

html.theme--light .history-item {
    background: var(--bg-card);
    border-color: var(--border-subtle);
}
html.theme--light .history-item:hover { background: var(--bg-secondary); }

html.theme--light .slider__arrow {
    background: rgba(255,255,255,0.90);
    border-color: var(--border-normal);
    color: var(--text-primary);
}
html.theme--light .slider__arrow:hover { background: #fff; }

html.theme--light .toast {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-normal);
    box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}

html.theme--light .skeleton { background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%); }

html.theme--light .player { background: var(--bg-secondary); }

html.theme--light .footer { background: var(--bg-secondary); border-top-color: var(--border-subtle); }
html.theme--light .footer__copy { color: var(--text-muted); }
