@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --surface-active: rgba(0, 212, 255, 0.15);
  --accent: #00d4ff;
  --accent2: #7b61ff;
  --text: #e8e8f0;
  --text-dim: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --danger: #ff4466;
  --success: #00e676;
  --glow: 0 0 30px rgba(0, 212, 255, 0.3);
  --radius: 16px;
  --transition: 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  --pc-btn-scale: 1;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  height: 100vh;
  cursor: none;
}

body.show-cursor {
  cursor: default;
}

/* ===== VIDEO PLAYER ===== */
#video-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#menu-dim {
  position: fixed;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  background:
    radial-gradient(circle at center,
      rgba(0, 0, 0, 0.02) 0%,
      rgba(0, 0, 0, 0.06) 34%,
      rgba(0, 0, 0, 0.40) 66%,
      rgba(0, 0, 0, 0.84) 100%),
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.76) 0%,
      rgba(0, 0, 0, 0.18) 24%,
      rgba(0, 0, 0, 0.10) 52%,
      rgba(0, 0, 0, 0.24) 76%,
      rgba(0, 0, 0, 0.90) 100%);
}

#menu-dim.dim-anim {
  transition: opacity var(--transition);
}

#menu-dim.active {
  opacity: 1;
}

/* ===== LOADER ===== */
#loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #0f0f2a 50%, #0a0a1a 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 40px;
  text-shadow: none;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.3);
  }
}

.loader-bar-track {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  animation: loadProgress 1.5s ease forwards;
}

@keyframes loadProgress {
  to {
    width: 100%;
  }
}

.loader-status {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--text-dim);
}

/* ===== CHANNEL OSD (on switch) ===== */
#channel-osd {
  position: fixed;
  top: 60px;
  left: 60px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 24px 36px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all var(--transition);
  pointer-events: none;
  max-width: 700px;
}

#channel-osd.active {
  opacity: 1;
  transform: translateY(0);
}

.osd-number {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 80px;
  text-align: center;
}

.osd-info {
  flex: 1;
}

.osd-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.osd-program {
  font-size: 1.05rem;
  color: var(--text-dim);
}

.osd-program i {
  color: var(--accent);
  margin-right: 6px;
}

/* ===== SIDEBAR ===== */
#sidebar {
  --sidebar-cat-width: 247px;
  --sidebar-accent: #62dcff;
  --sidebar-line: rgba(255, 255, 255, 0.1);
  --sidebar-bg-cat: rgba(5, 7, 10, 0.20);
  --sidebar-bg-ch: rgba(5, 7, 10, 0.70);
  position: fixed;
  inset: 0 auto 0 0;
  width: min(980px, 88vw);
  background: linear-gradient(90deg,
      var(--sidebar-bg-cat) 0,
      var(--sidebar-bg-cat) var(--sidebar-cat-width),
      var(--sidebar-bg-ch) var(--sidebar-cat-width),
      var(--sidebar-bg-ch) 100%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  -webkit-mask-image: none;
  mask-image: none;
  border-right: none;
  box-shadow: none;
  z-index: 600;
  display: grid;
  grid-template-columns: var(--sidebar-cat-width) minmax(0, 1fr);
  opacity: 0;
  transform: translateX(-20px);
  transition: none;
  pointer-events: none;
  overflow: hidden;
  will-change: opacity, transform;
  backface-visibility: hidden;
}

#sidebar::after {
  content: none;
  position: absolute;
  top: 0;
  right: -160px;
  width: 320px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg,
      rgba(5, 7, 10, 0.00) 0%,
      rgba(5, 7, 10, 0.10) 30%,
      rgba(5, 7, 10, 0.22) 58%,
      rgba(5, 7, 10, 0.34) 82%,
      rgba(5, 7, 10, 0.46) 100%);
  filter: blur(24px);
  opacity: 0.95;
}

#sidebar.menu-anim {
  transition: opacity var(--transition), transform var(--transition);
}

#sidebar.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.sidebar-nav {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  background: transparent;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 46px;
  padding: 16px 24px 8px;
}

.sidebar-logo {
  display: none;
}

.sidebar-clock {
  display: none;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 24px 8px;
  color: #fff;
}

