
    :root {
      --bg: #060606;
      --panel: rgba(255,255,255,.075);
      --line: rgba(255,255,255,.12);
      --text: #f7f7f7;
      --muted: rgba(247,247,247,.64);
      --brand: #ff6fae;
      --brand2: #ffa6d4;
      --safe-top: env(safe-area-inset-top);
      --safe-bottom: env(safe-area-inset-bottom);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color-scheme: dark;
    }

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

    html {
      width: 100%;
      min-height: 100%;
      touch-action: manipulation;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
      scroll-behavior: auto;
    }

    body {
      width: 100%;
      min-height: 100%;
      margin: 0;
      background:
        radial-gradient(circle at top left, rgba(255,51,95,.24), transparent 34%),
        radial-gradient(circle at top right, rgba(255,176,58,.16), transparent 30%),
        var(--bg);
      color: var(--text);
      overflow-x: hidden;
      overscroll-behavior-y: contain;
      padding-bottom: var(--safe-bottom);
    }

    button, input { font: inherit; touch-action: manipulation; }
    input, textarea, select { font-size: 16px !important; }
    button { border: 0; color: inherit; cursor: pointer; }

    .app { min-height: 100svh; }

    .loading-screen,
    .login-screen {
      min-height: 100svh;
      padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom));
      display: grid;
      place-items: center;
      position: relative;
      overflow: hidden;
      background: #050505;
    }

    .login-bg {
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.82)),
        url("../assets/bg.gif");
      background-size: cover;
      background-position: center;
      filter: saturate(1.08) contrast(1.02);
      transform: scale(1.04);
    }

    .login-card,
    .loading-card {
      width: min(420px, 100%);
      position: relative;
      z-index: 1;
      border-radius: 30px;
      padding: 20px;
      background: rgba(12,12,15,.72);
      border: 1px solid rgba(255,255,255,.16);
      box-shadow: 0 22px 80px rgba(0,0,0,.55);
      backdrop-filter: blur(22px) saturate(1.2);
      -webkit-backdrop-filter: blur(22px) saturate(1.2);
    }

    .login-logo {
      width: 74px;
      height: 74px;
      border-radius: 24px;
      overflow: hidden;
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      box-shadow: 0 18px 50px rgba(255,51,95,.28);
      margin-bottom: 14px;
    }

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

    .login-card h1,
    .loading-card h1 {
      margin: 0;
      font-size: 34px;
      line-height: .94;
      letter-spacing: -.06em;
    }

    .app-subtitle {
      margin: 7px 0 0;
      color: rgba(255,255,255,.86);
      font-weight: 800;
      letter-spacing: -.02em;
    }

    .login-card p,
    .loading-card p {
      margin: 8px 0 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 14px;
    }

    .login-form {
      margin-top: 18px;
      display: grid;
      gap: 10px;
    }

    .login-input {
      width: 100%;
      height: 50px;
      border-radius: 17px;
      border: 1px solid rgba(255,255,255,.13);
      outline: 0;
      background: rgba(255,255,255,.09);
      color: white;
      padding: 0 13px;
    }

    .login-btn,
    .google-btn,
    .primary-btn {
      min-height: 48px;
      border-radius: 17px;
      padding: 0 14px;
      background: linear-gradient(135deg, rgba(255,51,95,.96), rgba(255,176,58,.80));
      box-shadow: 0 16px 42px rgba(255,51,95,.20);
      color: white;
      font-weight: 900;
    }

    .google-btn {
      background: rgba(255,255,255,.10);
      border: 1px solid rgba(255,255,255,.16);
      box-shadow: none;
    }

    .login-btn:disabled,
    .google-btn:disabled,
    .primary-btn:disabled {
      opacity: .62;
      cursor: not-allowed;
    }

    .error-text {
      min-height: 20px;
      color: #ff9aae;
      font-size: 13px;
      margin: 2px 0 0;
    }

    .info-text {
      min-height: 20px;
      color: #b8ffd0;
      font-size: 13px;
      margin: 2px 0 0;
    }

    .divider {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 10px;
      align-items: center;
      color: rgba(255,255,255,.52);
      font-size: 12px;
      margin: 2px 0;
    }

    .divider::before,
    .divider::after {
      content: "";
      height: 1px;
      background: rgba(255,255,255,.14);
    }

    .spinner {
      width: 42px;
      height: 42px;
      border-radius: 999px;
      border: 3px solid rgba(255,255,255,.16);
      border-top-color: white;
      animation: spin .8s linear infinite;
      margin-bottom: 14px;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    .hero-header {
      padding: calc(10px + var(--safe-top)) 12px 0;
    }

    .brand-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      border-radius: 16px;
      padding: 4px 10px 4px 4px;
      background: rgba(255,255,255,.055);
      border: 1px solid rgba(255,255,255,.08);
    }

    .brand:active,
    .avatar-btn:active,
    .mini-btn:active,
    .search-btn:active,
    .clear-btn:active,
    .back:active,
    .sheet-btn:active,
    .avatar-pick:active,
    .login-btn:active,
    .google-btn:active {
      transform: scale(.96);
    }

    .logo-box {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      border-radius: 15px;
      overflow: hidden;
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      box-shadow: 0 10px 28px rgba(255,51,95,.22);
      font-weight: 950;
      flex: 0 0 auto;
    }

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

    .brand-title {
      min-width: 0;
      line-height: 1.04;
      text-align: left;
    }

    .brand-title strong {
      display: block;
      font-size: 19px;
      letter-spacing: -.04em;
    }

    .brand-title em {
      display: block;
      margin-top: 3px;
      color: rgba(255,255,255,.88);
      font-size: 12px;
      font-style: normal;
      font-weight: 800;
      letter-spacing: -.02em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 230px;
    }

    .brand-title span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 230px;
    }

    .avatar-btn {
      width: 44px;
      height: 44px;
      border-radius: 16px;
      overflow: visible;
      border: 1px solid rgba(255,255,255,.13);
      background: rgba(255,255,255,.075);
      display: block;
      padding: 0;
      flex: 0 0 auto;
      box-shadow: 0 10px 30px rgba(0,0,0,.24);
    }

    .avatar-cover {
      width: 100%;
      height: 100%;
      min-width: 100%;
      min-height: 100%;
      display: block;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      border-radius: inherit;
    }


    .avatar-stack {
      --avatar-inset: 8%;
      --frame-scale: 1.22;
      position: relative;
      width: 100%;
      height: 100%;
      display: block;
      border-radius: inherit;
      overflow: visible;
      isolation: isolate;
    }

    .avatar-stack .avatar-cover {
      position: absolute;
      inset: var(--avatar-inset);
      z-index: 1;
      width: auto;
      height: auto;
      min-width: 0;
      min-height: 0;
      border-radius: 999px;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    }

    .avatar-frame-img {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 2;
      width: 100%;
      height: 100%;
      max-width: none;
      max-height: none;
      object-fit: cover;
      object-position: center;
      transform: translate(-50%, -50%) scale(var(--frame-scale));
      transform-origin: center;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
      border-radius: 0;
    }

    .avatar-btn .avatar-stack {
      --avatar-inset: 8%;
      --frame-scale: 1.24;
    }

    .profile-avatar-lg .avatar-stack,
    .avatar-pick .avatar-stack {
      --avatar-inset: 8%;
      --frame-scale: 1.24;
    }

    .banner {
      margin: 13px -12px 0;
      width: calc(100% + 24px);
      height: clamp(170px, 39vw, 330px);
      overflow: hidden;
      border-top: 1px solid rgba(255,255,255,.10);
      border-bottom: 1px solid rgba(255,255,255,.12);
      background: #111;
      box-shadow: 0 18px 56px rgba(0,0,0,.40);
    }

    .banner-img {
      width: 100%;
      height: 100%;
      background-image: url("../assets/bg.gif");
      background-size: cover;
      background-position: center;
      filter: saturate(1.08) contrast(1.03);
      transform: scale(1.02);
    }

    .search-sticky {
      position: sticky;
      top: calc(7px + var(--safe-top));
      z-index: 40;
      padding: 9px 12px 8px;
      background: transparent;
      pointer-events: none;
    }

    .search {
      width: min(1080px, 100%);
      margin: 0 auto;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto auto;
      align-items: center;
      gap: 8px;
      min-height: 48px;
      padding: 6px 8px 6px 12px;
      border-radius: 17px;
      background: rgba(15,15,18,.64);
      border: 1px solid rgba(255,255,255,.13);
      box-shadow: 0 12px 32px rgba(0,0,0,.26);
      backdrop-filter: blur(16px) saturate(1.15);
      -webkit-backdrop-filter: blur(16px) saturate(1.15);
      pointer-events: auto;
    }

    .search-icon { color: var(--muted); font-size: 18px; line-height: 1; }

    .search input {
      width: 100%;
      border: 0;
      outline: 0;
      color: var(--text);
      background: transparent;
      padding: 8px 0;
      min-width: 0;
    }

    .search input::placeholder { color: rgba(247,247,247,.42); }

    .clear-btn,
    .search-btn {
      min-width: 38px;
      height: 36px;
      border-radius: 13px;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.10);
      display: grid;
      place-items: center;
      flex: 0 0 auto;
    }

    .search-btn {
      padding: 0 12px;
      min-width: 52px;
      background: linear-gradient(135deg, rgba(255,51,95,.95), rgba(255,176,58,.78));
      font-weight: 800;
    }

    .clear-btn.hidden { visibility: hidden; pointer-events: none; }

    .main {
      width: min(1080px, 100%);
      margin: 0 auto;
      padding: 0 12px 24px;
    }

    .section {
      display: flex;
      justify-content: space-between;
      align-items: end;
      gap: 12px;
      margin: 8px 0 12px;
    }

    .section h1 {
      margin: 0;
      font-size: 22px;
      letter-spacing: -.045em;
    }

    .section p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .mini-btn,
    .sheet-btn {
      min-height: 38px;
      padding: 0 12px;
      border-radius: 14px;
      background: rgba(255,255,255,.085);
      border: 1px solid rgba(255,255,255,.12);
      white-space: nowrap;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 11px;
    }

    @media (min-width: 700px) {
      .hero-header, .main { padding-left: 20px; padding-right: 20px; }
      .search-sticky { padding-left: 20px; padding-right: 20px; }

      .banner {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        height: clamp(220px, 31vw, 390px);
      }

      .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
      .brand-title span, .brand-title em { max-width: 420px; }
    }

    @media (min-width: 1050px) {
      .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    }

    .card {
      border-radius: 18px;
      overflow: hidden;
      background: var(--panel);
      border: 1px solid rgba(255,255,255,.10);
      box-shadow: 0 12px 32px rgba(0,0,0,.22);
    }

    .card:active { transform: scale(.98); }

    .poster-wrap {
      position: relative;
      aspect-ratio: 2 / 3;
      background: rgba(255,255,255,.07);
      overflow: hidden;
    }

    .poster {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .badge {
      position: absolute;
      top: 8px;
      left: 8px;
      max-width: calc(100% - 16px);
      padding: 5px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      background: rgba(0,0,0,.58);
      border: 1px solid rgba(255,255,255,.15);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .card-info { padding: 9px 9px 10px; }

    .card-title {
      min-height: 38px;
      margin: 0;
      font-size: 14px;
      line-height: 1.32;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      letter-spacing: -.018em;
    }

    .card-sub {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .detail {
      min-height: 100svh;
      padding-bottom: calc(20px + var(--safe-bottom));
    }

    .detail-header {
      position: sticky;
      top: 0;
      z-index: 30;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: calc(10px + var(--safe-top)) 12px 10px;
      background: linear-gradient(180deg, rgba(6,6,6,.98), rgba(6,6,6,.76));
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .back {
      min-height: 40px;
      padding: 0 12px;
      border-radius: 14px;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.12);
    }

    .detail-main {
      width: min(980px, 100%);
      margin: 0 auto;
      padding: 10px 12px 0;
    }

    .player {
      border-radius: 18px;
      overflow: hidden;
      background: #000;
      border: 1px solid rgba(255,255,255,.13);
      box-shadow: 0 18px 52px rgba(0,0,0,.42);
      margin-bottom: 12px;
      display: none;
    }

    .player.show { display: block; }

    .player-box {
      width: 100%;
      aspect-ratio: 16 / 9;
      background: #000;
    }

    .player-box iframe, .player-box video {
      width: 100%;
      height: 100%;
      display: block;
      border: 0;
      background: #000;
    }

    .vip-box {
      min-height: 100%;
      width: 100%;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 18px;
      background:
        radial-gradient(circle at 30% 10%, rgba(255,51,95,.22), transparent 35%),
        #09090b;
    }

    .vip-box strong {
      display: block;
      font-size: clamp(18px, 5vw, 28px);
      letter-spacing: -.04em;
    }

    .vip-box p {
      margin: 8px auto 0;
      color: var(--muted);
      max-width: 420px;
      line-height: 1.45;
      font-size: 13px;
    }

    .vip-qr {
      width: min(180px, 42vw);
      aspect-ratio: 1;
      object-fit: contain;
      display: block;
      margin: 14px auto 0;
      border-radius: 18px;
      background: white;
      padding: 8px;
    }

    .qr-missing {
      display: none;
      color: #ffb9c6 !important;
    }

    .movie-head {
      display: grid;
      grid-template-columns: 118px minmax(0, 1fr);
      gap: 13px;
      align-items: end;
      padding: 12px;
      border-radius: 22px;
      background: var(--panel);
      border: 1px solid rgba(255,255,255,.11);
      box-shadow: 0 16px 45px rgba(0,0,0,.24);
    }

    .detail-poster {
      width: 118px;
      aspect-ratio: 2 / 3;
      border-radius: 16px;
      object-fit: cover;
      background: rgba(255,255,255,.08);
    }

    .movie-title {
      margin: 0;
      font-size: clamp(22px, 7vw, 40px);
      line-height: 1;
      letter-spacing: -.055em;
    }

    .origin {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

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

    .chip {
      padding: 6px 8px;
      border-radius: 999px;
      font-size: 12px;
      background: rgba(255,255,255,.085);
      border: 1px solid rgba(255,255,255,.10);
      color: rgba(247,247,247,.82);
    }

    .vip-chip {
      background: linear-gradient(135deg, rgba(255,51,95,.95), rgba(255,176,58,.78));
      color: white;
      font-weight: 900;
    }

    .panel {
      margin-top: 12px;
      padding: 13px;
      border-radius: 18px;
      background: var(--panel);
      border: 1px solid rgba(255,255,255,.10);
    }

    .panel h2 {
      margin: 0 0 9px;
      font-size: 18px;
      letter-spacing: -.035em;
    }

    .desc {
      margin: 0;
      color: rgba(247,247,247,.74);
      line-height: 1.55;
      font-size: 14px;
    }

    .episodes {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    @media (min-width: 720px) {
      .episodes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
      .movie-head { grid-template-columns: 158px minmax(0, 1fr); gap: 18px; padding: 16px; }
      .detail-poster { width: 158px; }
    }

    .ep {
      min-height: 42px;
      border-radius: 13px;
      padding: 8px;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.11);
      color: white;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .ep.active {
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      color: white;
      font-weight: 800;
    }

    .state {
      min-height: 240px;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 22px;
      border-radius: 20px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.10);
    }

    .state strong { display: block; font-size: 19px; }

    .state p {
      margin: 8px auto 0;
      max-width: 420px;
      color: var(--muted);
      line-height: 1.48;
    }

    .skeleton-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 11px;
    }

    @media (min-width: 700px) {
      .skeleton-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    }

    @media (min-width: 1050px) {
      .skeleton-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    }

    .skel {
      aspect-ratio: 2 / 3.55;
      border-radius: 18px;
      background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
      background-size: 220% 100%;
      animation: shimmer 1.05s ease-in-out infinite;
    }

    @keyframes shimmer {
      from { background-position: 120% 0; }
      to { background-position: -120% 0; }
    }

    .sheet-backdrop {
      position: fixed;
      inset: 0;
      z-index: 100;
      background: rgba(0,0,0,.58);
      display: grid;
      align-items: end;
      padding: 14px;
    }

    .sheet {
      width: min(520px, 100%);
      margin: 0 auto;
      border-radius: 28px;
      padding: 16px;
      background: rgba(18,18,22,.92);
      border: 1px solid rgba(255,255,255,.16);
      box-shadow: 0 22px 80px rgba(0,0,0,.58);
      backdrop-filter: blur(22px) saturate(1.2);
      -webkit-backdrop-filter: blur(22px) saturate(1.2);
    }

    .sheet-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .sheet-head h2 {
      margin: 0;
      font-size: 22px;
      letter-spacing: -.045em;
    }

    .form-grid { display: grid; gap: 12px; }

    .field label {
      display: block;
      margin: 0 0 6px;
      color: var(--muted);
      font-size: 13px;
    }

    .field input[type="text"] {
      width: 100%;
      height: 46px;
      border-radius: 15px;
      border: 1px solid rgba(255,255,255,.13);
      outline: 0;
      background: rgba(255,255,255,.085);
      color: white;
      padding: 0 12px;
    }

    .avatar-edit {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border-radius: 20px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.10);
    }

    .avatar-pick {
      width: 72px;
      height: 72px;
      border-radius: 24px;
      overflow: visible;
      flex: 0 0 auto;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.13);
      padding: 0;
      display: block;
    }

    .avatar-help { min-width: 0; }

    .avatar-help strong { display: block; }

    .avatar-help span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }



    .global-notices {
      display: grid;
      gap: 9px;
      margin: 0 0 12px;
    }

    .global-notice {
      position: relative;
      overflow: hidden;
      border-radius: 18px;
      padding: 12px 13px 12px 42px;
      background:
        radial-gradient(circle at top left, rgba(255,51,135,.32), transparent 44%),
        linear-gradient(135deg, rgba(255,51,135,.22), rgba(255,113,174,.12));
      border: 1px solid rgba(255,130,188,.34);
      box-shadow: 0 14px 38px rgba(255,51,135,.12), 0 16px 40px rgba(0,0,0,.22);
    }

    .global-notice::before {
      content: "!";
      position: absolute;
      left: 12px;
      top: 12px;
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: linear-gradient(135deg, #ff2f8f, #ff85ba);
      color: white;
      font-weight: 950;
      font-size: 14px;
      box-shadow: 0 10px 24px rgba(255,47,143,.30);
    }

    .global-notice strong {
      display: block;
      margin: 0 0 5px;
      color: #fff1f8;
      font-size: 14px;
      letter-spacing: -.02em;
    }

    .global-notice p {
      margin: 0;
      color: rgba(255,241,248,.88);
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .global-notice time {
      display: block;
      margin-top: 7px;
      color: rgba(255,241,248,.56);
      font-size: 11px;
    }

    .profile-hero {
      display: grid;
      grid-template-columns: 82px minmax(0, 1fr);
      gap: 14px;
      align-items: center;
      padding: 14px;
      border-radius: 24px;
      background:
        radial-gradient(circle at top left, rgba(255,51,95,.18), transparent 44%),
        rgba(255,255,255,.065);
      border: 1px solid rgba(255,255,255,.12);
    }

    .profile-avatar-lg {
      width: 82px;
      height: 82px;
      border-radius: 28px;
      overflow: visible;
      padding: 0;
      display: block;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.14);
      box-shadow: 0 14px 36px rgba(0,0,0,.30);
    }

    .profile-meta {
      min-width: 0;
    }

    .profile-meta h3 {
      margin: 0;
      font-size: 22px;
      line-height: 1;
      letter-spacing: -.045em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .profile-meta p {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .status-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 10px;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      background: rgba(255,255,255,.09);
      border: 1px solid rgba(255,255,255,.12);
      color: rgba(255,255,255,.82);
    }

    .status-badge.vip {
      background: linear-gradient(135deg, rgba(255,51,95,.96), rgba(255,176,58,.80));
      color: white;
      border-color: rgba(255,255,255,.18);
    }

    .profile-action-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .profile-action-grid .primary-btn,
    .profile-action-grid .sheet-btn {
      width: 100%;
    }

    .history-panel {
      margin-top: 2px;
      padding: 12px;
      border-radius: 22px;
      background: rgba(255,255,255,.055);
      border: 1px solid rgba(255,255,255,.10);
    }

    .history-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .history-head strong {
      font-size: 16px;
      letter-spacing: -.025em;
    }

    .history-list {
      display: grid;
      gap: 9px;
      max-height: min(52svh, 420px);
      overflow: auto;
      padding-right: 2px;
    }

    .history-item {
      width: 100%;
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      text-align: left;
      padding: 8px;
      border-radius: 17px;
      background: rgba(255,255,255,.065);
      border: 1px solid rgba(255,255,255,.10);
    }

    .history-item:active {
      transform: scale(.985);
    }

    .history-poster {
      width: 54px;
      aspect-ratio: 2 / 3;
      border-radius: 12px;
      object-fit: cover;
      background: rgba(255,255,255,.08);
    }

    .history-info {
      min-width: 0;
    }

    .history-info strong {
      display: block;
      font-size: 14px;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .history-info span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .history-time {
      align-self: center;
      justify-self: end;
      padding: 6px 8px;
      border-radius: 999px;
      font-size: 12px;
      color: white;
      background: rgba(255,255,255,.095);
      border: 1px solid rgba(255,255,255,.10);
      white-space: nowrap;
    }

    .danger-text-btn {
      color: #ffb3c0;
      background: rgba(255,51,95,.10);
      border-color: rgba(255,51,95,.22);
    }

    .hidden-file {
      position: absolute;
      opacity: 0;
      width: 1px;
      height: 1px;
      pointer-events: none;
    }
  
    /* Profile modal v12: clean 2-tab UI */
    .sheet {
      max-height: calc(100svh - 28px - var(--safe-top) - var(--safe-bottom));
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow: hidden;
    }

    .sheet-head {
      margin-bottom: 0;
      flex: 0 0 auto;
    }

    .profile-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 7px;
      padding: 5px;
      border-radius: 18px;
      background: rgba(255,255,255,.065);
      border: 1px solid rgba(255,255,255,.10);
      flex: 0 0 auto;
    }

    .profile-tab-btn {
      min-height: 42px;
      border-radius: 14px;
      background: transparent;
      color: rgba(255,255,255,.62);
      font-weight: 900;
      border: 1px solid transparent;
    }

    .profile-tab-btn.active {
      color: #fff;
      background: linear-gradient(135deg, rgba(255,51,95,.92), rgba(255,176,58,.70));
      border-color: rgba(255,255,255,.16);
      box-shadow: 0 12px 30px rgba(255,51,95,.16);
    }

    .profile-tab-content {
      min-height: 0;
      flex: 1 1 auto;
      display: grid;
      gap: 12px;
      overflow: hidden;
    }

    .profile-account-tab {
      display: grid;
      gap: 12px;
      align-content: start;
    }

    .profile-save-btn {
      width: 100%;
    }

    .profile-avatar-lg {
      cursor: pointer;
    }

    .profile-avatar-note {
      display: block;
      margin-top: 6px;
      color: rgba(255,255,255,.54);
      font-size: 12px;
      line-height: 1.35;
    }

    .profile-footer {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding-top: 10px;
      border-top: 1px solid rgba(255,255,255,.10);
    }

    .profile-footer small {
      color: rgba(255,255,255,.46);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .logout-compact {
      min-height: 34px;
      padding: 0 11px;
      border-radius: 999px;
      font-size: 12px;
      color: #ffbdc8;
      background: rgba(255,51,95,.10);
      border: 1px solid rgba(255,51,95,.22);
      white-space: nowrap;
    }

    .history-panel {
      margin-top: 0;
      padding: 0;
      border: 0;
      background: transparent;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow: hidden;
    }

    .history-head {
      margin-bottom: 0;
      flex: 0 0 auto;
    }

    .history-head-actions {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .history-list {
      max-height: none;
      min-height: 220px;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 2px 2px 4px;
      scrollbar-width: thin;
    }

    .history-item {
      grid-template-columns: 56px minmax(0, 1fr) auto;
      min-height: 76px;
      border-radius: 18px;
    }

    .history-item.selecting {
      grid-template-columns: 28px 56px minmax(0, 1fr);
    }

    .history-check {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,.24);
      background: rgba(255,255,255,.08);
      color: transparent;
      font-size: 14px;
      font-weight: 950;
    }

    .history-check.checked {
      color: white;
      background: linear-gradient(135deg, rgba(255,51,95,.95), rgba(255,176,58,.78));
      border-color: rgba(255,255,255,.22);
    }

    .history-delete-bar {
      flex: 0 0 auto;
      display: grid;
      grid-template-columns: 1fr auto auto;
      align-items: center;
      gap: 8px;
      padding: 10px;
      border-radius: 17px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.10);
    }

    .history-delete-bar span {
      color: var(--muted);
      font-size: 12px;
    }

    .history-empty {
      min-height: 220px;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 22px;
      border-radius: 20px;
      background: rgba(255,255,255,.055);
      border: 1px solid rgba(255,255,255,.10);
    }

    .history-empty strong {
      display: block;
      font-size: 16px;
      letter-spacing: -.025em;
    }

    .history-empty p {
      margin: 7px auto 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
      max-width: 280px;
    }


  

    /* v14: ban page, avatar dropdown, separate history page */
    .ban-screen {
      min-height: 100svh;
      padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom));
      display: grid;
      place-items: center;
      position: relative;
      overflow: hidden;
      background: #050505;
    }

    .ban-card {
      width: min(460px, 100%);
      position: relative;
      z-index: 1;
      border-radius: 30px;
      padding: 20px;
      background: rgba(12,12,15,.76);
      border: 1px solid rgba(255,102,140,.28);
      box-shadow: 0 22px 80px rgba(0,0,0,.58), 0 0 42px rgba(255,51,95,.12);
      backdrop-filter: blur(22px) saturate(1.2);
      -webkit-backdrop-filter: blur(22px) saturate(1.2);
      text-align: left;
    }

    .ban-icon {
      width: 64px;
      height: 64px;
      border-radius: 22px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, rgba(255,51,95,.98), rgba(255,176,58,.78));
      color: white;
      font-size: 30px;
      font-weight: 950;
      box-shadow: 0 18px 50px rgba(255,51,95,.24);
      margin-bottom: 14px;
    }

    .ban-card h1 {
      margin: 0;
      font-size: clamp(28px, 8vw, 42px);
      line-height: .96;
      letter-spacing: -.06em;
    }

    .ban-card p {
      margin: 10px 0 0;
      color: rgba(255,255,255,.72);
      font-size: 14px;
      line-height: 1.55;
    }

    .ban-reason {
      margin-top: 14px;
      padding: 13px;
      border-radius: 18px;
      background: rgba(255,51,95,.11);
      border: 1px solid rgba(255,102,140,.22);
      color: rgba(255,241,246,.92);
      line-height: 1.5;
      font-size: 14px;
    }

    .ban-actions {
      margin-top: 16px;
      display: flex;
      justify-content: flex-end;
      gap: 9px;
      flex-wrap: wrap;
    }

    .profile-menu-wrap {
      position: relative;
      flex: 0 0 auto;
    }

    .profile-menu {
      position: absolute;
      top: calc(100% + 10px);
      right: 0;
      z-index: 80;
      width: min(260px, calc(100vw - 24px));
      padding: 9px;
      border-radius: 22px;
      background: rgba(18,18,22,.94);
      border: 1px solid rgba(255,255,255,.15);
      box-shadow: 0 22px 70px rgba(0,0,0,.50);
      backdrop-filter: blur(22px) saturate(1.2);
      -webkit-backdrop-filter: blur(22px) saturate(1.2);
    }

    .profile-menu::before {
      content: "";
      position: absolute;
      top: -7px;
      right: 16px;
      width: 14px;
      height: 14px;
      transform: rotate(45deg);
      background: rgba(18,18,22,.94);
      border-left: 1px solid rgba(255,255,255,.13);
      border-top: 1px solid rgba(255,255,255,.13);
    }

    .profile-menu-user {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      padding: 9px;
      border-radius: 17px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.08);
      margin-bottom: 7px;
    }

    .profile-menu-avatar {
      width: 42px;
      height: 42px;
      border-radius: 16px;
      position: relative;
    }

    .profile-menu-user strong,
    .profile-menu-user span {
      display: block;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .profile-menu-user strong {
      font-size: 14px;
      letter-spacing: -.02em;
    }

    .profile-menu-user span {
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
    }

    .profile-menu-btn {
      width: 100%;
      min-height: 44px;
      border-radius: 16px;
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background: transparent;
      color: rgba(255,255,255,.88);
      text-align: left;
      font-weight: 800;
    }

    .profile-menu-btn:hover,
    .profile-menu-btn:active {
      background: rgba(255,255,255,.08);
    }

    .profile-menu-btn.danger {
      color: #ffbdc8;
    }

    .history-page-head {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 12px;
      margin: 8px 0 12px;
    }

    .history-page-head h1 {
      margin: 0;
      font-size: 24px;
      letter-spacing: -.045em;
    }

    .history-page-head p {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .history-page-card {
      padding: 12px;
      border-radius: 24px;
      background: rgba(255,255,255,.055);
      border: 1px solid rgba(255,255,255,.10);
      box-shadow: 0 16px 45px rgba(0,0,0,.20);
    }

    .history-page-card .history-list {
      max-height: none;
      min-height: 320px;
      overflow-y: auto;
      overscroll-behavior: contain;
    }

  
    #searchInput::-webkit-search-cancel-button,
    #searchInput::-webkit-search-decoration {
      -webkit-appearance: none;
      appearance: none;
      display: none;
    }

    .detail-header {
      justify-content: flex-start;
    }

    .detail-header-spacer {
      flex: 1 1 auto;
    }

    .detail-profile-menu {
      margin-left: auto;
    }

    .source-tabs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      padding: 1px 0 10px;
      margin-bottom: 2px;
      scrollbar-width: thin;
    }

    .source-tab {
      flex: 0 0 auto;
      min-height: 38px;
      padding: 0 13px;
      border-radius: 999px;
      background: rgba(255,255,255,.075);
      border: 1px solid rgba(255,255,255,.11);
      color: rgba(255,255,255,.74);
      font-size: 13px;
      font-weight: 850;
      white-space: nowrap;
    }

    .source-tab.active {
      color: #fff;
      background: linear-gradient(135deg, rgba(255,51,95,.94), rgba(255,176,58,.76));
      border-color: rgba(255,255,255,.18);
      box-shadow: 0 12px 30px rgba(255,51,95,.14);
    }

    .player-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
      margin: -2px 0 12px;
    }

    .player-actions .mini-btn {
      min-height: 42px;
      font-weight: 850;
    }

    .player-actions .mini-btn:disabled {
      opacity: .42;
      cursor: not-allowed;
    }

    @media (min-width: 720px) {
      .player-actions {
        display: flex;
        justify-content: flex-end;
      }

      .player-actions .mini-btn {
        min-width: 130px;
      }
    }


  
    .related-parts {
      display: grid;
      gap: 9px;
    }

    .related-parts-row {
      display: flex;
      gap: 9px;
      overflow-x: auto;
      padding: 1px 1px 3px;
      overscroll-behavior-x: contain;
      scrollbar-width: thin;
    }

    .related-part-card {
      flex: 0 0 min(176px, 44vw);
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      gap: 9px;
      align-items: center;
      min-height: 78px;
      text-align: left;
      padding: 8px;
      border-radius: 17px;
      background: rgba(255,255,255,.065);
      border: 1px solid rgba(255,255,255,.10);
    }

    .related-part-card.active {
      background: linear-gradient(135deg, rgba(255,51,95,.22), rgba(255,176,58,.13));
      border-color: rgba(255,132,160,.32);
    }

    .related-part-card img {
      width: 48px;
      aspect-ratio: 2 / 3;
      border-radius: 11px;
      object-fit: cover;
      background: rgba(255,255,255,.08);
    }

    .related-part-card span {
      min-width: 0;
    }

    .related-part-card strong {
      display: block;
      font-size: 13px;
      line-height: 1.24;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .related-part-card em {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-style: normal;
      font-size: 11px;
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }


  
    /* v16.4 premium custom video controls */
    .player-box {
      position: relative;
      overflow: hidden;
    }

    .player-box:fullscreen,
    .player-box:-webkit-full-screen {
      width: 100vw;
      height: 100vh;
      aspect-ratio: auto;
      background: #000;
    }

    .player-box:fullscreen iframe,
    .player-box:fullscreen video,
    .player-box:-webkit-full-screen iframe,
    .player-box:-webkit-full-screen video {
      width: 100vw;
      height: 100vh;
      object-fit: contain;
    }

    .x-player {
      position: relative;
      width: 100%;
      height: 100%;
      min-height: inherit;
      background: #000;
      overflow: hidden;
      cursor: none;
      user-select: none;
    }

    .x-player.controls-visible,
    .x-player:not(.is-playing) {
      cursor: default;
    }

    .x-player video {
      width: 100%;
      height: 100%;
      display: block;
      background: #000;
    }

    .x-hotzones {
      position: absolute;
      inset: 0;
      z-index: 6;
      display: grid;
      grid-template-columns: 30% 40% 30%;
    }

    .x-zone {
      border: 0;
      background: transparent;
      padding: 0;
      min-width: 0;
      min-height: 0;
    }

    .x-feedback {
      position: absolute;
      z-index: 10;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%) scale(.92);
      min-width: 78px;
      height: 78px;
      padding: 0 18px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      background: rgba(0,0,0,.50);
      border: 1px solid rgba(255,255,255,.16);
      color: white;
      font-size: 24px;
      font-weight: 950;
      opacity: 0;
      pointer-events: none;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      transition: opacity .16s ease, transform .16s ease;
      box-shadow: 0 18px 60px rgba(0,0,0,.38);
    }

    .x-feedback.show {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }

    .x-controls {
      position: absolute;
      inset: 0;
      z-index: 8;
      display: grid;
      grid-template-rows: auto 1fr auto;
      pointer-events: none;
      opacity: 0;
      transition: opacity .22s ease;
      background:
        linear-gradient(180deg, rgba(0,0,0,.70), rgba(0,0,0,.22) 24%, transparent 44%),
        linear-gradient(0deg, rgba(0,0,0,.82), rgba(0,0,0,.28) 30%, transparent 56%);
    }

    .x-player.controls-visible .x-controls,
    .x-player:not(.is-playing) .x-controls {
      opacity: 1;
    }

    .x-topbar {
      pointer-events: none;
      padding: 13px 14px 0;
      min-width: 0;
    }

    .x-title {
      max-width: min(720px, 78vw);
      color: rgba(255,255,255,.94);
      font-size: 13px;
      line-height: 1.25;
      font-weight: 850;
      letter-spacing: -.015em;
      text-shadow: 0 2px 12px rgba(0,0,0,.78);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .x-control-bottom {
      pointer-events: auto;
      padding: 0 14px 13px;
      display: grid;
      gap: 10px;
    }

    .x-seek-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      color: rgba(255,255,255,.92);
      font-size: 12px;
      font-weight: 850;
      text-shadow: 0 2px 8px rgba(0,0,0,.70);
    }

    .x-seek {
      width: 100%;
      height: 18px;
      margin: 0;
      appearance: none;
      -webkit-appearance: none;
      background: transparent;
      cursor: pointer;
    }

    .x-seek::-webkit-slider-runnable-track {
      height: 4px;
      border-radius: 999px;
      background: linear-gradient(90deg, #ffcf4f var(--x-progress, 0%), rgba(255,255,255,.30) var(--x-progress, 0%));
    }

    .x-seek::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 13px;
      height: 13px;
      margin-top: -4.5px;
      border-radius: 999px;
      background: white;
      box-shadow: 0 3px 12px rgba(0,0,0,.45);
    }

    .x-seek::-moz-range-track {
      height: 4px;
      border-radius: 999px;
      background: rgba(255,255,255,.30);
    }

    .x-seek::-moz-range-progress {
      height: 4px;
      border-radius: 999px;
      background: #ffcf4f;
    }

    .x-seek::-moz-range-thumb {
      width: 13px;
      height: 13px;
      border: 0;
      border-radius: 999px;
      background: white;
      box-shadow: 0 3px 12px rgba(0,0,0,.45);
    }

    .x-buttons {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .x-btn {
      width: 42px;
      height: 42px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      padding: 0;
      background: rgba(255,255,255,.075);
      border: 1px solid rgba(255,255,255,.13);
      color: white;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: 0 12px 34px rgba(0,0,0,.24);
    }

    .x-btn svg {
      width: 20px;
      height: 20px;
      display: block;
      fill: currentColor;
    }

    .x-btn.main {
      width: 50px;
      height: 50px;
      background: rgba(255,255,255,.16);
    }

    .x-btn.main svg {
      width: 22px;
      height: 22px;
    }

    .x-btn:active {
      transform: scale(.93);
    }

    .x-btn[disabled] {
      opacity: .30;
      cursor: not-allowed;
      transform: none;
    }

    .x-grow {
      flex: 1 1 auto;
      min-width: 0;
    }

    @media (hover: hover) {
      .x-btn:hover {
        background: rgba(255,255,255,.16);
      }
    }

    @media (max-width: 640px) {
      .x-topbar {
        padding: 10px 10px 0;
      }

      .x-title {
        font-size: 12px;
        max-width: 82vw;
      }

      .x-control-bottom {
        padding: 0 10px 10px;
        gap: 8px;
      }

      .x-buttons {
        gap: 6px;
      }

      .x-btn {
        width: 38px;
        height: 38px;
      }

      .x-btn.main {
        width: 44px;
        height: 44px;
      }

      .x-btn svg {
        width: 18px;
        height: 18px;
      }

      .x-btn.main svg {
        width: 20px;
        height: 20px;
      }

      .x-seek-row {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px;
        font-size: 11px;
      }
    }

    @media (orientation: landscape) and (max-height: 520px) {
      .x-topbar {
        padding: 7px 10px 0;
      }

      .x-control-bottom {
        padding: 0 10px 7px;
        gap: 6px;
      }

      .x-title {
        font-size: 12px;
      }

      .x-btn {
        width: 36px;
        height: 36px;
      }

      .x-btn.main {
        width: 42px;
        height: 42px;
      }

      .x-seek-row {
        font-size: 11px;
      }
    }


  
    .profile-menu.is-hidden {
      display: none;
    }

    .vip-qr {
      width: min(230px, 72vw);
      height: auto;
      max-height: min(230px, 72vw);
      aspect-ratio: auto;
      object-fit: contain;
      padding: 8px;
      border: 0;
      background: #fff;
    }


  
    /* v16.6: QR không bị player 16:9 cắt mất */
    .player:has(.vip-box) {
      overflow: visible;
    }

    .player-box:has(.vip-box) {
      aspect-ratio: auto;
      height: auto;
      min-height: min(620px, calc(100svh - 120px));
      overflow: visible;
      background: transparent;
    }

    .player-box:has(.vip-box) .vip-box {
      min-height: min(620px, calc(100svh - 120px));
      align-items: start;
      padding: 22px 14px 24px;
    }

    .player-box:has(.vip-box) .vip-box > div {
      width: min(430px, 100%);
      display: grid;
      justify-items: center;
    }

    .player-box:has(.vip-box) .vip-qr {
      width: min(260px, 82vw);
      max-width: 100%;
      height: auto;
      max-height: none;
      aspect-ratio: auto;
      object-fit: contain;
      object-position: center;
      display: block;
      padding: 10px;
      margin: 14px auto 0;
      background: #fff;
      border: 0;
      border-radius: 18px;
      box-shadow: 0 14px 42px rgba(0,0,0,.34);
    }

    @supports not selector(:has(*)) {
      .vip-box {
        min-height: 480px;
      }

      .vip-qr {
        width: min(260px, 82vw);
        height: auto;
        object-fit: contain;
      }
    }

    /* v16.6: fullscreen giả cho mobile/iOS để giữ custom toolbar */
    body.x-lock-scroll {
      overflow: hidden !important;
      touch-action: none;
    }

    .player-box.x-fake-fullscreen {
      position: fixed !important;
      inset: 0 !important;
      z-index: 9999 !important;
      width: 100vw !important;
      height: 100dvh !important;
      min-height: 100dvh !important;
      aspect-ratio: auto !important;
      border-radius: 0 !important;
      background: #000 !important;
    }

    .player-box.x-fake-fullscreen .x-player,
    .player-box.x-fake-fullscreen video {
      width: 100vw !important;
      height: 100dvh !important;
      object-fit: contain !important;
    }

    @supports (height: 100svh) {
      .player-box.x-fake-fullscreen {
        height: 100svh !important;
        min-height: 100svh !important;
      }

      .player-box.x-fake-fullscreen .x-player,
      .player-box.x-fake-fullscreen video {
        height: 100svh !important;
      }
    }


  
    /* v16.7: mobile fullscreen full khi đang dọc + giữ custom controls */
    .player-box.x-fake-fullscreen {
      inset: 0 !important;
      transform: none;
      transform-origin: center center;
      overflow: hidden !important;
    }

    .player-box.x-fake-fullscreen.x-rotate-landscape {
      inset: auto !important;
      left: 50% !important;
      top: 50% !important;
      width: 100dvh !important;
      height: 100dvw !important;
      min-height: 100dvw !important;
      max-width: none !important;
      max-height: none !important;
      transform: translate(-50%, -50%) rotate(90deg) !important;
      border-radius: 0 !important;
    }

    .player-box.x-fake-fullscreen.x-rotate-landscape .x-player,
    .player-box.x-fake-fullscreen.x-rotate-landscape video {
      width: 100dvh !important;
      height: 100dvw !important;
      min-height: 100dvw !important;
      object-fit: contain !important;
    }

    @supports (width: 100svh) {
      .player-box.x-fake-fullscreen.x-rotate-landscape {
        width: 100svh !important;
        height: 100svw !important;
        min-height: 100svw !important;
      }

      .player-box.x-fake-fullscreen.x-rotate-landscape .x-player,
      .player-box.x-fake-fullscreen.x-rotate-landscape video {
        width: 100svh !important;
        height: 100svw !important;
        min-height: 100svw !important;
      }
    }

    .player-box.x-fake-fullscreen.x-rotate-landscape .x-controls {
      border-radius: 0;
    }

    /* v16.7: hh.gif hiển thị đủ, không bị crop */
    .player:has(.vip-box) {
      overflow: visible;
    }

    .player-box:has(.vip-box) {
      aspect-ratio: auto;
      height: auto;
      min-height: min(620px, calc(100svh - 120px));
      overflow: visible;
      background: transparent;
    }

    .player-box:has(.vip-box) .vip-box {
      min-height: min(620px, calc(100svh - 120px));
      align-items: start;
      padding: 22px 14px 24px;
    }

    .player-box:has(.vip-box) .vip-box > div {
      width: min(430px, 100%);
      display: grid;
      justify-items: center;
    }

    .player-box:has(.vip-box) .vip-qr,
    .vip-qr {
      width: min(260px, 82vw);
      max-width: 100%;
      height: auto;
      max-height: none;
      aspect-ratio: auto;
      object-fit: contain;
      object-position: center;
      display: block;
      padding: 10px;
      margin: 14px auto 0;
      background: #fff;
      border: 0;
      border-radius: 18px;
      box-shadow: 0 14px 42px rgba(0,0,0,.34);
    }


  
    /* v16.8: Mobile fullscreen không ép xoay. Dọc thì full dọc, ngang thì full ngang theo xoay màn hình thật. */
    .player-box.x-fake-fullscreen,
    .player-box.x-fake-fullscreen.x-rotate-landscape {
      position: fixed !important;
      inset: 0 !important;
      left: 0 !important;
      top: 0 !important;
      z-index: 9999 !important;
      width: 100vw !important;
      height: 100dvh !important;
      min-height: 100dvh !important;
      max-width: none !important;
      max-height: none !important;
      aspect-ratio: auto !important;
      transform: none !important;
      border-radius: 0 !important;
      background: #000 !important;
      overflow: hidden !important;
    }

    .player-box.x-fake-fullscreen .x-player,
    .player-box.x-fake-fullscreen video,
    .player-box.x-fake-fullscreen.x-rotate-landscape .x-player,
    .player-box.x-fake-fullscreen.x-rotate-landscape video {
      width: 100vw !important;
      height: 100dvh !important;
      min-height: 100dvh !important;
      object-fit: contain !important;
    }

    @supports (height: 100svh) {
      .player-box.x-fake-fullscreen,
      .player-box.x-fake-fullscreen.x-rotate-landscape {
        height: 100svh !important;
        min-height: 100svh !important;
      }

      .player-box.x-fake-fullscreen .x-player,
      .player-box.x-fake-fullscreen video,
      .player-box.x-fake-fullscreen.x-rotate-landscape .x-player,
      .player-box.x-fake-fullscreen.x-rotate-landscape video {
        height: 100svh !important;
        min-height: 100svh !important;
      }
    }


  
    /* v16.9: fullscreen mobile dùng visualViewport thật để hết thừa mép iOS/Android */
    html.x-fs-root,
    body.x-fs-root,
    body.x-lock-scroll {
      width: 100% !important;
      height: 100% !important;
      min-height: 100% !important;
      overflow: hidden !important;
      overscroll-behavior: none !important;
      touch-action: none !important;
      background: #000 !important;
    }

    .player-box.x-fake-fullscreen,
    .player-box.x-fake-fullscreen.x-rotate-landscape {
      position: fixed !important;
      left: var(--x-fs-left, 0px) !important;
      top: var(--x-fs-top, 0px) !important;
      right: auto !important;
      bottom: auto !important;
      z-index: 2147483647 !important;
      width: var(--x-fs-width, 100vw) !important;
      height: var(--x-fs-height, 100dvh) !important;
      min-width: var(--x-fs-width, 100vw) !important;
      min-height: var(--x-fs-height, 100dvh) !important;
      max-width: var(--x-fs-width, 100vw) !important;
      max-height: var(--x-fs-height, 100dvh) !important;
      margin: 0 !important;
      padding: 0 !important;
      aspect-ratio: auto !important;
      transform: none !important;
      border: 0 !important;
      border-radius: 0 !important;
      outline: 0 !important;
      background: #000 !important;
      overflow: hidden !important;
      contain: strict;
    }

    .player-box.x-fake-fullscreen .x-player,
    .player-box.x-fake-fullscreen.x-rotate-landscape .x-player {
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      background: #000 !important;
      overflow: hidden !important;
    }

    .player-box.x-fake-fullscreen video,
    .player-box.x-fake-fullscreen.x-rotate-landscape video {
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      object-fit: contain !important;
      background: #000 !important;
    }

    .player-box.x-fake-fullscreen .x-controls {
      inset: 0 !important;
      width: 100% !important;
      height: 100% !important;
      border-radius: 0 !important;
    }

    .player-box.x-fake-fullscreen .x-hotzones {
      inset: 0 !important;
      width: 100% !important;
      height: 100% !important;
    }


  
    /* v17: theme hồng nhạt nhưng vẫn đen */
    body {
      background:
        radial-gradient(circle at top left, rgba(255,111,174,.25), transparent 34%),
        radial-gradient(circle at top right, rgba(255,166,212,.16), transparent 30%),
        var(--bg);
    }

    .search-btn,
    .login-btn,
    .primary-btn,
    .vip-chip,
    .ep.active,
    .profile-tab-btn.active,
    .status-badge.vip,
    .history-check.checked {
      background: linear-gradient(135deg, rgba(255,111,174,.96), rgba(255,166,212,.78));
      box-shadow: 0 16px 42px rgba(255,111,174,.16);
    }

    .source-tab.active {
      background: linear-gradient(135deg, rgba(255,111,174,.92), rgba(255,166,212,.70));
      box-shadow: 0 12px 30px rgba(255,111,174,.14);
    }

    .global-notice {
      background:
        radial-gradient(circle at top left, rgba(255,111,174,.30), transparent 44%),
        linear-gradient(135deg, rgba(255,111,174,.20), rgba(255,166,212,.11));
      border-color: rgba(255,166,212,.30);
      box-shadow: 0 14px 38px rgba(255,111,174,.10), 0 16px 40px rgba(0,0,0,.22);
    }

    .global-notice::before {
      background: linear-gradient(135deg, #ff6fae, #ffa6d4);
      box-shadow: 0 10px 24px rgba(255,111,174,.26);
    }

    .profile-hero {
      background:
        radial-gradient(circle at top left, rgba(255,111,174,.16), transparent 44%),
        rgba(255,255,255,.065);
    }

    /* v17: VIP block gọn hơn, không kéo dài xấu */
    .player.vip-player {
      background: transparent;
      border: 0;
      box-shadow: none;
      overflow: visible;
      margin-bottom: 12px;
    }

    .player.vip-player .player-box {
      aspect-ratio: auto !important;
      height: auto !important;
      min-height: 0 !important;
      overflow: visible !important;
      background: transparent !important;
    }

    .player.vip-player .vip-box,
    .player-box:has(.vip-box) .vip-box {
      min-height: 0 !important;
      width: 100%;
      padding: 24px 14px 26px;
      border-radius: 24px;
      background:
        radial-gradient(circle at 35% 5%, rgba(255,111,174,.18), transparent 36%),
        linear-gradient(180deg, rgba(20,20,24,.90), rgba(8,8,10,.96));
      border: 1px solid rgba(255,166,212,.16);
      box-shadow: 0 18px 52px rgba(0,0,0,.30);
      display: grid;
      place-items: center;
    }

    .player.vip-player .vip-box > div,
    .player-box:has(.vip-box) .vip-box > div {
      width: min(420px, 100%);
      display: grid;
      justify-items: center;
      text-align: center;
    }

    .vip-box strong {
      font-size: clamp(21px, 5.4vw, 30px);
      line-height: 1.08;
    }

    .vip-box p {
      margin-top: 8px;
      font-size: 14px;
    }

    .player.vip-player .vip-qr,
    .player-box:has(.vip-box) .vip-qr,
    .vip-qr {
      width: min(250px, 72vw) !important;
      max-width: 100% !important;
      height: auto !important;
      max-height: none !important;
      aspect-ratio: auto !important;
      object-fit: contain !important;
      padding: 8px !important;
      border: 0 !important;
      background: #fff !important;
      border-radius: 20px !important;
      box-shadow: 0 16px 42px rgba(0,0,0,.36);
    }

    /* v17: mobile web fake fullscreen bám sát viewport, hạn chế hở mép iOS/Android */
    .player-box.x-fake-fullscreen {
      position: fixed !important;
      left: 0 !important;
      top: 0 !important;
      right: auto !important;
      bottom: auto !important;
      width: var(--x-fs-width, 100vw) !important;
      height: var(--x-fs-height, 100vh) !important;
      min-width: var(--x-fs-width, 100vw) !important;
      min-height: var(--x-fs-height, 100vh) !important;
      max-width: var(--x-fs-width, 100vw) !important;
      max-height: var(--x-fs-height, 100vh) !important;
      transform: translate3d(var(--x-fs-left, 0px), var(--x-fs-top, 0px), 0) !important;
      background: #000 !important;
      border-radius: 0 !important;
      border: 0 !important;
      z-index: 2147483647 !important;
      overscroll-behavior: none !important;
    }

    .player-box.x-fake-fullscreen .x-player,
    .player-box.x-fake-fullscreen video {
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      object-fit: contain !important;
    }

    body.x-lock-scroll #app {
      overflow: hidden !important;
      height: 100vh !important;
    }


  
    /* v17.1 movie tags */
    .tag-strip {
      width: min(1080px, 100%);
      margin: 0 auto 14px;
      overflow-x: auto;
      display: flex;
      gap: 9px;
      padding: 2px 1px 6px;
      overscroll-behavior-x: contain;
      scrollbar-width: none;
      mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 32px), transparent 100%);
    }

    .tag-strip::-webkit-scrollbar {
      display: none;
    }

    .movie-tag {
      flex: 0 0 auto;
      min-height: 42px;
      padding: 0 18px;
      border-radius: 999px;
      background: rgba(255,255,255,.065);
      border: 1px solid rgba(255,255,255,.12);
      color: rgba(255,255,255,.78);
      font-weight: 900;
      letter-spacing: -.015em;
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .movie-tag.active {
      color: white;
      background: linear-gradient(135deg, rgba(255,111,174,.96), rgba(255,166,212,.78));
      border-color: rgba(255,255,255,.18);
      box-shadow: 0 14px 36px rgba(255,111,174,.16);
    }

    @media (min-width: 700px) {
      .tag-strip {
        padding-left: 1px;
        padding-right: 1px;
        gap: 10px;
      }

      .movie-tag {
        min-height: 44px;
        padding: 0 21px;
        font-size: 15px;
      }
    }


  

/* =========================================================
   XeMCL v18 Anime Glassmorphism UI Refresh
   - bg.gif vẫn là thương hiệu
   - tone hồng / đen / anime
   - chỉ polish UI, giữ logic cũ
========================================================= */
:root {
  --bg: #05030a;
  --panel: rgba(255,255,255,.072);
  --line: rgba(255,255,255,.14);
  --text: #fff7fb;
  --muted: rgba(255,247,251,.66);
  --brand: #ff74b7;
  --brand2: #ffaad6;
  --brand3: #b86bff;
  --glass: rgba(18, 10, 27, .56);
  --glass-2: rgba(255,255,255,.075);
  --glow: 0 24px 80px rgba(255,116,183,.16);
  --shadow-soft: 0 18px 60px rgba(0,0,0,.34);
}

html { background: #05030a; }

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(255,116,183,.22), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(184,107,255,.16), transparent 30%),
    radial-gradient(circle at 50% 110%, rgba(255,170,214,.10), transparent 38%),
    #05030a;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at top, #000 0%, transparent 70%);
}

