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

:root {
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-elevated: #222;
    --text: #fff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --accent: #ff5500;
    --accent-gradient: linear-gradient(135deg, #ff5500, #ff8800);
    --rating-good: #3bb33b;
    --rating-mid: #777;
    --rating-bad: #b33b3b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

#app {
    padding: 62px 12px 24px;
    max-width: 430px;
    margin: 0 auto;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px max(14px, calc((100% - 430px) / 2 + 14px));
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: var(--text);
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
}

.header-spacer {
    flex: 1;
}

.bot-btn {
    padding: 8px 13px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--accent-gradient);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.profile-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-btn .profile-letter {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
}

.logo::before {
    content: '🎬';
    font-size: 22px;
    margin-right: 7px;
}

.logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.search-bar input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

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

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.filters {
    display: flex;
    gap: 8px;
    margin: 12px 0 4px;
}

.filter-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: #fff;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 16px 0 12px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px;
}

.movie-row {
    margin-top: 18px;
}

.row-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.row-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.row-scroll::-webkit-scrollbar {
    display: none;
}

.row-scroll .movie-card {
    flex: 0 0 calc((100% - 20px) / 2.5);
    scroll-snap-align: start;
}

.row-loading {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px 0;
}

.movie-card {
    cursor: pointer;
}

.poster-wrap {
    position: relative;
}

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

.movie-poster.no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.rating-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--rating-mid);
}

.rating-badge.good { background: var(--rating-good); }
.rating-badge.bad { background: var(--rating-bad); }

.series-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
}

.movie-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 7px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.status {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.load-more {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 13px 0;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--accent);
    cursor: pointer;
}

.app-footer {
    margin-top: 36px;
    padding: 22px 0 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
}

.footer-count {
    font-size: 15px;
    font-weight: 700;
}

.footer-count span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.footer-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
}

.footer-copyright {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-disclaimer {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.movie-page {
    position: fixed;
    inset: 0;
    z-index: 10;
    overflow-y: auto;
    background: var(--bg);
    padding-top: 54px;
}

.page-hero {
    position: relative;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    height: 210px;
    background: var(--bg-card);
}

.page-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.15) 40%, var(--bg) 100%);
}

.page-body {
    padding: 0 14px 40px;
    max-width: 430px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    gap: 14px;
    margin-top: -46px;
    position: relative;
    z-index: 2;
}

.page-poster {
    width: 116px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.page-title-block {
    padding-top: 52px;
}

.page-title {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.4px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.page-ratings {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.rating-block {
    text-align: left;
}

.rating-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--rating-mid);
}

.rating-value.good { color: var(--rating-good); }
.rating-value.bad { color: var(--rating-bad); }

.rating-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.meta-chip {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--bg-card);
    color: rgba(255, 255, 255, 0.8);
}

.watch-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 0;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    background: var(--accent-gradient);
    color: #fff;
    cursor: pointer;
}

.page-section {
    margin-top: 22px;
}

.page-section-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.page-description {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.persons-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.persons-scroll::-webkit-scrollbar {
    display: none;
}

.person-card {
    flex: 0 0 82px;
    text-align: center;
}

.person-photo {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    background: var(--bg-card);
    display: block;
}

.person-photo.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.person-name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    margin-top: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.frames-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.frames-scroll::-webkit-scrollbar {
    display: none;
}

.person-header {
    text-align: center;
    padding: 24px 0 8px;
}

.person-photo-big {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    background: var(--bg-card);
    display: inline-block;
}

.person-photo-big.no-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}

.person-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-top: 12px;
}

.person-movies-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
    margin-bottom: 18px;
}

.frame-img {
    flex: 0 0 auto;
    height: 130px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-card);
    scroll-snap-align: start;
}