.sidebar-title-row span {
  font-size: 1.62rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}

.sidebar-categories {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.sidebar-categories::-webkit-scrollbar {
  width: 4px;
}

.sidebar-categories::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

.category-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 24px 0 28px;
  color: rgba(235, 238, 245, 0.84);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.category-item i,
.category-count {
  display: none;
}

.category-name {
  flex: 1;
  min-width: 0;
  font-size: 1.01rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-item:hover {
  color: #fff;
}

.category-item.focused {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.category-item.active {
  color: var(--sidebar-accent);
}

.category-item.active::before {
  content: none;
}

.category-item.active.focused {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#sidebar.focus-ch .category-item {
  justify-content: flex-start;
  padding: 0 24px 0 28px;
}

#sidebar.focus-ch .category-name,
#sidebar.focus-ch .category-count {
  max-width: none;
  opacity: 1;
  margin: 0;
  overflow: visible;
}

/* ===== CHANNEL LIST ===== */
.sidebar-channels-wrap {
  --focus-row-height: 132px;
  --channel-row-col-left: 176px;
  --channel-row-gap: 20px;
  --channel-row-pad-top: 12px;
  --channel-row-pad-right: 8px;
  --channel-row-pad-bottom: 14px;
  --channel-row-pad-left: 10px;
  --channel-thumb-height: 108px;
  --channels-pad-right: 16px;
  --channels-pad-left: 18px;
  --channels-pad-y: 14px;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.sidebar-channels {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: none;
  scroll-behavior: auto;
  padding:
    var(--channels-pad-y)
    var(--channels-pad-right)
    var(--channels-pad-y)
    var(--channels-pad-left);
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.16s ease;
  scrollbar-width: none;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.sidebar-channels-wrap.is-loading .sidebar-channels {
  opacity: 0;
  visibility: hidden;
  transition: none;
  pointer-events: none;
}

.sidebar-ch-focus-window {
  position: absolute;
  left: var(--channels-pad-left);
  right: var(--channels-pad-right);
  top: 50%;
  height: var(--focus-row-height);
  transform: translateY(-50%);
  background: rgba(88, 92, 99, 0.88);
  border: 1px solid rgba(220, 225, 232, 0.28);
  border-radius: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}

#sidebar.focus-ch .sidebar-ch-focus-window {
  opacity: 1;
}

.sidebar-channels-wrap.is-loading .sidebar-ch-focus-window {
  opacity: 0;
}

.sidebar-ch-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
  padding:
    var(--channels-pad-y)
    var(--channels-pad-right)
    var(--channels-pad-y)
    var(--channels-pad-left);
  overflow: hidden;
}

.sidebar-channels-wrap.is-loading .sidebar-ch-skeleton {
  display: block;
}

.sidebar-skeleton-row {
  display: grid;
  grid-template-columns: var(--channel-row-col-left) minmax(0, 1fr);
  align-items: center;
  gap: var(--channel-row-gap);
  height: var(--focus-row-height);
  min-height: var(--focus-row-height);
  padding:
    var(--channel-row-pad-top)
    var(--channel-row-pad-right)
    var(--channel-row-pad-bottom)
    var(--channel-row-pad-left);
}

.sidebar-skeleton-thumb,
.sidebar-skeleton-line {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  animation: sidebarSkeletonPulse 1.2s ease-in-out infinite alternate;
}

.sidebar-skeleton-thumb {
  height: var(--channel-thumb-height);
}

.sidebar-skeleton-info {
  display: grid;
  gap: 12px;
}

.sidebar-skeleton-line {
  display: block;
  height: 14px;
}

.sidebar-skeleton-line-lg {
  width: 84%;
}

.sidebar-skeleton-line-sm {
  width: 52%;
}

@keyframes sidebarSkeletonPulse {
  from {
    opacity: 0.52;
  }

  to {
    opacity: 0.9;
  }
}

.sidebar-channels-wrap.is-empty .sidebar-ch-focus-window {
  display: none;
}

.sidebar-channels.is-empty {
  padding: var(--channels-pad-y) var(--channels-pad-right) var(--channels-pad-y) var(--channels-pad-left);
}

.sidebar-channels::-webkit-scrollbar {
  width: 0;
}

.sidebar-channels::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

.ch-list-title {
  display: none;
}

.ch-list-count {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.sidebar-empty {
  padding: 28px 4px;
  text-align: left;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.6);
}

.ch-item {
  display: grid;
  grid-template-columns: var(--channel-row-col-left) minmax(0, 1fr);
  align-items: center;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
  gap: var(--channel-row-gap);
  height: var(--focus-row-height);
  min-height: var(--focus-row-height);
  padding:
    var(--channel-row-pad-top)
    var(--channel-row-pad-right)
    var(--channel-row-pad-bottom)
    var(--channel-row-pad-left);
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  border-radius: 14px;
  background: transparent;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  cursor: pointer;
}

.ch-item:hover {
  background: transparent;
}

.ch-item.active {
  background: linear-gradient(90deg,
      rgba(18, 26, 34, 0.62) 0%,
      rgba(18, 26, 34, 0.28) 100%);
  box-shadow: none;
}

.ch-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(184, 207, 224, 0.94) 100%);
}

