body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --primary: #ff0000;

  /* Subtitle Customization Variables */
  --sub-color: #ffffff;
  --sub-size: 56px;
  --sub-font: "Inter", Arial, sans-serif;
  --sub-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  --sub-bg: rgba(0, 0, 0, 0);
}

/*
 * Android Chrome SurfaceView fix:
 * Video element dùng hardware SurfaceView để decode. Các sibling elements (canvas,
 * div overlay) tạo compositing layers che mất SurfaceView trên màn hình thật
 * (CDP screenshot vẫn thấy video vì capture từ renderer process).
 * Fix: buộc video thành dedicated compositing layer.
 */
.art-video-player > video.art-video {
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

.art-video-player {
  isolation: isolate;
  /* 
   * MAGIC FIX cho Android Chrome: 
   * Ép opacity < 1 (0.999) buộc trình duyệt phải render toàn bộ khối player 
   * (gồm cả video hardware + webgl canvas + ui) vào một offscreen buffer 
   * duy nhất trước khi vẽ ra màn hình. Khắc phục triệt để lỗi đen màn hình
   * sau 3-5s khi UI ẩn hoặc khi JASSUB render frame mới.
   */
  opacity: 0.999 !important;
}

/* Tất cả overlay children phải transparent với hardware compositor */
.art-video-player > *:not(video) {
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* 
 * JASSUB WebGL Canvas Fix (Android Chrome):
 * Khi bật phụ đề ASS, JASSUB tạo WebGL canvas. Trên Android, WebGL canvas 
 * đè lên Hardware Video Surface sẽ gây đen màn hình. Cần ép nó vào z-space.
 */
.art-video-player > canvas.JASSUB,
.JASSUB.ass-libass-canvas {
  transform: translateZ(1px) !important;
  -webkit-transform: translateZ(1px) !important;
  will-change: transform !important;
  pointer-events: none !important;
  /* mix-blend-mode: normal; giúp compositor không bị lỗi opaque */
  mix-blend-mode: normal !important; 
}

/* Custom Scrollbar for Player & UI */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}


.art-subtitle {
  text-shadow: var(--sub-shadow) !important;
  color: var(--sub-color) !important;
  font-family: var(--sub-font) !important;
  background-color: var(--sub-bg) !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  transition: opacity 0.2s ease !important;
  z-index: 100 !important;
  width: fit-content !important;
  max-width: 90% !important;
  left: 0 !important;
  right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;

  /* Mặc định cho Desktop / PC */
  font-size: clamp(28px, var(--sub-size), 72px) !important;
  bottom: 115px !important;
  top: auto !important;
  transform: none !important;
  padding: 0 20px !important;
  line-height: 1.4 !important;
}

.art-subtitle:empty {
  display: none !important;
}

/* 1. TABLET (Màn hình trung bình) */
@media (min-width: 768px) and (max-width: 1024px) {
  .art-subtitle {
    font-size: clamp(20px, calc(var(--sub-size) * 0.85), 32px) !important;
    bottom: 70px !important;
    padding: 0 15px !important;
  }
}

/* 2. MOBILE LANDSCAPE (Điện thoại xoay ngang) */
@media (max-width: 950px) and (orientation: landscape) {
  .art-subtitle {
    font-size: clamp(14px, calc(var(--sub-size) * 0.45), 22px) !important;
    bottom: 35px !important;
    padding: 0 12px !important;
    line-height: 1.2 !important;
  }
}

/* 3. MOBILE PORTRAIT (Điện thoại cầm dọc) */
@media (max-width: 767px) and (orientation: portrait) {
  .art-subtitle {
    font-size: clamp(10px, calc(var(--sub-size) * 0.25), 18px) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(20vmin) !important;
    line-height: 1.2 !important;
    padding: 0 10px !important;
  }
}

.art-notice {
  display: none !important;
}

.art-setting-header {
  justify-content: center !important;
  align-items: center !important;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 15px 4px !important;
  /* Căn lề trái 15px giống các mục khác */
  background: transparent !important;
  display: flex;
  margin: 0;
  text-transform: none !important;
  text-align: left !important;
  letter-spacing: 1px;
  pointer-events: none !important;
  margin-left: -7px !important;
  bottom: 20px !important;

}

/* Vùng chứa tiêu đề (Header Item) */
.art-setting-item:has(.art-setting-header),
.art-setting-item:has(.art-setting-header):hover {
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  height: auto !important;
  margin: 0 !important;
}

/* Ẩn dấu checkmark và các icon bên phải của tiêu đề */
.art-setting-item:has(.art-setting-header) .art-setting-item-right,
.art-setting-item:has(.art-setting-header) .art-setting-item-right-icon,
.art-setting-item:has(.art-setting-header) .art-icon-check,
.art-setting-item:has(.art-setting-header) i {
  display: none !important;
}

.art-icon-loading-custom {
  color: var(--primary) !important;
}

.art-icon-loading-custom path[opacity="0.3"] {
  opacity: 0.15 !important;
}

.art-progress {
  left: 15px !important;
  width: calc(100% - 30px) !important;
  height: 10px !important;
}

@media (max-width: 768px) {
  .art-progress {
    left: 7px !important;
    width: calc(100% - 14px) !important;
  }
}

.art-control-progress-inner {
  height: 6px !important;
  bottom: 16px !important;
}

@media (max-width: 768px) {
  .art-control-progress-inner {
    bottom: 16px !important;
    height: 6px !important;
  }
}

.art-progress-played {
  background: #ff0000 !important;
  height: 6px !important;
}

.art-controls {
  bottom: 10px !important;
  padding: 0 15px !important;
}

@media (max-width: 768px) {
  .art-controls {
    bottom: 5px !important;
    padding: 0 10px !important;
  }
}

.art-control-control10,
.art-control-control11 {
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
}

@media (max-width: 400px) {
  .art-control.art-control-time {
    display: none !important;
  }
}

.hidden {
  display: none !important;
}

.text-white {
  color: #fff !important;
}

.hover\:text-primary:hover {
  color: var(--primary) !important;
}

.\!w-8 {
  width: 32px !important;
}

.\!h-8 {
  height: 32px !important;
}

.font-medium {
  font-weight: 500 !important;
}

/* Custom Play/Pause icon styles */
.custom-play-pause {
  width: 32px !important;
  height: 32px !important;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-play-pause:hover {
  color: var(--primary) !important;
}

.custom-play-pause svg {
  width: 100%;
  height: 100%;
}

/* Icon sizing */
.art-thumb-preview {
  position: absolute;
  bottom: 50px !important;
  width: 178px;
  z-index: 1000;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
}

.art-thumb-preview.show {
  display: flex;
}

.art-thumb-preview .img {
  width: 178px;
  height: 100px;
  background-repeat: no-repeat;
  background-color: #000;
  border-radius: 6px;
  border: 1px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

/* Spacing for right-side controls on PC */
@media (min-width: 769px) {
  .art-controls-right .art-control {
    margin-left: 8px;
  }
}

/* Hide ArtPlayer default subtitle button (using custom CC) */
.art-control-subtitle {
  display: none !important;
}

/* Hover effect for all control icons */
.art-controls .art-control:hover svg {
  color: #ffd785;
  filter: drop-shadow(0 0 3px rgba(255, 215, 133, 0.3));
  transition: color 0.2s, filter 0.2s;
}

.art-controls .art-control svg {
  transition: color 0.2s, filter 0.2s;
}

/* Right-side icon sizing */
.art-controls-right .art-control svg {
  width: 22px;
  height: 22px;
}

/* CC Control Dropdown */
.cc-control-wrapper {
  position: relative;
  cursor: pointer;
  top: 2px !important;

}

.cc-dropdown {
  position: absolute;
  bottom: 50px;
  right: -10px;
  background: rgba(20, 20, 30, 0.95);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 420px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cc-close-btn {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.cc-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Settings close button */
.settings-close-btn {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  text-align: right;
  transition: all 0.2s;
}

.settings-close-btn:hover {
  color: #fff;
}

/* Settings always on top */
.art-settings {
  z-index: 9999 !important;
}

.cc-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.cc-toggle-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
}

.cc-tab {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.cc-tab:hover {
  color: #fff;
}

.cc-tab.active {
  background: #fff;
  color: #000;
  font-weight: 200;
}

.cc-subtitle-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 13px;
}

.cc-sub-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.cc-sub-item.active {
  background: rgba(255, 200, 50, 0.15);
  color: #ffc832;
  border: 1px solid rgba(255, 200, 50, 0.25);
}

.cc-sub-check {
  display: none;
  color: #ffc832;
  font-weight: bold;
}

.cc-sub-item.active .cc-sub-check {
  display: inline;
}

/* Dual Subtitle Wrapper (flex column gap) */
.dual-sub-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 200;
  pointer-events: none;
  padding: 0 10px;
}

.dual-sub-primary {
  color: var(--sub-color, #fff);
  font-size: clamp(18px, var(--sub-size, 48px), 48px);
  font-family: var(--sub-font, Arial, sans-serif);
  text-shadow: var(--sub-shadow, 1px 1px 0 #000);
  background-color: var(--sub-bg, transparent);
  font-weight: 600;
  text-align: center;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
  border-radius: 4px;
  max-width: 100%;
  padding: 2px 8px;
}

.dual-sub-primary:empty {
  display: none;
}

.dual-sub-secondary {
  color: var(--sec-sub-color, #00ffff);
  font-size: clamp(14px, calc(var(--sec-sub-size, 42px) * 0.72), 38px);
  font-family: var(--sec-sub-font, Arial, sans-serif);
  text-shadow: var(--sec-sub-shadow, 1px 1px 0 #000);
  background-color: var(--sec-sub-bg, transparent);
  font-weight: 600;
  text-align: center;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.3;
  border-radius: 4px;
  max-width: 100%;
  padding: 2px 8px;
  opacity: 0.9;
}

.dual-sub-secondary:empty {
  display: none;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
  .dual-sub-wrapper {
    bottom: 40px;
  }

  .dual-sub-primary {
    font-size: clamp(20px, calc(var(--sub-size, 48px) * 0.85), 32px);
  }

  .dual-sub-secondary {
    font-size: clamp(16px, calc(var(--sec-sub-size, 42px) * 0.7), 28px);
  }
}

/* Mobile Landscape */
@media (max-width: 950px) and (orientation: landscape) {
  .dual-sub-wrapper {
    bottom: 45px;
    gap: 2px;
  }

  .dual-sub-primary {
    font-size: clamp(14px, calc(var(--sub-size, 48px) * 0.45), 22px);
    line-height: 1.2;
  }

  .dual-sub-secondary {
    font-size: clamp(10px, calc(var(--sec-sub-size, 42px) * 0.35), 16px);
    line-height: 1.2;
  }
}

/* Mobile Portrait */
@media (max-width: 767px) and (orientation: portrait) {
  .dual-sub-wrapper {
    bottom: 41%;
    top: auto;
    gap: 2px;
  }

  .dual-sub-primary {
    font-size: clamp(14px, calc(var(--sub-size, 48px) * 0.42), 22px);
    line-height: 1.3;
  }

  .dual-sub-secondary {
    font-size: clamp(11px, calc(var(--sec-sub-size, 42px) * 0.35), 18px);
    line-height: 1.2;
  }
}

/* Dual column layout in CC dropdown */
.cc-dual-container {
  display: flex;
  gap: 6px;
}

.cc-dual-col {
  flex: 1;
  min-width: 0;
}

.cc-dual-header {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px 2px;
}

.cc-dual-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 3px;
}

.cc-dual-list .cc-sub-item {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
}

/* Disabled column */
.cc-col-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.cc-col-disabled .cc-sub-item.active {
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  border-color: transparent;
}

@media (max-width: 768px) {
  .art-subtitle-secondary {
    font-size: clamp(8px, calc(var(--sec-sub-size, 42px) * 0.35), 14px);
    bottom: 25px;
  }

  .cc-dual-container {
    flex-direction: column;
    gap: 4px;
  }

  .cc-dual-list {
    max-height: 120px;
  }

  .cc-dual-list .cc-sub-item {
    font-size: 10px;
    padding: 4px 6px;
  }
}

/* Icon sizing */
.art-icon-loading {
  width: 40px;
  height: 40px;
  color: #a2b2ff;
}

.art-icon-state {
  width: 48px;
  height: 48px;
}

.art-icon-indicator {
  width: 22px;
  height: 22px;
}

@media (min-width: 1024px) {
  .art-icon-loading {
    width: 80px;
    height: 80px;
  }

  .art-icon-state {
    width: 64px;
    height: 64px;
  }
}

/* VOLUME RANGE CUSTOM */
.art-volume-range {
  width: 80px;
  height: 3px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.art-volume-range::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, #fff 0%, #fff var(--val, 50%), rgba(150, 150, 150, 0.5) var(--val, 50%));
}

.art-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
}

/* Highlights on progress bar */
.art-skip-highlight {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  z-index: 10;
  pointer-events: none;
}

/* Skip Buttons Layer - auto-hides with controls via .art-hover */
.skip-buttons-layer {
  position: absolute;
  bottom: 120px;
  right: 15px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.art-video-player:hover .skip-buttons-layer,
.art-video-player.art-hover .skip-buttons-layer,
.art-video-player.art-control-show .skip-buttons-layer {
  opacity: 1;
}

.skip-btn {
  display: none;
  /* JS controls this */
  position: relative;
  background-color: hsla(0, 0%, 100%, 0.85);
  border: none;
  color: #000;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  align-items: center;
  overflow: hidden;
  pointer-events: auto;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  animation: skipBtnIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-btn:hover {
  background-color: #fff;
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.skip-btn .skip-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 0;
  transition: width 0.3s linear;
  pointer-events: none;
}

.skip-btn .skip-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 300 !important;
}

.skip-btn .skip-content svg {
  flex-shrink: 0;
}

@keyframes skipBtnIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1024px) {
  .skip-buttons-layer {
    right: 10px;
    bottom: 100px;
    gap: 6px;
  }

  .skip-btn {
    font-size: 13px;
    border-radius: 5px;
  }

  .skip-btn .skip-content {
    padding: 8px 14px;
    gap: 6px;
    font-weight: 300 !important;
  }
}

/* Custom Playback Bottom UI */
.art-video-player .art-bottom {
  padding: 0px !important;
  background-image: linear-gradient(0deg, rgba(20, 22, 30, 0.8), rgba(20, 22, 30, 0)) !important;
  transition: opacity 0.3s ease !important;
}

/* Chỉ ẩn bottom khi đang hiện poster (chưa play) */
.artplayer.art-state-poster .art-bottom,
.art-video-player.art-state-poster .art-bottom {
  opacity: 0 !important;
  display: none !important;
  pointer-events: none !important;
}

/* Hide default play button to use custom one */
.art-control-playAndPause {
  display: none !important;
}

/* Center Overlay Icons */
.player-center-icon {
  width: 70px;
  height: 70px;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.art-icon-state svg {
  width: 80px;
  height: 80px;
}

.player-center-icon:active {
  opacity: 1;
}

@media (max-width: 1024px) {
  .player-center-icon {
    width: 50px;
    height: 50px;
  }

  .art-icon-state svg {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 768px) {
  .player-center-icon {
    width: 35px;
    height: 35px;
  }

  .art-icon-state svg {
    width: 35px;
    height: 35px;
  }
}

/* Ẩn video lúc đang lấy thumbnail để tránh bị nháy */
.art-video.loading-poster {
  opacity: 0 !important;
}

.artplayer-app {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  overflow: hidden !important;
}

/* KHÓA CHẶT KHUNG MÁY PHÁT KHÔNG CHO NHẢY */
.artplayer,
.art-video-player {
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
}

/* ÉP VIDEO PHẢI LẤP ĐẦY KHUNG TỨC THÌ (0ms) */
.art-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* ÉP THUMB (POSTER) PHẢI LUÔN LÀ CONTAIN - KHÔNG ĐƯỢC FULL/ZOOM */
[class*="art-poster"],
.art-poster,
.art-video-container .art-poster {
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  object-fit: cover !important;
}

#ad-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #000;
  display: none;
}

/* Responsive Skip Button */
.ad-skip-btn {
  position: absolute;
  bottom: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 10px 20px;
  font-size: 14px;
  cursor: not-allowed;
  border-radius: 0;
  z-index: 100000;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ad-skip-btn {
    bottom: 80px;
    right: 10px;
    padding: 8px 16px;
    font-size: 12px;
  }

  .player-logo {
    width: 100px !important;
  }
}

.player-logo {
  width: 150px;
  height: auto;
}

/* ANTI-DEVTOOL OVERLAY */
.dt-lock {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  color: #fff;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #10b981;
  border-radius: 50%;
  animation: dt-spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Ẩn các thành phần của trình phát khi nằm trong ad-container (chế độ quảng cáo) */
#ad-container .art-control-progress,
#ad-container .art-progress,
#ad-container .art-control-time,
#ad-container .art-info,
#ad-container .art-control-playAndPause,
#ad-container .art-control-playpause {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#ad-container .art-controls-left {
  flex: 1;
  display: flex !important;
  align-items: center;
}

#ad-container .art-mask {
  pointer-events: none !important;
}


/* --- CẬP NHẬT GIAO DIỆN MENU SETTINGS MỚI --- */
/* --- KHÔI PHỤC LAYOUT CỦA BẠN VÀ CHỈ THÊM ICON --- */
.art-video-player .art-settings,
.art-settings.art-settings,
.art-video-player.art-backdrop .art-settings {
  background: rgba(20, 20, 30, 0.95) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  height: auto !important;
  max-height: 80vh !important;
  min-width: 290px !important;
  overflow-y: auto !important;
  padding: 10px !important;
  position: absolute !important;
  right: 15px !important;
  left: auto !important;
  /* Ép không cho dùng left để tránh nhảy vị trí */
  bottom: 70px !important;
  transform: none !important;
  /* Bỏ transform để không bị lệch khi Artplayer tính toán lại center */
  margin: 0 !important;
}

.art-setting-item {
  height: 44px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: transparent !important;
  color: #fff !important;
  position: relative !important;
  padding: 8px !important;
}

.art-setting-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.art-setting-item-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-align: left !important;
  /* padding-left: 10px !important; */
}

.art-setting-item-left-icon {
  display: none !important;
}

.art-setting-item-left-text {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
}

/* --- TỰ ĐỘNG THÊM CHẤM MÀU DỰA TRÊN TEXT --- */
.art-setting-item-left-text::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  display: none;
  /* Mặc định ẩn */
}

/* Chỉ hiện chấm màu cho các mục tiêu biểu */
.art-settings [data-text="Trắng"] .art-setting-item-left-text::before {
  display: block;
  background: #fff;
}

.art-settings [data-text="Vàng"] .art-setting-item-left-text::before {
  display: block;
  background: #ffff00;
}

.art-settings [data-text="Xanh lá"] .art-setting-item-left-text::before {
  display: block;
  background: #00ff00;
}

.art-settings [data-text="Xanh dương"] .art-setting-item-left-text::before {
  display: block;
  background: #00ffff;
}

.art-settings [data-text="Hồng"] .art-setting-item-left-text::before {
  display: block;
  background: #ff00ff;
}

.art-settings [data-text="Đỏ"] .art-setting-item-left-text::before {
  display: block;
  background: #ff0000;
}

.art-settings [data-text="Cam"] .art-setting-item-left-text::before {
  display: block;
  background: #ffa500;
}

.art-settings [data-text="Xanh đậm"] .art-setting-item-left-text::before {
  display: block;
  background: #0000ff;
}

.art-settings [data-text="Đen"] .art-setting-item-left-text::before {
  display: block;
  background: #000;
  border: 1px solid #444;
}

.art-settings [data-text="Xám"] .art-setting-item-left-text::before {
  display: block;
  background: #808080;
}

.art-settings [data-text="Xanh biển"] .art-setting-item-left-text::before {
  display: block;
  background: #1e90ff;
}

.art-setting-item-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
}

.art-setting-item-right-tooltip {
  color: var(--primary) !important;
  font-size: 13px !important;
  font-weight: medium !important;
}

/* 1. ẨN ICON MẶC ĐỊNH CỦA ARTPLAYER TRONG SETTINGS */
.art-settings .art-icon-check {
  display: none !important;
}

/* 2. TỰ VẼ DẤU TÍCH VÀNG LÊN MỤC ĐANG CHỌN (.art-current) */
.art-settings .art-setting-item.art-current::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 20px;
  height: 20px;
  background-color: #ffd785 !important;
  /* Màu vàng active */
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>') no-repeat center;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>') no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  display: block !important;
  z-index: 10;
}