.hero-header {
  position: relative;
  padding-top: calc(13px + var(--safe-top));
}

.brand-row {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 2px;
}

.brand,
.avatar-btn,
.search,
.panel,
.card,
.movie-head,
.history-page-card,
.profile-menu,
.sheet,
.login-card,
.loading-card,
.ban-card {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.055));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.brand {
  min-height: 58px;
  border-radius: 22px;
  padding: 7px 14px 7px 7px;
}

.logo-box {
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(255,116,183,.26);
}

.brand-title strong {
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #ff9cca;
  font-size: 17px;
}

.brand-title em {
  font-size: 12px;
  color: rgba(255,247,251,.92);
}

.avatar-btn {
  width: 50px;
  height: 50px;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(255,116,183,.14), 0 16px 44px rgba(0,0,0,.32);
}

.banner {
  width: min(1120px, calc(100% + 24px));
  margin: 14px auto 0;
  border-radius: 0 0 30px 30px;
  border: 1px solid rgba(255,255,255,.11);
  height: clamp(210px, 37vw, 420px);
  box-shadow: 0 26px 90px rgba(0,0,0,.46), 0 0 80px rgba(255,116,183,.10);
}

.banner-img {
  background-image:
    linear-gradient(180deg, rgba(5,3,10,.10), rgba(5,3,10,.24)),
    url("../assets/bg.gif");
  transform: scale(1.035);
  filter: saturate(1.16) contrast(1.06) brightness(.96);
}