.ch-item.active.focused {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.ch-item.focused {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.ch-item.active .ch-num {
  background: rgba(233, 245, 255, 0.95);
  color: rgba(8, 14, 20, 0.95);
}

#sidebar.focus-ch .ch-item.focused .ch-name {
  color: #fff;
}

#sidebar.focus-ch .ch-item.focused .ch-now {
  color: rgba(255, 255, 255, 0.68);
}

#sidebar.focus-ch .ch-item.focused .ch-badge {
  background: rgba(98, 220, 255, 0.22);
  color: #fff;
}

#sidebar.focus-ch .ch-item.focused .ch-thumb {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.ch-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--channel-thumb-height);
  border: none;
  background: linear-gradient(135deg, rgba(68, 68, 68, 0.56), rgba(48, 48, 48, 0.56));
  overflow: hidden;
}

.ch-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.ch-logo-fallback {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
}

.ch-thumb.has-logo .ch-logo-fallback {
  opacity: 0;
}

.ch-item.logo-error .ch-thumb.has-logo .ch-logo-fallback {
  opacity: 1;
}

.ch-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 42px;
  padding: 2px 7px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-variant-numeric: tabular-nums;
  background: rgba(20, 23, 28, 0.88);
}

.ch-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  gap: 4px;
  min-width: 0;
}

.ch-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
}

.ch-name {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.12;
  color: rgba(255, 255, 255, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-now {
  font-size: 1.08rem;
  line-height: 1.22;
  min-height: 1.22em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.62);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-progress {
  width: 100%;
  height: 5px;
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.ch-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.15s linear;
}

.ch-item.no-program .ch-now {
  visibility: hidden;
}

.ch-item.no-program .ch-progress {
  visibility: hidden;
}

.ch-fav {
  display: none;
}

@media (max-width: 1280px) {
  #sidebar {
    --sidebar-cat-width: 270px;
    width: min(920px, 92vw);
  }

  .sidebar-logo {
    font-size: 1.62rem;
  }

  .category-name {
    font-size: 0.94rem;
  }

  .sidebar-channels-wrap {
    --focus-row-height: 120px;
    --channel-row-col-left: 160px;
    --channel-row-gap: 16px;
    --channel-thumb-height: 96px;
  }
}

@media (max-width: 960px) {
  #sidebar {
    --sidebar-cat-width: 222px;
    width: 100vw;
  }

  .sidebar-header {
    min-height: 60px;
    padding: 14px 14px 10px;
  }

  .sidebar-logo {
    font-size: 1.34rem;
  }

  .sidebar-clock {
    font-size: 0.84rem;
  }

  .sidebar-title-row {
    padding: 0 16px 6px;
  }

  .sidebar-title-row span {
    font-size: 1.28rem;
    letter-spacing: 0.015em;
  }

  .category-item {
    min-height: 42px;
    padding: 0 16px 0 20px;
  }

  #sidebar.focus-ch .category-item {
    padding: 0 16px 0 20px;
  }

  .category-name {
    font-size: 0.84rem;
  }

  .sidebar-channels-wrap {
    --focus-row-height: 90px;
    --channels-pad-right: 10px;
    --channels-pad-left: 10px;
    --channels-pad-y: 10px;
    --channel-row-col-left: 116px;
    --channel-row-gap: 10px;
    --channel-row-pad-top: 8px;
    --channel-row-pad-right: 4px;
    --channel-row-pad-bottom: 10px;
    --channel-row-pad-left: 4px;
    --channel-thumb-height: 72px;
  }

  .ch-list-title {
    top: -10px;
    font-size: 1rem;
    margin-bottom: 8px;
    padding: 10px 2px 8px;
  }

  .ch-name {
    font-size: 1.6rem;
  }

  .ch-now {
    font-size: 0.9rem;
  }

  .ch-badge {
    font-size: 0.72rem;
    min-width: 30px;
    height: 22px;
    padding: 0 6px;
  }
}
/* ===== PLAYER CONTROLS (YouTube-style) ===== */
#player-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 60px 40px 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: none;
  pointer-events: none;
}

