@layer reset, tokens, base, components, layouts, pages, utilities;

@layer reset {
  * {
    box-sizing: border-box;
  }

  html {
    height: 100%;
    color-scheme: dark;
  }

  body {
    min-height: 100%;
    margin: 0;
    color-scheme: dark;
  }

  a {
    text-decoration: none;
  }
}

@layer tokens {
  :root {
    --bg: #0f1115;
    --panel: #161a22;
    --panel-2: #1b2130;
    --text: #e7edf3;
    --muted: #9aa5b1;
    --primary: #6c5ce7;
    --accent: #00b0ff;
    --border: rgba(255, 255, 255, .07);
    --border-2: rgba(255, 255, 255, .12);
    --error: #ff5555;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
    
    --head-cover-w: 64px;
    --updates-w: 360px;
    --upd-cover-w: 72px;
    --upd-row-cover: 80px;
    --updates-panel-max: 860px;
    --home-two-gap: 16px;
    
    --chat-offset-bottom: 45px;

    --container-max-width: 1400px;
    --container-padding: 24px;
    --catalog-sidebar-width: 370px;
  }
}


@layer base {
  html {
    width: 100%;
    overflow-x: clip;
  }

  body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(60vw 60vw at 75% -10%, #152033 0%, #0f1115 60%) no-repeat, var(--bg);
    width: 100%;
    position: relative;
    overflow-x: clip;
  }

  a {
    color: var(--accent);
  }

  a:hover {
    text-decoration: underline;
  }

  ::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
  }
  
  ::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, .12); 
    border-radius: 10px; 
    border: 2px solid transparent; 
    background-clip: padding-box; 
  }
  
  ::-webkit-scrollbar-track { 
    background: transparent; 
  }
}

@layer components {
  
  .container {
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    padding: var(--container-padding);
    padding-bottom: calc(var(--container-padding) + 60px);
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    position: relative;
    z-index: 150;
  }

  .brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 700;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
  }

  .brand:hover {
    opacity: 0.8;
  }

  .brand.disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }

  .brand.disabled:hover {
    opacity: 0.5;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    box-shadow: var(--shadow);
  }

  .panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #06121a;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s ease, box-shadow 0.2s ease;
  }

  .btn:disabled {
    opacity: .5;
    cursor: not-allowed;
  }
  
  @media (min-width: 701px) {
    .btn:not(:disabled):hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
      opacity: 0.95;
    }
    
    .btn:not(:disabled):active {
      transform: translateY(0);
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
  }

  .chat-container .btn {
    opacity: 1 !important;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%) !important;
    color: #06121a !important;
  }

  .btn-ghost-old {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }

  .btn-ghost-old:disabled {
    opacity: .5;
    cursor: not-allowed;
  }
  

  @media (min-width: 701px) {
    .btn-ghost-old:not(:disabled):hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .btn-ghost-old:not(:disabled):active {
      transform: translateY(0);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }
  }

  .chip-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .chip {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
    transition: all .15s ease;
    opacity: .8;
  }

  .chip.enabled {
    opacity: 1;
  }

  .chip--active {
    background: var(--primary);
    border-color: transparent;
    color: #fafafa;
    box-shadow: 0 6px 18px rgba(108, 92, 231, .35);
    opacity: 1;
  }

  .chip:disabled {
    opacity: .35;
    cursor: not-allowed;
  }

  .search-panel {
    padding: 18px;
  }

  .search-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
  }

  .search-row input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
  }

  .search-row .icon {
    opacity: .8;
  }

  .source-toggle {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 4px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .source-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
  }

  .source-btn:hover:not(.active) {
    background: rgba(255, 255, 255, .05);
    color: var(--text);
  }

  .source-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, .3);
  }

  .source-btn .source-icon {
    font-size: 16px;
  }

  .selection-source-toggle {
    margin: 8px 0;
  }

  .selection-source-toggle .source-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .season-selector {
    margin-bottom: 16px;
  }

  .season-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .season-item {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
  }

  .season-item:hover:not(.active) {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
  }

  .season-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }

  .nested-search {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin-bottom: 16px;
  }

  .tabs {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0;
  }

  .tab--active {
    color: var(--text);
    position: relative;
  }

  .tab--active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--primary);
  }

  .loader {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 14px;
    display: none;
  }

  .loader.show {
    display: block;
  }

  .card {
    display: grid;
    grid-template-rows: auto auto;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
  }

  .card:hover {
    transform: translateY(-2px);
    border-color: var(--border-2);
  }

  .card-img {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0a0b0f;
  }

  .card-img img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
  }

  .card-img .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .65) 0%, rgba(0, 0, 0, 0) 55%);
  }

  .card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .card-badge {
    background: rgba(0, 0, 0, .55);
    border: 1px solid var(--border-2);
    color: #eaf0ff;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .2px;
    border-radius: 8px;
    padding: 3px 6px;
    backdrop-filter: blur(2px);
  }

  .card-body {
    padding: 12px;
  }

  .card .title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
  }

  .ep-panel, .voice-panel {
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    max-height: 420px;
    overflow: auto;
  }

  .ep-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }

  .ep-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, .03);
    transition: all .15s ease;
    min-height: 48px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
  }

  .ep-item:hover {
    border-color: var(--border-2);
    transform: translateY(-1px);
  }

  .ep-item.active {
    background: rgba(108, 92, 231, .15);
    border-color: var(--primary);
  }

  .ep-item.ep-item-special {
    border-color: rgba(255, 214, 102, .55);
    background: rgba(255, 214, 102, .12);
  }

  .ep-item.ep-item-special .ep-name {
    color: #fff4c0;
  }

  .ep-item.ep-item-special .ep-num {
    background: rgba(255, 214, 102, .18);
    color: #fff4c0;
  }

  .ep-item.ep-item-special.active {
    background: rgba(108, 92, 231, .2);
    border-color: var(--primary);
  }

  .ep-item.ep-item-special.active .ep-name {
    color: #fff;
  }

  .ep-item.ep-item-special.active .ep-num {
    background: rgba(108, 92, 231, .18);
    color: #dfe7ff;
  }

  .ep-num {
    font-weight: 800;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(108, 92, 231, .15);
    color: #dfe7ff;
    font-size: 14px;
    position: relative;
  }

  .ep-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #ffbb55;
    color: #1a1a1d;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: .4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    text-transform: uppercase;
  }

  .ep-name {
    font-size: 14px;
    line-height: 1.25;
    color: var(--text);
  }

  .voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    gap: 8px;
  }
  
  .voice-item .voice-flag {
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .voice-item .voice-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .voice-item:hover {
    background: rgba(255, 255, 255, .04);
  }

  .voice-item.active {
    background: rgba(108, 92, 231, .15);
    color: #fff;
  }

  .voice-item .badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #bcd6ff;
  }

  .voice-item .hd {
    margin-left: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #c6ffd5;
  }
}

@layer layouts {
  
  .main-content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .main-content-area.with-chat {
    grid-template-columns: 1fr 320px;
  }

  .toolbar {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1.1fr 1.9fr;
    gap: 16px;
    align-items: start;
  }
  .grid {
    display: grid;
  }

  .landing-layout {
    display: grid;
    grid-template-columns: 1fr var(--updates-w);
    gap: 16px;
    align-items: start;
  }

  .landing-main {
    min-width: 0;
    overflow: visible;
  }

  .landing-aside {
    min-width: var(--updates-w);
    display: grid;
    gap: 12px;
  }

  .home-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--home-two-gap);
    align-items: start;
    margin-top: 16px;
  }

  .carousel {
    position: relative;
  }

  .caro-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .landing-row {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    scrollbar-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .landing-row::-webkit-scrollbar {
    display: none;
  }

  .landing-row > .card {
    flex: 0 0 clamp(140px, 14vw, 190px);
    scroll-snap-align: start;
  }
  
  .caro-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(31, 41, 55, .9);
    border: 1px solid var(--border-2);
    color: #e5e7eb;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, opacity .15s ease;
    box-shadow: none;
  }

  .caro-btn:hover {
    background: rgba(55, 65, 81, .95);
  }

  .caro-btn:active {
    transform: translateY(-50%) scale(.97);
  }

  .caro-btn:disabled {
    opacity: .35;
    pointer-events: none;
  }

  .caro-left {
    left: -18px;
  }

  .caro-right {
    right: -18px;
  }

  .caro-btn svg {
    width: 14px;
    height: 14px;
  }

  .caro-fade {
    display: none;
  }
}