.search-sticky {
  padding-top: 12px;
}

.search {
  min-height: 56px;
  border-radius: 999px;
  background: rgba(16,9,24,.58);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 18px 48px rgba(0,0,0,.30), 0 0 40px rgba(255,116,183,.08);
}

.search-btn,
.login-btn,
.primary-btn,
.vip-chip,
.ep.active,
.profile-tab-btn.active,
.status-badge.vip,
.history-check.checked,
.movie-tag.active,
.source-tab.active {
  background: linear-gradient(135deg, rgba(255,116,183,.98), rgba(255,170,214,.75));
  box-shadow: 0 16px 42px rgba(255,116,183,.20);
}

.main {
  width: min(1120px, 100%);
  padding-bottom: 34px;
}

.tag-strip {
  margin-top: 4px;
  margin-bottom: 18px;
}

.movie-tag {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 12px 38px rgba(0,0,0,.18);
}

.section {
  align-items: center;
  padding: 2px 2px 6px;
}

.section h1,
.history-page-head h1 {
  font-size: clamp(26px, 6vw, 48px);
  line-height: .96;
  letter-spacing: -.065em;
  text-shadow: 0 14px 46px rgba(0,0,0,.38);
}

.section p,
.history-page-head p {
  color: rgba(255,247,251,.62);
  font-weight: 650;
}