#player-controls.menu-anim {
  transition: opacity var(--transition), transform var(--transition);
}

#player-controls.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Seek HUD overlay */
.seek-hud-overlay {
  position: fixed;
  inset: 0;
  z-index: 640;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.seek-hud-overlay.active {
  opacity: 1;
}

.seek-hud-corner {
  position: absolute;
  top: 46%;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.2s ease;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.42);
}

.seek-hud-corner.left {
  left: 48px;
}

.seek-hud-corner.right {
  right: 48px;
  flex-direction: row-reverse;
}

.seek-hud-corner.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.seek-hud-arrow-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 54px;
}

.seek-hud-corner.left .seek-hud-arrow-wrap {
  justify-content: flex-end;
  margin-right: -6px;
}

.seek-hud-corner.right .seek-hud-arrow-wrap {
  justify-content: flex-start;
  margin-left: -6px;
}

.seek-hud-main-arrow {
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  opacity: 0.96;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.seek-hud-corner.left.has-anchor .seek-hud-main-arrow {
  transform: translateX(calc(-1 * (var(--seek-hud-anchor-shift, 16px) + 8px)));
}

.seek-hud-corner.right.has-anchor .seek-hud-main-arrow {
  transform: translateX(calc(var(--seek-hud-anchor-shift, 16px) + 8px));
}

.seek-hud-burst-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.seek-hud-hit-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 2.42rem;
  line-height: 1;
  font-weight: 700;
  opacity: 0.96;
  will-change: transform, opacity;
  transform: translate(-50%, -50%);
}

.seek-hud-hit-arrow {
  animation-duration: 220ms;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  animation-fill-mode: forwards;
}

.seek-hud-hit-arrow.left {
  left: 74%;
  animation-name: seekHitLeft;
}

.seek-hud-hit-arrow.right {
  left: 26%;
  animation-name: seekHitRight;
}

@keyframes seekHitLeft {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%);
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% - var(--seek-hud-anchor-shift, 16px) - 10px), -50%);
  }
}

@keyframes seekHitRight {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%);
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--seek-hud-anchor-shift, 16px) + 10px), -50%);
  }
}

.seek-hud-delta {
  min-width: 0;
  font-size: 2.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
}

.seek-hud-corner.left .seek-hud-delta {
  text-align: left;
}

.seek-hud-corner.right .seek-hud-delta {
  text-align: right;
}

.seek-hud-delta::before,
.seek-hud-delta::after {
  content: none;
}

.seek-hud-live {
  display: none;
  font-size: 1.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.seek-hud-corner.show-live .seek-hud-delta {
  display: none;
}

.seek-hud-corner.show-live .seek-hud-live {
  display: inline-flex;
  align-items: center;
}

/* Progress bars layout */
.pc-progress-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  opacity: 1;
  transition: opacity 0.3s;
}

.pc-progress-row:last-of-type {
  margin-bottom: 20px;
}

.pc-progress-row.active {
  opacity: 1;
}

.pc-prog-label {
  display: none;
}

.pc-prog-time {
  display: none;
}

.pc-progress-wrap {
  position: relative;
  height: 5px;
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.2s, background 0.2s, box-shadow 0.3s;
}

.pc-progress-wrap:hover {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
}