@layer pages {
  
  .selection {
    padding: 16px;
  }

  .selection-head {
    display: grid;
    grid-template-columns: var(--head-cover-w) 1fr;
    gap: 12px;
    align-items: center;
  }

  .head-cover {
    width: var(--head-cover-w);
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0a0b0f;
  }

  .head-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .head-cover.no-img {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #121723, #0e131b);
    color: var(--muted);
    font-size: 11px;
  }

  .head-cover.no-img::after {
    content: 'No cover';
    opacity: .8;
  }

  .head-meta .title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
  }

  .head-meta .meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .head-meta .meta .star {
    color: #fbbf24;
    margin: 0 4px 0 6px;
  }

  .head-meta .meta .sep {
    opacity: .6;
    margin: 0 6px;
  }

  .head-meta .meta .item b {
    font-weight: 800;
  }

  .section-title {
    font-weight: 700;
    margin: 8px 0;
  }

  #selectionResults {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 8px;
  }
  
  #selection-search-panel:has(#selectionResults:not(:empty)) ~ .selection-head,
  #selection-search-panel:has(#selectionResults:not(:empty)) ~ .toolbar {
    display: none !important;
  }
  
  #selection-search-panel:has(#selectionResults:not(:empty)) {
    margin-bottom: 0;
  }
  
  #selectionResults.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  #results.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .card--result .card-img {
    aspect-ratio: 2 / 3;
    background: #0b0e13;
    position: relative;
    overflow: hidden;
  }

  .card--result .card-img img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
  }

  .card--result .card-img .overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .0) 58%);
  }

  .card--result .card-body {
    padding: 10px;
  }

  .card--result .card-body .title {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
  }

  .card--result .card-body .subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
  }

  .card--result .card-badges {
    top: 6px;
    left: 6px;
    gap: 6px;
  }

  .card--result .card-badge,
  .card--result .badge-episode {
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2px;
    border-radius: 8px;
    padding: 3px 6px;
    color: #eaf0ff;
  }

  .card--result {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  .card--result:hover {
    transform: translateY(-2px);
    border-color: var(--border-2);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  }

  .card--result:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 12px;
  }

  #results .card {
    content-visibility: auto;
    contain-intrinsic-size: 280px 380px;
  }

  .landing-sections {
    display: grid;
    gap: 16px;
    margin-top: 16px;
    padding-bottom: 40px;
  }

  .landing-section {
    min-width: 0;
  }

  .landing-title {
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0px;
    margin-bottom: 15px;
  }

  .card--poster .card-img {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    position: relative;
  }
  
  @media (min-width: 701px) {
    .card--poster {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .card--poster:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .card--poster .card-img,
    .card--poster .card-img img,
    .card--poster .overlay {
      transition: none;
    }
  }

  .card--poster .card-body .title {
    font-size: 14px;
  }

  .badge-episode {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #eaf0ff;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .2px;
  }

  .updates-grid-section {
    display: grid;
    gap: 10px;
    margin-top: 18px;
  }

  .updates-grid-section .landing-title {
    font-weight: 800;
    font-size: 16px;
  }

  .updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .update-card.card--poster .card-img {
    aspect-ratio: 2 / 3;
  }

  .update-card .card-badges {
    top: 6px;
    left: 6px;
    gap: 6px;
  }

  .update-card .badge-episode {
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 10px;
    font-weight: 800;
    border-radius: 8px;
    padding: 3px 6px;
    color: #eaf0ff;
  }

  .update-card .badge-type {
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 10px;
    border-radius: 6px;
    padding: 2px 6px;
    color: #eaf0ff;
  }

  .update-card .card-body {
    padding: 10px;
  }

  .update-card .card-body .title {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
  }

  .update-card .card-body .subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
  }

  .updates-more {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  .updates-more .btn {
    min-width: 200px;
  }

  .updates-panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 12px;
  }

  .updates-panel .panel-title {
    font-weight: 800;
    font-size: 16px;
    margin: 2px 2px 10px;
  }

  .updates-panel .updates-list,
  .updates-panel .updates-list * {
    list-style: none;
  }

  .updates-panel .updates-list *:focus,
  .updates-panel .updates-list *:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .updates-list,
  .upd-item {
    list-style: none;
  }

  .updates-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .02);
  }

  .upd-item {
    display: grid;
    grid-template-columns: var(--upd-row-cover) 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    transition: background .15s ease;
    cursor: pointer;
  }

  .upd-item + .upd-item {
    border-top: 1px solid var(--border);
  }

  .upd-item:hover {
    background: rgba(255, 255, 255, .04);
  }

  .upd-cover {
    position: relative;
    width: var(--upd-row-cover);
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #0a0d12;
    border: 1px solid var(--border);
  }

  .upd-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .upd-type {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .65);
    color: #e8eefc;
    border: 1px solid rgba(255, 255, 255, .18);
  }

  .upd-age {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fff;
    border: none;
    letter-spacing: .2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
  }

  .upd-age.age-0 {
    background: #64748b;
  }

  .upd-age.age-12 {
    background: #2563eb;
  }

  .upd-age.age-16 {
    background: #f59e0b;
  }

  .upd-age.age-18 {
    background: #ef4444;
  }

  .upd-title {
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    white-space: normal;
  }

  .upd-ep {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .upd-ep .ep-num {
    font-weight: 800;
  }

  .upd-ep .ep-name {
    opacity: .9;
  }

  .upd-ep .ep-extra {
    color: var(--muted);
    margin-left: 10px;
    font-size: 12px;
  }

  .upd-time {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
  }

  .now-panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 12px;
  }

  .now-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .now-title {
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
  }

  .now-title .arrow {
    opacity: .7;
    transition: transform .15s ease;
  }

  .now-title:hover .arrow {
    transform: translateX(2px);
    opacity: 1;
  }

  .now-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .now-pill {
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
  }

  .now-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
  }

  .now-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
  }


  .now-col {
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
  }

  .now-col .col-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--muted);
  }

  .now-item {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 10px;
    align-items: center;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
  }

  .now-item:hover {
    background: rgba(255, 255, 255, .04);
  }

  .now-item + .now-item {
    margin-top: 2px;
  }

  .now-thumb {
    width: 74px;
    height: 74px;
    border-radius: 12px;
    overflow: hidden;
    background: #0a0d12;
    border: 1px solid var(--border);
  }

  .now-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .now-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .now-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .now-meta .eye {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: .9;
  }

  .now-panel .updates-list,
  .now-panel .updates-list * {
    list-style: none;
  }

  .now-panel .now-meta .eye {
    display: none;
  }

  #now-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .now-modal {
    width: min(1100px, 92vw);
    max-height: 86vh;
    overflow: hidden;
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  .now-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .now-modal-filters {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .now-modal-body {
    padding: 12px;
    overflow: auto;
  }

  .now-select {
    background: rgba(17, 24, 39, .95);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e7edf3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) 50%;
    transition: border-color 0.2s, background-color 0.2s;
    min-width: 140px;
  }
  
  .now-select:hover {
    border-color: var(--accent);
    background-color: rgba(17, 24, 39, 1);
  }
  
  .now-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  .now-select option {
    background: #111827;
    color: #e7edf3;
    padding: 8px;
  }

  .now-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .now-grid .card.card--poster.card--result .card-img {
    aspect-ratio: 2 / 3;
  }

  .now-grid .card.card--poster.card--result .card-body {
    padding: 8px;
  }

  .now-grid .card.card--poster.card--result .card-body .title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
  }

  .now-grid .card.card--poster.card--result .card-body .subtitle {
    font-size: 12px;
    color: var(--muted);
  }

  .now-modal-foot {
    display: flex;
    justify-content: center;
    padding: 10px;
    border-top: 1px solid var(--border);
  }

  .now-end {
    text-align: center;
    color: var(--muted);
    padding: 18px 8px 22px;
    opacity: .9;
  }

  .now-end .shrug {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .related-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
  }

  .related-head {
    font-weight: 800;
    margin: 0 0 8px;
  }

  .related-body {
    display: grid;
    gap: 10px;
  }

  .related-loader {
    color: var(--muted);
    font-size: 14px;
  }

  .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }

  .related-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .02);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
  }

  .related-card:hover {
    background: rgba(255, 255, 255, .04);
    border-color: var(--border-2);
    transform: translateY(-1px);
  }

  .rel-cover {
    width: 92px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #0b0e13;
    border: 1px solid var(--border);
  }

  .rel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .rel-body {
    display: grid;
    gap: 4px;
  }

  .rel-type {
    font-size: 12px;
    color: var(--accent);
    font-weight: 700;
    opacity: .9;
  }

  .rel-title {
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
  }

  .rel-sub {
    font-size: 12px;
    color: var(--muted);
  }

  .related-card.related-disabled {
    opacity: .5;
    filter: grayscale(60%);
    cursor: not-allowed;
    pointer-events: none;
  }

  .player-panel {
    padding: 12px;
  }

  .player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1000;
  }
  
  .download-dropdown {
    position: relative;
    display: inline-block;
  }
  
  .download-menu {
    position: fixed;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 0;
    min-width: 160px;
    max-width: 200px;
    z-index: 999999 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    max-height: 300px;
    overflow-y: auto;
  }
  
  .download-menu-title {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  
  .download-quality-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
  }
  
  .download-quality-item:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .download-quality-item .quality-badge {
    font-weight: 600;
    margin-right: 8px;
  }
  
  .download-quality-item .quality-hd {
    color: var(--primary);
    font-size: 11px;
    margin-left: 4px;
  }

  .player-panel {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .player-panel .plyr {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .toolbar {
    transition: grid-template-columns 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }
  
  .toolbar > *:first-child {
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.4s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
  }
  
  body.theater-mode .main-layout {
    display: grid;
    grid-template-columns: 0fr 1fr;
    transition: grid-template-columns 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  body.theater-mode .layout-left {
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  
  body.theater-mode .layout-right {
    max-width: 100%;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  body.theater-mode .toolbar {
    display: block;
  }
  
  body.theater-mode .toolbar > *:first-child {
    display: none;
  }
  
  body.theater-mode .player-panel {
    border-radius: 12px;
    background: var(--card);
    margin: 0;
    padding: 0;
    width: 100%;
    position: relative;
    z-index: 50;
    overflow: visible;
  }
  
  body.theater-mode .player-panel .player-head {
    background: var(--card);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  
  body.theater-mode .player-panel #player-container {
    width: 100%;
    position: relative;
  }
  
  body.theater-mode .player-panel .plyr {
    border-radius: 0 0 12px 12px;
    width: 100%;
    max-height: 80vh;
  }
  
  body.theater-mode .selection-head,
  body.theater-mode .selection-source-toggle,
  body.theater-mode #selection-search-panel {
    display: none;
  }
  
  body.theater-mode .content-card,
  body.theater-mode .info-section {
    display: none;
  }
  
  body.theater-mode #hint {
    display: none;
  }
  
  body.theater-mode #theater-mode-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  body.theater-mode #theater-mode-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text);
  }
  
  .player-wrapper {
    position: relative;
  }
  
  .skip-intro-btn {
    position: absolute;
    bottom: 55px;
    left: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(45, 45, 50, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }
  
  .plyr--fullscreen .skip-intro-btn,
  .plyr--full-ui .skip-intro-btn {
    bottom: 65px;
    left: 20px;
  }
  
  .skip-intro-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  .skip-intro-btn.hidden {
    display: none;
  }
  
  .skip-intro-btn:hover {
    background: rgba(60, 60, 65, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }
  
  .skip-intro-btn:active {
    transform: translateY(0);
  }
  
  .skip-intro-btn.fade-out {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }
  
  .skip-intro-icon {
    font-size: 14px;
  }
  
  .skip-intro-text {
    white-space: nowrap;
  }
  
  body.theater-mode .skip-intro-btn {
    bottom: 65px;
  }
  
  .theater-controls {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 50;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    flex-wrap: wrap;
    max-width: calc(100% - 24px);
  }
  
  body.theater-mode .theater-controls {
    display: flex;
  }
  
  body.theater-mode .player-wrapper:hover .theater-controls,
  body.theater-mode .theater-controls:focus-within,
  body.theater-mode .theater-controls.has-popup {
    opacity: 1;
    pointer-events: auto;
  }
  
  .theater-ctrl-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    white-space: nowrap;
  }
  
  .theater-ctrl-btn:hover {
    background: rgba(139, 92, 246, 0.8);
    border-color: var(--accent);
  }
  
  .theater-ctrl-btn .badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
  }
  
  .theater-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px;
    min-width: 200px;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
  
  .theater-popup.active {
    display: block;
    animation: popupFadeDown 0.2s ease;
  }
  
  @keyframes popupFadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .theater-popup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .theater-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
  
  .theater-popup-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
  }
  
  .theater-popup-item:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent);
  }
  
  .theater-popup-item.active {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
  }
  
  .theater-popup-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .theater-popup-list .theater-popup-item {
    text-align: left;
  }
  
  @media (max-width: 768px) {
    #theater-mode-btn {
      display: none !important;
    }
    
    body.theater-mode .player-panel {
      margin: 0 -12px;
      width: calc(100% + 24px);
    }
    
    body.theater-mode .player-panel .plyr {
      max-height: 50vh;
    }
    
    .theater-controls {
      display: none !important;
    }
  }

  .plyr .skip-indicator,
  .plyr--fullscreen .skip-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 100;
  }
  
  .plyr .skip-indicator--left,
  .plyr--fullscreen .skip-indicator--left {
    left: 15%;
  }
  
  .plyr .skip-indicator--right,
  .plyr--fullscreen .skip-indicator--right {
    right: 15%;
  }
  
  .plyr .skip-indicator--visible,
  .plyr--fullscreen .skip-indicator--visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  
  .skip-indicator__icon {
    font-size: 24px;
    color: #fff;
    letter-spacing: -4px;
    margin-bottom: 4px;
  }
  
  .skip-indicator__text {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
  }
  
  @media (max-width: 600px) {
    .plyr .skip-indicator,
    .plyr--fullscreen .skip-indicator {
      width: 70px;
      height: 70px;
    }
    .skip-indicator__icon {
      font-size: 18px;
    }
    .skip-indicator__text {
      font-size: 11px;
    }
    .plyr .skip-indicator--left,
    .plyr--fullscreen .skip-indicator--left {
      left: 10%;
    }
    .plyr .skip-indicator--right,
    .plyr--fullscreen .skip-indicator--right {
      right: 10%;
    }
  }

  .player-shell {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }

  .player-shell > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }

  .plyr {
    --plyr-color-main: var(--accent);
    --plyr-video-background: #000;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
    position: relative;
    contain: layout style paint;
  }

  .plyr__captions {
    pointer-events: none;
  }

  .plyr__video-wrapper > video,
  .plyr video {
    object-fit: contain;
    transform: translateZ(0);
  }

  .plyr--video .plyr__poster {
    background-size: contain;
    background-position: center;
  }

  .player-panel .plyr {
    width: 100%;
    height: auto;
  }

  body:not(.app-fullscreen-mode) .player-panel .plyr__video-wrapper {
    padding-bottom: 0;
    height: auto;
    aspect-ratio: auto;
  }

  body:not(.app-fullscreen-mode) .player-panel .plyr__video-wrapper > video {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  body.app-fullscreen-mode .plyr--fullscreen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  body.app-fullscreen-mode .plyr--fullscreen .plyr__video-wrapper {
    padding: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .plyr:fullscreen .plyr__video-wrapper,
  .plyr:-webkit-full-screen .plyr__video-wrapper {
    padding: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  body.app-fullscreen-mode .plyr--fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #000;
  }

  :picture-in-picture {
    background-color: black !important;
  }

  .plyr--video .plyr__poster {
    background-size: contain;
    background-position: center;
  }

  .app-fullscreen-mode .plyr--fullscreen .plyr__captions {
    bottom: 48px;
  }

  .plyr--video .plyr__controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .75));
    padding: 10px;
  }

  .plyr__progress,
  .plyr__progress__buffer,
  .plyr__progress__played {
    display: block;
    visibility: visible;
    opacity: 1;
  }

  .plyr__time {
    color: #fff;
    font-size: 13px;
  }

  .plyr__captions {
    z-index: 15;
    bottom: 56px;
  }

  .plyr--hide-controls .plyr__captions {
    bottom: 12px;
  }

  .plyr__menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .plyr__menu__container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 17, 21, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  }

  .plyr__menu__container [role="menu"] {
    background: rgba(15, 17, 21, 0.98) !important;
  }

  .plyr__menu__container [role="menuitem"],
  .plyr__menu__container [role="menuitemradio"] {
    color: #ffffff !important;
    background: transparent;
  }

  .plyr__menu__container [role="menuitem"]:hover,
  .plyr__menu__container [role="menuitemradio"]:hover {
    background: rgba(108, 92, 231, 0.2) !important;
    color: #ffffff !important;
  }

  .plyr__menu__container [role="menuitemradio"][aria-checked="true"] {
    background: rgba(108, 92, 231, 0.3) !important;
    color: #ffffff !important;
  }

  .plyr__menu__container .plyr__menu__value {
    color: rgba(255, 255, 255, 0.8) !important;
  }

  .plyr__menu__container [role="menuitem"] span,
  .plyr__menu__container [role="menuitemradio"] span {
    color: #ffffff !important;
  }

  .plyr__control[data-plyr="back"] {
    color: #ffffff !important;
  }

  .plyr__menu__container .plyr__control > span {
    color: #ffffff !important;
  }
  
  .plyr__menu__container .plyr__control {
    color: #ffffff !important;
  }
  
  .plyr__menu__container button {
    color: #ffffff !important;
  }

  .plyr__menu__container hr {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 4px 0;
  }

  .plyr__controls button[data-plyr="settings"] {
    border-radius: 6px;
  }

  .plyr__menu__container {
    animation: plyrMenuFadeIn 0.2s ease-out;
  }

  .plyr__video-wrapper,
  .plyr__video-wrapper video {
    will-change: auto;
    transform: translateZ(0);
  }

  .plyr__menu,
  .plyr__menu__container,
  .plyr [data-plyr="settings"] {
    will-change: auto;
    transform: none;
  }

  .watch-party-controls {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }

  .watch-party-panel {
    padding: 16px;
    margin-bottom: 18px;
    border: 1px dashed var(--primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .wp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .invite-link-wrapper {
    display: flex;
    gap: 8px;
  }

  .watch-party-panel input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-weight: 500;
  }
  
  .resync-btn {
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
  }
  
  .resync-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.02);
  }
  
  .resync-btn:disabled {
    opacity: 0.6;
    cursor: wait;
  }

  #catalogWatchPartyPanel {
    margin-bottom: 20px;
  }

  .host-only-disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    user-select: none !important;
  }

  .host-only-disabled:hover {
    opacity: 0.5 !important;
    pointer-events: none !important;
  }

  .host-only-disabled:active {
    pointer-events: none !important;
  }

  .host-only-disabled:focus {
    pointer-events: none !important;
  }

  .catalog-layout {
    display: flex;
    gap: 20px;
    min-height: 600px;
  }

  #catalogChatSidebar {
    width: 300px;
    overflow: visible;
    display: none;
  }

  .catalog-main {
    flex: 1;
    min-width: 0;
  }

  .catalog-anime-card.guest-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
  }

  .catalog-anime-card.guest-disabled:hover {
    opacity: 0.6;
    transform: none;
  }

  @media (max-width: 1200px) {
    .catalog-chat-sidebar {
      width: 250px;
    }
  }

  @media (max-width: 900px) {
    .catalog-layout {
      flex-direction: column;
    }
    
    .catalog-chat-sidebar {
      width: 100%;
      max-height: 300px;
    }
  }

  .chat-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 80vh;
  }

  .chat-header {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);    
  }

  #participants-list,
  #catalogParticipantsList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
  }

  .participant {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 8px;
  }

  .participant.host::after {
    content: ' 👑';
    font-size: 12px;
  }

  .participant.host {
    background: rgba(99, 102, 241, .15);
    color: #a5b4fc;
  }  

  .participant.clickable {
    cursor: pointer;
  }

  .participant.clickable:hover {
    outline: 1px dashed var(--border-2);
  }

  .chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .chat-message, .message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.4;
    word-wrap: break-word;
  }


  .chat-message.system, .message.system {
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    font-style: italic;
    padding: 0;
  }

  .chat-message.other, .message:not(.system) {
    background: var(--panel-2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
  }

  .chat-message.mine, .message.mine {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
  }

  .chat-message .sender, .message .chat-sender {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
    opacity: 0.8;
  }

  .chat-form {
    position: relative;
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;    
  }

  .chat-form input {
    flex-grow: 1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);    
    min-width: 0;
    font-size: 14px;
  }

  .chat-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .2);
  }

  .chat-form button {
    flex-shrink: 0;
    padding: 8px;    
    width: 42px;
  }

  #gifBtn {
    flex-shrink: 0;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 12px;
  }

  #catalogGifBtn {
    flex-shrink: 0;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 12px;
    width: auto;
  }

  .gif-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    z-index: 10;
  }

  .gif-picker-header {
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .gif-picker-header input {
    width: 100%;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
  }

  .gif-picker-header input:focus {
    background: rgba(255, 255, 255, .08);
    border-color: var(--primary);
  }

  .gif-picker-body {
    padding: 12px;
    overflow-y: auto;
    flex-grow: 1;
  }

  .gif-picker-body::-webkit-scrollbar {
    width: 6px;
  }

  .gif-picker-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .02);
    border-radius: 3px;
  }

  .gif-picker-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 3px;
  }

  .gif-picker-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .15);
  }

  .gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gif-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--panel-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, .1);
    transition: all 0.2s;
    aspect-ratio: 1;
    position: relative;
  }

  .gif-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    z-index: 1;
  }

  .gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .gif-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1), transparent);
    animation: shimmer 1.5s infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .gif-item.loading::before {
    opacity: 1;
  }

  .chat-message.has-gif-only {
    padding: 4px 8px;
    background: transparent;
    margin: 12px 0;
  }

  .chat-message.has-gif-only .message-content-wrapper {
    padding: 0;
    background: none;
    max-width: 90%;
  }

  .chat-message.has-gif-only .sender {
    padding: 0 0 8px 4px;
    font-size: 13px;
    opacity: 0.7;
    font-weight: 500;
  }

  .chat-message.has-gif-only img,
  .chat-gif {
    width: 100%;
    max-width: 350px;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, .08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .chat-message.has-gif-only img:hover,
  .chat-gif:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
  }

  .chat-message.mine.has-gif-only {
    display: flex;
    justify-content: flex-end;
  }

  .chat-message.mine.has-gif-only .message-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .chat-message.other.has-gif-only {
    display: flex;
    justify-content: flex-start;
  }

  .chat-message.other.has-gif-only .message-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-message.has-gif-only img {
    animation: fadeInScale 0.3s ease-out;
  }

  .chat-handle {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 2003;
    background: rgba(229, 231, 235, 0.92);
    color: #111827;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: none;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
  }

  .chat-handle:hover {
    transform: translateY(-1px);
  }

  .chat-handle.is-active {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 3px 10px rgba(0, 0, 0, 0.14);
    background: rgba(108, 92, 231, 0.95);
    color: #fff;
  }

  .chat-handle svg {
    width: 20px;
    height: 20px;
  }

  @media (min-width: 901px) {
    .plyr--fullscreen .chat-handle,
    body.app-fullscreen-mode .chat-handle {
      display: grid !important;
    }
  }

  body.app-fullscreen-mode.plyr-controls-visible .chat-handle {
    bottom: calc(var(--fs-controls-h, 56px) + 32px + env(safe-area-inset-bottom, 0px));
  }

  .plyr--fullscreen #chat-container,
  body.app-fullscreen-mode #chat-container {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(var(--chat-offset-bottom) + env(safe-area-inset-bottom, 0px));
    top: auto;
    height: auto;
    z-index: 2002;
    width: clamp(240px, 28vw, 320px);
    max-height: clamp(240px, 60vh, 480px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: var(--fs-chat-bg, rgba(22, 26, 34, 0.80));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: -10px 12px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transform: translateX(calc(100% + 12px));
    opacity: 0;
    visibility: hidden;
    transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1),
      opacity .35s cubic-bezier(0.22, 1, 0.36, 1),
      visibility .35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  body.app-fullscreen-mode.plyr-controls-visible #chat-container {
    bottom: calc(var(--fs-controls-h, 56px) + var(--chat-offset-bottom) + 16px + env(safe-area-inset-bottom, 0px));
  }

  .plyr--fullscreen #chat-container.is-open,
  body.app-fullscreen-mode #chat-container.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .plyr--fullscreen #chat-container.is-closing,
  body.app-fullscreen-mode #chat-container.is-closing {
    transform: translateX(calc(100% + 12px));
    opacity: 0;
    visibility: hidden;
  }

  .fs-chat-controls {
    display: none;
  }

  .plyr--fullscreen #chat-container .fs-chat-controls,
  body.app-fullscreen-mode #chat-container .fs-chat-controls {
    display: flex;
    padding: 8px 12px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .plyr--fullscreen #chat-container .fs-chat-close-btn,
  body.app-fullscreen-mode #chat-container .fs-chat-close-btn {
    display: none;
  }

  .plyr--fullscreen #chat-container .chat-header,
  body.app-fullscreen-mode #chat-container .chat-header {
    display: none;
  }

  .plyr--fullscreen #chat-container .chat-messages,
  body.app-fullscreen-mode #chat-container .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .plyr--fullscreen #chat-container .chat-form,
  body.app-fullscreen-mode #chat-container .chat-form {
    margin-top: 4px;
  }

  .chat-handle {
    right: 15px;
    bottom: 60px;
  }

  body.app-fullscreen-mode.plyr-controls-visible .chat-handle {
    bottom: calc(var(--fs-controls-h, 56px) + 36px + env(safe-area-inset-bottom, 0px));
  }

  .plyr--fullscreen #chat-container,
  body.app-fullscreen-mode #chat-container {
    right: calc(16px + 72px + env(safe-area-inset-right, 0px));
  }

  .plyr--fullscreen #chat-container .chat-form input,
  body.app-fullscreen-mode #chat-container .chat-form input {
    background: rgba(13, 16, 22, 0.95);
    color: #e9eef6;
    border: 1px solid rgba(255, 255, 255, 0.18);
    caret-color: #e9eef6;
  }

  .plyr--fullscreen #chat-container .chat-form input::placeholder,
  body.app-fullscreen-mode #chat-container .chat-form input::placeholder {
    color: rgba(233, 238, 246, 0.6);
  }

  .plyr--fullscreen #chat-container .chat-form input:focus,
  body.app-fullscreen-mode #chat-container .chat-form input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
  }

  .chat-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 8px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .chat-header-mobile-title {
    font-weight: 700;
    font-size: 15px;
  }

  .chat-close-btn-mobile {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
  }

  .chat-close-btn-mobile:hover {
    color: var(--text);
  }

  .host-only-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(70%);
  }

  .voice-item.host-only-disabled,
  .ep-item.host-only-disabled,
  .chip.host-only-disabled {
    background: rgba(128, 128, 128, 0.1);
    border-color: rgba(128, 128, 128, 0.2);
    color: var(--muted);
  }

  .btn.host-only-disabled,
  .btn-ghost-old.host-only-disabled {
    background: #4a4a4a;
    color: #888;
    cursor: not-allowed;
    opacity: 0.5;
  }

  .host-info {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 13px;
    color: var(--muted);
    display: none;
  }

  .host-info.show {
    display: block;
  }

  .host-info .icon {
    margin-right: 6px;
  }

  .plyr__controls.host-only-disabled {
    display: none;
  }

  #catalog-block {
    display: none;
  }

  #catalog-block:not(.hidden) {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f1115;
    background: radial-gradient(60vw 60vw at 75% -10%, #152033 0%, #0f1115 60%) no-repeat, #0f1115;
    z-index: 100;
    overflow: hidden;
    padding-top: 94px;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
  }

  .catalog-main {
    flex: 1;
    max-width: calc(var(--container-max-width) - var(--catalog-sidebar-width) - 40px);
    margin-left: var(--container-padding);
    min-width: 0;
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: clip;
  }

  .catalog-main::-webkit-scrollbar {
    width: 8px;
  }

  .catalog-main::-webkit-scrollbar-track {
    background: transparent;
  }

  .catalog-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }

  .catalog-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .catalog-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .catalog-desktop-actions {
    display: none;
    align-items: center;
    gap: 8px;
  }

  .catalog-sort-dropdown {
    position: relative;
  }

  .catalog-sort-dropdown.is-open #catalogSortDropdownToggle {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.55) 0%, rgba(79, 70, 229, 0.55) 100%);
    border-color: rgba(99, 102, 241, 0.55);
    color: #e9edff;
  }

  .catalog-sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    min-width: 260px;
    background: linear-gradient(180deg, rgba(14, 19, 31, 0.97) 0%, rgba(9, 13, 21, 0.97) 100%);
    border: 1px solid rgba(88, 101, 242, 0.35);
    border-radius: 14px;
    box-shadow: 0 28px 48px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    z-index: 2050;
  }

  .catalog-sort-menu-group + .catalog-sort-menu-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(88, 101, 242, 0.22);
  }

  .catalog-sort-menu-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(170, 181, 216, 0.72);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .catalog-sort-menu-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.3) 0%, rgba(88, 101, 242, 0) 70%);
  }

  .catalog-sort-menu-item {
    width: 100%;
    background: none;
    border: 1px solid transparent;
    color: rgba(228, 233, 255, 0.9);
    text-align: left;
    padding: 9px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  }

  .catalog-sort-menu-item:hover {
    background: rgba(88, 101, 242, 0.14);
    border-color: rgba(88, 101, 242, 0.4);
    transform: translateX(3px);
  }

  .catalog-sort-menu-item.is-selected {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.32) 0%, rgba(56, 189, 248, 0.28) 100%);
    border-color: rgba(129, 140, 248, 0.55);
    color: #f1f5ff;
  }

  .catalog-sort-menu-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .catalog-sort-menu-item.is-selected .catalog-sort-menu-marker {
    border-color: rgba(226, 232, 255, 0.9);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8) 0%, rgba(59, 130, 246, 0.85) 100%);
  }

  .catalog-sort-menu-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
  }

  .catalog-sort-menu-item.is-selected .catalog-sort-menu-dot {
    background: rgba(255, 255, 255, 0.92);
  }

  .catalog-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 999px;
    color: #d7dcff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .catalog-pill-btn:hover,
  .catalog-pill-btn:focus-visible {
    background: rgba(108, 92, 231, 0.2);
    border-color: rgba(108, 92, 231, 0.45);
    color: #ffffff;
  }

  .catalog-pill-btn:active {
    transform: scale(0.97);
  }

  .catalog-pill-btn span:first-child {
    font-size: 15px;
    line-height: 1;
  }

  .catalog-mobile-actions,
  .catalog-mobile-btn,
  #catalogBackBtn {
    display: none;
  }

  .filters-sidebar {
    width: var(--catalog-sidebar-width);
    flex-shrink: 0;
    margin-right: var(--container-padding);
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    visibility: visible;
    opacity: 1;
    transform: none;
  }


  @media (min-width: 701px) and (min-height: 501px) {
    .filters-sidebar {
      position: relative !important;
      transform: none !important;
      visibility: visible !important;
      opacity: 1 !important;
      display: flex !important;
    }

    .filters-sidebar.hidden {
      visibility: visible !important;
      opacity: 1 !important;
      transform: none !important;
      display: flex !important;
    }

    .catalog-header {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      right: auto !important;
      z-index: auto !important;
    }

    .catalog-desktop-actions {
      display: flex !important;
    }

    .filters-sidebar-header {
      display: none !important;
    }

    .catalog-mobile-actions,
    .catalog-mobile-btn,
    #catalogBackBtn,
    .filters-back-btn {
      display: none !important;
    }

    .filter-section-sort {
      display: block !important;
    }
  }

  .filters-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-2);
    flex-shrink: 0;
  }

  .filters-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .filters-back-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .filters-back-btn:hover {
    color: var(--primary);
  }

  .filters-reset-btn,
  .filters-close-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
  }

  .filters-reset-btn:hover,
  .filters-close-btn:hover {
    background: rgba(108, 92, 231, 0.1);
  }

  .filters-apply-btn {
    min-height: 42px;
    padding: 10px 18px;
    font-size: 14px;
  }

  .filters-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    padding: 16px 24px 24px 24px;
  }

  .filters-sidebar-content::-webkit-scrollbar {
    width: 8px;
  }

  .filters-sidebar-content::-webkit-scrollbar-track {
    background: var(--panel);
  }

  .filters-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 4px;
  }

  .filters-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
  }

  .filter-section {
    margin-bottom: 24px;
  }
  
  .filters-actions {
    display: none;
    gap: 8px;
    padding: 16px 24px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 2100;
  }
  
  .filters-actions .btn,
  .filters-actions .btn-ghost-old {
    flex: 1;
    min-height: 48px;
  }
  
  .filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .filter-button {
    width: 100%;
    padding: 12px 16px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
  }

  .filter-button:hover {
    background: var(--panel);
    border-color: var(--border-2);
  }

  .filter-button-arrow {
    color: var(--muted);
    font-size: 13px;
  }

  .filter-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .filter-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
  }

  .filter-input::placeholder {
    color: var(--muted);
  }

  .filter-input:focus {
    outline: none;
    border-color: var(--primary);
  }

  .filter-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
  }

  .filter-select:focus {
    outline: none;
    border-color: var(--primary);
  }

  .filter-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    min-height: 44px;
  }

  .filter-checkbox:hover {
    background: var(--panel);
    border-color: var(--border-2);
  }

  .filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
    pointer-events: auto;
  }

  .filter-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
  }

  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 17, 21, 0.95);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .modal-overlay:not(.hidden) {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.2s ease-out;
  }

  .modal-content {
    width: 100%;
    height: 100vh;
    max-width: 420px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    margin-left: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .modal-overlay:not(.hidden) .modal-content {
    transform: translateX(0);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-shrink: 0;
  }

  .modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .modal-apply-btn {
    min-height: 40px;
    padding: 10px 18px;
    font-size: 14px;
  }

  @media (min-width: 701px) {
    .filters-header-actions {
      display: none;
    }

    .filters-actions {
      display: flex;
    }
  }

  @media (max-width: 700px) {
    .filters-actions {
      display: none;
    }
  }

  .modal-back {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .modal-back:hover {
    color: var(--primary);
  }

  .modal-reset {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
  }

  .modal-reset:hover {
    background: rgba(108, 92, 231, 0.1);
  }

  .modal-search {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
  }

  .modal-search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
  }

  .modal-search-input::placeholder {
    color: var(--muted);
  }

  .modal-search-input:focus {
    outline: none;
    border-color: var(--primary);
  }

  .modal-strict {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(108, 92, 231, 0.05);
    flex-shrink: 0;
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px;
    background: var(--bg);
  }

  .modal-body::-webkit-scrollbar {
    width: 8px;
  }

  .modal-body::-webkit-scrollbar-track {
    background: transparent;
  }

  .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }

  .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .modal-item:last-child {
    border-bottom: none;
  }

  .modal-item:hover {
    padding-left: 4px;
  }

  .modal-item:active {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.03);
  }

  .modal-item-name {
    font-size: 15px;
    color: var(--text);
    font-weight: 400;
  }

  .modal-item-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    min-width: 20px;
    min-height: 20px;
  }

  .modal-item.state-none .modal-item-checkbox {
    background: transparent;
    border-color: var(--border-2);
  }

  .modal-item.state-include .modal-item-checkbox {
    background: var(--primary);
    border-color: var(--primary);
  }

  .modal-item.state-include .modal-item-checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
  }

  .modal-item.state-exclude .modal-item-checkbox {
    background: var(--error);
    border-color: var(--error);
  }

  .modal-item.state-exclude .modal-item-checkbox::after {
    content: '✕';
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
  }

  .sort-modal-group {
    padding: 8px 0 16px;
  }

  .sort-modal-group + .sort-modal-group {
    padding-top: 0;
  }

  .sort-modal-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .sort-modal-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0 12px;
  }

  .sort-modal-group .modal-item:last-of-type {
    border-bottom: none;
  }

  .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--panel);
    flex-shrink: 0;
    position: relative;
    z-index: 2100;
    position: sticky;
    bottom: 0;
  }

  .modal-footer .btn {
    width: 100%;
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
  }

  #randomModal.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  #randomModal .modal-content {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 80vh;
    margin: 0;
    border-radius: var(--radius);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease-out;
  }

  #randomModal:not(.hidden) .modal-content {
    transform: scale(1);
    opacity: 1;
  }

  .random-anime-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
  }

  .random-anime-card {
    display: flex;
    gap: 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .random-anime-card:hover {
    background: var(--panel);
    border-color: var(--primary);
    transform: translateX(4px);
  }

  .random-anime-card-cover {
    width: 80px;
    height: 112px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
  }

  .random-anime-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .random-anime-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }

  .random-anime-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }

  .random-anime-card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }

  .random-anime-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
  }

  .random-anime-card-type {
    font-size: 12px;
    color: var(--muted);
  }

  .random-anime-card-year {
    font-size: 12px;
    color: var(--muted);
  }

  #catalogResults {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    align-items: start;
    justify-items: stretch;
    grid-auto-flow: row;
    margin-right: 0;
    padding-right: 0;
    flex: none;
    overflow-y: visible;
    max-height: none;
  }

  #catalogResults .catalog-anime-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    background: transparent;
    border: none;
  }

  #catalogResults .catalog-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0b0f;
    flex-shrink: 0;
  }

  #catalogResults .catalog-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }
  
  .catalog-rating-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    color: #04121f;
    background: rgba(34, 197, 94, 0.92);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    z-index: 2;
    font-variant-numeric: tabular-nums;
  }

  #catalogResults .catalog-title {
    min-height: 36px;
    font-size: 14px;
    line-height: 1.3;
  }

  #catalogResults .catalog-info {
    padding: 0;
    background: transparent;
  }

  .catalog-anime-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
  }

  .catalog-anime-card:hover {
    transform: translateY(-2px);
    opacity: 0.9;
  }

  .catalog-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #0a0b0f;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 6px;
    min-height: 0;
  }

  .catalog-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .3s ease;
    image-rendering: -webkit-optimize-contrast;
  }

  .catalog-anime-card:hover .catalog-poster img {
    transform: scale(1.08);
  }

  .catalog-rating-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    color: #04121f;
    background: rgba(34, 197, 94, 0.92);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    z-index: 2;
    font-variant-numeric: tabular-nums;
  }

  .catalog-rating-badge--good {
    background: rgba(34, 197, 94, 0.92);
    color: #04121f;
  }

  .catalog-rating-badge--bad {
    background: rgba(248, 113, 113, 0.95);
    color: #ffffff;
  }

  .catalog-rating-badge--neutral {
    background: rgba(148, 163, 184, 0.85);
    color: #0b1620;
  }

  .catalog-info {
    padding: 6px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: transparent;
  }

  .catalog-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
  }

  .catalog-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #catalogLoader,
  #catalogSentinel {
    grid-column: 1 / -1;
  }

  #catalogLoader {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 56px;
  }
}


