:root {
    color-scheme: dark;
    --bg: #0f1015;
    --surface: #1a1b22;
    --surface-hover: #252630;
    --line: #2c2e39;
    --text: #f7f7fa;
    --muted: #a0a2b1;
    --accent: #a98cff;
    --accent-strong: #7954e8;
}
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; font-weight: 400; }
a, a:hover { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#i-play { fill: currentColor; stroke: none; }
.site-header { height: 72px; padding: 0 30px 0 20px; display: grid; grid-template-columns: 228px minmax(0, 1fr) auto; align-items: center; gap: 24px; position: sticky; top: 0; z-index: 40; background: #0f1015f2; border-bottom: 1px solid #ffffff0e; backdrop-filter: blur(18px); }
.header-brand, .header-actions { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: inline-flex; }
.header-actions { justify-content: flex-end; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.site-logo { font-size: 23px; font-weight: 850; letter-spacing: -1.1px; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.site-logo-mark { background: linear-gradient(140deg, #bd8cff, #7150e7); width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 18px #8055ea4d; }
.site-logo-mark .icon { width: 18px; height: 18px; margin-left: 2px; }
.site-logo-mark .icon, .anime-tile-play .icon { fill: currentColor; stroke: none; }
.site-logo-accent { color: var(--accent); }
.header-search { height: 42px; display: flex; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #17181e; transition: border-color .2s, box-shadow .2s; position: relative; }
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); padding: 6px; background: #1a1b22; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px #0009; z-index: 60; max-height: 440px; overflow-y: auto; }
.search-suggest[hidden] { display: none; }
.search-suggest-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 9px; border-radius: 9px; }
.search-suggest-item img { width: 40px; height: 54px; object-fit: cover; border-radius: 5px; background: #22232c; }
.search-suggest-item strong { display: block; font-size: 13px; font-weight: 650; line-height: 1.3; }
.search-suggest-item small { color: var(--muted); font-size: 11px; }
.search-suggest-item.active, .search-suggest-item:hover { background: var(--surface-hover); }
.header-search:focus-within { border-color: #9870f2; box-shadow: 0 0 0 3px #9164ee22; }
.header-search input { width: 100%; min-width: 0; padding: 0 18px; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 14px; }
.header-search input::placeholder { color: #838594; }
.header-search button { width: 62px; flex: none; border: 0; border-left: 1px solid var(--line); border-radius: 0 11px 11px 0; color: var(--text); background: #24252d; display: grid; place-items: center; cursor: pointer; }
.header-search button:hover { background: #33333e; }
.header-search button .icon { width: 20px; height: 20px; }
.sign-in { border: 1px solid #6e55ba; color: #d5c4ff; border-radius: 22px; padding: 8px 18px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sign-in:hover { background: #7c59df20; color: #fff; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 650; }
.account-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #6f52bf; color: white; font-size: 15px; }
.account-dropdown { min-width: 170px; padding: 7px; position: absolute; right: 0; top: calc(100% + 15px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px #0008; }
.account-dropdown a { display: block; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.account-dropdown a:hover { background: var(--surface-hover); }
.site-sidebar { width: 228px; height: calc(100vh - 72px); position: fixed; top: 72px; left: 0; z-index: 30; padding: 22px 12px 20px; border-right: 1px solid #ffffff0e; background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto; transition: transform .22s ease; }
body.sidebar-collapsed .site-sidebar { transform: translateX(-100%); }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link-item { min-height: 44px; display: flex; align-items: center; gap: 20px; padding: 0 14px; border-radius: 10px; color: #d5d5dd; font-size: 14px; font-weight: 560; }
.nav-link-item .icon { width: 20px; height: 20px; }
.nav-link-item:hover { background: var(--surface-hover); color: white; }
.nav-link-item[aria-current="page"] { background: #30283f; color: #f2eaff; font-weight: 700; }
.nav-link-item[aria-current="page"] .icon { color: var(--accent); }
.sidebar-divider { height: 1px; background: var(--line); margin: 18px 12px; }
.sidebar-bottom { border-top: 1px solid var(--line); padding: 18px 15px 0; font-size: 12px; line-height: 1.6; color: #7f8190; }
.sidebar-bottom p { margin: 0 0 12px; }
.sidebar-bottom a:hover { color: var(--text); }
.site-content { min-height: calc(100vh - 72px); margin-left: 228px; display: flex; flex-direction: column; transition: margin-left .22s ease; }
body.sidebar-collapsed .site-content { margin-left: 0; }
.site-main { width: min(100%, 1560px); margin: 0 auto; padding: 26px clamp(18px, 3.1vw, 56px) 70px; flex: 1; }
.site-footer { padding: 22px clamp(18px, 3.1vw, 56px); border-top: 1px solid var(--line); color: #868896; font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }
.site-footer div { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a:hover { color: var(--text); }
.sidebar-backdrop[hidden] { display: none; }

.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero-carousel { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-carousel::-webkit-scrollbar { display: none; }
.hero-carousel .hero { flex: 0 0 100%; scroll-snap-align: start; }
.hero { min-height: 356px; position: relative; isolation: isolate; border-radius: 20px; overflow: hidden; background: #2e2e38; display: flex; align-items: flex-end; box-shadow: 0 10px 44px #0005; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #101116 6%, #101116de 37%, #10111633 78%), linear-gradient(0deg, #101116cb, transparent 65%); }
.hero img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero-copy { max-width: 620px; padding: 40px clamp(24px, 4vw, 62px); }
.hero h1 { margin: 12px 0 12px; font-size: clamp(30px, 3.5vw, 52px); line-height: 1.07; letter-spacing: -.04em; font-weight: 850; }
.hero p { max-width: 510px; margin: 0; color: #d5d3dc; line-height: 1.55; font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.primary-action, .secondary-action { min-height: 42px; padding: 9px 18px; border-radius: 10px; display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 14px; }
.primary-action { background: #ece6ff; color: #1a1429; }
.primary-action:hover { background: white; color: #1a1429; }
.secondary-action { background: #ffffff24; color: white; backdrop-filter: blur(5px); }
.secondary-action:hover { background: #ffffff39; color: white; }
.primary-action .icon, .secondary-action .icon { width: 18px; height: 18px; }
.chip-row { display: flex; gap: 9px; overflow-x: auto; padding: 24px 0 10px; scrollbar-width: none; cursor: grab; user-select: none; -webkit-overflow-scrolling: touch; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.dragging { cursor: grabbing; }
.chip-row.dragging .filter-chip { pointer-events: none; }
.filter-chip { display: inline-flex; align-items: center; min-height: 35px; padding: 7px 15px; border-radius: 9px; background: var(--surface); color: #d6d5dc; font-size: 13px; font-weight: 650; white-space: nowrap; transition: background .2s; }
.filter-chip:hover { background: #34313e; color: white; }
.filter-chip.active { background: #e6dcff; color: #241733; }
.feed-section { margin-top: 32px; }
.feed-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.feed-heading h2 { margin: 4px 0 0; font-size: clamp(21px, 2.1vw, 27px); letter-spacing: -.025em; font-weight: 790; }
.feed-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-link { color: #c9b8ff; font-size: 13px; font-weight: 700; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.section-link:hover { color: white; }
.section-link .icon { width: 16px; height: 16px; }
.anime-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 15px; }
.anime-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.anime-tile { min-width: 0; position: relative; }
.anime-tile-link { display: block; }
.anime-tile-poster { position: relative; aspect-ratio: 3 / 4.1; overflow: hidden; border-radius: 12px; background: var(--surface); }
.anime-tile-poster::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, #0008); pointer-events: none; }
.anime-tile-poster img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease, filter .25s ease; }
.anime-tile-link:hover img { transform: scale(1.04); filter: brightness(.8); }
.anime-tile-rating { position: absolute; top: 8px; left: 8px; z-index: 1; background: #121318d9; border: 1px solid #ffffff25; padding: 4px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.anime-tile-rating::first-letter { color: #ffce63; }
.anime-tile-play { position: absolute; top: 50%; left: 50%; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #eee8ff; color: #34244e; transform: translate(-50%, -45%); opacity: 0; transition: opacity .2s, transform .2s; }
.anime-tile-link:hover .anime-tile-play, .anime-tile-link:focus-visible .anime-tile-play { opacity: 1; transform: translate(-50%, -50%); }
.anime-tile-play .icon { margin-left: 2px; }
.anime-tile-copy { padding: 10px 2px 0; }
.anime-tile-copy h3 { margin: 0; font-size: 13px; font-weight: 730; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.anime-tile-copy p { margin: 6px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anime-tile-watch { position: absolute; right: 8px; top: 8px; z-index: 2; background: #452a75e8; padding: 4px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.empty-feed { border: 1px dashed var(--line); border-radius: 16px; padding: 32px; color: var(--muted); text-align: center; }

.page-intro { margin: 8px 0 24px; }
.page-intro h1 { font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; font-weight: 830; margin: 5px 0 8px; }
.page-intro p { color: var(--muted); font-size: 14px; margin: 0; }
.page-intro .chip-row { padding: 18px 0 0; }
.load-more-button { min-width: 180px; margin: 34px auto 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 11px 23px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; display: block; text-align: center; }
.load-more-button:hover { background: var(--surface-hover); color: white; }
.load-more-button:disabled { opacity: .55; cursor: wait; }
.load-more-button[hidden] { display: none; }
.catalog-empty { margin: 70px auto; text-align: center; max-width: 460px; }
.catalog-empty h2 { font-size: 24px; }
.catalog-empty p { color: var(--muted); }

.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 28px; align-items: start; }
.player-shell { width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #050506; box-shadow: 0 12px 40px #0007; display: grid; place-items: center; color: var(--muted); }
.player-shell iframe { width: 100%; height: 100%; border: 0; }
.watch-title { margin: 21px 0 11px; font-size: clamp(25px, 2.6vw, 36px); font-weight: 810; letter-spacing: -.03em; line-height: 1.17; }
.watch-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.watch-meta .score { color: #ffd06d; font-weight: 800; }
.watch-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.watch-tags a { padding: 6px 11px; background: var(--surface); border-radius: 8px; color: #d3d3dc; font-size: 12px; }
.watch-tags a:hover { background: var(--surface-hover); color: white; }
.watch-status { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.watch-status button { border: 1px solid var(--line); background: var(--surface); color: #e3e3ea; padding: 9px 14px; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.watch-status button:hover { background: var(--surface-hover); }
.watch-status button.active { border-color: #a98cff; background: #5b438e; color: #fff; }
.watch-status button:disabled { opacity: .5; cursor: wait; }
.watch-status-message { min-height: 18px; font-size: 12px; color: var(--muted); margin: -8px 0 18px; }
.watch-description { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.watch-description h2 { font-size: 18px; font-weight: 760; margin-bottom: 10px; }
.watch-description p { color: #bfc0cc; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.watch-sidebar { padding-top: 2px; }
.watch-sidebar h2 { font-size: 18px; font-weight: 780; margin: 0 0 16px; }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 11px; min-width: 0; }
.related-item img { width: 94px; height: 125px; object-fit: cover; border-radius: 8px; background: var(--surface); }
.related-item:hover strong { color: var(--accent); }
.related-item strong { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.35; }
.related-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.franchise-section { margin-top: 38px; }

.catalog-filters { border: 1px solid var(--line); background: #17181e; padding: 22px; border-radius: 16px; }
.filter-fields { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr)); gap: 12px; }
.filter-field { display: flex; flex-direction: column; gap: 8px; color: #c5c5d0; font-size: 12px; font-weight: 680; }
.filter-field input, .filter-field select { width: 100%; min-width: 0; height: 41px; padding: 0 12px; border: 1px solid #3a3a46; background: #22232c; color: var(--text); border-radius: 8px; font-size: 13px; outline: none; }
.filter-field input:focus, .filter-field select:focus { border-color: var(--accent); }
.filter-genres { border: 0; padding: 0; margin: 23px 0 0; }
.filter-genres legend { float: none; width: auto; margin-bottom: 11px; font-size: 13px; font-weight: 730; }
.genre-options { display: flex; flex-wrap: wrap; gap: 8px; max-height: 138px; overflow-y: auto; }
.genre-options label { cursor: pointer; }
.genre-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.genre-options span { display: inline-block; padding: 7px 12px; background: #262731; border: 1px solid transparent; border-radius: 8px; color: #d2d2db; font-size: 12px; }
.genre-options label:hover span { background: #373340; }
.genre-options input:checked + span { background: #4f397c; border-color: #9c7de2; color: white; }
.genre-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-actions { display: flex; align-items: center; gap: 12px; margin-top: 23px; }
.filter-actions .primary-action { border: 0; cursor: pointer; }
.filter-reset { background: transparent; border: 0; color: var(--muted); padding: 9px; cursor: pointer; font-size: 13px; }
.filter-reset:hover { color: white; }

.library-heading { margin-top: 8px; }
.anime-manager { margin: 18px 0; }
.status-tabs { gap: 8px; margin-bottom: 24px; }
.status-tab { background: var(--surface); border: 1px solid var(--line); padding: 13px; color: #d3d3df; }
.status-tab.active { background: #4e3976; border-color: #9472d9; }
.anime-card { background: var(--surface); border: 1px solid var(--line); }
.anime-card .anime-title:hover { color: var(--accent); }

@media (max-width: 1300px) { .anime-grid, .anime-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .anime-grid, .anime-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } .watch-layout { grid-template-columns: minmax(0, 1fr) 230px; } .related-item { grid-template-columns: 76px 1fr; } .related-item img { width: 76px; height: 103px; } .filter-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .site-header { grid-template-columns: 180px minmax(130px, 1fr) auto; gap: 12px; padding: 0 18px; }
    .site-sidebar { width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 35px #0007; }
    .menu-open .site-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 72px 0 0; z-index: 25; background: #0009; }
    .site-content { margin-left: 0; }
    .watch-layout { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 680px) {
    .site-header { height: 64px; grid-template-columns: 1fr auto; gap: 6px; padding: 0 12px; }
    .site-logo { font-size: 20px; }
    .header-brand { gap: 4px; }
    .header-actions { grid-column: 2; grid-row: 1; }
    .header-search { grid-column: 1 / -1; grid-row: 2; height: 38px; margin: 0 0 9px; }
    .site-header { height: 112px; grid-template-rows: 58px 45px; }
    .site-sidebar { top: 112px; height: calc(100vh - 112px); }
    .sidebar-backdrop { inset: 112px 0 0; }
    .account-name, .header-filter { display: none; }
    .site-main { padding: 16px 16px 52px; }
    .hero { min-height: 330px; }
    .hero::after { background: linear-gradient(0deg, #101116 4%, #101116ba 57%, #10111611); }
    .hero-copy { padding: 25px; }
    .hero p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .anime-grid, .anime-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
    .watch-layout { display: block; }
    .watch-sidebar { margin-top: 34px; }
    .related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer { display: block; }
    .site-footer div { margin-top: 12px; gap: 14px; }
    .filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-title-field { grid-column: 1 / -1; }
    .catalog-filters { padding: 16px; }
}
@media (max-width: 430px) { .anime-grid, .anime-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .related-list { display: block; } .related-item { margin-bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
