/* ============================================================
   NusaTV — futuristic dark UI
   ============================================================ */

:root {
  --bg: #05060b;
  --bg-soft: #0a0c14;
  --panel: rgba(17, 20, 32, 0.72);
  --panel-solid: #0f1220;
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2ff;
  --text-dim: #9aa4bf;
  --text-faint: #64708c;

  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #f472b6;
  --lime: #a3e635;
  --red: #ff3b5c;
  --amber: #fbbf24;

  --grad: linear-gradient(115deg, var(--cyan) 0%, var(--violet) 52%, var(--magenta) 100%);
  --grad-soft: linear-gradient(115deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.16));
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
  --glow-violet: 0 0 30px rgba(139, 92, 246, 0.35);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

/* ---------- Background aurora + grid ---------- */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-glow::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 42% at 12% 8%, rgba(34, 211, 238, 0.2), transparent 62%),
    radial-gradient(40% 46% at 88% 4%, rgba(139, 92, 246, 0.22), transparent 64%),
    radial-gradient(46% 52% at 72% 92%, rgba(244, 114, 182, 0.13), transparent 66%),
    radial-gradient(40% 42% at 18% 88%, rgba(163, 230, 53, 0.07), transparent 64%);
  filter: blur(20px);
  animation: aurora 26s ease-in-out infinite alternate;
}

.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
}

@keyframes aurora {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.02); }
}

/* ---------- Scrollbars ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

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

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.4), rgba(139, 92, 246, 0.45));
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.7), rgba(139, 92, 246, 0.75));
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ---------- Layout ---------- */

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 66px;
  flex: 0 0 auto;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.9), rgba(8, 10, 18, 0.62));
  backdrop-filter: blur(18px) saturate(1.3);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.45), rgba(139, 92, 246, 0.45), transparent);
  opacity: 0.75;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #05060b;
  background: var(--grad);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-name em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.tab svg {
  width: 17px;
  height: 17px;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.22), rgba(139, 92, 246, 0.24));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 20px -8px rgba(139, 92, 246, 0.9);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 59, 92, 0.35);
  background: rgba(255, 59, 92, 0.1);
  color: #ffb3c0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.live-dot.is-on {
  opacity: 1;
  animation: liveGlow 2s ease-in-out infinite;
}

.live-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.live-dot.is-on i {
  animation: blink 1.15s ease-in-out infinite;
}

.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 7px 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.lang-picker svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  opacity: 0.75;
  transition: opacity 0.2s, color 0.2s;
}

.lang-picker:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.lang-picker:hover svg {
  opacity: 1;
  color: var(--cyan);
}

.lang-picker:focus-within {
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14), 0 6px 22px -12px rgba(139, 92, 246, 0.9);
}

.lang-picker select {
  height: 30px;
  width: auto;
  min-width: 46px;
  padding: 0 22px 0 2px;
  border: 0;
  border-radius: 99px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239aa4bf' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
      no-repeat right 5px center,
    transparent;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.lang-picker select:focus {
  border-color: transparent;
  box-shadow: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 59, 92, 0); }
  50% { box-shadow: 0 0 20px rgba(255, 59, 92, 0.22); }
}

.main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px 10px;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
  animation: viewIn 0.5s var(--ease) both;
}

.view.is-active {
  display: flex;
}

#view-live {
  gap: 18px;
}

#view-sports {
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 12px;
}

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

/* ---------- Generic buttons ---------- */

.ghost-btn,
.primary-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.2s;
}

.ghost-btn {
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 18px -6px rgba(34, 211, 238, 0.8);
  transform: translateY(-1px);
}

.ghost-btn.small {
  padding: 6px 11px;
  font-size: 12.5px;
}

.primary-btn {
  padding: 9px 16px;
  border: 0;
  color: #05060b;
  background: var(--grad);
  box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(34, 211, 238, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.primary-btn:active,
.ghost-btn:active,
.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

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

.icon-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: 0 0 20px -6px rgba(139, 92, 246, 0.9);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--cyan);
}