@layer utilities {
  .hidden {
    display: none;
  }

  .related-panel.hidden {
    display: none;
  }

  #catalogLoadMore.hidden {
    display: none;
  }

  .chat-handle.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
  }

  .chat-raised {
    --chat-offset-bottom: 80px;
  }

  .chat-very-raised {
    --chat-offset-bottom: 120px;
  }

  .chat-low {
    --chat-offset-bottom: 8px;
  }
}


@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes plyrMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}


@media (min-width: 1101px) {
  @layer layouts {
    .landing-aside {
      position: sticky;
      top: 12px;
    }
  }
}

@media (min-width: 1600px) {
  @layer pages {
    #results.grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .updates-grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    #catalogResults {
      grid-template-columns: repeat(6, 1fr);
      gap: 16px;
    }
  }
}

@media (max-width: 1400px) {
  @layer pages {
    #catalogResults {
      grid-template-columns: repeat(5, 1fr);
      gap: 16px;
    }
  }
}



@media (max-width: 1200px) {
  @layer tokens {
    :root {
      --container-padding: 20px;
    }
  }

  @layer layouts {
    .main-content-area.with-chat {
      grid-template-columns: 1fr;
    }
  }

  @layer pages {
    #catalogResults {
      grid-template-columns: repeat(4, 1fr);
    }
  }
}