.mini-btn,
.sheet-btn,
.back,
.clear-btn,
.search-btn,
.profile-menu-btn,
.ep,
.source-tab,
.movie-tag {
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

@media (hover: hover) {
  .card:hover,
  .related-part-card:hover,
  .history-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255,170,214,.28);
    box-shadow: 0 26px 70px rgba(0,0,0,.34), 0 0 44px rgba(255,116,183,.12);
  }

  .movie-tag:hover,
  .mini-btn:hover,
  .sheet-btn:hover,
  .back:hover,
  .ep:hover,
  .source-tab:hover,
  .profile-menu-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.12);
  }
}

.grid {
  gap: 13px;
}

.card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.065);
  transform: translateZ(0);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 46%, rgba(5,3,10,.86) 100%);
  opacity: .62;
}

.poster-wrap {
  border-radius: inherit;
  overflow: hidden;
}

.poster {
  transform: scale(1.01);
  transition: transform .32s ease, filter .32s ease;
}

@media (hover: hover) {
  .card:hover .poster {
    transform: scale(1.065);
    filter: saturate(1.14) contrast(1.05);
  }
}

.badge {
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(12,6,18,.62);
  border-color: rgba(255,255,255,.18);
}

.card-info {
  position: relative;
  z-index: 2;
  padding: 10px 11px 13px;
}

.card-title {
  font-size: 14px;
  min-height: 38px;
  color: #fff;
}

.card-sub {
  color: rgba(255,247,251,.66);
}

.detail-header {
  background: linear-gradient(180deg, rgba(5,3,10,.92), rgba(5,3,10,.66));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.back {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255,255,255,.09);
}

.detail-main {
  width: min(1040px, 100%);
}

.player {
  border-radius: 26px;
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 24px 80px rgba(0,0,0,.42), 0 0 60px rgba(255,116,183,.08);
}

.movie-head {
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  border-radius: 28px;
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(255,116,183,.16), transparent 42%),
    rgba(255,255,255,.070);
}

.detail-poster {
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}

.movie-title {
  font-size: clamp(26px, 7vw, 52px);
  text-shadow: 0 16px 50px rgba(0,0,0,.40);
}

.chip {
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.13);
}

.panel {
  border-radius: 24px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.088), rgba(255,255,255,.052));
}

.panel h2 {
  font-size: 20px;
  letter-spacing: -.045em;
}

.episodes {
  gap: 9px;
}

.ep {
  min-height: 46px;
  border-radius: 16px;
  background: rgba(255,255,255,.075);
}

.related-part-card,
.history-item {
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 14px 42px rgba(0,0,0,.20);
}

.related-part-card {
  border-radius: 20px;
  flex-basis: min(210px, 54vw);
}

.related-part-card img {
  width: 58px;
  border-radius: 14px;
}

.profile-menu {
  border-radius: 26px;
  background: rgba(18,10,27,.86);
  box-shadow: 0 28px 90px rgba(0,0,0,.48), 0 0 70px rgba(255,116,183,.12);
}

.profile-menu-user {
  border-radius: 20px;
  background: rgba(255,255,255,.075);
}

.sheet-backdrop {
  background: rgba(0,0,0,.64);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet {
  border-radius: 34px;
  background: rgba(18,10,27,.90);
}

.profile-hero {
  border-radius: 28px;
}

.x-controls {
  background:
    linear-gradient(180deg, rgba(0,0,0,.76), rgba(0,0,0,.22) 25%, transparent 45%),
    linear-gradient(0deg, rgba(0,0,0,.84), rgba(0,0,0,.26) 32%, transparent 58%);
}

.x-btn {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.16);
}

.x-btn.main {
  background: rgba(255,116,183,.22);
  box-shadow: 0 12px 34px rgba(255,116,183,.14);
}

.x-seek::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #ff8fc8 var(--x-progress, 0%), rgba(255,255,255,.30) var(--x-progress, 0%));
}

.player.vip-player .vip-box,
.player-box:has(.vip-box) .vip-box {
  border-radius: 30px;
  background:
    radial-gradient(circle at 35% 5%, rgba(255,116,183,.20), transparent 36%),
    linear-gradient(180deg, rgba(20,12,28,.92), rgba(8,5,12,.96));
}

@media (min-width: 720px) {
  .movie-head {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
  }

  .detail-poster {
    width: 180px;
  }

  .grid {
    gap: 16px;
  }
}

@media (min-width: 1050px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .panel,
  .movie-head,
  .player,
  .history-page-card {
    animation: softIn .34s ease both;
  }

  @keyframes softIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}



/* v18.2 fixes: desktop tag navigation + pagination */
.tag-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(1080px, 100%);
  margin: 0 auto 14px;
}

.tag-shell .tag-strip {
  width: 100%;
  margin: 0;
  scroll-behavior: smooth;
  cursor: grab;
  mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.tag-shell .tag-strip.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.tag-scroll-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.085);
  border: 1px solid rgba(255,255,255,.13);
  color: white;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tag-scroll-btn:active {
  transform: scale(.94);
}

.home-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 8px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.10);
}

.home-pagination span {
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 850;
  min-width: 88px;
  text-align: center;
}

.page-btn[disabled] {
  opacity: .38;
  pointer-events: none;
}