/* Primary bar focused - cyan glow */
.pc-progress-primary .pc-progress-wrap.focused {
  height: 10px;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4), 0 0 32px rgba(0, 212, 255, 0.12);
  background: rgba(255, 255, 255, 0.22);
}

.pc-progress-wrap.focused .pc-progress-thumb {
  opacity: 1;
  width: 18px;
  height: 18px;
}

/* Primary fill - cyan/accent gradient */
.pc-progress-primary .pc-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: none;
}

.pc-progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s, width 0.2s, height 0.2s;
}

.pc-progress-primary .pc-progress-thumb {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.pc-progress-wrap.no-epg .pc-progress-thumb {
  opacity: 1;
  width: 8px;
  height: 8px;
}

.pc-progress-wrap.no-epg.focused .pc-progress-thumb,
.pc-progress-wrap.no-epg:hover .pc-progress-thumb {
  opacity: 1;
  width: 10px;
  height: 10px;
}


.pc-progress-wrap:hover .pc-progress-thumb {
  opacity: 1;
}

/* Controls row */
.pc-info-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 22px;
  margin-bottom: 12px;
}

.pc-info-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pc-title {
  display: block;
  font-size: 2.92rem;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
}

.pc-channel-name {
  display: block;
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.06;
  color: rgba(255, 255, 255, 0.78);
  max-width: none;
  padding-right: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-time {
  display: none;
}

.pc-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 96px;
}

.pc-live-clock {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 188px;
  padding: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.pc-live-clock::after {
  display: none;
}

.pc-live-clock-label {
  display: none;
}

.pc-live-clock-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pc-live-clock-hm {
  font-size: 1.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.98);
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

.pc-live-clock-sec {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}

.pc-live-clock-date {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.66);
  font-variant-numeric: tabular-nums;
}

.pc-state-row {
  --state-rgb: 255, 74, 98;
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
  padding: 0;
  min-width: 0;
  max-width: 68%;
  flex-shrink: 0;
  border: none;
  background: transparent;
  filter: none;
}

.pc-info-state {
  position: absolute;
  right: 0;
  bottom: -6px;
  margin: 0;
}

.pc-state-row.hide-time .pc-state-datetime {
  display: none;
}

.pc-state-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px 0 28px;
  border-radius: 0 8px 8px 0;
  border: none;
  background: rgba(20, 24, 31, 0.72);
  color: rgba(232, 236, 246, 0.9);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.024em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  text-shadow: none;
  box-shadow: none;
}

.pc-state-badge::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgb(var(--state-rgb));
  box-shadow: none;
}

.pc-state-datetime {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px 0 0 8px;
  border: none;
  background: rgba(17, 20, 26, 0.62);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(230, 234, 244, 0.9);
  white-space: nowrap;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
  box-shadow: none;
}

.pc-state-row.hide-time {
  gap: 0;
}

.pc-state-row.hide-time .pc-state-badge {
  border-radius: 8px;
}

.pc-state-row.hide-time .pc-state-badge::before {
  display: block;
}

.pc-state-row.is-live .pc-state-badge {
  color: rgba(241, 244, 251, 0.94);
}

.pc-state-row.is-paused .pc-state-badge {
  color: rgba(241, 244, 251, 0.94);
}

.pc-state-row.is-after-pause .pc-state-badge {
  color: rgba(241, 244, 251, 0.94);
}

.pc-state-row.is-record .pc-state-badge {
  color: rgba(241, 244, 251, 0.94);
}

.pc-state-row.is-live {
  --state-rgb: 95, 214, 162;
}

.pc-state-row.is-paused {
  --state-rgb: 255, 196, 107;
}

.pc-state-row.is-after-pause {
  --state-rgb: 126, 183, 255;
}

.pc-state-row.is-record {
  --state-rgb: 255, 110, 132;
}

.pc-main-controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.pc-side-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

#player-controls .pc-btn {
  width: calc(46px * var(--pc-btn-scale));
  height: calc(46px * var(--pc-btn-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: var(--text);
  font-size: calc(1.02rem * var(--pc-btn-scale));
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

#player-controls .pc-btn:hover,
#player-controls .pc-btn.focused {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  transform: none;
}

#player-controls .pc-btn.pc-mini {
  width: calc(44px * var(--pc-btn-scale));
  height: calc(44px * var(--pc-btn-scale));
  font-size: calc(0.96rem * var(--pc-btn-scale));
}