@media (max-width: 1200px) {
  #catalogChatSidebar {
    width: 250px;
  }
}

@media (max-width: 700px) {
  .catalog-layout {
    flex-direction: column;
  }
  
  #catalogChatSidebar {
    display: none !important;
  }

  .catalog-main {
    scrollbar-width: none;
  }

  .catalog-main::-webkit-scrollbar {
    display: none;
  }

  #catalogSortBtnMobile span[aria-hidden="true"] {
    display: none;
  }
}

@media (max-width: 1100px) {
  @layer layouts {
    .landing-layout {
      grid-template-columns: 1fr;
    }

    .landing-aside {
      position: static;
    }

    .home-two {
      grid-template-columns: 1fr;
    }
    
    .landing-main {
      overflow: hidden;
      min-width: 0;
      width: 100%;
      padding-bottom: 16px;
    }
  }

  @layer pages {
    .landing-row > .card {
      flex: 0 0 clamp(130px, 36vw, 170px);
    }

    .now-grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .now-col .now-item {
      grid-template-columns: 72px 1fr;
      gap: 8px;
    }

    .now-thumb {
      width: 56px;
      height: 56px;
    }
  }
}

@media (max-width: 980px) {
  @layer layouts {
    .toolbar {
      grid-template-columns: 1fr;
      gap: 12px;
    }
  }
}


@media (min-width: 701px) and (max-width: 1100px) and (min-height: 501px) {
  @layer tokens {
    :root {
      --catalog-sidebar-width: 280px;
    }
  }
  
  @layer base {
    body {
      overflow-x: clip !important;
      max-width: 100vw !important;
    }
    
    .container {
      max-width: 100% !important;
      padding-bottom: 80px !important;
    }
  }
  
  @layer components {
    header {
      flex-direction: row !important;
      align-items: center !important;
      flex-wrap: nowrap !important;
    }
    
    .watch-party-controls {
      flex-direction: row !important;
      gap: 8px !important;
      width: auto !important;
      margin-left: auto !important;
    }
    
    .watch-party-controls button {
      flex: 0 0 auto !important;
      white-space: nowrap !important;
      font-size: 12px !important;
      padding: 8px 14px !important;
    }
  }
  
  @layer layouts {
    .home-two {
      display: grid !important;
      grid-template-columns: 1fr 1fr !important;
      gap: 16px !important;
    }
  }
  
  @layer pages {
    #catalog-block:not(.hidden) {
      padding-top: 80px !important;
    }
    
    .filters-sidebar {
      overflow-y: auto;
    }
    
    .filters-sidebar-header {
      padding: 16px 18px;
      flex-shrink: 0;
    }
    
    .filters-sidebar-content {
      padding: 10px 12px 16px;
      overflow-y: auto;
      max-height: calc(100vh - 70px);
    }
    
    .filter-section {
      margin-bottom: 14px;
    }
    
    .filter-label {
      font-size: 12px;
      margin-bottom: 6px;
    }
    
    .filter-button {
      padding: 8px 12px;
      font-size: 13px;
      min-height: 36px;
    }
    
    .filter-input {
      padding: 7px 10px;
      font-size: 13px;
    }
    
    .filter-checkboxes {
      gap: 8px;
    }
    
    .filter-checkbox {
      padding: 8px 10px;
      font-size: 13px;
    }

    #catalogResults {
      grid-template-columns: repeat(3, 1fr);
      gap: 14px;
    }
    
    .landing-row > .card {
      flex: 0 0 clamp(140px, 22vw, 180px);
    }
    
    .now-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }
    
    .updates-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}