@media (max-width: 700px) {
  .tag-shell {
    display: block;
    margin-bottom: 14px;
  }

  .tag-scroll-btn {
    display: none;
  }

  .tag-shell .tag-strip {
    width: min(1080px, 100%);
    margin: 0 auto;
    cursor: auto;
  }

  .home-pagination {
    margin-top: 18px;
    padding: 10px;
    gap: 8px;
  }

  .home-pagination .page-btn {
    min-height: 40px;
    padding: 0 10px;
    font-size: 13px;
  }

  .home-pagination span {
    min-width: 70px;
    font-size: 12px;
  }
}



/* v18.3: tag strip PC kéo trực tiếp, không dùng button */
.tag-shell.no-buttons,
.tag-shell {
  display: block !important;
  width: min(1080px, 100%);
  margin: 0 auto 14px;
  position: relative;
}

.tag-scroll-btn {
  display: none !important;
}

.tag-shell .tag-strip,
#tagStrip {
  width: 100% !important;
  margin: 0 auto !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x;
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

#tagStrip.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

#tagStrip .movie-tag {
  cursor: pointer;
}

#tagStrip.dragging .movie-tag {
  cursor: grabbing;
}

#tagStrip::-webkit-scrollbar {
  height: 0;
}

@media (hover: hover) and (pointer: fine) {
  #tagStrip {
    scrollbar-width: none;
  }

  #tagStrip::-webkit-scrollbar {
    display: none;
  }
}



/* v18.4: history và episode list không làm phình layout */
.history-list,
.history-page-list,
.history-items,
.profile-history-list {
  max-height: min(560px, 62svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
}

.history-list::-webkit-scrollbar,
.history-page-list::-webkit-scrollbar,
.history-items::-webkit-scrollbar,
.profile-history-list::-webkit-scrollbar,
.episodes::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.history-list::-webkit-scrollbar-thumb,
.history-page-list::-webkit-scrollbar-thumb,
.history-items::-webkit-scrollbar-thumb,
.profile-history-list::-webkit-scrollbar-thumb,
.episodes::-webkit-scrollbar-thumb {
  background: rgba(255,112,187,.42);
  border-radius: 999px;
}

/* Danh sách tập dài: giữ khung gọn, cuộn trong khung */
.episodes {
  max-height: min(440px, 54svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  align-content: start;
}

/* Ô tìm tập + nhảy tập */
.episode-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin: 0 0 12px;
}

.episode-search {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 0 13px;
  color: white;
  background: rgba(255,255,255,.065);
  outline: none;
}

.episode-select {
  min-height: 42px;
  max-width: 180px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 0 10px;
  color: white;
  background: rgba(28,22,35,.94);
  outline: none;
}

.episode-count {
  margin: -4px 0 10px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-weight: 750;
}

.x-feedback {
  display: none !important;
}

@media (max-width: 640px) {
  .history-list,
  .history-page-list,
  .history-items,
  .profile-history-list {
    max-height: min(520px, 58svh);
  }

  .episodes {
    max-height: min(390px, 48svh);
  }

  .episode-tools {
    grid-template-columns: 1fr;
  }

  .episode-select {
    max-width: none;
    width: 100%;
  }
}



/* v18.5: PC rộng hơn, giảm đen hai bên */
@media (min-width: 1200px) {
  .main,
  .v18-main {
    width: min(1480px, calc(100% - 48px)) !important;
    max-width: none !important;
  }

  .hero-header,
  .v18-clean-header,
  .v18-bg-banner {
    width: min(1480px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
  }

  .v18-topbar {
    border-radius: 0 0 24px 24px;
  }

  .grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1600px) {
  .main,
  .v18-main,
  .hero-header,
  .v18-clean-header,
  .v18-bg-banner {
    width: min(1680px, calc(100% - 64px)) !important;
  }

  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }
}

/* v18.5: hover info trên PC */
.hover-info {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .v18-card,
  .card {
    position: relative;
  }

  .v18-card:hover {
    z-index: 30;
  }

  .v18-card .hover-info {
    position: absolute;
    left: calc(100% + 12px);
    top: 18px;
    width: 280px;
    max-width: min(280px, 34vw);
    display: block;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(.98);
    transition: opacity .18s ease, transform .18s ease;
    padding: 14px;
    border-radius: 20px;
    background: rgba(18, 12, 24, .94);
    border: 1px solid rgba(255,255,255,.13);
    box-shadow: 0 24px 70px rgba(0,0,0,.42);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .grid .v18-card:nth-child(6n) .hover-info,
  .grid .v18-card:nth-child(7n) .hover-info,
  .grid .v18-card:nth-child(8n) .hover-info {
    left: auto;
    right: calc(100% + 12px);
  }

  .v18-card:hover .hover-info {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .hover-info strong {
    display: block;
    color: white;
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 4px;
  }

  .hover-info em {
    display: block;
    color: rgba(255,255,255,.58);
    font-style: normal;
    font-size: 12px;
    margin-bottom: 9px;
  }

  .hover-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 9px;
  }

  .hover-chips span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,112,187,.16);
    color: rgba(255,255,255,.88);
    font-size: 11px;
    font-weight: 850;
  }

  .hover-info p {
    color: rgba(255,255,255,.70);
    font-size: 12px;
    line-height: 1.45;
  }
}

/* v18.5: filter modal */
.filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3,2,6,.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.filter-sheet {
  width: min(720px, 100%);
  max-height: min(760px, 88svh);
  overflow: auto;
  border-radius: 28px;
  padding: 20px;
  background: rgba(18, 12, 24, .96);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 28px 90px rgba(0,0,0,.50);
}

.filter-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-head h2 {
  font-size: 28px;
  margin: 0 0 6px;
}

.filter-head p {
  color: rgba(255,255,255,.62);
  margin: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: white;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 22px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.filter-field {
  display: grid;
  gap: 7px;
}

.filter-field span {
  color: rgba(255,255,255,.68);
  font-size: 13px;
  font-weight: 850;
}

.filter-field select {
  min-height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.075);
  color: white;
  padding: 0 12px;
  outline: none;
}

.filter-field option {
  background: #17101f;
  color: white;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.episode-groups {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  margin: -2px 0 8px;
  scrollbar-width: thin;
}

.episode-group {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.11);
  color: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 850;
}

.episode-group.active {
  color: #220815;
  background: linear-gradient(135deg, #ff70bb, #ffc0df);
}

.episode-select {
  display: none !important;
}

@media (max-width: 700px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-sheet {
    border-radius: 24px;
    padding: 16px;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}



/* v18.6 layout/font/UI hard polish */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.012em;
}

/* PC layout phải rộng, không bó vào giữa xấu */
@media (min-width: 1024px) {
  .hero-header,
  .v18-clean-header {
    width: min(1880px, calc(100vw - 48px)) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }

  .v18-topbar {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: auto minmax(280px, 1fr) minmax(320px, 480px) auto !important;
    border-radius: 0 0 28px 28px;
  }

  .v18-bg-banner {
    width: 100% !important;
    max-width: none !important;
    height: clamp(360px, 42vw, 760px) !important;
    margin-inline: auto !important;
    border-radius: 0 0 34px 34px;
  }

  .v18-bg-img {
    background-size: cover !important;
    background-position: center !important;
  }

  .main,
  .v18-main {
    width: min(1880px, calc(100vw - 48px)) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }

  .grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1500px) {
  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1780px) {
  .grid {
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  }
}

/* hover info fix: không bị chìm/không hiện */
.hover-info {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .v18-card,
  .card {
    position: relative !important;
    overflow: visible !important;
  }

  .grid {
    overflow: visible !important;
  }

  .v18-card:hover,
  .card:hover {
    z-index: 80 !important;
  }

  .v18-card .hover-info,
  .card .hover-info {
    position: absolute;
    left: calc(100% + 14px);
    top: 12px;
    width: 300px;
    max-width: min(320px, 36vw);
    display: block !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(.98);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    padding: 15px;
    border-radius: 22px;
    background: rgba(16, 10, 22, .97);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 28px 90px rgba(0,0,0,.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .v18-card:hover .hover-info,
  .card:hover .hover-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .grid .v18-card:nth-child(6n) .hover-info,
  .grid .v18-card:nth-child(7n) .hover-info,
  .grid .v18-card:nth-child(8n) .hover-info,
  .grid .v18-card:nth-child(9n) .hover-info {
    left: auto;
    right: calc(100% + 14px);
  }

  .hover-info strong {
    display: block;
    font-size: 16px;
    line-height: 1.18;
    color: white;
    margin-bottom: 5px;
  }

  .hover-info em {
    display: block;
    color: rgba(255,255,255,.58);
    font-size: 12px;
    font-style: normal;
    margin-bottom: 10px;
  }

  .hover-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
  }

  .hover-chips span {
    min-height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255,112,187,.17);
    color: rgba(255,255,255,.9);
    font-size: 11px;
    font-weight: 850;
  }

  .hover-info p {
    margin: 0;
    color: rgba(255,255,255,.70);
    font-size: 12px;
    line-height: 1.46;
  }
}

/* pagination icon-only */
.home-pagination {
  gap: 12px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 6px 0 2px !important;
}

.home-pagination .page-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 30px !important;
  line-height: 1 !important;
  background: rgba(255,255,255,.08) !important;
}

.home-pagination span {
  min-width: 96px;
}

/* footer credit */
.v18-footer {
  margin: 70px 0 22px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 34px;
  background:
    radial-gradient(circle at top left, rgba(255,112,187,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 28px 80px rgba(0,0,0,.26);
}

.footer-love {
  width: max-content;
  max-width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(209,22,55,.92), rgba(148,18,36,.88));
  color: white;
  font-weight: 950;
  margin-bottom: 34px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand img {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  object-fit: cover;
}

.footer-brand strong {
  display: block;
  color: white;
  font-size: clamp(28px, 4vw, 42px);
  line-height: .92;
  letter-spacing: .16em;
}

.footer-brand em {
  display: block;
  margin-top: 7px;
  color: rgba(255,255,255,.70);
  font-style: normal;
  font-size: 14px;
}

.footer-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-left: 24px;
  border-left: 1px solid rgba(255,255,255,.14);
}

.footer-socials span {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.075);
  color: rgba(255,255,255,.78);
  font-weight: 900;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 38px;
  color: rgba(255,255,255,.88);
  font-weight: 900;
}

.footer-desc {
  max-width: 980px;
  margin: 28px 0 0;
  color: rgba(255,255,255,.62);
  font-size: 16px;
  line-height: 1.7;
}

.footer-copy {
  margin: 28px 0 0;
  color: rgba(255,255,255,.88);
  font-size: 16px;
  font-weight: 850;
}

.filter-sheet {
  animation: filterPop .16s ease both;
}

@keyframes filterPop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
  .v18-footer {
    margin-top: 44px;
    padding: 22px;
    border-radius: 28px;
  }

  .footer-love {
    margin-bottom: 24px;
  }

  .footer-brand-row {
    gap: 18px;
  }

  .footer-socials {
    padding-left: 0;
    border-left: 0;
  }

  .footer-links {
    margin-top: 28px;
    gap: 14px 20px;
  }

  .footer-desc {
    font-size: 14px;
  }
}



/* v18.7: PC layout thật sự rộng + banner full-style */
.brand-title strong,
.v18-brand .brand-title strong,
.footer-brand strong {
  text-transform: none !important;
}

@media (min-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  .hero-header,
  .v18-clean-header {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .v18-topbar {
    width: 100vw !important;
    max-width: none !important;
    min-height: 82px !important;
    padding: calc(14px + var(--safe-top)) clamp(28px, 3.2vw, 70px) 14px !important;
    grid-template-columns: auto minmax(480px, 1fr) minmax(380px, 560px) auto !important;
    gap: clamp(18px, 2.2vw, 38px) !important;
    border-radius: 0 !important;
    background: rgba(7,6,13,.70) !important;
  }

  .v18-brand {
    justify-self: start !important;
    min-width: 270px !important;
    padding: 8px 14px !important;
  }

  .v18-brand .brand-title strong {
    font-size: 24px !important;
    letter-spacing: .08em !important;
  }

  .v18-nav-links {
    justify-content: flex-start !important;
    gap: 10px !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: none;
  }

  .v18-nav-links::-webkit-scrollbar {
    display: none;
  }

  .v18-nav-links button {
    min-height: 44px !important;
    padding: 0 18px !important;
    white-space: nowrap !important;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
  }

  .v18-search {
    height: 52px !important;
    border-radius: 19px !important;
  }

  .profile-menu-wrap {
    justify-self: end !important;
  }

  .v18-bg-banner {
    width: 100vw !important;
    max-width: none !important;
    height: clamp(520px, 72vh, 860px) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }

  .v18-bg-img {
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
  }

  .main,
  .v18-main {
    width: min(1680px, calc(100vw - 76px)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-top: 28px !important;
  }

  .grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .v18-card:nth-child(n+15),
  .card:nth-child(n+15) {
    display: none !important;
  }
}

@media (min-width: 1700px) {
  .main,
  .v18-main {
    width: min(1780px, calc(100vw - 96px)) !important;
  }

  .grid {
    gap: 20px !important;
  }
}

/* Thông báo không kéo dài vô cớ trên PC */
@media (min-width: 1024px) {
  .global-notice {
    width: min(100%, 980px) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    border-radius: 22px !important;
  }
}

/* icon button/pagination đẹp hơn */
.reload-soft,
.mini-btn,
.primary-btn,
.icon-btn,
.page-btn {
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.reload-soft:hover,
.mini-btn:hover,
.primary-btn:hover,
.icon-btn:hover,
.page-btn:hover {
  transform: translateY(-1px);
}

.home-pagination {
  margin: 18px 0 12px !important;
}

.home-pagination .page-btn {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  font-size: 34px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background:
    radial-gradient(circle at 30% 10%, rgba(255,255,255,.16), transparent 42%),
    rgba(255,255,255,.075) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.22) !important;
}

.home-pagination span {
  min-width: 86px !important;
  padding: 0 10px;
  color: rgba(255,255,255,.62) !important;
}

/* Bộ lọc pro */
.v18-filter-pro {
  position: relative;
  overflow: hidden;
}

.v18-filter-pro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(255,112,187,.24), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(158,113,255,.16), transparent 34%);
  pointer-events: none;
}

.v18-filter-pro > * {
  position: relative;
  z-index: 1;
}

.filter-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,112,187,.16);
  border: 1px solid rgba(255,192,223,.20);
  color: #ffd4eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  margin-bottom: 9px;
}

.filter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.filter-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 850;
}

.filter-chip.active {
  color: #220815;
  background: linear-gradient(135deg, #ff70bb, #ffc0df);
  border-color: rgba(255,255,255,.20);
}

.filter-field {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}

.filter-field select {
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.055)) !important;
  border-color: rgba(255,255,255,.14) !important;
  font-weight: 850;
}

.filter-actions .primary-btn {
  min-width: 150px;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(255,112,187,.20);
}

/* hover card force visible */
@media (hover: hover) and (pointer: fine) {
  .v18-card:hover .hover-info,
  .card:hover .hover-info {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 999 !important;
  }
}

/* Mobile không bị ảnh hưởng bởi PC layout */
@media (max-width: 860px) {
  .v18-topbar {
    width: 100% !important;
  }

  .v18-bg-banner {
    width: 100% !important;
  }

  .grid .v18-card:nth-child(n+15),
  .grid .card:nth-child(n+15) {
    display: block !important;
  }
}



/* ==========================================================
   v18.9 clean PC layout + filter rework
========================================================== */