/* ---------- Switch ---------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-strong);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.switch-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cfd6e8;
  transition: transform 0.25s var(--ease), background 0.25s;
}

.switch input:checked + .switch-track {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(139, 92, 246, 0.55));
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 14px -2px rgba(139, 92, 246, 0.7);
}

.switch input:checked + .switch-track span {
  transform: translateX(16px);
  background: #fff;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Sidebar ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 356px;
  min-height: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 22, 36, 0.82), rgba(10, 12, 20, 0.82));
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
  opacity: 0.6;
}

.sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 0 0 auto;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 37px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(4, 6, 12, 0.65);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.search input::placeholder {
  color: var(--text-faint);
}

.search input:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), var(--glow-cyan);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search kbd {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font: inherit;
  font-size: 11px;
}

.source-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.select-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.select-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-faint);
}

select {
  height: 36px;
  width: 100%;
  padding: 0 34px 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4bf' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
      no-repeat right 12px center,
    rgba(4, 6, 12, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.25s;
}

select option,
select optgroup {
  background: #0d1020;
  color: var(--text);
}

select:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.13);
}

.custom-url {
  display: flex;
  gap: 8px;
}

.custom-url input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 6, 12, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

.custom-url input:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

/* Chips */

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.chip b {
  font-weight: 700;
  opacity: 0.65;
  font-size: 10.5px;
  margin-left: 3px;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.chip.is-active {
  color: #05060b;
  border-color: transparent;
  background: linear-gradient(115deg, #67e8f9, #a78bfa);
  box-shadow: 0 6px 18px -8px rgba(139, 92, 246, 0.9);
}

.chip.is-active b {
  opacity: 0.75;
}

.sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.muted {
  color: var(--text-faint);
}

.fav-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.fav-filter svg {
  width: 14px;
  height: 14px;
}

.fav-filter b {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.fav-filter:hover {
  color: var(--amber);
}

.fav-filter.is-active {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 16px -6px rgba(251, 191, 36, 0.7);
}

.fav-filter.is-active svg {
  fill: currentColor;
}

/* Channel list */

.channel-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

.ch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
  animation: chIn 0.32s var(--ease) both;
}

@keyframes chIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.ch:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

.ch:focus-visible {
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.07);
}

.ch.is-active {
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.14), rgba(139, 92, 246, 0.15));
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px -16px rgba(139, 92, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.ch.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 22%;
  bottom: 22%;
  width: 2.5px;
  border-radius: 4px;
  background: var(--grad);
  box-shadow: var(--glow-cyan);
}

.ch-logo {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
}

.ch-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  display: block;
}

.ch-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.22));
}

.ch-logo img.is-loaded + .ch-fallback,
.ch-logo .ch-fallback.is-hidden {
  display: none;
}

.ch-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e6ebfb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-sub .dot {
  opacity: 0.5;
}

.ch-badge {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 5px;
  color: #9ff3ff;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.1);
}

.ch-fav {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, color 0.18s, transform 0.18s;
}

.ch-fav svg {
  width: 15px;
  height: 15px;
}

.ch:hover .ch-fav,
.ch.is-active .ch-fav,
.ch-fav.is-on {
  opacity: 1;
}

.ch-fav.is-on {
  color: var(--amber);
}

.ch-fav.is-on svg {
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

.ch-fav:hover {
  transform: scale(1.12);
}

.ch.is-fav-less .ch-fav {
  opacity: 0;
}

/* Equalizer bars next to active channel */

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  flex: 0 0 auto;
}

.eq i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  animation: eq 0.9s ease-in-out infinite;
}

.eq i:nth-child(1) { height: 55%; animation-delay: -0.2s; }
.eq i:nth-child(2) { height: 100%; animation-delay: -0.5s; background: var(--violet); }
.eq i:nth-child(3) { height: 40%; animation-delay: -0.8s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.list-footer {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

/* Skeleton items in channel list */

.ch.sk {
  pointer-events: none;
  border-color: transparent;
  animation: none;
}

.sk-box,
.sk-line {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 8px;
}

.sk-box::after,
.sk-line::after,
.sk-card::after,
.sk-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.sk-box {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
}

.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sk-line {
  height: 9px;
  border-radius: 4px;
}

.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; height: 8px; }
.sk-line.w55 { width: 55%; height: 8px; }

/* ---------- Stage / player ---------- */

.stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 2px;
}

.player-card {
  flex: 0 0 auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 22, 36, 0.7), rgba(9, 11, 19, 0.85));
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: radial-gradient(ellipse at 50% 0%, #141a2c, #04050a 72%);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.player::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  z-index: 2;
}

.player video:not([src]) {
  opacity: 0;
}