@media (min-width: 701px) and (max-width: 1100px) and (orientation: landscape) and (min-height: 501px) {
  @layer pages {
    :root {
      --catalog-sidebar-width: 240px !important; 
    }
    
    #catalog-block:not(.hidden) {
      padding-top: 80px !important;
    }
    
    .filters-sidebar-header {
      padding: 12px 14px; 
    }
    
    .filters-sidebar-content {
      padding: 8px 10px 14px !important; 
    }
    
    .filter-section {
      margin-bottom: 12px !important;
    }
    
    .filter-label {
      font-size: 11px !important;
      margin-bottom: 4px !important;
    }
    
    .filter-button {
      padding: 6px 10px !important;
      font-size: 12px !important;
      min-height: 32px;
    }
    
    .filter-input {
      padding: 5px 8px !important;
      font-size: 12px !important;
    }
    
    .filter-checkbox {
      padding: 6px 8px !important;
      font-size: 12px !important;
    }
    
    #catalogResults {
      grid-template-columns: repeat(5, 1fr);
      gap: 12px;
    }
    
    .now-grid {
      grid-template-columns: repeat(5, 1fr);
      gap: 10px;
    }
  }
}


@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) and (min-height: 501px) {
  @layer pages {
    #catalog-block:not(.hidden) {
      padding-top: 80px !important;
    }
    
    #catalogResults {
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 14px;
    }
    
    .now-grid {
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 12px;
    }
  }
}