:root {
  --x-pc-pad: clamp(28px, 4vw, 86px);
  --x-content-max: 1840px;
}

.brand-title strong,
.v18-brand .brand-title strong,
.footer-brand strong {
  text-transform: none !important;
}

@media (min-width: 1024px) {
  body {
    overflow-x: hidden !important;
  }

  .hero-header,
  .v18-clean-header {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .v18-topbar {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: 84px !important;
    padding: calc(14px + var(--safe-top)) var(--x-pc-pad) 14px !important;
    display: grid !important;
    grid-template-columns: minmax(220px, 300px) minmax(520px, 1fr) minmax(360px, 560px) auto !important;
    align-items: center !important;
    gap: clamp(18px, 2.2vw, 42px) !important;
    border-radius: 0 !important;
    background: rgba(7, 6, 13, .72) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    box-sizing: border-box !important;
  }

  .v18-brand,
  .brand {
    justify-self: start !important;
    width: auto !important;
    min-width: 240px !important;
    max-width: 300px !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    border-radius: 22px !important;
  }

  .v18-brand .brand-title strong,
  .brand-title strong {
    font-size: 24px !important;
    letter-spacing: .02em !important;
  }

  .v18-nav-links {
    justify-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    padding: 0 2px !important;
  }

  .v18-nav-links::-webkit-scrollbar {
    display: none !important;
  }

  .v18-nav-links button {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    padding: 0 18px !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
    color: rgba(255,255,255,.78) !important;
    background: rgba(255,255,255,.052) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
  }

  .v18-nav-links button:hover {
    color: #fff !important;
    background: rgba(255,112,187,.18) !important;
    border-color: rgba(255,112,187,.28) !important;
  }

  .v18-search {
    justify-self: stretch !important;
    width: 100% !important;
    height: 52px !important;
    border-radius: 18px !important;
  }

  .profile-menu-wrap {
    justify-self: end !important;
    margin-left: 0 !important;
  }

  .avatar-btn {
    width: 54px !important;
    height: 54px !important;
  }

  .v18-bg-banner {
    width: 100vw !important;
    max-width: none !important;
    height: min(78vh, 820px) !important;
    min-height: 560px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #07060d !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
  }

  .v18-bg-img {
    width: 100% !important;
    height: 100% !important;
    background-image: url("../assets/bg.gif") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    filter: saturate(1.12) contrast(1.05) !important;
  }

  .main,
  .v18-main {
    width: min(var(--x-content-max), calc(100vw - (var(--x-pc-pad) * 2))) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    padding-top: 28px !important;
  }

  .grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 18px !important;
    overflow: visible !important;
  }

  .v18-card:nth-child(n+15),
  .card:nth-child(n+15) {
    display: none !important;
  }
}

@media (min-width: 1600px) {
  :root {
    --x-pc-pad: clamp(42px, 4.5vw, 110px);
    --x-content-max: 1920px;
  }

  .grid {
    gap: 20px !important;
  }
}

/* Thông báo ở giữa, không kéo dài mắc cười */
.global-notice {
  width: min(980px, 100%) !important;
  max-width: 980px !important;
  margin: 0 auto 18px !important;
  border-radius: 22px !important;
}

/* Bộ lọc sạch, không chọn nhanh, cuộn được */
.filter-backdrop {
  padding: 18px !important;
  align-items: center !important;
  justify-items: center !important;
}

.filter-sheet.v18-filter-pro,
.filter-sheet {
  width: min(720px, calc(100vw - 28px)) !important;
  max-height: min(760px, 86svh) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  border-radius: 30px !important;
  padding: 0 !important;
  background:
    radial-gradient(circle at 15% 0%, rgba(255,112,187,.22), transparent 36%),
    rgba(18, 12, 24, .98) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  box-shadow: 0 32px 100px rgba(0,0,0,.55) !important;
}

.filter-head {
  padding: 20px 20px 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

.filter-head h2 {
  margin: 4px 0 6px !important;
  font-size: clamp(26px, 4vw, 36px) !important;
  line-height: .95 !important;
}

.filter-head p {
  max-width: 520px !important;
  color: rgba(255,255,255,.62) !important;
}

.filter-body {
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 16px 20px !important;
  scrollbar-width: thin !important;
}

.filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.filter-field {
  min-width: 0 !important;
  padding: 12px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
}

.filter-field select {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  color: white !important;
  background: rgba(255,255,255,.08) !important;
}

.filter-actions {
  margin: 0 !important;
  padding: 14px 20px 20px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(0,0,0,.12) !important;
}

.filter-quick,
.filter-chip {
  display: none !important;
}

/* Pagination icon-only */
.home-pagination {
  margin: 18px 0 10px !important;
  gap: 12px !important;
  background: transparent !important;
  border: 0 !important;
}

.home-pagination .page-btn {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 34px !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.22) !important;
}

.home-pagination span {
  min-width: 88px !important;
  color: rgba(255,255,255,.62) !important;
}

/* Hover info forced */
.hover-info {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .v18-card,
  .card {
    position: relative !important;
    overflow: visible !important;
  }

  .v18-card:hover,
  .card:hover {
    z-index: 120 !important;
  }

  .v18-card .hover-info,
  .card .hover-info {
    position: absolute !important;
    left: calc(100% + 14px) !important;
    top: 12px !important;
    width: 300px !important;
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(8px) scale(.98) !important;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease !important;
    z-index: 999 !important;
    padding: 15px !important;
    border-radius: 22px !important;
    background: rgba(16, 10, 22, .98) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    box-shadow: 0 28px 90px rgba(0,0,0,.55) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .v18-card:hover .hover-info,
  .card:hover .hover-info {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
  }

  .grid .v18-card:nth-child(6n) .hover-info,
  .grid .v18-card:nth-child(7n) .hover-info {
    left: auto !important;
    right: calc(100% + 14px) !important;
  }
}

/* Mobile giữ layout mobile */
@media (max-width: 860px) {
  .v18-topbar {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .v18-bg-banner {
    width: 100% !important;
    min-height: 190px !important;
    height: min(62vw, 330px) !important;
  }

  .filter-grid {
    grid-template-columns: 1fr !important;
  }

  .filter-sheet.v18-filter-pro,
  .filter-sheet {
    max-height: min(680px, 88svh) !important;
    border-radius: 24px !important;
  }

  .filter-head {
    padding: 16px 16px 12px !important;
  }

  .filter-body {
    padding: 14px 16px !important;
  }

  .filter-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 12px 16px 16px !important;
  }
}



/* ==========================================================
   v19: list page logic + mobile safe zone polish
========================================================== */

html,
body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  background: #07060d !important;
}

body {
  overscroll-behavior-x: none !important;
}

#app {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
  background: #07060d !important;
}

/* Chống mobile vuốt làm cả web lệch trái/phải */
* {
  box-sizing: border-box;
}

img,
video,
iframe {
  max-width: 100%;
}

/* Home có banner, list page thì bỏ banner/tag để qua trang không phải cuộn */
.list-page-main {
  padding-top: clamp(12px, 2vw, 22px) !important;
}

.list-page-main .v18-section-head {
  margin-top: 4px !important;
}

/* Tag hover không trắng */
.movie-tag:hover,
.tag-strip .movie-tag:hover,
#tagStrip .movie-tag:hover {
  color: #fff !important;
  background: rgba(255,112,187,.16) !important;
  border-color: rgba(255,160,210,.30) !important;
}

.movie-tag.active:hover {
  color: #230713 !important;
  background: linear-gradient(135deg, #ff70bb, #ffc0df) !important;
}

/* Phần khác / horizontal scroll không nháy trắng */
.related-parts,
.related-parts-row,
.source-tabs,
.tag-strip,
#tagStrip {
  background: transparent !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
}

.related-parts-row,
.source-tabs {
  scrollbar-width: none !important;
}

.related-parts-row::-webkit-scrollbar,
.source-tabs::-webkit-scrollbar,
.tag-strip::-webkit-scrollbar,
#tagStrip::-webkit-scrollbar {
  display: none !important;
}

.related-part-card:hover,
.source-tab:hover {
  background: rgba(255,112,187,.15) !important;
  border-color: rgba(255,160,210,.28) !important;
}

/* Mobile banner luôn center, không lệch phải */
@media (max-width: 860px) {
  .hero-header,
  .v18-clean-header,
  .v18-bg-banner,
  .v18-bg-img {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
  }

  .v18-bg-banner {
    overflow: hidden !important;
  }

  .v18-bg-img {
    background-position: center center !important;
    background-size: cover !important;
  }

  .main,
  .v18-main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }
}

/* Login/auth full màn, không kéo ra khoảng đen */
.auth-screen,
.login-screen,
.auth-page,
.login-page {
  min-height: 100svh !important;
  overflow: hidden !important;
  background-color: #07060d !important;
}

.auth-screen::before,
.login-screen::before,
.auth-page::before,
.login-page::before {
  background-position: center center !important;
  background-size: cover !important;
}

@supports (height: 100dvh) {
  .auth-screen,
  .login-screen,
  .auth-page,
  .login-page {
    min-height: 100dvh !important;
    height: 100dvh !important;
  }
}

/* Giảm nháy khi mở hồ sơ / chọn lịch sử */
.sheet,
.profile-menu,
.history-item,
.history-card,
.modal,
.filter-sheet {
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tránh nháy trắng chung do tap highlight mobile */
button,
a,
.card,
.movie-tag,
.related-part-card,
.history-item {
  -webkit-tap-highlight-color: transparent !important;
}

/* PC giữ banner to và topbar full */
@media (min-width: 1024px) {
  .v18-bg-banner {
    min-height: 560px !important;
    height: min(78vh, 820px) !important;
  }

  .list-page-main {
    width: min(1680px, calc(100vw - 76px)) !important;
  }
}



/* ==========================================================
   v19.1 header/search/banner/player/fullscreen fix
========================================================== */

html,
body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body {
  overflow-y: auto !important;
}

body.x-lock-scroll {
  overflow: hidden !important;
}

#app {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
}

/* Real topbar layout */
.v19-header,
.hero-header {
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
}

.v19-topbar,
.brand-row {
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: calc(12px + var(--safe-top)) max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-left)) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

.v19-brand,
.brand {
  justify-self: start !important;
  min-width: 0 !important;
  max-width: min(260px, 64vw) !important;
  margin: 0 !important;
}

.v19-profile-wrap,
.profile-menu-wrap {
  justify-self: end !important;
}

.v19-top-nav,
.v19-search-inline {
  display: none;
}

.v19-search-toggle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 20px;
}

.v19-mobile-search-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  transition: grid-template-rows .22s ease, opacity .18s ease, padding .22s ease;
  overflow: hidden;
}

.v19-mobile-search-panel > .search {
  min-height: 0;
}

.v19-mobile-search-panel.active {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-top: 8px;
  padding-bottom: 10px;
}

.v19-header.search-open .v19-brand,
.v19-header.search-open .profile-menu-wrap {
  opacity: .08;
  pointer-events: none;
}

.v19-header.search-open .v19-search-toggle {
  background: linear-gradient(135deg, #ff70bb, #ffc0df);
  color: #230713;
}

/* Banner safe-zone mobile: center and no horizontal drifting */
.v19-banner,
.banner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  transform: none !important;
}

.v19-banner .banner-img,
.banner-img {
  width: 100% !important;
  max-width: 100% !important;
  transform: none !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

/* PC topbar full and balanced */
@media (min-width: 1024px) {
  .v19-topbar,
  .brand-row {
    min-height: 84px !important;
    padding: calc(14px + var(--safe-top)) clamp(30px, 4vw, 86px) 14px !important;
    grid-template-columns: minmax(220px, 320px) minmax(430px, 1fr) minmax(330px, 540px) auto !important;
    gap: clamp(18px, 2vw, 38px) !important;
    background: rgba(7,6,13,.74) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
  }

  .v19-brand,
  .brand {
    max-width: 320px !important;
  }

  .v19-top-nav {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .v19-top-nav::-webkit-scrollbar {
    display: none;
  }

  .v19-top-nav button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.80);
    font-weight: 850;
  }

  .v19-top-nav button:hover {
    color: #fff;
    background: rgba(255,112,187,.18);
    border-color: rgba(255,112,187,.28);
  }

  .v19-search-inline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 8px 0 15px;
    border-radius: 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
  }

  .v19-search-inline input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
  }

  .v19-search-go {
    height: 38px;
    padding: 0 14px;
    border-radius: 13px;
    background: linear-gradient(135deg, #ff70bb, #ffc0df);
    color: #230713;
    font-weight: 900;
  }

  .v19-search-toggle,
  .v19-mobile-search-panel {
    display: none !important;
  }

  .v19-profile-wrap,
  .profile-menu-wrap {
    justify-self: end !important;
  }

  .v19-banner,
  .banner {
    width: 100vw !important;
    max-width: 100vw !important;
    height: min(76vh, 820px) !important;
    min-height: 560px !important;
  }

  .main,
  .v18-main {
    width: min(1840px, calc(100vw - clamp(60px, 8vw, 172px))) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }
}

/* Mobile tighter */
@media (max-width: 860px) {
  .brand-title strong {
    font-size: 21px !important;
    letter-spacing: .02em !important;
  }

  .brand-title em,
  .brand-title span {
    display: none !important;
  }

  .logo-box {
    width: 42px !important;
    height: 42px !important;
  }

  .avatar-btn {
    width: 44px !important;
    height: 44px !important;
  }

  .v19-banner,
  .banner {
    height: min(58vw, 300px) !important;
    min-height: 180px !important;
  }

  .banner-img {
    background-position: center center !important;
  }
}

/* Player controls: back to premium look */
.x-controls {
  background:
    linear-gradient(180deg, rgba(0,0,0,.66), rgba(0,0,0,.18) 25%, transparent 46%),
    linear-gradient(0deg, rgba(0,0,0,.80), rgba(0,0,0,.28) 32%, transparent 58%) !important;
}

.x-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: #fff !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(18px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.1) !important;
}

.x-btn.main {
  width: 54px !important;
  height: 54px !important;
  background: rgba(255,255,255,.18) !important;
}

.x-btn:hover {
  background: rgba(255,112,187,.22) !important;
  border-color: rgba(255,160,210,.28) !important;
}

.x-btn svg {
  width: 21px !important;
  height: 21px !important;
}

.x-btn.main svg {
  width: 24px !important;
  height: 24px !important;
}

.x-control-bottom {
  padding: 0 clamp(12px, 2vw, 18px) clamp(12px, 2vw, 18px) !important;
}

.x-seek::-webkit-slider-runnable-track {
  height: 4px !important;
  background: linear-gradient(90deg, #ff70bb var(--x-progress, 0%), rgba(255,255,255,.30) var(--x-progress, 0%)) !important;
}

.x-seek::-moz-range-progress {
  background: #ff70bb !important;
}

/* PWA fake fullscreen must fill viewport */
.player-box.x-fake-fullscreen {
  position: fixed !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  min-width: var(--x-fs-width, 100vw) !important;
  min-height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  transform: none !important;
}

/* PC page scroll restored */
@media (hover: hover) and (pointer: fine) {
  html,
  body {
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
  }
}



/* ==========================================================
   v19.2 search overlay + loading safe-zone + player/PWA fix
========================================================== */

/* Loading/login safe zone: không nhảy lên sát tai thỏ/không đen đáy */
.loading-screen,
.login-screen {
  min-height: 100svh !important;
  height: 100svh !important;
  padding-top: max(20px, calc(20px + env(safe-area-inset-top))) !important;
  padding-bottom: max(20px, calc(20px + env(safe-area-inset-bottom))) !important;
  overflow: hidden !important;
  background-color: #07060d !important;
  background-position: center center !important;
  background-size: cover !important;
}

@supports (height: 100dvh) {
  .loading-screen,
  .login-screen {
    min-height: 100dvh !important;
    height: 100dvh !important;
  }
}

/* Glass topbar: chỉ logo/search/avatar, bỏ tab linh tinh */
.v19-header,
.hero-header {
  position: relative !important;
  z-index: 20 !important;
}

.v19-topbar,
.brand-row {
  position: relative !important;
  z-index: 80 !important;
  background: rgba(7, 6, 13, .34) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  backdrop-filter: blur(22px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.25) !important;
}

.v19-top-nav {
  display: none !important;
}

.v19-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  justify-self: end !important;
}