/* Idle state */

.player-idle {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px;
  max-width: 460px;
}

.idle-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.2), rgba(139, 92, 246, 0.1));
  box-shadow: 0 0 50px -12px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: floatY 4s ease-in-out infinite;
}

.idle-icon svg {
  width: 36px;
  height: 36px;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.player-idle h2 {
  margin: 18px 0 6px;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.player-idle p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.player-idle kbd {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 11.5px;
}

/* Loading overlay */

.player-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at center, rgba(9, 12, 22, 0.9), rgba(4, 5, 10, 0.96));
  backdrop-filter: blur(3px);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

.player-loading.is-buffering {
  z-index: 4;
  gap: 0;
  background: radial-gradient(ellipse at center, rgba(9, 12, 22, 0.18), rgba(4, 5, 10, 0.42));
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.player-loading.is-buffering #playerLoadingText {
  display: none;
}

.player-loading.is-buffering .spinner {
  width: 34px;
  height: 34px;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 24%, var(--cyan) 55%, var(--violet) 78%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 0);
  animation: spin 0.95s linear infinite;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.65));
}

.spinner::after {
  content: "";
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

/* Error overlay */

.player-error {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 26px;
  background: radial-gradient(ellipse at center, rgba(20, 8, 14, 0.9), rgba(4, 5, 10, 0.97));
  backdrop-filter: blur(4px);
}

.err-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 59, 92, 0.45);
  background: rgba(255, 59, 92, 0.12);
  color: #ff8fa3;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 30px -8px rgba(255, 59, 92, 0.8);
}

.player-error h3 {
  margin: 8px 0 0;
  font-size: 16px;
}

.player-error p {
  margin: 0 0 8px;
  max-width: 400px;
  color: var(--text-dim);
  font-size: 12.5px;
}

.err-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}

.tap-play {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(4, 6, 12, 0.35);
  color: #fff;
  cursor: pointer;
}

.tap-play svg {
  width: 58px;
  height: 58px;
  padding: 14px;
  border-radius: 50%;
  background: rgba(10, 12, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px -6px rgba(34, 211, 238, 0.6);
  transition: transform 0.2s var(--ease);
}

.tap-play:hover svg {
  transform: scale(1.07);
}

/* ---------- Custom player chrome ---------- */

.player {
  --vol: 100%;
}

.player.is-hide-cursor {
  cursor: none;
}

.player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 40px;
  background: linear-gradient(180deg, rgba(4, 6, 12, 0.82), rgba(4, 6, 12, 0));
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.player.show-ui .player-top {
  opacity: 1;
  transform: translateY(0);
}

.pt-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 20, 0.6);
  backdrop-filter: blur(8px);
}

.pt-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.pt-logo svg {
  width: 17px;
  height: 17px;
  color: var(--cyan);
}

.pt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.pt-text b {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-text small {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid rgba(255, 59, 92, 0.45);
  background: rgba(255, 59, 92, 0.16);
  color: #ffc2cc;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.1px;
  backdrop-filter: blur(10px);
}

.pt-live i,
.pctl-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: blink 1.6s ease-in-out infinite;
}

.pc-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 10, 18, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 50px -8px rgba(34, 211, 238, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.pc-center svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.pc-center:hover {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(14, 18, 30, 0.72);
}

.pctl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 48px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(4, 6, 12, 0.5) 34%, rgba(4, 6, 12, 0.92));
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.player.show-ui .pctl {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pctl-bar {
  position: relative;
  height: 3.5px;
  margin: 0 2px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  cursor: default;
}

.pctl-bar.is-seekable {
  height: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}

.pctl-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 62%, var(--magenta));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
  overflow: hidden;
}

.pctl-bar.is-live .pctl-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: liveSweep 2.6s ease-in-out infinite;
}

@keyframes liveSweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

.pctl-thumb {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  display: none;
}

.pctl-bar.is-seekable .pctl-thumb {
  display: block;
}

.pctl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.pctl-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.pctl-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.pctl-btn:active {
  transform: scale(0.94);
}

.pctl-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pctl-btn svg {
  width: 19px;
  height: 19px;
}

.pc-ico-pause,
.pc-ico-mute,
.pc-ico-fs-exit {
  display: none;
}

.player.is-playing .pc-ico-play,
.player.is-muted .pc-ico-vol,
.player.is-fs .pc-ico-fs {
  display: none;
}