@media (max-width: 700px) {
  @layer tokens {
    :root {
      --container-padding: 16px;
    }
  }
  
  @layer base {
    html {
      overflow-x: clip !important;
      width: 100%;
    }
    
    body {
      overflow-x: clip !important;
      overflow-y: auto !important;
      max-width: 100vw !important;
      
      scrollbar-width: none; 
      -ms-overflow-style: none;
    }
    
    body::-webkit-scrollbar {
      display: none;
    }
    
    .container {
      max-width: 100vw !important;
      box-sizing: border-box;
      padding-bottom: 100px !important;
    }
    
    .container:has(#catalog-block:not(.hidden)) {
      overflow-x: clip !important;
    }
  }

  @layer components {
    #selection-block:not(.hidden) header {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      padding: 12px 16px;
    }

    #selection-block:not(.hidden) .brand {
      font-size: 18px;
      gap: 10px;
    }
    
    #selection-block:not(.hidden) .brand-badge {
      width: 32px;
      height: 32px;
    }
    
    #selection-block:not(.hidden) .watch-party-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      width: 100%;
      margin-left: 0;
    }
    
    #selection-block:not(.hidden) .watch-party-controls button {
      flex: 1 1 calc(50% - 3px);
      min-width: 0;
      white-space: nowrap;
      font-size: 12px;
      padding: 10px 8px;
      border-radius: 8px;
    }

    #search-block:not(.hidden) header {
      flex-direction: row;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      flex-wrap: wrap;
    }

    #search-block:not(.hidden) .brand {
      font-size: 16px;
      gap: 8px;
    }

    #search-block:not(.hidden) .brand-badge {
      width: 30px;
      height: 30px;
    }

    #search-block:not(.hidden) .watch-party-controls {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      flex: 1;
      justify-content: flex-end;
    }

    #search-block:not(.hidden) .watch-party-controls button {
      font-size: 11px;
      padding: 8px 10px;
      white-space: nowrap;
    }
    
    .container:has(#catalog-block:not(.hidden)) > header {
      display: none !important;
    }

    .search-panel {
      padding: 14px;
    }

    .search-row {
      padding: 10px;
      gap: 8px;
    }

    .search-row input {
      font-size: 16px; 
    }

    .btn, .btn-ghost-old {
      padding: 10px 12px;
      font-size: 14px;
      border-radius: 10px;
      min-height: 44px;
    }

    .chip {
      padding: 8px 12px;
      font-size: 13px;
      min-height: 40px;
    }

    .chip-group {
      gap: 6px;
    }
  }

  @layer pages {
    #results.grid,
    #selectionResults.grid,
    .landing-sections,
    .landing-section,
    .home-two,
    .now-panel {
      max-width: 100vw;
      overflow-x: visible;
    }
    
    #results.grid {
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 10px;
    }
    
    #selectionResults.grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }

    .card--result .card-body .title {
      font-size: 13px;
      line-height: 1.25;
    }

    .card--result .card-body .subtitle {
      font-size: 11.5px;
    }

    .landing-section {
      overflow: visible;
      min-width: 0;
      max-width: 100vw;
    }
    
    .landing-title {
      padding-left: 3px;
      padding-right: 3px;
      margin-bottom: 12px;
    }

    .landing-scroll-wrapper {
      margin-inline: 0;
      padding-inline: var(--container-padding);
      overflow-x: auto;
      overflow-y: hidden;
      scroll-snap-type: x proximity;
      scroll-padding-left: var(--container-padding);
      scroll-padding-right: var(--container-padding);
      touch-action: pan-x;
      overscroll-behavior-inline: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    
    .landing-scroll-wrapper::-webkit-scrollbar {
      display: none;
    }

    .landing-row {
      display: flex;
      flex-wrap: nowrap;
      gap: 12px;
      padding-bottom: 8px;
      padding-left: 0;
      padding-right: 0;
      margin: 0;
    }

    .landing-row::after {
      content: "";
      flex: 0 0 var(--container-padding);
    }
    
    .caro-btn {
      display: none !important;
    }
    
    .landing-row > .card {
      flex: 0 0 130px; 
      min-width: 130px;
      max-width: 130px;
      height: auto;
      display: flex;
      flex-direction: column;
    }
    
    .landing-row .card-img {
      width: 130px;
      height: 195px;
      flex-shrink: 0;
    }
    
    .landing-row .card-body {
      padding: 8px;
      overflow: hidden;
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    
    .landing-row .card-body .title {
      font-size: 12px;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
      margin-bottom: 2px;
      flex: 1;
    }
    
    .landing-row .card-body .subtitle {
      font-size: 10px;
      color: var(--muted);
      margin-top: auto;
    }

    .selection {
      padding: 12px;
    }

    .selection-head {
      grid-template-columns: 56px 1fr;
      gap: 10px;
      margin-bottom: 12px;
    }

    .head-cover {
      width: 56px;
    }

    .head-meta .title {
      font-size: 16px;
      line-height: 1.3;
    }

    .head-meta .meta {
      font-size: 12px;
    }

    .section-title {
      font-size: 15px;
      margin: 10px 0 8px;
    }

    .ep-panel, .voice-panel {
      max-height: min(45vh, 400px);
      padding: 8px;
    }

    .ep-list {
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .ep-item {
      min-height: 50px;
      padding: 8px 10px;
    }

    .ep-num {
      width: 34px;
      height: 34px;
      font-size: 13px;
    }

    .ep-name {
      font-size: 13px;
    }

    .voice-item {
      padding: 10px;
      font-size: 14px;
    }

    .player-shell {
      min-height: 50vh;
      border-radius: 10px;
    }

    .player-panel {
      padding: 10px;
    }

    .player-head {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    .player-head .title {
      font-size: 15px;
    }

    .player-head .chip-group {
      width: 100%;
      justify-content: stretch;
    }

    .player-head .chip-group button {
      flex: 1;
    }

    .chat-handle {
      display: grid;
      right: 16px;
      bottom: 16px;
      width: 52px;
      height: 52px;
    }

    .chat-handle svg {
      width: 22px;
      height: 22px;
    }

    .player-shell .chat-handle,
    .plyr .chat-handle {
      display: none !important;
    }

    #chat-container {
      position: fixed;
      top: auto;
      bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      right: calc(12px + env(safe-area-inset-right, 0px));
      left: auto;
      width: clamp(280px, 88vw, 360px);
      max-height: clamp(250px, 42vh, 480px);
      z-index: 2002;
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 10px;
      border-radius: 16px;
      background: rgba(22, 26, 34, 0.96);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
      overflow: hidden;
      transform: translateY(calc(100% + 20px));
      opacity: 0;
      visibility: hidden;
      transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1),
        opacity .3s cubic-bezier(0.22, 1, 0.36, 1),
        visibility .3s cubic-bezier(0.22, 1, 0.36, 1);
      pointer-events: auto;
    }

    #chat-container.is-open {
      transform: translateY(0);
      opacity: 1;
      visibility: visible;
    }

    #chat-container.is-closing {
      transform: translateY(calc(100% + 20px));
      opacity: 0;
      visibility: hidden;
    }

    #chat-container .chat-header-mobile {
      display: flex;
    }

    #chat-container .chat-header {
      display: none;
    }

    #chat-container .chat-messages {
      flex: 1 1 auto;
      min-height: 0;
      padding: 8px;
      gap: 8px;
    }

    #chat-container .chat-form {
      padding: 8px;
      gap: 6px;
    }

    #chat-container .chat-form input {
      background: rgba(13, 16, 22, 0.95);
      color: #e9eef6;
      border: 1px solid rgba(255, 255, 255, 0.18);
      font-size: 15px;
      padding: 10px 12px;
    }

    #chat-container .chat-form button {
      min-height: 40px;
    }

    .gif-picker {
      height: 320px;
      bottom: 105%;
    }

    .gif-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }

    .chat-message.has-gif-only img,
    .chat-gif {
      max-width: 240px;
      border-radius: 12px;
    }

    .related-grid {
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .related-card {
      grid-template-columns: 80px 1fr;
      padding: 10px;
    }

    .rel-cover {
      width: 80px;
    }

    .rel-title {
      font-size: 13.5px;
    }

    .toolbar {
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 12px;
    }
    
    .home-two {
      display: flex;
      flex-direction: column-reverse;
      gap: 14px;
      overflow: visible;
      padding-bottom: 40px; 
    }
    
    .now-head {
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
      padding-left: var(--container-padding);
      padding-right: var(--container-padding);
    }
    
    .now-title {
      font-size: 15px;
      flex: 0 0 100%;
      margin-bottom: 4px;
    }
    
    .now-filters {
      flex-wrap: wrap;
      gap: 6px;
      width: 100%;
      justify-content: flex-start;
    }
    
    .now-pill {
      font-size: 11px;
      padding: 5px 10px;
      white-space: nowrap;
    }
    
    .now-panel {
      padding: 12px 0;
      overflow: hidden;
      position: relative;
    }
    
    .search-panel {
      padding: 10px 12px;
      margin-bottom: 0; 
    }
    
    .search-row {
      padding: 8px 10px;
      gap: 6px;
    }
    
    .search-row .icon {
      font-size: 16px;
    }
    
    .search-row input {
      font-size: 14px;
    }
    
    .search-row .btn {
      font-size: 12px;
      padding: 8px 10px;
      min-height: 36px;
    }
    
    .now-panel {
      padding: 12px 0 16px 0; 
      overflow: hidden;
      min-width: 0;
      width: 100%;
      max-width: 100vw;
    }
    
    .now-title {
      font-size: 15px;
      font-weight: 700;
      margin-bottom: 12px;
      padding-left: 0px;
      padding-right: 0px;
    }
    
    .now-scroll-wrapper {
      margin-inline: 0;
      padding-inline: 0px;
      overflow-x: auto;
      overflow-y: hidden;
      scroll-snap-type: x proximity;
      scroll-padding-left: 0px;
      scroll-padding-right: 0px;
      scroll-behavior: smooth;
      touch-action: pan-x;
      overscroll-behavior-x: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    
    .now-scroll-wrapper::-webkit-scrollbar {
      display: none;
    }
    
    .now-cols {
      display: flex;
      gap: 16px;
      padding-bottom: 4px;
      position: relative;
      width: 100%;
      padding-left: 0;
      padding-right: 0;
      margin: 0;
    }

    .now-cols::after {
      content: "";
      flex: 0 0 var(--container-padding);
    }
    
    .now-col {
      flex: 0 0 min(340px, 90vw);
      min-width: min(340px, 90vw);
      max-width: min(340px, 90vw);
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 10px;
      scroll-snap-align: center;
      scroll-snap-stop: normal;
    }
    
    .now-col .col-title {
      font-weight: 700;
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 4px;
      display: block;
    }
    
    .now-item {
      display: grid;
      grid-template-columns: 80px 1fr;
      gap: 10px;
      padding: 8px;
      margin-top: 0;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.15s, transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    @media (min-width: 701px) {
      .now-item:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      }
    }
    
    @media (max-width: 700px) {
      .now-item:hover {
        background: rgba(255, 255, 255, 0.05);
      }
    }
    
    .now-thumb {
      width: 80px;
      height: 80px;
    }
    
    .now-name {
      font-size: 13px;
      line-height: 1.3;
      font-weight: 600;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-word;
      max-width: 100%;
    }
    
    .now-meta {
      font-size: 11px;
      color: var(--muted);
      margin-top: 2px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap; 
    }
    
    .updates-panel {
      padding: 10px 12px 24px 12px; 
    }
    
    .updates-panel .panel-title {
      font-size: 15px;
      font-weight: 700;
      margin-bottom: 8px;
    }
    
    .updates-more {
      margin-top: 12px;
      margin-bottom: 20px;
    }
    
    .upd-item {
      grid-template-columns: 95px 1fr;
      gap: 10px;
      padding: 10px;
    }
    
    .upd-cover {
      width: 95px;
    }
    

    .upd-type {
      font-size: 10px;
      padding: 3px 5px;
      border-radius: 4px;
      top: 3px;
      left: 3px;
    }
    
    .upd-title {
      font-size: 13px;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
      white-space: normal;
      margin-bottom: 2px;
    }
    
    .upd-ep {
      font-size: 12px;
      white-space: normal;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
    .upd-time {
      font-size: 11px;
      margin-top: 2px;
    }
    
    #now-overlay {
      padding: 0;
      background: rgba(0, 0, 0, 0.85);
      overflow-y: auto;
      overflow-x: clip;
    }
    
    .now-modal {
      width: 100vw;
      max-width: 100vw;
      min-height: 100vh;
      border-radius: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      overflow: visible;
    }
    
    .now-modal-head {
      padding: 12px 16px;
      background: var(--panel);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      gap: 12px;
      max-width: 100vw;
    }
    
    .btn-back {
      background: transparent;
      border: none;
      color: var(--text);
      padding: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border-radius: 6px;
      transition: background 0.2s;
      flex-shrink: 0;
    }
    
    .btn-back:active {
      background: var(--border);
    }
    
    .now-modal-title {
      font-size: 18px;
      font-weight: 700;
      flex: 1;
    }
    
    .now-modal-controls {
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex-shrink: 0;
    }

    .now-modal-head--mobile {
      padding: 32px 16px 12px;
    }

    .now-mobile-toolbar {
      padding: 12px 16px 16px;
      background: var(--panel-2);
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 12px;
      align-items: stretch;
    }

    .now-mobile-time {
      position: relative;
      align-self: stretch;
      display: flex;
      justify-content: flex-end;
      width: 100%;
    }

    .now-mobile-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 16px;
      background: rgba(108, 92, 231, 0.15);
      border: 1px solid rgba(108, 92, 231, 0.35);
      border-radius: 999px;
      color: var(--text);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .now-mobile-toggle:active {
      transform: scale(0.97);
      background: rgba(108, 92, 231, 0.25);
    }

    .now-mobile-toggle.open .now-mobile-toggle-icon {
      transform: rotate(180deg);
    }

    .now-mobile-toggle-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      transition: transform 0.2s ease;
    }

    .now-mobile-toggle-icon svg {
      width: 14px;
      height: 14px;
    }

    .now-mobile-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      display: none;
      flex-direction: column;
      min-width: 160px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
      padding: 6px;
      z-index: 2102;
    }

    .now-mobile-menu.open {
      display: flex;
    }

    .now-mobile-menu-item {
      background: transparent;
      border: none;
      color: var(--text);
      text-align: left;
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
    }

    .now-mobile-menu-item:hover,
    .now-mobile-menu-item:active {
      background: rgba(108, 92, 231, 0.25);
      color: #ffffff;
    }

    .now-mobile-segments {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .now-mobile-pill {
      border: 1px solid rgba(108, 92, 231, 0.35);
      background: rgba(108, 92, 231, 0.12);
      border-radius: 12px;
      padding: 10px 12px;
      color: var(--text);
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      transition: all 0.2s ease;
    }

    .now-mobile-pill.active {
      background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
      border-color: transparent;
      color: #06121a;
      box-shadow: 0 6px 16px rgba(108, 92, 231, 0.35);
    }

    .now-mobile-pill:active {
      transform: scale(0.97);
    }
    
    .now-select-mobile {
      font-size: 12px;
      padding: 6px 28px 6px 8px;
      background: var(--panel);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: 6px;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e7edf3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: calc(100% - 8px) 50%;
      min-width: 110px;
      max-width: 120px;
    }
    
    .now-select-mobile option {
      background: var(--panel);
      color: var(--text);
    }
    
    .now-modal-head > div:first-child {
      font-size: 16px;
      font-weight: 700;
    }
    
    .now-modal-filters {
      gap: 8px;
      flex-wrap: wrap;
    }
    
    .now-select {
      font-size: 13px;
      padding: 6px 24px 6px 10px;
    }
    
    .now-modal-body {
      padding: 12px 16px 24px 16px;
      overflow-y: auto !important;
      overflow-x: clip !important;
      flex: 1;
      min-height: 0;
      max-width: 100vw;
      scrollbar-width: thin;
      -ms-overflow-style: auto;
    }
    
    .now-modal-body::-webkit-scrollbar {
      width: 6px;
    }
    
    .now-modal-body::-webkit-scrollbar-track {
      background: transparent;
    }
    
    .now-modal-body::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 3px;
    }
    
    .now-panel .now-grid {
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .now-grid {
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      padding-bottom: 16px;
      max-width: 100%;
    }
    
    .now-grid .card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      position: relative;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      min-width: 0;
      max-width: 100%;
    }
    
    @media (min-width: 701px) {
      .now-grid .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        border-color: var(--accent);
      }
    }
    
    .now-grid .card:active {
      transform: scale(0.98);
    }
    
    .now-grid .card-img {
      aspect-ratio: 2 / 3;
      border-radius: 10px 10px 0 0;
      position: relative;
      width: 100%;
      overflow: hidden;
    }
    
    .now-grid .card-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .now-grid .card-img .badge {
      position: absolute;
      top: 6px;
      left: 6px;
      background: linear-gradient(135deg, #34d399 0%, #059669 100%);
      color: #022c22;
      font-size: 11px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 6px;
      box-shadow: 0 2px 6px rgba(3, 102, 84, 0.35);
    }
    
    .now-grid .card-body {
      padding: 10px;
      min-width: 0;
      overflow: hidden;
    }
    
    .now-grid .card-body .title {
      font-size: 12px;
      font-weight: 600;
      line-height: 1.3;
      margin-bottom: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-word;
      max-width: 100%;
    }
    
    .now-grid .card-body .subtitle {
      font-size: 10px;
      color: var(--muted);
      margin-top: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  @layer pages {
    .container:has(#catalog-block:not(.hidden)) > header {
      display: none !important;
    }
    
    .container:has(#catalog-block:not(.hidden)) {
      padding: 0 !important;
    }
    
    #catalog-block:not(.hidden) {
      padding-top: 0;
      padding-left: 0;
      padding-right: 0;
      gap: 0;
    }
    
    .catalog-main {
      padding: 0;
      margin-left: 0;
      border-radius: 0;
      background: var(--bg);
    }

    .catalog-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      background: var(--panel);
      border-bottom: 1px solid var(--border);
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0;
      padding: 12px 16px;
      gap: 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .catalog-header h2 {
      font-size: 16px !important;
      margin: 0 !important;
      flex: 0 0 auto;
    }

    .catalog-mobile-actions {
      display: flex;
      gap: 8px;
      margin-top: 0;
      flex: 0 0 auto;
    }

    .catalog-mobile-btn {
      display: flex !important;
      flex: 0 0 auto;
      min-height: 36px;
    }

    .catalog-mobile-btn span:first-child {
      font-size: 16px;
    }

    #catalogResults {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      padding: 12px;
      margin-top: 60px;
    }

    #catalogResults .catalog-anime-card {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
      background: transparent;
      border: none;
      cursor: pointer;
    }

    #catalogResults .catalog-poster {
      position: relative;
      aspect-ratio: 2 / 3;
      width: 100%;
      border-radius: 10px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.03);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    #catalogResults .catalog-anime-card:active .catalog-poster {
      transform: scale(0.97);
    }

    #catalogResults .catalog-poster img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .catalog-rating-badge {
      position: absolute;
      top: 6px;
      left: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-width: 32px;
      padding: 4px 7px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 11px;
      line-height: 1;
      color: #04121f;
      background: rgba(34, 197, 94, 0.92);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
      backdrop-filter: blur(6px);
      z-index: 2;
      font-variant-numeric: tabular-nums;
    }

    .catalog-title {
      font-size: 13px;
      line-height: 1.3;
      font-weight: 500;
      color: var(--text);
      min-height: 34px;
      max-height: 34px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .catalog-meta {
      font-size: 11px;
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #catalogLoader {
      margin: 20px 0;
      padding: 20px;
      text-align: center;
    }

    #catalogSentinel {
      height: 20px;
      margin-bottom: 20px;
    }

    #catalogChatSidebar {
      display: none !important;
    }

    .catalog-layout {
      display: block;
    }

    .filters-sidebar {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      width: 100%;
      max-width: 100%;
      height: 100vh;
      max-height: 100vh;
      margin: 0;
      border-radius: 0;
      border: none;
      box-shadow: none;
      z-index: 1000;
      transform: translateX(100%);
      transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
      background: var(--bg);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .filters-sidebar:not(.hidden) {
      transform: translateX(0);
    }

    .filters-sidebar-header {
      padding: 16px 18px;
      border-bottom: 1px solid var(--border);
      position: relative;
      flex-shrink: 0;
      background: var(--panel);
      z-index: 10;
    }

    .filters-sidebar-header::before {
      display: none;
    }

    .filters-sidebar-content {
      padding: 16px 18px 16px;
      overflow-y: auto;
      overflow-x: hidden;
      flex: 1 1 auto;
      min-height: 0;
      -webkit-overflow-scrolling: touch;
      padding-bottom: calc(100px + env(safe-area-inset-bottom, 20px));
    }
    
    .filter-section {
      margin-bottom: 20px;
    }
    
    .filter-section-sort {
      display: none !important;
    }

    .filter-label {
      font-size: 13px;
      margin-bottom: 10px;
      font-weight: 600;
    }

    .filter-button {
      padding: 12px 16px;
      font-size: 14px;
      min-height: 44px;
    }

    .filter-input {
      padding: 10px 14px;
      font-size: 14px;
      min-height: 44px;
    }

    .filter-checkboxes {
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .filter-checkbox {
      padding: 12px;
      font-size: 15px;
      min-height: 52px;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }
    
    .filter-checkbox input[type="checkbox"] {
      width: 22px;
      height: 22px;
      min-width: 22px;
      min-height: 22px;
    }

    .modal-overlay {
      background: rgba(0, 0, 0, 0.95);
      backdrop-filter: none;
    }

    .modal-content {
      max-width: 100%;
      height: 100vh;
      max-height: 100vh;
      margin: 0;
      border-radius: 0;
      transform: translateX(100%);
      box-shadow: none;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .modal-overlay:not(.hidden) .modal-content {
      transform: translateX(0);
    }

    .modal-header {
      padding: 16px 18px;
      border-radius: 0;
      position: relative;
      flex-shrink: 0;
    }

    .modal-header::before {
      content: '';
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      display: none;
    }
    
    .modal-search {
      flex-shrink: 0;
    }
    
    .modal-strict {
      flex-shrink: 0;
    }

    .modal-body {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 16px 20px;
      padding-bottom: calc(120px + env(safe-area-inset-bottom, 24px));
    }

    .modal-footer {
      padding: 20px;
      padding-bottom: calc(44px + env(safe-area-inset-bottom, 20px));
      background: linear-gradient(to top, var(--panel) 85%, rgba(22, 26, 34, 0.95) 100%);
      border-radius: 0;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 2100;
      flex-shrink: 0;
      border-top: 2px solid var(--border-2);
      box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
    }

    .modal-footer .btn {
      min-height: 48px;
      font-size: 14px;
      font-weight: 700;
      border-radius: 10px;
      pointer-events: auto !important;
      cursor: pointer !important;
      touch-action: manipulation !important;
      -webkit-tap-highlight-color: transparent;
      background: linear-gradient(135deg, #00b0ff 0%, #6c5ce7 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
      border: none;
      text-transform: none;
      letter-spacing: normal;
    }
    
    .modal-footer .btn:active {
      transform: scale(0.96);
      opacity: 0.9;
      box-shadow: 0 3px 10px rgba(108, 92, 231, 0.4);
    }
  }
}

@media (max-width: 640px) {
  @layer tokens {
    :root {
      --container-padding: 12px;
    }
  }

  @layer components {
    .search-row {
      padding: 10px;
      gap: 6px;
    }

    .search-row input {
      font-size: 16px;
      padding: 2px 0;
    }

    .btn, .btn-ghost-old {
      padding: 10px 12px;
      border-radius: 10px;
      min-height: 44px;
      font-size: 13px;
    }

    .chip {
      padding: 8px 12px;
      font-size: 13px;
      min-height: 40px;
    }

    .watch-party-panel {
      padding: 12px;
      margin-bottom: 14px;
    }

    .watch-party-panel input {
      font-size: 12px;
      padding: 8px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
    }
    
    .invite-link-wrapper {
      flex-wrap: wrap;
      gap: 6px;
    }
    
    .invite-link-wrapper button {
      font-size: 12px;
      padding: 8px 12px;
      white-space: nowrap;
    }
  }

  @layer pages {
    #results.grid {
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 8px;
    }
    
    #selectionResults.grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }

    .card--result .card-body .title {
      font-size: 12px;
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }

    .card--result .card-body .subtitle {
      font-size: 11px;
    }

    .card--result .card-badge {
      font-size: 9px;
      padding: 2px 5px;
    }

    .landing-row > .card {
      flex: 0 0 clamp(105px, 32vw, 140px);
    }

    .selection {
      padding: 10px;
    }

    .selection-head {
      grid-template-columns: 1fr;
      text-align: center;
    }

    .head-cover {
      width: 120px;
      margin: 0 auto 10px;
    }

    .head-meta .title {
      font-size: 15px;
    }

    .head-meta .meta {
      font-size: 11.5px;
      justify-content: center;
    }

    .section-title {
      font-size: 14px;
      margin: 8px 0 6px;
    }

    .ep-list {
      grid-template-columns: 1fr;
    }

    .voice-item {
      padding: 9px;
      font-size: 13px;
    }

    .player-shell {
      min-height: 48vh;
      border-radius: 8px;
    }

    .player-head .title {
      font-size: 14px;
    }

    .modal-content {
      max-width: 100%;
      border-radius: 0;
    }

    .modal-header {
      padding: 14px 16px;
    }

    .modal-back {
      font-size: 15px;
    }

    .modal-search {
      padding: 12px 16px;
    }

    .modal-search-input {
      font-size: 15px;
      padding: 10px 12px;
    }

    .modal-body {
      padding: 10px 16px 16px;
    }

    .modal-item {
      padding: 12px 0;
    }

    .modal-item-name {
      font-size: 14px;
    }

    .modal-footer {
      padding: 12px 16px;
    }

    #randomModal .modal-content {
      max-width: 95vw;
      max-height: 85vh;
      border-radius: 14px;
    }

    .random-anime-card {
      padding: 10px;
    }

    .random-anime-card-cover {
      width: 70px;
      height: 98px;
    }

    .random-anime-card-title {
      font-size: 13px;
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }

    .random-anime-card-meta {
      gap: 8px;
    }

    .random-anime-card-rating,
    .random-anime-card-type,
    .random-anime-card-year {
      font-size: 11px;
    }

    #catalog-block:not(.hidden) {
      padding: 0;
    }

    .catalog-main {
      padding: 0;
      max-width: 100%;
      background: var(--bg);
    }

    .catalog-header {
      padding: 10px 12px;
    }

    .catalog-header h2 {
      font-size: 15px !important;
    }

    .catalog-mobile-btn {
      padding: 7px 12px;
      font-size: 12px;
      gap: 4px;
      min-height: 34px;
    }

    .catalog-mobile-btn span:first-child {
      font-size: 15px;
    }

    #catalogResults {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      padding: 10px;
      margin-top: 58px; 
    }

    .catalog-title {
      font-size: 12px;
      min-height: 32px;
      max-height: 32px;
    }

    .catalog-meta {
      font-size: 10px;
    }

    .catalog-rating-badge {
      font-size: 10px;
      padding: 3px 6px;
      top: 5px;
      left: 5px;
    }

    #catalogResults .catalog-poster {
      border-radius: 8px;
    }

    .filters-sidebar {
      width: 100%;
      max-width: 100%;
    }

    #chat-container {
      width: clamp(260px, 92vw, 340px);
      max-height: clamp(220px, 38vh, 420px);
      border-radius: 14px;
    }

    .chat-handle {
      width: 50px;
      height: 50px;
      right: 14px;
      bottom: 14px;
    }

    .chat-handle svg {
      width: 21px;
      height: 21px;
    }

    .gif-picker {
      height: 280px;
    }

    .gif-grid {
      gap: 6px;
    }
  }
}