#player-controls .pc-btn.play-btn.pc-btn-main {
  width: calc(80px * var(--pc-btn-scale));
  height: calc(80px * var(--pc-btn-scale));
  font-size: calc(1.95rem * var(--pc-btn-scale));
  background: rgba(255, 255, 255, 0.22);
  color: #f3f3f3;
  box-shadow: none;
}

#player-controls .pc-btn.play-btn.pc-btn-main:hover,
#player-controls .pc-btn.play-btn.pc-btn-main.focused {
  background: rgba(245, 245, 245, 0.98);
  color: #000;
  transform: none;
  box-shadow: none;
}

#player-controls .pc-btn.disabled {
  opacity: 0.38;
  color: var(--text-dim);
  box-shadow: none;
}

#player-controls .pc-btn.disabled:hover,
#player-controls .pc-btn.disabled.focused {
  transform: none;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

#player-controls .pc-live-btn {
  background: rgba(255, 255, 255, 0.14) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
  width: auto;
  padding: 0 16px;
  border-radius: 20px;
  gap: 8px;
  animation: none;
}

#player-controls .pc-live-btn:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  box-shadow: none;
}

@media (max-width: 960px) {
  .pc-title {
    font-size: 1.74rem;
  }

  .pc-channel-name {
    font-size: 1.06rem;
    letter-spacing: 0.024em;
  }

  .pc-time {
    font-size: 1.2rem;
  }

  .pc-main-controls {
    gap: 10px;
  }

  .pc-live-clock {
    min-width: 164px;
    padding: 0;
    gap: 2px;
  }

  .pc-live-clock-label {
    display: none;
  }

  .pc-live-clock-hm {
    font-size: 1.62rem;
    letter-spacing: 0.02em;
  }

  .pc-live-clock-sec {
    font-size: 0.9rem;
  }

  .pc-live-clock-date {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .pc-info-row {
    gap: 12px;
  }

  .pc-progress-row {
    gap: 0;
  }

  .pc-state-row {
    margin-left: 0;
    gap: 6px;
    padding: 0;
    max-width: 66%;
  }

  .pc-info-state {
    right: 0;
    bottom: -3px;
    margin: 0;
  }

  .pc-channel-name {
    padding-right: 210px;
  }

  .pc-state-badge {
    min-height: 30px;
    padding: 0 10px 0 22px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .pc-state-badge::before {
    left: 8px;
    width: 7px;
    height: 7px;
  }

  .pc-state-datetime {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.9rem;
    letter-spacing: 0.024em;
    max-width: 190px;
  }

  .pc-side-actions {
    gap: 8px;
  }

  #player-controls .pc-btn.pc-mini {
    width: calc(38px * var(--pc-btn-scale));
    height: calc(38px * var(--pc-btn-scale));
    font-size: calc(0.88rem * var(--pc-btn-scale));
  }

  #player-controls .pc-btn.play-btn.pc-btn-main {
    width: calc(66px * var(--pc-btn-scale));
    height: calc(66px * var(--pc-btn-scale));
    font-size: calc(1.55rem * var(--pc-btn-scale));
  }
}

@media (max-width: 640px) {
  .pc-live-clock {
    min-width: 0;
    padding: 0;
  }

  .pc-live-clock-label,
  .pc-live-clock-date {
    display: none;
  }

  .pc-live-clock-main {
    gap: 5px;
  }

  .pc-live-clock-hm {
    font-size: 1.34rem;
  }

  .pc-live-clock-sec {
    font-size: 0.76rem;
  }
}

/* Quality menu */
.pc-quality-menu {
  position: absolute;
  bottom: 80px;
  right: 40px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 180px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s;
}