.player.is-playing .pc-ico-pause,
.player.is-muted .pc-ico-mute,
.player.is-fs .pc-ico-fs-exit {
  display: block;
}

.pctl-volwrap {
  display: flex;
  align-items: center;
}

.pctl-vol {
  width: 70px;
  height: 4px;
  margin: 0 7px 0 2px;
  border-radius: 99px;
  appearance: none;
  background: linear-gradient(90deg, var(--cyan) var(--vol), rgba(255, 255, 255, 0.22) var(--vol));
  outline: none;
  cursor: pointer;
}

.pctl-vol::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

.pctl-vol::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

.pctl-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255, 59, 92, 0.38);
  background: rgba(255, 59, 92, 0.13);
  color: #ffc2cc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.pctl-time {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pctl-spacer {
  flex: 1 1 auto;
}

.pctl-quality {
  position: relative;
}

.pctl-pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.pctl-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.pctl-menu {
  position: absolute;
  right: 0;
  bottom: 38px;
  min-width: 108px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 19, 0.94);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(16px);
}

.pctl-menu button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.pctl-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.pctl-menu button.is-active {
  color: var(--cyan);
}

.player:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.player:fullscreen .player-top,
.player:fullscreen .pctl {
  padding-left: 26px;
  padding-right: 26px;
}

/* Now playing bar */

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.now-logo {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.14), rgba(139, 92, 246, 0.14));
  color: var(--text-faint);
}

.now-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.now-logo svg {
  width: 22px;
  height: 22px;
}

.now-text {
  flex: 1 1 auto;
  min-width: 0;
}

.now-text h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.icon-btn.is-on {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

.icon-btn.is-on svg {
  fill: currentColor;
}

.player-hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 0 4px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.player-hint svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--text-dim);
}

/* Recent */

.recent {
  margin-top: 2px;
  padding: 13px 14px 15px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(15, 18, 30, 0.55);
  backdrop-filter: blur(14px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.recent-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.recent-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 250px;
  padding: 7px 12px 7px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.recent-chip:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-1px);
}

.recent-chip.is-active {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.14));
  box-shadow: 0 0 20px -8px rgba(139, 92, 246, 0.9);
}

.recent-chip img,
.recent-chip .recent-fb {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
}

.recent-chip .recent-fb {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.22));
}

.recent-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Sports view ---------- */

.sports-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.sports-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(100deg, #fff, #b9c4e4 45%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sports-head p {
  margin: 3px 0 0;
  color: var(--text-dim);
  font-size: 12.5px;
}

.sports-head p b {
  color: var(--cyan);
  font-weight: 700;
}

.sports-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sports-actions select {
  width: auto;
  min-width: 160px;
}

.date-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(15, 18, 30, 0.6);
  backdrop-filter: blur(14px);
}

.date-label {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  padding: 0 4px;
}

.date-label strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.date-label span {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.date-bar input[type="date"] {
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 6, 12, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  color-scheme: dark;
  cursor: pointer;
}

.date-bar input[type="date"]:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

.spacer {
  flex: 1 1 auto;
}

.sports-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  padding-right: 4px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-weight: 600;
}

.summary-pill.live {
  color: #ffb3c0;
  border-color: rgba(255, 59, 92, 0.35);
  background: rgba(255, 59, 92, 0.1);
}

.summary-pill.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: blink 1.2s infinite;
}

.sports-body {
  flex: 1 1 auto;
  min-height: 0;
}

.sports-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 10px;
}

/* League block */

.league {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 22, 36, 0.68), rgba(10, 12, 20, 0.72));
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: viewIn 0.45s var(--ease) both;
}

.league-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.055), transparent 45%);
}

.league-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  object-fit: contain;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.league-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.league-sport {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.league-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
}

.events {
  display: flex;
  flex-direction: column;
}

/* Event row */

.event {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  grid-template-areas:
    "time teams status"
    "time meta status";
  gap: 2px 14px;
  padding: 13px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  transition: background 0.18s;
  position: relative;
}

.event:first-child {
  border-top: 0;
}

.event:hover {
  background: rgba(255, 255, 255, 0.028);
}

.event.is-live {
  background: linear-gradient(90deg, rgba(255, 59, 92, 0.075), transparent 42%);
}

