/* Cinema theme: neutral charcoal, source artwork and compact browsing rails. */
:root {
  color-scheme: dark;
  --background: #111111; --surface: #1c1c1c; --soft: #242424;
  --text: #f5f5f5; --muted: #a3a3a3; --line: #333333;
  --accent: #dc3036; --accent-deep: #c92029; --accent-soft: #3d1b1d;
  --blue: #ededed; --teal: #7dd3a8;
  --r-s: 4px; --r-m: 6px; --r-l: 8px;
  --shadow-card: none; --shadow-hover: 0 8px 24px #0005;
  background: var(--background); color: var(--text);
}
body { background: var(--background); color: var(--text); }
button, input, select { letter-spacing: 0; }
.page-width { width: calc(100% - 96px); max-width: 1800px; }
.site-header { background: #111111f5; border-color: #292929; }
.header-inner { min-height: 64px; gap: 28px; }
.brand { gap: 12px; }
.brand strong { color: var(--accent); font-size: 24px; font-weight: 800; }
.brand small { color: var(--muted); font-size: 12px; }
.main-nav { gap: 8px; align-self: stretch; }
.main-nav button { color: #c5c5c5; padding: 0 12px; border-radius: 0; font-size: 14px; }
.main-nav button.active { color: #fff; background: transparent; }
.main-nav button.active::after { content: ""; position: absolute; height: 3px; background: var(--accent); bottom: 0; left: 12px; right: 12px; }
.main-nav button:hover { background: #ffffff08; color: #fff; }
.search-box { background: #242424; color: #bcbcbc; border: 1px solid #3a3a3a; border-radius: 6px; width: 260px; min-width: 120px; }
.search-box:focus-within { background: #242424; border-color: #aaa; box-shadow: none; }
.library-button { width: 38px; height: 38px; padding: 0; border-radius: 4px; justify-content: center; color: #e8e8e8; position: relative; }
.library-button small { position: absolute; top: -3px; right: -5px; padding: 0 3px; background: var(--accent); color: #fff; border-radius: 3px; }
.featured { height: auto; aspect-ratio: 3 / 1; min-height: 360px; max-height: 480px; border-radius: 0; background: #111; box-shadow: none; }
.featured-media { inset: 0 0 0 auto; width: auto; max-width: 78%; height: 100%; object-fit: contain; object-position: right center; mask-image: linear-gradient(90deg, transparent, #000 18%); transition: none; }
.featured:hover .featured-media { transform: none; }
.featured::before { background: linear-gradient(90deg, #111 0%, #111e 22%, #1114 46%, #1110 66%), linear-gradient(0deg, #111 0%, #1110 18%); }
.featured-copy { padding: 70px 48px 0; width: min(70%, 900px); max-width: none; }
.featured h1 { font-size: 52px; line-height: 1.3; font-weight: 800; }
.featured-copy p { color: #d3d3d3; margin-top: 16px; font-size: 15px; }
.featured-actions { margin-top: 28px; gap: 12px; }
.primary-button, .outline-button { border-radius: 5px; min-height: 44px; font-size: 14px; padding: 10px 22px; box-shadow: none; }
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { transform: none; }
.outline-button { background: #ffffff0c; border-color: #656565; color: #eee; }
.featured .outline-button { background: #1115; border-color: #a0a0a0; }
.featured-tabs { left: auto; right: 48px; bottom: 34px; gap: 8px; }
.featured-tabs button { width: 28px; height: 4px; min-height: 0; padding: 0; border-radius: 1px; background: #fff6; }
.featured-tabs button.active { background: #fff; }
.featured-tabs button:focus-visible { outline-offset: 5px; }
.browse-body { padding-top: 10px; }
.type-nav { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 18px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.type-nav button { flex: 0 0 auto; border: 1px solid #393939; border-radius: 5px; background: #222; color: #d5d5d5; padding: 7px 19px; font-size: 13px; line-height: 20px; }
.type-nav button:hover { background: #333; }
.type-nav button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-bar { margin: 0 0 24px; align-items: start; }
.category-nav { flex: 1; flex-wrap: wrap; overflow: visible; gap: 6px; }
.category-nav button { background: transparent; color: #aaa; border-radius: 4px; box-shadow: none; padding: 7px 10px; }
.category-nav button.active { background: #303030; color: #fff; box-shadow: none; }
.filter-controls { gap: 8px; }
.filter-controls select { font-size: 12px; background: #242424; border: 1px solid #424242; border-radius: 4px; color: #ddd; box-shadow: none; padding: 7px 9px; height: 34px; max-width: 100%; }
.catalog-layout { display: block; }
.catalog-section { margin-top: 0; }
.section-heading { min-height: 28px; margin-bottom: 14px; }
.section-heading h2 { font-size: 21px; font-weight: 700; }
.section-heading h2::before { display: none; }
.text-button { font-size: 12px; color: #aaa; }
.text-button:hover { color: #fff; }
.shelf { margin-bottom: 32px; min-width: 0; }
.shelf-actions { display: flex; align-items: center; gap: 8px; }
.shelf-actions .text-button { margin-right: 8px; }
.icon-button { border-radius: 4px; color: #bbb; }
.rail-arrow { width: 28px; height: 28px; background: #242424; }
.poster-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 108px) / 7); gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-top: 4px; }
.poster-rail::-webkit-scrollbar { display: none; }
.poster-rail .anime-card { scroll-snap-align: start; }
.anime-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 28px 18px; }
.poster-button { border-radius: 6px; aspect-ratio: 3 / 4; background: #252525; box-shadow: none; }
.poster-rail .poster-button { aspect-ratio: 6 / 5; }
.poster-button:hover { transform: none; box-shadow: none; }
.poster-button:hover img { transform: scale(1.035); }
.poster-play::before, .poster-play::after { display: none; }
.poster-play svg { width: 42px; height: 42px; padding: 11px; border-radius: 50%; fill: #fff; background: #111b; stroke-width: 2px; }
.poster-play { background: #0002; }
.episode-label { font-size: 11px; border-radius: 3px; padding: 2px 6px; background: #111b; }
.anime-title { color: #f1f1f1; font-size: 14px; font-weight: 500; padding: 9px 0 2px; }
.anime-title:hover { color: #fff; text-decoration: underline; }
.anime-meta { display: flex; gap: 2px; align-items: center; color: #999; font-size: 11px; min-height: 20px; }
.anime-meta .mx-start-first { color: #bbb; font-size: 10px; margin-left: auto; padding-left: 5px; }
.anime-meta .mx-start-first:hover { color: #fff; }
.saved-indicator { border-radius: 3px; box-shadow: none; }
.load-more-wrap button { background: #262626; color: #ddd; border: 1px solid #444; border-radius: 4px; box-shadow: none; }
.load-more-wrap button:hover { color: #fff; }
.open-section { margin-top: 0; margin-bottom: 32px; }
.open-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 54px) / 4); overflow-x: auto; gap: 18px; scrollbar-width: thin; scrollbar-color: #444 transparent; padding-bottom: 8px; }
.open-thumb { border-radius: 6px; }
.open-thumb:hover { transform: none; }
.open-card button.anime-title { font-size: 14px; }
.activity-directory { border-top: 1px solid #2c2c2c; margin-top: 32px; padding-top: 22px; }
.activity-directory summary { list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 14px; cursor: pointer; color: #aaa; }
.activity-directory summary::-webkit-details-marker { display: none; }
.activity-directory[open] summary svg { transform: rotate(180deg); }
.sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; position: static; padding-top: 24px; }
.sidebar > section { background: transparent; padding: 0; border-radius: 0; box-shadow: none; }
.sidebar .section-heading h2 { font-size: 16px; }
.rank-number, .hot-list li:nth-child(-n+3) .rank-number { background: #303030; color: #aaa; border-radius: 3px; }
.site-footer { border-top: 1px solid #292929; background: transparent; border-radius: 0; box-shadow: none; padding: 24px 0 36px; margin-top: 36px; color: #858585; line-height: 1.8; }
.site-footer strong { color: #bcbcbc; }
.site-footer > div:first-child { flex-wrap: wrap; }
.site-footer p { max-width: 960px; }
dialog { color: var(--text); background: #1c1c1c; border: 1px solid #3a3a3a; border-radius: 8px; }
dialog::backdrop { background: #000c; }
.dialog-heading { background: #1c1c1cf5; border-color: #383838; border-radius: 0; }
.dialog-heading h2 { font-size: 20px; }
.watch-detail { background: #1c1c1c; border-color: #353535; }
.source-choice { background: #272727; border-color: #444; color: #ccc; border-radius: 4px; }
.source-choice.active { background: var(--accent-soft); color: #fff; border-color: var(--accent); }
.playback-bar, .episode-panel { background: #1c1c1c; border-color: #333; }
.playback-bar select { color: #ddd; }
.episode-link { background: #282828; border-color: #444; color: #ddd; border-radius: 4px; }
.episode-link.active { color: #fff; }
.source-note, .player-info, .player-info .description { color: #aaa; }
.player-info a { color: #eee; text-decoration: underline; }
.source-status-row { border-color: #383838; }
.bottom-nav { background: #181818f5; border-color: #333; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bottom-nav button { color: #aaa; }
.bottom-nav button.active { color: #fff; }
.toast { background: #f2f2f2; color: #151515; border-radius: 4px; box-shadow: 0 4px 28px #0007; }
@media (min-width: 1900px) {
  .featured-copy { padding-left: max(48px, calc((100% - 1800px) / 2)); }
}
@media (max-width: 1200px) {
  .header-inner { gap: 18px; }
  .brand small { display: none; }
  .main-nav button { padding-inline: 9px; }
  .poster-rail { grid-auto-columns: calc((100% - 72px) / 5); }
  .anime-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .featured-copy { width: 80%; }
}
@media (max-width: 900px) {
  .page-width { width: calc(100% - 48px); }
  .header-inner { flex-wrap: wrap; gap: 10px 16px; padding-block: 12px; }
  .brand strong { font-size: 21px; }
  .main-nav { order: 4; width: 100%; height: 34px; justify-content: start; }
  .main-nav button { padding-inline: 12px; }
  .search-box { margin-left: auto; width: 230px; }
  .featured { min-height: 360px; }
  .featured-copy { padding: 74px 24px 0; }
  .featured h1 { font-size: 40px; }
  .featured-tabs { right: 24px; bottom: 28px; }
  .poster-rail { gap: 14px; grid-auto-columns: calc((100% - 42px) / 4); }
  .anime-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 14px; }
  .filter-bar { flex-wrap: wrap; }
  .category-nav { flex-basis: 100%; }
  .sidebar { grid-template-columns: 1fr 1fr; }
  .history-section { grid-column: 1 / -1; }
  .open-grid { grid-auto-columns: calc((100% - 28px) / 3); gap: 14px; }
}
@media (max-width: 680px) {
  body { padding-bottom: 68px; }
  .page-width { width: calc(100% - 32px); }
  .header-inner { min-height: 104px; display: grid; grid-template-columns: 1fr 36px; gap: 10px 12px; padding: 12px 0; }
  .brand strong { font-size: 21px; }
  .brand small { display: inline; font-size: 10px; }
  .main-nav { display: none; }
  .library-button { grid-row: 1; grid-column: 2; }
  .search-box { width: 100%; min-width: 0; grid-row: 2; grid-column: 1 / -1; margin: 0; height: 34px; }
  .featured { height: auto; min-height: 0; max-height: none; aspect-ratio: auto; margin-top: 0; padding-top: 56.25%; padding-bottom: 18px; }
  .featured-media { inset: 0 0 auto; width: 100%; max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: contain; object-position: center; mask-image: none; }
  .featured::before { bottom: auto; height: calc(100vw * 9 / 16 + 1px); background: linear-gradient(0deg, #111, #1110 30%); }
  .featured-copy { position: relative; padding: 0 16px; margin-top: -8px; width: 100%; max-width: 100%; }
  .featured h1 { font-size: 32px; max-width: 100%; }
  .featured-copy p { font-size: 12px; margin-top: 10px; }
  .featured-actions { margin-top: 18px; gap: 10px; }
  .primary-button, .outline-button { min-height: 40px; padding: 9px 14px; font-size: 12px; }
  .featured-tabs { right: 16px; bottom: auto; top: calc(100vw * 9 / 16 - 22px); gap: 5px; }
  .featured-tabs button { width: 20px; }
  .browse-body { padding-top: 8px; }
  .type-nav { gap: 8px; padding-bottom: 16px; margin-right: -16px; padding-right: 16px; }
  .type-nav button { padding: 6px 14px; font-size: 12px; }
  .section-heading { margin-bottom: 10px; min-height: 28px; }
  .section-heading h2 { font-size: 18px; }
  .shelf { margin-bottom: 24px; }
  .shelf-actions .text-button { font-size: 11px; margin-right: 0; }
  .rail-arrow { display: none; }
  .poster-rail { grid-auto-columns: 35%; gap: 12px; margin-right: -16px; padding-right: 16px; }
  .poster-rail .poster-button { aspect-ratio: 3 / 4; }
  .anime-title { font-size: 12px; padding-top: 7px; }
  .anime-meta { font-size: 10px; }
  .poster-rail .mx-start-first { display: none; }
  .anime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 10px; }
  .anime-grid .anime-meta { flex-wrap: wrap; white-space: normal; line-height: 1.6; }
  .anime-grid .mx-start-first { margin-left: 0; padding-left: 2px; }
  .filter-bar { gap: 10px; margin-bottom: 18px; }
  .filter-controls { width: 100%; justify-content: space-between; gap: 6px; }
  .filter-controls label { flex: 1; min-width: 0; }
  .filter-controls select { width: 100%; padding: 6px; font-size: 11px; }
  .category-nav { gap: 4px; }
  .category-nav button { font-size: 11px; padding: 5px 9px; }
  .heading-group { gap: 8px; }
  .heading-group > span, .section-note { font-size: 11px; }
  .open-section { margin-bottom: 24px; }
  .open-grid { grid-auto-columns: 72%; gap: 12px; margin-right: -16px; padding-right: 16px; }
  .open-card button.anime-title { font-size: 13px; }
  .sidebar { grid-template-columns: 1fr; gap: 26px; }
  .history-section { grid-column: auto; }
  .watch-dialog, .watch-dialog.mx-watch-dialog { width: calc(100% - 16px); max-height: calc(100svh - 24px); }
  .watch-dialog-body, .mx-watch-dialog .watch-dialog-body { display: block; }
  .dialog-heading { padding: 12px; }
  .dialog-heading h2 { font-size: 18px; }
  .watch-detail { padding: 16px; border-left: 0; border-top: 1px solid #333; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .site-footer { margin-top: 28px; font-size: 10px; }
  .site-footer > div:first-child { display: block; }
  .site-footer #updateTime { display: block; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