@media (max-width: 480px) {
  @layer tokens {
    :root {
      --container-padding: 10px;
    }
  }

  @layer components {
    header {
      padding: 10px 12px;
      gap: 8px;
      flex-wrap: wrap;
    }

    .brand {
      font-size: 16px;
      gap: 8px;
    }

    .brand-badge {
      width: 28px;
      height: 28px;
      border-radius: 8px;
    }

    .watch-party-controls {
      width: 100%;
      margin-left: 0;
      justify-content: space-between;
      gap: 6px;
    }

    .watch-party-controls button {
      font-size: 11px;
      padding: 9px 8px;
      flex: 1;
      min-width: 0;
    }

    .search-panel {
      padding: 12px;
    }

    .btn, .btn-ghost-old {
      font-size: 13px;
      padding: 9px 10px;
    }
    
    .modal-footer .btn {
      min-height: 56px !important;
      font-size: 18px !important;
      font-weight: 800 !important;
      border-radius: 14px !important;
      text-transform: uppercase !important;
      letter-spacing: 0.5px !important;
      box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6) !important;
    }
  }

  @layer pages {
    #results.grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }

    .card--result .card-body {
      padding: 8px;
    }

    .card--result .card-body .title {
      font-size: 11.5px;
    }

    .landing-row > .card {
      flex: 0 0 115px;
      min-width: 115px;
      max-width: 130px;
    }
    
    .landing-row .card-img {
      width: 115px;
      height: 172px;
    }
    
    .landing-row .card-body .title {
      font-size: 11px;
    }
    
    .now-thumb {
      width: 70px;
      height: 70px;
    }
    
    .now-name {
      font-size: 11px;
    }
    
    .upd-item {
      grid-template-columns: 85px 1fr;
      gap: 8px;
      padding: 8px;
    }
    
    .upd-cover {
      width: 85px;
    }
    
    .upd-type {
      font-size: 9px;
      padding: 2px 4px;
    }
    
    .upd-title {
      font-size: 12px;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
      white-space: normal;
      margin-bottom: 2px;
    }
    
    .upd-ep {
      font-size: 11px;
      white-space: normal;
      line-height: 1.3;
    }
    
    .upd-time {
      font-size: 10px;
    }

    .selection {
      padding: 8px;
    }

    .ep-num {
      width: 32px;
      height: 32px;
      font-size: 12px;
    }

    .ep-name {
      font-size: 12px;
    }

    .voice-item {
      padding: 8px;
      font-size: 12px;
    }

    .player-panel {
      padding: 8px;
    }

    #catalog-block:not(.hidden) {
      padding: 75px 8px 8px;
    }

    .catalog-main {
      padding: 10px;
    }

    #catalogResults {
      gap: 6px;
    }

    .catalog-title {
      font-size: 11px;
      min-height: 26px;
    }

    .catalog-mobile-btn {
      font-size: 12px;
      padding: 8px;
    }

    .plyr--fullscreen #chat-container,
    body.app-fullscreen-mode #chat-container {
      width: min(92vw, 300px);
      max-height: min(70vh, 450px);
      right: calc(10px + 50px + env(safe-area-inset-right, 0px));
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    body.app-fullscreen-mode.plyr-controls-visible #chat-container {
      bottom: calc(var(--fs-controls-h, 56px) + 20px + env(safe-area-inset-bottom, 0px));
    }

    .chat-message.has-gif-only img,
    .chat-gif {
      max-width: 200px;
      border-radius: 10px;
    }

    .modal-header {
      padding: 12px 14px;
    }

    .modal-search {
      padding: 10px 14px;
    }

    .modal-body {
      padding: 8px 14px 14px;
    }

    .modal-item {
      padding: 10px 0;
    }

    .modal-footer {
      padding: 10px 14px;
    }

    #randomModal .modal-content {
      max-width: 96vw;
      border-radius: 12px;
    }

    .random-anime-card {
      padding: 8px;
      gap: 8px;
    }

    .random-anime-card-cover {
      width: 64px;
      height: 90px;
    }

    .random-anime-card-title {
      font-size: 12px;
    }
  }
}

@media (hover: none) and (pointer: coarse) {
  @layer components {
    .btn, .btn-ghost-old, .chip {
      min-height: 44px;
      padding: 10px 14px;
    }

    .card:hover,
    .ep-item:hover,
    .voice-item:hover {
      transform: none;
      border-color: var(--border);
    }

    .card:active,
    .ep-item:active,
    .voice-item:active {
      opacity: 0.8;
      transform: scale(0.98);
    }
  }

  @layer pages {
    .card:hover,
    .related-card:hover,
    .upd-item:hover,
    .catalog-anime-card:hover {
      transform: none;
      opacity: 1;
    }

    .card:active,
    .related-card:active,
    .upd-item:active,
    .catalog-anime-card:active {
      opacity: 0.85;
      transform: scale(0.98);
    }

    .chip, .ep-item, .voice-item, .filter-checkbox {
      min-height: 44px;
    }
  }
}

@supports (padding: max(0px)) {
  @media (max-width: 900px) {
    @layer components {
      .container {
        padding-left: max(var(--container-padding), env(safe-area-inset-left));
        padding-right: max(var(--container-padding), env(safe-area-inset-right));
      }

      header {
        padding-top: max(12px, env(safe-area-inset-top));
      }
    }

    @layer pages {
      .chat-handle {
        bottom: max(16px, calc(16px + env(safe-area-inset-bottom))) !important;
        right: max(16px, calc(16px + env(safe-area-inset-right))) !important;
      }

      #chat-container {
        bottom: max(12px, calc(12px + env(safe-area-inset-bottom))) !important;
        right: max(12px, calc(12px + env(safe-area-inset-right))) !important;
      }

      #catalog-block:not(.hidden) {
        padding-top: max(88px, calc(88px + env(safe-area-inset-top)));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer base {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  @layer layouts {
    .caro-btn {
      transition: none;
    }

    .landing-row {
      scroll-behavior: auto;
    }
  }

  @layer pages {
    .plyr--fullscreen #chat-container,
    body.app-fullscreen-mode #chat-container,
    #chat-container {
      transition: none;
    }

    .modal-overlay,
    .modal-content {
      transition: none;
      animation: none;
    }
  }
}

@media (max-width: 700px) and (max-height: 450px) and (orientation: landscape) {
  @layer components {
    header {
      padding: 8px 12px;
    }

    .brand {
      font-size: 15px;
    }

    .brand-badge {
      width: 26px;
      height: 26px;
    }
    
    .watch-party-controls {
      gap: 6px;
    }
    
    .watch-party-controls button {
      font-size: 11px;
      padding: 7px 10px;
    }
  }

  @layer pages {
    .selection {
      padding: 8px;
    }

    .selection-head {
      grid-template-columns: 48px 1fr;
    }

    .head-cover {
      width: 48px;
    }

    .ep-panel, .voice-panel {
      max-height: 30vh;
    }

    #chat-container {
      max-height: 35vh;
    }
    
  }
}

@supports (-webkit-touch-callout: none) {
  @layer pages {
    .player-shell {
      min-height: calc(50vh - 60px);
    }

    #chat-container {
      max-height: calc(42vh - 40px);
    }
  }
}


.plyr__menu__container {
  background: #0f1115 !important;
}

.plyr__menu__container [role="menu"] {
  background: #0f1115 !important;
}

.plyr__menu__container [role="menuitem"],
.plyr__menu__container [role="menuitemradio"],
.plyr__menu__container button,
.plyr__menu__container .plyr__control,
.plyr__menu__container .plyr__control span,
.plyr__menu__container span {
  color: #ffffff !important;
}

.plyr__menu__container .plyr__menu__value {
  color: rgba(255, 255, 255, 0.7) !important;
}

.plyr__menu__container [role="menuitem"]:hover,
.plyr__menu__container [role="menuitemradio"]:hover,
.plyr__menu__container button:hover {
  background: rgba(108, 92, 231, 0.2) !important;
  color: #ffffff !important;
}

.plyr__menu__container [role="menuitemradio"][aria-checked="true"] {
  background: rgba(108, 92, 231, 0.3) !important;
  color: #ffffff !important;
}