.event.is-live::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2.5px;
  border-radius: 4px;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.9);
}

.ev-time {
  grid-area: time;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-top: 2px;
}

.ev-time b {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #dfe5f7;
}

.ev-time span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-faint);
}

.ev-teams {
  grid-area: teams;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ev-team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13.5px;
}

.ev-team img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

.ev-logo-fb {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 800;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.ev-team .ev-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #dfe5f7;
}

.ev-team.is-loser .ev-name {
  color: var(--text-dim);
}

.ev-team.is-loser .ev-score {
  color: var(--text-dim);
}

.ev-score {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  padding-left: 8px;
}

.ev-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 31px;
  margin-top: 2px;
}

.ev-meta .dot {
  opacity: 0.5;
}

.ev-status {
  grid-area: status;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge.live {
  color: #ffc0cb;
  border-color: rgba(255, 59, 92, 0.4);
  background: rgba(255, 59, 92, 0.14);
  box-shadow: 0 0 18px -6px rgba(255, 59, 92, 0.85);
}

.badge.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: blink 1.1s infinite;
}

.badge.final {
  color: #c7d2fe;
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
}

.badge.scheduled {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.09);
}

.ev-clock {
  font-size: 11px;
  font-weight: 700;
  color: #ff9db0;
  font-variant-numeric: tabular-nums;
}

.ev-sub {
  font-size: 10.5px;
  color: var(--text-faint);
  text-align: right;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generic (multi-competitor) event */

.ev-generic {
  grid-template-columns: 74px minmax(0, 1fr) auto;
  grid-template-areas:
    "time name status"
    "time people status";
}

.ev-generic .ev-name-main {
  grid-area: name;
  font-size: 14px;
  font-weight: 650;
  color: #e6ebfb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-generic .ev-people {
  grid-area: people;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty & error states */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 70px 22px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(15, 18, 30, 0.4);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 26px;
}

.state h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.state p {
  margin: 0;
  max-width: 420px;
  color: var(--text-dim);
  font-size: 12.5px;
}

/* Sports skeleton */

.sports-skeleton {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sk-league {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(15, 18, 30, 0.5);
  overflow: hidden;
}

.sk-league-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sk-tile {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  flex: 0 0 30px;
}

.sk-league-head .sk-line {
  height: 10px;
}

.sk-event {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sk-event:first-of-type {
  border-top: 0;
}

.sk-event .sk-line {
  height: 9px;
}

.sk-event .sk-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sk-event .sk-tile {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
}

.sk-pill {
  width: 66px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
  position: relative;
  overflow: hidden;
}

.sk-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  animation: shimmer 1.5s infinite;
}

/* Top progress bar */

.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.top-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  transform: translateX(-100%);
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.9));
}

body.is-busy .top-progress {
  opacity: 1;
}

body.is-busy .top-progress::after {
  animation: progressSlide 1.3s ease-in-out infinite;
}

@keyframes progressSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---------- Footer ---------- */

.footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 22px 12px;
  color: var(--text-faint);
  font-size: 11px;
}

.footer a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer a:hover {
  color: var(--cyan);
}

.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(90vw, 460px);
  padding: 11px 17px;
  border-radius: 13px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(15, 18, 32, 0.94);
  backdrop-filter: blur(16px);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 26px -12px rgba(139, 92, 246, 0.8);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(255, 59, 92, 0.45);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 26px -12px rgba(255, 59, 92, 0.8);
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.25s ease;
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(82vh, 780px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: linear-gradient(180deg, rgba(22, 25, 41, 0.98), rgba(10, 12, 21, 0.98));
  box-shadow: 0 40px 100px -30px #000, 0 0 60px -30px rgba(139, 92, 246, 0.9);
  animation: modalIn 0.35s var(--ease);
  overflow: hidden;
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #a5f3fc;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
}

.modal-body {
  padding: 16px 22px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-item {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.api-item:hover {
  border-color: rgba(34, 211, 238, 0.28);
}

.api-item-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.method {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--lime);
  border: 1px solid rgba(163, 230, 53, 0.3);
  background: rgba(163, 230, 53, 0.08);
}

.api-path {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #e9d5ff;
}

.api-desc {
  margin: 6px 0 8px;
  color: var(--text-dim);
  font-size: 12px;
}

.api-example {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-example input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-dim);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  outline: none;
}