.v19-search-toggle {
  width: 46px !important;
  height: 46px !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: white !important;
  font-size: 21px !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

.v19-search-toggle:hover {
  background: rgba(255,112,187,.18) !important;
}

/* PC: logo sát trái, search ở giữa, avatar sát phải */
@media (min-width: 1024px) {
  .v19-topbar,
  .brand-row {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: calc(14px + var(--safe-top)) clamp(30px, 4vw, 86px) 14px !important;
    grid-template-columns: minmax(220px, 330px) minmax(520px, 1fr) auto !important;
    gap: clamp(18px, 2vw, 42px) !important;
  }

  .v19-search-inline {
    display: grid !important;
    justify-self: stretch !important;
    width: 100% !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }

  .v19-search-toggle {
    display: none !important;
  }

  .v19-actions {
    min-width: 62px !important;
  }

  .v19-profile-wrap,
  .profile-menu-wrap {
    justify-self: end !important;
  }
}

/* Mobile: search là overlay, không đẩy layout */
@media (max-width: 860px) {
  .v19-topbar,
  .brand-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }

  .v19-search-inline {
    display: none !important;
  }

  .v19-header.search-open .v19-brand,
  .v19-header.search-open .profile-menu-wrap {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

.v19-search-dim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3,2,8,.58);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .18s ease;
}

.v19-search-dim.active {
  opacity: 1;
  pointer-events: auto;
}

.v19-search-overlay {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: calc(76px + env(safe-area-inset-top));
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.v19-search-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.v19-search-box {
  width: min(720px, 100%);
  margin-inline: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
  border-color: rgba(255,255,255,.18) !important;
  background: rgba(18, 12, 24, .94) !important;
}

/* Banner mobile center */
@media (max-width: 860px) {
  .banner,
  .v19-banner {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .banner-img {
    width: 100% !important;
    max-width: 100% !important;
    background-position: center center !important;
    background-size: cover !important;
  }
}

/* Player custom buttons: center icon, remove lệch pause */
.x-btn {
  display: grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.x-btn svg,
.x-btn img {
  display: block !important;
  margin: auto !important;
  position: static !important;
  transform: none !important;
  flex: 0 0 auto !important;
}

.x-btn.main {
  display: grid !important;
  place-items: center !important;
}

.x-btn.main svg {
  width: 25px !important;
  height: 25px !important;
}

/* icon pause/play nằm chính giữa */
.x-btn[data-player-action="toggle"] svg,
.x-btn[data-action="toggle"] svg,
.x-btn.main svg {
  transform: translateX(0) !important;
}

/* PWA fullscreen: player không biến mất + cleanup không khóa scroll */
.player-box.x-fake-fullscreen {
  position: fixed !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  min-width: var(--x-fs-width, 100vw) !important;
  min-height: var(--x-fs-height, 100dvh) !important;
  max-width: var(--x-fs-width, 100vw) !important;
  max-height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  transform: none !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.player-box.x-fake-fullscreen .x-player,
.player-box.x-fake-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000 !important;
}

html.x-fs-root,
body.x-fs-root,
body.x-lock-scroll {
  overflow: hidden !important;
}

body:not(.x-lock-scroll) {
  overflow-y: auto !important;
}



/* ==========================================================
   v19.3 topbar overlay + compact PC search + PWA fullscreen fix
========================================================== */

/* Topbar glass overlay trên bg.gif khi có banner */
.v19-header {
  position: relative !important;
  z-index: 20 !important;
}

.v19-header.has-banner .v19-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 85 !important;
}

.v19-header.no-banner .v19-topbar {
  position: relative !important;
  z-index: 85 !important;
}

.v19-topbar,
.brand-row {
  background: rgba(8, 6, 14, .36) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  backdrop-filter: blur(24px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.25) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.20) !important;
}

.v19-spacer {
  min-width: 0;
}

/* Fix history/no-search mobile: avatar không rớt xuống dòng */
@media (max-width: 860px) {
  .v19-topbar,
  .brand-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 66px !important;
    align-items: center !important;
  }

  .v19-spacer {
    display: none !important;
  }

  .v19-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
  }

  .v19-brand,
  .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    max-width: calc(100vw - 118px) !important;
  }

  .v19-profile-wrap,
  .profile-menu-wrap {
    align-self: center !important;
    justify-self: end !important;
  }
}

/* PC: search compact icon, mở ra khi hover/focus */
@media (min-width: 1024px) {
  .v19-topbar,
  .brand-row {
    grid-template-columns: minmax(220px, 330px) minmax(0, 1fr) auto !important;
  }

  .v19-spacer {
    display: block !important;
  }

  .v19-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .v19-search-inline {
    justify-self: end !important;
    width: 54px !important;
    max-width: min(430px, 32vw) !important;
    overflow: hidden !important;
    transition: width .22s ease, background .18s ease, border-color .18s ease !important;
    grid-template-columns: auto minmax(0,1fr) auto !important;
    padding-left: 16px !important;
    padding-right: 7px !important;
  }

  .v19-search-inline:hover,
  .v19-search-inline:focus-within {
    width: min(430px, 32vw) !important;
    background: rgba(255,255,255,.095) !important;
    border-color: rgba(255,255,255,.18) !important;
  }

  .v19-search-inline input,
  .v19-search-inline .v19-search-go {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .14s ease .05s !important;
  }

  .v19-search-inline:hover input,
  .v19-search-inline:focus-within input,
  .v19-search-inline:hover .v19-search-go,
  .v19-search-inline:focus-within .v19-search-go {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .v19-search-inline span {
    min-width: 20px !important;
    text-align: center !important;
  }
}

/* Search overlay ẩn tuyệt đối khi không active để không bật keyboard ở vùng trống */
.v19-search-overlay:not(.active),
.v19-search-dim:not(.active) {
  display: none !important;
  pointer-events: none !important;
}

.v19-search-overlay.active,
.v19-search-dim.active {
  display: block !important;
}

/* Mobile search overlay giữ logo/avatar, chỉ làm nền mờ */
@media (max-width: 860px) {
  .v19-header.search-open .v19-brand,
  .v19-header.search-open .profile-menu-wrap {
    opacity: 1 !important;
    pointer-events: auto !important;
    filter: none !important;
  }

  .v19-search-dim.active {
    background: rgba(3,2,8,.62) !important;
    backdrop-filter: blur(9px) !important;
    -webkit-backdrop-filter: blur(9px) !important;
  }

  .v19-search-overlay {
    top: calc(74px + env(safe-area-inset-top)) !important;
  }
}

/* Banner dưới topbar overlay */
.v19-banner,
.banner {
  position: relative !important;
  z-index: 1 !important;
}

@media (min-width: 1024px) {
  .v19-banner,
  .banner {
    padding-top: 0 !important;
    height: min(76vh, 820px) !important;
    min-height: 560px !important;
  }
}

/* PWA fake fullscreen: append vào body vẫn luôn hiện trên cùng */
body > .player-box.x-fake-fullscreen {
  position: fixed !important;
  inset: auto !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  min-width: var(--x-fs-width, 100vw) !important;
  min-height: var(--x-fs-height, 100dvh) !important;
  max-width: var(--x-fs-width, 100vw) !important;
  max-height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  overflow: hidden !important;
  contain: none !important;
}

body > .player-box.x-fake-fullscreen .x-player,
body > .player-box.x-fake-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000 !important;
}

/* Player icons centered, pause không lệch */
.x-btn,
.x-btn.main {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.x-btn svg,
.x-btn.main svg {
  display: block !important;
  margin: 0 auto !important;
  position: static !important;
  transform: none !important;
}

/* Scroll unlock fallback after leaving fullscreen */
body:not(.x-lock-scroll) {
  overflow-y: auto !important;
}



/* ==========================================================
   v19.4 transparent topbar + natural rotate + PWA fullscreen polish
========================================================== */

/* Topbar thật sự trong suốt hơn: nền bg.gif nhìn xuyên qua */
.v19-header.has-banner .v19-topbar,
.hero-header.has-banner .brand-row,
.v19-header.has-banner .brand-row {
  background: rgba(7, 6, 13, .08) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
}

/* Card logo/avatar mới là glass nhẹ, không phải cả thanh đen */
.v19-header.has-banner .brand,
.v19-header.has-banner .avatar-btn,
.v19-header.has-banner .v19-search-toggle,
.v19-header.has-banner .v19-search-inline {
  background: rgba(12, 10, 18, .34) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  backdrop-filter: blur(18px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
}

/* PC: search chỉ thành khung rõ khi hover/focus */
@media (min-width: 1024px) {
  .v19-header.has-banner .v19-search-inline:not(:hover):not(:focus-within) {
    background: rgba(12, 10, 18, .20) !important;
    border-color: rgba(255,255,255,.08) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .v19-header.has-banner .v19-search-inline:hover,
  .v19-header.has-banner .v19-search-inline:focus-within {
    background: rgba(14, 10, 20, .72) !important;
    border-color: rgba(255,180,220,.24) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.32) !important;
  }
}

/* Mobile: topbar phải gọn, không che nửa banner */
@media (max-width: 860px) {
  .v19-header.has-banner .v19-topbar,
  .v19-header.has-banner .brand-row {
    min-height: 54px !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-bottom: 6px !important;
    background: rgba(7, 6, 13, .06) !important;
    backdrop-filter: blur(11px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(11px) saturate(1.12) !important;
  }

  .v19-header.has-banner .brand {
    height: 44px !important;
    min-height: 44px !important;
    padding: 4px 10px 4px 6px !important;
    border-radius: 18px !important;
    max-width: min(210px, calc(100vw - 116px)) !important;
  }

  .v19-header.has-banner .logo-box {
    width: 36px !important;
    height: 36px !important;
    border-radius: 14px !important;
  }

  .v19-header.has-banner .brand-title strong {
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .v19-header.has-banner .brand-title em,
  .v19-header.has-banner .brand-title span {
    display: none !important;
  }

  .v19-header.has-banner .avatar-btn,
  .v19-header.has-banner .v19-search-toggle {
    width: 42px !important;
    height: 42px !important;
  }

  .v19-header.has-banner .v19-actions {
    gap: 8px !important;
  }

  .v19-banner,
  .banner {
    height: min(64vw, 320px) !important;
    min-height: 210px !important;
  }

  .v19-banner .banner-img,
  .banner-img {
    background-position: center center !important;
    background-size: cover !important;
  }
}

/* Cho phép xoay ngang tự nhiên: không khóa layout vào portrait */
html,
body,
#app {
  touch-action: pan-x pan-y !important;
}

@media (orientation: landscape) and (max-height: 520px) {
  .v19-header.has-banner .v19-topbar,
  .v19-header.has-banner .brand-row {
    min-height: 48px !important;
    padding-top: max(4px, env(safe-area-inset-top)) !important;
    padding-bottom: 4px !important;
  }

  .v19-banner,
  .banner {
    min-height: 180px !important;
    height: 72vh !important;
  }

  .v19-search-overlay {
    top: calc(58px + env(safe-area-inset-top)) !important;
  }
}

/* PWA fake fullscreen: dùng visualViewport, luôn phủ trên cùng, không ẩn player */
body > .player-box.x-fake-fullscreen {
  position: fixed !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  min-width: var(--x-fs-width, 100vw) !important;
  min-height: var(--x-fs-height, 100dvh) !important;
  max-width: var(--x-fs-width, 100vw) !important;
  max-height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  overflow: hidden !important;
  contain: none !important;
}

body > .player-box.x-fake-fullscreen .x-player,
body > .player-box.x-fake-fullscreen video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000 !important;
  object-fit: contain !important;
}

/* Nút fullscreen PWA phải bấm được, controls trên video */
body > .player-box.x-fake-fullscreen .x-controls {
  position: absolute !important;
  inset: 0 !important;
  z-index: 5 !important;
}

/* Khi không fullscreen, tuyệt đối không khóa cuộn */
body:not(.x-lock-scroll) {
  overflow-y: auto !important;
  position: static !important;
}



/* ==========================================================
   v19.5 floating transparent topbar + native/PWA fullscreen
========================================================== */

/* topbar = transparent container, only buttons float */
.v19-header.has-banner .v19-topbar,
.hero-header.has-banner .brand-row,
.v19-header.has-banner .brand-row {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.v19-header.has-banner .brand,
.v19-header.has-banner .avatar-btn,
.v19-header.has-banner .v19-search-toggle,
.v19-header.has-banner .v19-search-inline {
  background: rgba(10, 8, 15, .28) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 16px 54px rgba(0,0,0,.18) !important;
  backdrop-filter: blur(18px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
}

/* PC search: chỉ có icon nổi, hover/focus bung glass input */
@media (min-width: 1024px) {
  .v19-header.has-banner .v19-search-inline {
    background: rgba(10, 8, 15, .20) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  .v19-header.has-banner .v19-search-inline:hover,
  .v19-header.has-banner .v19-search-inline:focus-within {
    background: rgba(12, 9, 18, .74) !important;
    border-color: rgba(255,190,225,.26) !important;
    box-shadow: 0 24px 76px rgba(0,0,0,.34) !important;
    backdrop-filter: blur(24px) saturate(1.28) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.28) !important;
  }
}

/* Mobile: topbar floating, gọn để không che bg.gif */
@media (max-width: 860px) {
  .v19-header.has-banner .v19-topbar,
  .v19-header.has-banner .brand-row {
    min-height: 48px !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-bottom: 4px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .v19-header.has-banner .brand {
    height: 42px !important;
    min-height: 42px !important;
    padding: 4px 10px 4px 6px !important;
    border-radius: 18px !important;
    max-width: min(206px, calc(100vw - 112px)) !important;
    background: rgba(10,8,15,.30) !important;
  }

  .v19-header.has-banner .logo-box {
    width: 34px !important;
    height: 34px !important;
    border-radius: 13px !important;
  }

  .v19-header.has-banner .brand-title strong {
    font-size: 19px !important;
    line-height: 1 !important;
  }

  .v19-header.has-banner .avatar-btn,
  .v19-header.has-banner .v19-search-toggle {
    width: 40px !important;
    height: 40px !important;
    background: rgba(10,8,15,.30) !important;
  }

  .v19-header.has-banner .v19-actions {
    gap: 8px !important;
  }

  .v19-banner,
  .banner {
    min-height: 230px !important;
    height: min(68vw, 340px) !important;
  }

  .v19-banner .banner-img,
  .banner-img {
    background-position: center center !important;
    background-size: cover !important;
  }
}

/* Không khóa xoay ngang bằng CSS */
html,
body,
#app {
  touch-action: auto !important;
  overscroll-behavior-x: none !important;
}

@media (orientation: landscape) and (max-height: 540px) {
  .v19-header.has-banner .v19-topbar,
  .v19-header.has-banner .brand-row {
    min-height: 42px !important;
    padding-top: max(4px, env(safe-area-inset-top)) !important;
    padding-bottom: 4px !important;
  }

  .v19-header.has-banner .brand {
    height: 38px !important;
    min-height: 38px !important;
  }

  .v19-header.has-banner .logo-box {
    width: 30px !important;
    height: 30px !important;
  }

  .v19-header.has-banner .avatar-btn,
  .v19-header.has-banner .v19-search-toggle {
    width: 38px !important;
    height: 38px !important;
  }

  .v19-banner,
  .banner {
    min-height: 180px !important;
    height: 74vh !important;
  }
}

/* Fullscreen fallback vẫn chắc nếu native bị chặn */
body > .player-box.x-fake-fullscreen,
.player-box.x-fake-fullscreen {
  position: fixed !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  min-width: var(--x-fs-width, 100vw) !important;
  min-height: var(--x-fs-height, 100dvh) !important;
  max-width: var(--x-fs-width, 100vw) !important;
  max-height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  overflow: hidden !important;
}

body > .player-box.x-fake-fullscreen .x-player,
body > .player-box.x-fake-fullscreen video,
.player-box.x-fake-fullscreen .x-player,
.player-box.x-fake-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000 !important;
  object-fit: contain !important;
}

/* Nếu người dùng thoát fullscreen, không để body bị khóa */
body:not(.x-lock-scroll) {
  overflow-y: auto !important;
  position: static !important;
}



/* ==========================================================
   v19.6 no-jitter modal/search + rotate/fullscreen hardening
========================================================== */

/* Search/filter không làm giật layout: modal fixed, không reflow */
.v19-search-dim,
.v19-search-overlay,
.filter-backdrop {
  contain: layout paint style;
}

.v19-search-overlay,
.filter-backdrop {
  will-change: opacity, transform;
}

#xFilterHost {
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
}

#xFilterHost .filter-backdrop {
  pointer-events: auto;
}

/* Không đổi scrollbar/layout khi mở filter/search */
html,
body {
  scrollbar-gutter: stable both-edges;
}

/* Tránh iOS zoom/reflow khi focus input */
@media (max-width: 860px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Bỏ mọi khả năng khóa xoay do CSS cũ */
html,
body,
#app {
  touch-action: auto !important;
}

@media (orientation: landscape) and (max-height: 540px) {
  .v19-header.has-banner .v19-topbar,
  .v19-header.has-banner .brand-row {
    min-height: 42px !important;
    padding-top: max(4px, env(safe-area-inset-top)) !important;
    padding-bottom: 4px !important;
  }

  .v19-banner,
  .banner {
    min-height: 170px !important;
    height: 72vh !important;
  }
}

/* Fullscreen fallback chắc hơn */
.player-box.x-fake-fullscreen,
body > .player-box.x-fake-fullscreen {
  position: fixed !important;
  left: var(--x-fs-left, 0px) !important;
  top: var(--x-fs-top, 0px) !important;
  width: var(--x-fs-width, 100vw) !important;
  height: var(--x-fs-height, 100dvh) !important;
  z-index: 2147483647 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #000 !important;
  transform: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

.player-box.x-fake-fullscreen .x-player,
.player-box.x-fake-fullscreen video,
body > .player-box.x-fake-fullscreen .x-player,
body > .player-box.x-fake-fullscreen video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  object-fit: contain !important;
  background: #000 !important;
}

body:not(.x-lock-scroll) {
  overflow-y: auto !important;
  position: static !important;
}



/* ==========================================================
   v19.11 targeted fixes:
   related parts scroll + filter click + volume hover + hover card clamp
========================================================== */

/* Phần khác / nhiều phần: PC kéo ngang bằng chuột/wheel được */
.related-parts-row,
.related-row,
.parts-row,
.related-parts,
.part-list,
.source-tabs {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: none !important;
}

.related-parts-row::-webkit-scrollbar,
.related-row::-webkit-scrollbar,
.parts-row::-webkit-scrollbar,
.related-parts::-webkit-scrollbar,
.part-list::-webkit-scrollbar,
.source-tabs::-webkit-scrollbar {
  display: none !important;
}

.related-parts-row.is-dragging,
.related-row.is-dragging,
.parts-row.is-dragging,
.related-parts.is-dragging,
.part-list.is-dragging,
.source-tabs.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .related-parts-row > *,
  .related-row > *,
  .parts-row > *,
  .related-parts > *,
  .part-list > *,
  .source-tabs > * {
    flex: 0 0 auto !important;
  }
}