.pc-quality-menu.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.quality-option {
  padding: 12px 20px;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.quality-option:hover,
.quality-option.focused {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.quality-option.active {
  color: var(--accent);
}

.quality-option.active::before {
  content: '\2713';
  font-weight: 700;
  color: var(--accent);
}

.quality-label {
  font-weight: 600;
}

.quality-badge {
  font-size: 0.7rem;
  background: var(--accent);
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}



/* ===== NUMBER INPUT OSD ===== */
#number-osd {
  position: fixed;
  top: 60px;
  right: 60px;
  z-index: 800;
  background: rgba(10, 10, 20, 0.9);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 20px 36px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}

#number-osd.active {
  opacity: 1;
}

.num-digits {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  letter-spacing: 4px;
}

/* ===== EPG PANEL ===== */
#epg-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 550;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(30px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 40px;
  transform: translateY(100%);
  transition: transform var(--transition);
}

#epg-panel.active {
  transform: translateY(0);
}

.epg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.epg-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.epg-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  color: var(--text);
}

.epg-close:hover {
  background: var(--surface-hover);
}

.epg-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.epg-list::-webkit-scrollbar {
  display: none;
}

.epg-item {
  flex-shrink: 0;
  min-width: 220px;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.epg-item.current {
  border-color: var(--accent);
  background: var(--surface-active);
}

.epg-item.focused {
  border-color: var(--accent2);
  background: rgba(123, 97, 255, 0.15);
  box-shadow: 0 0 12px rgba(123, 97, 255, 0.2);
  transform: scale(1.02);
}

.epg-item-time {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.epg-item-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.epg-item-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ===== SETTINGS PANEL ===== */
.settings-close-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-close-btn:hover,
.settings-close-btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

#settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 900;
  width: 520px;
  background: rgba(15, 15, 25, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}

#settings-panel.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.settings-head {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(123, 97, 255, 0.12));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-head-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-head-title i {
  color: var(--accent);
}

.settings-body {
  padding: 24px 28px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.settings-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.s-option {
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.s-option:hover,
.s-option.focused {
  background: var(--surface-hover);
  color: var(--text);
}

.s-option.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 97, 255, 0.2));
  border-color: var(--accent);
  color: var(--accent);
}

.s-option.s-option-action {
  min-width: 170px;
  text-align: center;
}

.s-option.busy {
  pointer-events: none;
  opacity: 0.6;
}

/* ===== HINTS ===== */
#hints {
  position: fixed;
  bottom: 16px;
  right: 30px;
  z-index: 300;
  display: flex;
  gap: 16px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

#hints:hover {
  opacity: 0.8;
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ===== ERROR TOAST ===== */
#error-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 999;
  background: rgba(255, 68, 102, 0.15);
  border: 1px solid rgba(255, 68, 102, 0.3);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 16px 28px;
  color: var(--danger);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}

#error-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== SCROLLBAR GLOBAL ===== */
::-webkit-scrollbar {
  width: 4px;
}

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

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

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* ===== LOW PERF (VIDAA/Hisense) ===== */
body.low-perf #sidebar {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

body.low-perf #channel-osd,
body.low-perf .pc-quality-menu,
body.low-perf #number-osd,
body.low-perf #epg-panel,
body.low-perf #settings-panel,
body.low-perf #error-toast {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.low-perf #channel-osd,
body.low-perf .pc-quality-menu,
body.low-perf #number-osd,
body.low-perf #settings-panel,
body.low-perf #error-toast {
  transition-property: opacity, transform;
}

body.low-perf #player-controls .pc-progress-primary .pc-progress-wrap.focused,
body.low-perf .epg-item.focused,
body.low-perf .pc-state-badge,
body.low-perf .pc-progress-primary .pc-progress-thumb {
  box-shadow: none !important;
}

body.low-perf .seek-hud-corner {
  text-shadow: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

body.low-perf .seek-hud-live {
  letter-spacing: 0.04em;
}

body.low-perf .seek-hud-main-arrow {
  transition-timing-function: linear;
}

body.low-perf .seek-hud-hit-arrow {
  animation-timing-function: linear;
}

body.low-perf .epg-item.focused {
  transform: none;
}

body.low-perf .sidebar-skeleton-thumb,
body.low-perf .sidebar-skeleton-line {
  animation-duration: 1.6s;
}

body.low-perf #menu-dim {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.18) 40%,
    rgba(0, 0, 0, 0.72) 100%
  );
}