.art-setting-item-back {
  font-weight: bold !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  margin-bottom: 8px !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  padding-left: 10px !important;
}

/* Thêm mũi tên vào nút Back (Header) */
.art-setting-item-back::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  background-color: currentColor;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.67 3.87L9.9 2.1L0 12l9.9 9.9l1.77-1.77L3.54 12z"/></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.67 3.87L9.9 2.1L0 12l9.9 9.9l1.77-1.77L3.54 12z"/></svg>') no-repeat center;
  opacity: 0.8;
}

.art-settings .art-setting-item-right-icon {
  display: none !important;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 950px) {

  /* Settings menu - Bottom Sheet on mobile */
  .art-video-player .art-settings,
  .art-settings.art-settings,
  .art-video-player.art-backdrop .art-settings {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    min-width: unset !important;
    width: 100% !important;
    max-height: 70vh !important;
    padding: 16px !important;
    border-radius: 0 !important;
    animation: ccSlideUp 0.25s ease-out;
    z-index: 9999 !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5) !important;
  }

  .art-setting-item {
    height: 46px !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
  }

  .art-setting-item-left-text {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  .art-setting-item-right-tooltip {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  .art-setting-item-back {
    height: 48px !important;
    padding-left: 10px !important;
  }

  /* CC Dropdown - Bottom Sheet on Mobile */
  .cc-dropdown {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 0 !important;
    padding: 16px !important;
    animation: ccSlideUp 0.25s ease-out;
    z-index: 9999 !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5) !important;
  }

  @keyframes ccSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .cc-dropdown-header {
    margin-bottom: 10px;
  }

  .cc-dual-container {
    flex-direction: row !important;
    gap: 8px !important;
  }

  .cc-dual-list {
    max-height: 35vh !important;
  }

  .cc-dual-col+.cc-dual-col {
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0;
    padding-left: 4px;
  }

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

  .cc-tab {
    font-size: 10px;
    padding: 3px 8px;
  }

  .cc-sub-item {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Subtitle - smaller on mobile */
  .art-subtitle,
  .art-subtitle span,
  .art-subtitle p {
    font-size: 18px !important;
    --sub-size: 18px !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {

  .art-subtitle,
  .art-subtitle span,
  .art-subtitle p {
    font-size: 14px !important;
    --sub-size: 14px !important;
  }
}