/* Bộ lọc: click trong sheet không được tự đóng */
#xFilterHost {
  pointer-events: none;
}

#xFilterHost .filter-backdrop {
  pointer-events: auto;
}

#xFilterHost .filter-sheet,
#xFilterHost [data-no-close="true"] {
  pointer-events: auto !important;
}

/* Volume hover trên PC giống YouTube */
.x-volume-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.x-volume-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: 42px;
  height: 142px;
  padding: 14px 0;
  border-radius: 999px;
  background: rgba(14, 10, 20, .78);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 20px 70px rgba(0,0,0,.42);
  backdrop-filter: blur(22px) saturate(1.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  transform: translateX(-50%) translateY(8px) scale(.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 20;
  display: grid;
  place-items: center;
}

.x-volume-wrap:hover .x-volume-panel,
.x-volume-wrap:focus-within .x-volume-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.x-volume-slider {
  width: 104px;
  height: 28px;
  transform: rotate(-90deg);
  accent-color: #ff70bb;
  cursor: pointer;
}

@media (hover: none), (pointer: coarse) {
  .x-volume-panel {
    display: none !important;
  }
}

/* Hover thông tin không bay ra khỏi mép phải */
@media (hover: hover) and (pointer: fine) {
  .grid {
    overflow: visible !important;
  }

  .v18-card .hover-info,
  .card .hover-info {
    max-width: min(300px, calc(100vw - 32px)) !important;
  }

  .grid .v18-card:nth-child(7n) .hover-info,
  .grid .v18-card:nth-child(7n-1) .hover-info,
  .grid .card:nth-child(7n) .hover-info,
  .grid .card:nth-child(7n-1) .hover-info,
  .grid .v18-card:nth-child(8n) .hover-info,
  .grid .v18-card:nth-child(8n-1) .hover-info,
  .grid .card:nth-child(8n) .hover-info,
  .grid .card:nth-child(8n-1) .hover-info {
    left: auto !important;
    right: calc(100% + 14px) !important;
  }
}



/* ==========================================================
   v19.12: Phần khác scroll/drag fix
========================================================== */

.related-parts {
  overflow: hidden !important;
  max-width: 100% !important;
}

.related-parts-row {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x !important;
  cursor: grab !important;
  padding: 2px 4px 6px !important;
  scroll-behavior: smooth;
  scrollbar-width: none !important;
}

.related-parts-row::-webkit-scrollbar {
  display: none !important;
}

.related-parts-row.maybe-dragging,
.related-parts-row.dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

.related-parts-row.dragging .related-part-card {
  pointer-events: none !important;
}

.related-parts-row .related-part-card {
  flex: 0 0 210px !important;
  width: 210px !important;
  max-width: 210px !important;
}

@media (max-width: 860px) {
  .related-parts-row .related-part-card {
    flex-basis: min(176px, 48vw) !important;
    width: min(176px, 48vw) !important;
    max-width: min(176px, 48vw) !important;
  }
}



/* ==========================================================
   v19.13 filter fixes:
   - Hoạt hình filter API uses /danh-sach/hoat-hinh
   - Home resets filters
   - Year search field
========================================================== */

.filter-year-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.filter-year-stack .filter-field {
  margin: 0 !important;
}

.filter-year-search-field input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  border-radius: 14px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  font-weight: 800;
}

.filter-year-search-field input::placeholder {
  color: rgba(255,255,255,.42);
}

.filter-year-search-field input:focus {
  border-color: rgba(255,112,187,.42);
  box-shadow: 0 0 0 3px rgba(255,112,187,.12);
}



/* ==========================================================
   v19.14 player runtime + filter UI balance fix
========================================================== */

/* Bộ lọc: các ô cùng kích thước, Quốc gia không phình to */
.filter-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
}

.filter-grid > *,
.filter-field,
.filter-year-stack {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.filter-year-stack {
  display: grid !important;
  gap: 10px !important;
  grid-column: auto !important;
}

.filter-year-stack .filter-field {
  width: 100% !important;
}

.filter-field select,
.filter-field input,
.filter-year-search-field input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 860px) {
  .filter-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Volume slider an toàn: không ảnh hưởng layout player nếu CSS cũ đè */
.x-volume-wrap {
  flex: 0 0 auto !important;
}



/* ==========================================================
   v19.15 volume UI + filter grid balance
========================================================== */

/* Bộ lọc: 4 ô chính bằng nhau, năm nằm 1 hàng riêng gọn đều */
.filter-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.filter-grid > .filter-field {
  height: 100% !important;
  min-height: 88px !important;
}

.filter-grid > .filter-year-stack {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.filter-year-stack .filter-field {
  min-height: 88px !important;
  height: 100% !important;
}

.filter-field,
.filter-field select,
.filter-year-search-field input {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

.filter-field select,
.filter-year-search-field input {
  min-height: 46px !important;
}

@media (max-width: 860px) {
  .filter-grid,
  .filter-grid > .filter-year-stack {
    grid-template-columns: 1fr !important;
  }
}

/* Volume: panel không biến mất khi rê chuột lên, slider nằm gọn trong panel */
.x-volume-wrap {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: visible !important;
}

.x-volume-panel {
  position: absolute !important;
  left: 50% !important;
  bottom: calc(100% - 2px) !important;
  width: 48px !important;
  height: 154px !important;
  padding: 14px 0 !important;
  border-radius: 999px !important;
  background: rgba(14, 10, 20, .86) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 22px 76px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(24px) saturate(1.26) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.26) !important;
  transform: translateX(-50%) translateY(10px) scale(.96) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease !important;
  z-index: 80 !important;
  display: grid !important;
  place-items: center !important;
}

/* Cầu hover giữa nút loa và bảng volume để rê chuột không bị mất */
.x-volume-panel::after {
  content: "" !important;
  position: absolute !important;
  left: -10px !important;
  right: -10px !important;
  bottom: -24px !important;
  height: 28px !important;
  background: transparent !important;
}

.x-volume-wrap:hover .x-volume-panel,
.x-volume-wrap:focus-within .x-volume-panel {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

/* Vertical range đẹp, không thò ra ngoài */
.x-volume-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 104px !important;
  height: 8px !important;
  transform: rotate(-90deg) !important;
  transform-origin: center !important;
  background: transparent !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #ff70bb !important;
}

.x-volume-slider::-webkit-slider-runnable-track {
  height: 6px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ff70bb 0%, rgba(255,255,255,.32) 0%) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important;
}

.x-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 999px !important;
  margin-top: -5px !important;
  background: #fff !important;
  border: 3px solid #ff70bb !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
}

.x-volume-slider::-moz-range-track {
  height: 6px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.32) !important;
}

.x-volume-slider::-moz-range-progress {
  height: 6px !important;
  border-radius: 999px !important;
  background: #ff70bb !important;
}

.x-volume-slider::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  border-radius: 999px !important;
  background: #fff !important;
  border: 3px solid #ff70bb !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
}

@media (hover: none), (pointer: coarse) {
  .x-volume-panel {
    display: none !important;
  }
}



/* ==========================================================
   v19.16 real volume slider fix
   - Không dùng range xoay nên không thò khỏi nền
   - Kéo được thật bằng pointer
========================================================== */

.x-volume-wrap {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: visible !important;
}

.x-volume-panel {
  position: absolute !important;
  left: 50% !important;
  bottom: calc(100% - 4px) !important;
  width: 52px !important;
  height: 156px !important;
  padding: 14px 0 !important;
  border-radius: 999px !important;
  background: rgba(14, 10, 20, .88) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 22px 76px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(24px) saturate(1.26) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.26) !important;
  transform: translateX(-50%) translateY(8px) scale(.96) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease !important;
  z-index: 90 !important;
  display: grid !important;
  place-items: center !important;
}

.x-volume-panel::after {
  content: "" !important;
  position: absolute !important;
  left: -14px !important;
  right: -14px !important;
  bottom: -30px !important;
  height: 36px !important;
  background: transparent !important;
}

.x-volume-wrap:hover .x-volume-panel,
.x-volume-wrap:focus-within .x-volume-panel,
.x-volume-wrap.dragging .x-volume-panel {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

/* Hide old range if old CSS/markup somehow remains */
.x-volume-slider {
  display: none !important;
}

.x-volume-rail {
  position: relative !important;
  width: 12px !important;
  height: 116px !important;
  border: 0 !important;
  outline: 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.22) !important;
  cursor: pointer !important;
  touch-action: none !important;
  overflow: visible !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important;
}

.x-volume-rail:focus-visible {
  box-shadow:
    0 0 0 3px rgba(255,112,187,.24),
    inset 0 0 0 1px rgba(255,255,255,.12) !important;
}

.x-volume-fill {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffc0df, #ff70bb) !important;
  pointer-events: none !important;
}

.x-volume-thumb {
  position: absolute !important;
  left: 50% !important;
  bottom: 100% !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  background: #fff !important;
  border: 3px solid #ff70bb !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.42) !important;
  transform: translate(-50%, 50%) !important;
  pointer-events: none !important;
}

@media (hover: none), (pointer: coarse) {
  .x-volume-panel {
    display: none !important;
  }
}



/* ==========================================================
   v19.17 history/Supabase + volume UI sync fix
========================================================== */

/* Volume fill/thumb đọc biến --x-volume để UI tụt theo âm lượng thật */
.x-volume-rail {
  --x-volume: 100%;
}

.x-volume-fill {
  height: var(--x-volume, 100%) !important;
}

.x-volume-thumb {
  bottom: var(--x-volume, 100%) !important;
}

.x-volume-wrap.dragging .x-volume-panel,
.x-volume-rail.is-volume-dragging + .x-volume-panel,
.x-volume-rail.is-volume-dragging {
  pointer-events: auto !important;
}






/* ==========================================================
   v19.19 scroll unlock + hidden scrollbar
   - Khôi phục wheel/touch/touchpad trên PC/mobile/PWA
   - Vẫn ẩn scrollbar để nhìn như app native
   - Không đoán sai vùng scroll nội bộ nữa
========================================================== */

html,
body {
  width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-x: none !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* App vẫn cao tối thiểu full màn nhưng không khóa cuộn */
#app,
.app {
  min-height: 100svh !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

@supports (min-height: 100dvh) {
  #app,
  .app {
    min-height: 100dvh !important;
  }
}

/* Các vùng có scroll riêng vẫn cuộn được, chỉ ẩn scrollbar */
.main,
.v18-main,
.filter-body,
.profile-sheet,
.sheet,
.history-list,
.episode-list,
.related-parts-row,
.tag-strip,
#tagStrip {
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Fullscreen/player vẫn được quyền khóa scroll */
html.x-fs-root,
body.x-fs-root,
body.x-lock-scroll {
  overflow: hidden !important;
}

/* Khi rời fullscreen, trả lại scroll toàn trang */
body:not(.x-lock-scroll):not(.x-fs-root) {
  overflow-y: auto !important;
  position: static !important;
}



/* ==========================================================
   v19.20 search pagination
========================================================== */

.search-pagination {
  margin-top: 18px !important;
}

.search-pagination span::before {
  content: "Tìm kiếm • ";
  opacity: .72;
}