.api-example .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.api-example .icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .sidebar {
    flex-basis: 320px;
  }
  .main {
    padding: 16px;
  }
}

@media (max-width: 980px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  body {
    overflow-y: auto;
  }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .tabs {
    order: 3;
    width: 100%;
  }
  .tab {
    flex: 1;
    justify-content: center;
  }
  .live-dot {
    display: none;
  }
  .main {
    height: auto;
    padding: 14px;
  }
  .view {
    height: auto;
  }
  #view-live {
    flex-direction: column;
  }
  .stage {
    order: -1;
    overflow: visible;
  }
  .sidebar {
    flex: 0 0 auto;
    height: 66vh;
    min-height: 420px;
  }
  .footer {
    flex-direction: column;
    gap: 6px;
    padding-bottom: 18px;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 10px;
  }
  .player-card {
    border-radius: 16px;
  }
  .now-playing {
    flex-wrap: wrap;
    padding: 11px 12px;
  }
  .now-text {
    flex-basis: calc(100% - 62px);
  }
  .now-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  .sports-head h1 {
    font-size: 20px;
  }
  .sports-actions {
    width: 100%;
  }
  .sports-actions select {
    flex: 1;
  }
  .date-bar {
    gap: 7px;
    padding: 9px;
  }
  .date-label {
    min-width: 0;
    flex: 1;
  }
  .date-bar input[type="date"] {
    width: 100%;
    order: 6;
  }
  .spacer {
    display: none;
  }
  .sports-summary {
    width: 100%;
    padding: 2px 0 0;
  }
  .event {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 12px;
  }
  .ev-time b {
    font-size: 12.5px;
  }
  .ev-team {
    font-size: 12.5px;
  }
  .ev-meta {
    padding-left: 31px;
  }
  .ev-status {
    min-width: 62px;
  }
  .ev-sub {
    display: none;
  }
  .player-top {
    padding: 10px 12px 30px;
  }
  .pt-logo {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
  }
  .pt-text b {
    font-size: 12px;
  }
  .pt-text small {
    font-size: 9.5px;
  }
  .pt-live {
    padding: 3px 7px;
    font-size: 8.5px;
  }
  .pc-center {
    width: 58px;
    height: 58px;
  }
  .pc-center svg {
    width: 23px;
    height: 23px;
  }
  .pctl {
    padding: 36px 8px 7px;
  }
  .pctl-bar {
    margin-bottom: 7px;
  }
  .pctl-row {
    gap: 1px;
  }
  .pctl-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .pctl-btn svg {
    width: 18px;
    height: 18px;
  }
  .pctl-vol {
    display: none;
  }
  .pctl-time {
    display: none;
  }
  .pctl-live {
    margin-left: 3px;
    padding: 3px 6px;
    font-size: 8px;
    letter-spacing: 0.7px;
  }
  .pctl-pill {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }
  .pctl-menu {
    bottom: 34px;
  }
  .player-idle h2 {
    font-size: 15px;
  }
  .player-idle p {
    font-size: 11.5px;
  }
  .idle-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
  .idle-icon svg {
    width: 28px;
    height: 28px;
  }
  .modal-head {
    padding: 16px;
  }
  .modal-body {
    padding: 14px 16px 18px;
  }
}

/* ---------- Boot loader ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(24, 29, 52, 0.95), #04050a 68%),
    #04050a;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.boot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 10%, transparent 70%);
  animation: bootGrid 12s linear infinite;
}

@keyframes bootGrid {
  to { background-position: 48px 48px, 48px 48px; }
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}

.boot-logo {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  color: #05060b;
  background: var(--grad);
  box-shadow: 0 0 70px -10px rgba(139, 92, 246, 0.9), 0 0 40px -14px rgba(34, 211, 238, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: bootPulse 2.1s ease-in-out infinite;
}

.boot-logo svg {
  width: 46px;
  height: 46px;
}

@keyframes bootPulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 70px -10px rgba(139, 92, 246, 0.9); }
  50% { transform: translateY(-5px) scale(1.03); box-shadow: 0 0 90px -6px rgba(34, 211, 238, 0.9); }
}

.boot-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.boot-name span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.boot-bar {
  position: relative;
  width: 200px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.boot-bar i {
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  animation: bootSlide 1.15s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.9));
}

@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

.boot p {
  margin: 0;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