@media (orientation: landscape) and (max-height: 500px) {
  @layer components {
    body {
      overflow-x: clip !important;
      overflow-y: auto !important;
      max-width: 100vw !important;
      position: relative;
      
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
    }
    
    body::-webkit-scrollbar {
      display: none !important; 
    }
    
    *::-webkit-scrollbar {
      width: 0 !important;
      height: 0 !important;
    }
    
    * {
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
    }
    
    html.touch-device body,
    body {
      overflow-x: clip !important;
      overflow-y: auto !important;
    }
    
    .container {
      overflow-y: visible !important;
      max-width: 100vw !important;
      padding-bottom: 80px !important;
    }
    
    .container:has(#catalog-block:not(.hidden)) {
      overflow-x: clip !important;
    }
    
    #search-block,
    #catalog-block,
    #selection-block {
      max-width: 100vw !important;
    }
    
    header {
      padding: 8px 12px !important;
    }
    
    .brand {
      font-size: 14px !important;
    }
    
    .brand-badge {
      width: 28px !important;
      height: 28px !important;
    }
    
    .watch-party-controls button {
      font-size: 11px !important;
      padding: 6px 10px !important;
    }
  }
  
  @layer layouts {
    .landing-layout {
      grid-template-columns: 1fr !important;
    }
  }
  
  @layer pages {
    html.touch-device .container:has(#catalog-block:not(.hidden)) > header,
    .container:has(#catalog-block:not(.hidden)) > header {
      display: none !important;
    }
    
    html.touch-device .container:has(#catalog-block:not(.hidden)),
    .container:has(#catalog-block:not(.hidden)) {
      padding: 0 !important;
    }
    
    html.touch-device #catalog-block:not(.hidden),
    #catalog-block:not(.hidden) {
      padding-top: 0 !important;
      padding-left: 0 !important;
      padding-right: 0 !important;
      gap: 0 !important;
    }

    html.touch-device .catalog-main,
    .catalog-main {
      max-width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
      border-radius: 0 !important;
      background: var(--bg) !important;
    }
    
    html.touch-device .catalog-header,
    .catalog-header {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      z-index: 100 !important;
      background: var(--panel) !important;
      border-bottom: 1px solid var(--border) !important;
      margin-bottom: 0 !important;
      padding: 10px 14px !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    html.touch-device .catalog-mobile-actions,
    .catalog-mobile-actions {
      display: flex !important;
      gap: 8px;
      margin-top: 0;
      flex: 0 0 auto;
    }
    
    html.touch-device .catalog-mobile-btn,
    .catalog-mobile-btn {
      display: flex !important;
      align-items: center;
      justify-content: center;
      gap: 6px;
      flex: 0 0 auto;
      padding: 8px 14px;
      background: rgba(108, 92, 231, 0.12);
      border: 1px solid rgba(108, 92, 231, 0.25);
      border-radius: 8px;
      color: #c7d2fe;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      min-height: 36px;
    }
    
    html.touch-device .catalog-mobile-btn:active,
    .catalog-mobile-btn:active {
      background: rgba(108, 92, 231, 0.25);
      transform: scale(0.96);
    }
    
    html.touch-device .catalog-mobile-btn span:first-child,
    .catalog-mobile-btn span:first-child {
      font-size: 16px;
    }
    
    html.touch-device #catalogBackBtn,
    #catalogBackBtn {
      display: inline-flex !important;
    }
    
    html.touch-device .filters-sidebar,
    .filters-sidebar {
      position: fixed !important;
      top: 0 !important;
      bottom: 0 !important;
      left: 0 !important;
      right: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      height: 100vh !important;
      margin: 0 !important;
      border-radius: 0 !important;
      border: none !important;
      box-shadow: none !important;
      z-index: 1000 !important;
      transform: translateX(100%) !important;
      transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
      background: var(--bg) !important;
    }
    
    html.touch-device .filters-sidebar:not(.hidden),
    .filters-sidebar:not(.hidden) {
      transform: translateX(0) !important;
    }
    
    html.touch-device .filters-sidebar-content,
    .filters-sidebar-content {
      padding: 12px 16px;
      overflow-y: auto;
      max-height: calc(100vh - 120px);
      padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px));
    }

    html.touch-device .filters-sidebar-header,
    .filters-sidebar-header {
      flex-wrap: wrap;
      gap: 12px;
      align-items: flex-start;
    }

    html.touch-device .filters-header-actions,
    .filters-header-actions {
      width: 100%;
      justify-content: flex-end;
      gap: 12px;
      flex-wrap: wrap;
    }

    html.touch-device .filters-apply-btn,
    .filters-apply-btn {
      min-height: 48px;
      font-size: 14px;
      font-weight: 700;
      background: linear-gradient(135deg, #00b0ff 0%, #6c5ce7 100%);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
    }

    html.touch-device .modal-header-actions,
    .modal-header-actions {
      flex-wrap: wrap;
      gap: 12px;
      justify-content: flex-end;
    }

    html.touch-device .modal-apply-btn,
    .modal-apply-btn {
      min-height: 48px;
      font-size: 14px;
      font-weight: 700;
      background: linear-gradient(135deg, #00b0ff 0%, #6c5ce7 100%);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
    }
    html.touch-device .modal-body,
    .modal-body {
      padding-bottom: calc(120px + env(safe-area-inset-bottom, 24px)) !important;
    }
    
    html.touch-device .modal-footer,
    .modal-footer {
      position: fixed !important;
      bottom: 0 !important;
      left: 0 !important;
      right: 0 !important;
      padding: 20px !important;
      padding-bottom: calc(44px + env(safe-area-inset-bottom, 20px)) !important;
      background: linear-gradient(to top, var(--panel) 85%, rgba(22, 26, 34, 0.95) 100%) !important;
      border-top: 2px solid var(--border-2) !important;
      box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5) !important;
      z-index: 2101 !important;
    }
    
    html.touch-device .modal-footer .btn,
    .modal-footer .btn {
      min-height: 48px !important;
      font-size: 14px !important;
      font-weight: 700 !important;
      background: linear-gradient(135deg, #00b0ff 0%, #6c5ce7 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4) !important;
    }
    
    html.touch-device .filters-back-btn,
    .filters-back-btn {
      display: flex !important;
    }
    
    html.touch-device #catalogResults,
    #catalogResults {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 10px !important;
      padding: 12px !important;
      margin-top: 56px !important;
    }
    
    #catalogResults .catalog-anime-card {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    
    #catalogResults .catalog-poster {
      aspect-ratio: 2 / 3;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .catalog-title {
      font-size: 12px !important;
      line-height: 1.3;
      min-height: 31px !important;
      max-height: 31px !important;
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }
    
    .catalog-meta {
      font-size: 10px !important;
    }
    
    .catalog-rating-badge {
      font-size: 10px !important;
      padding: 3px 6px !important;
      top: 4px !important;
      left: 4px !important;
    }
  }
}

#applyCatalogFilters,
#applyCatalogFiltersMobile {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 2101 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

#applyCatalogFilters:hover,
#applyCatalogFiltersMobile:hover {
  opacity: 0.9;
}

#applyCatalogFilters:active,
#applyCatalogFiltersMobile:active {
  transform: scale(0.98);
  opacity: 0.8;
}


.filters-sidebar-content,
.filter-section {
  pointer-events: auto !important;
}

@supports (-webkit-touch-callout: none) {
  .filter-checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2px solid var(--border-2);
    border-radius: 4px;
    background: var(--panel);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .filter-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
  }
  
  .filter-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
  }
  
  .modal-item {
    min-height: 56px;
  }
  
  .modal-item-checkbox {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
  }
  
  .modal-footer .btn {
    min-height: 52px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 700px) {
  .btn,
  .btn-ghost-old {
    -webkit-tap-highlight-color: rgba(108, 92, 231, 0.2);
  }
  
  .btn:active,
  .btn-ghost-old:active {
    transform: scale(0.96);
    opacity: 0.8;
  }
  
  .modal-item:active {
    background: rgba(108, 92, 231, 0.1) !important;
  }
  
  .filter-checkbox:active {
    background: rgba(108, 92, 231, 0.08) !important;
    transform: scale(0.98);
  }
  
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  button, 
  .btn, 
  .btn-ghost-old,
  .modal-item,
  .filter-checkbox,
  input[type="checkbox"] {
    -webkit-tap-highlight-color: rgba(108, 92, 231, 0.15);
  }
  
  .modal-overlay {
    align-items: stretch;
    justify-content: flex-end;
  }
  
  .modal-content {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  
  .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 24px)) !important;
  }
  
  .modal-footer {
    flex-shrink: 0;
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--panel) 85%, rgba(22, 26, 34, 0.95) 100%);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
    border-top: 2px solid var(--border-2);
    padding: 20px !important;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 28px)) !important;
    z-index: 2101;
  }
  
  #sortModal .modal-content {
    display: flex;
    flex-direction: column;
  }
  
  #sortModal .modal-body {
    flex: 1 1 auto;
    min-height: 200px;
    overflow-y: auto;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 24px)) !important;
  }
  
  #sortModal .modal-footer {
    flex-shrink: 0;
    margin-top: 0;
    position: fixed !important;
  }
}


.chat-handle.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

@media (max-width: 700px) {
  .skip-intro-btn {
    bottom: 50px;
    left: 10px;
    padding: 6px 12px;
    font-size: 12px;
    gap: 5px;
    border-radius: 5px;
  }
  
  .skip-intro-icon {
    font-size: 12px;
  }
  
  .plyr--fullscreen .skip-intro-btn {
    bottom: 60px;
    left: 14px;
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: clip !important;
    overflow-y: auto !important;
    max-width: 100vw !important;
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  .container {
    overflow-x: clip !important;
    overflow-y: visible !important;
    padding-bottom: 24px;
    max-width: 100vw;
  }
  
  #selection-block,
  #catalog-block,
  .selection {
    overflow-x: clip !important;
  }

  #search-block {
    overflow-x: clip !important;
    overflow-y: visible !important;
    max-width: 100vw;
  }
  
  #selection-block:not(.hidden),
  .selection {
    overflow-x: clip !important;
  }

  .chat-handle {
    display: grid !important;
    position: fixed !important;
    right: 16px !important;
    bottom: 16px !important;
    z-index: 9999 !important;
  }

  #chat-container {
    position: fixed !important;
    top: auto !important;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(15px + env(safe-area-inset-right, 0px)) !important;
    
    width: clamp(280px, 90vw, 380px) !important;
    max-height: 32vh !important;
    z-index: 2002 !important;

    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(22, 26, 34, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: -10px 12px 30px rgba(0,0,0,0.35);
    overflow: hidden;
    transform: translateY(calc(100% + 20px));
    opacity: 0; visibility: hidden;
    transition: transform .32s cubic-bezier(0.22, 1, 0.36, 1),
                opacity .32s cubic-bezier(0.22, 1, 0.36, 1),
                visibility .32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto !important;
  }
  #chat-container.is-open {
    transform: translateY(0);
    opacity: 1; visibility: visible;
  }
  
  #chat-container .chat-header-mobile {
      display: flex;
  }
  #chat-container .chat-header {
      display: none !important;
  }

  #chat-container .chat-form input {
    background: rgba(13, 16, 22, 0.95) !important;
    color: #e9eef6 !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
  }
}

@media (max-width: 640px) {
  .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .btn, .btn-ghost-old { min-height: 44px; }
  
  .plyr__controls [data-plyr="mute"],
  .plyr__controls .plyr__volume {
    display: none !important;
  }

  .plyr--video .plyr__controls {
    display: flex !important;
    align-items: center !important;
  }

  .plyr__progress__container {
    flex: 1 1 auto !important;
  }
}

@media (max-width: 360px) {
  @layer components {
    header {
      padding: 8px 10px;
      gap: 6px;
    }
    
    .brand {
      font-size: 14px;
      gap: 6px;
    }
    
    .brand-badge {
      width: 26px;
      height: 26px;
    }
    
    .watch-party-controls {
      gap: 5px;
    }
    
    .watch-party-controls button {
      font-size: 10px;
      padding: 8px 6px;
    }
    
    .btn, .btn-ghost-old {
      font-size: 11px;
      padding: 8px 8px;
      border-radius: 8px;
    }
    
    .search-panel {
      padding: 8px 10px;
    }
    
    .search-row {
      padding: 6px 8px;
      gap: 4px;
    }
    
    .search-row .icon {
      font-size: 14px;
    }
    
    .search-row input {
      font-size: 13px;
    }
    
    .search-row .btn {
      font-size: 11px;
      padding: 6px 8px;
      min-height: 32px;
    }
  }

  @layer pages {
    .catalog-header {
      padding: 10px 12px;
      gap: 8px;
    }

    .catalog-header h2 {
      font-size: 14px !important;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .catalog-header h2 #catalogBackBtn {
      font-size: 18px;
      padding: 8px 10px;
      min-width: auto;
      white-space: nowrap;
    }

    .catalog-mobile-actions {
      gap: 6px;
    }

    .catalog-mobile-btn {
      font-size: 11px;
      padding: 7px 10px;
      gap: 4px;
    }

    .catalog-mobile-btn span:first-child {
      font-size: 14px;
    }
  }
}

.catalog-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: fadeIn 0.2s ease;
}

.catalog-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.catalog-loading-spinner .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 700px) {
  .catalog-loading-spinner {
    padding: 24px;
  }
  
  .catalog-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  
  .catalog-loading-spinner div:last-child {
    font-size: 13px !important;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  #catalogResults,
  .now-grid,
  .landing-row,
  .landing-layout {
    transition: grid-template-columns 0.3s ease, gap 0.2s ease;
  }
  
  #catalogResults .catalog-anime-card,
  .landing-row > .card {
    transition: flex-basis 0.3s ease, width 0.3s ease;
  }
}

@layer pages {
  @media (max-width: 700px) {
    .landing-scroll-wrapper,
    .now-scroll-wrapper {
      margin-inline: 0;
      padding-inline: 0;
    }

    .landing-row {
      padding-inline: 0 var(--container-padding);
      scroll-padding-inline: var(--container-padding);
      overscroll-behavior-inline: contain;
    }

    .landing-row::after {
      content: "";
      flex: 0 0 var(--container-padding);
    }

    .landing-row > .card {
      scroll-snap-align: start;
    }

    .now-panel {
      overflow: hidden;
    }

    .now-scroll-wrapper {
      padding-inline: 0 var(--container-padding);
      scroll-padding-inline: var(--container-padding);
      overscroll-behavior-inline: contain;
    }

    .now-cols {
      display: flex;
      gap: 16px;
    }

    .now-cols::after {
      content: "";
      flex: 0 0 var(--container-padding);
    }

    .now-col {
      scroll-snap-align: start;
    }
  }
}