/* Additive styles for the native media path and Chromecast controls. */
.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.video iframe[hidden],
.video video[hidden],
.cast-button[hidden],
.cast-status[hidden] {
  display: none;
}

.cast-button {
  color: #fff;
  border-color: #ffffff55;
}

.cast-button:hover,
.cast-button[aria-pressed="true"] {
  border-color: #e0b47d;
  color: #e0b47d;
}

.cast-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

/* Keep inline icon fonts and SVGs centered inside their existing controls. */
.primary-options__toggle > i,
.tools .filter > i,
.app-install-trigger > i,
.app-platform-icon > i,
.app-install-mark > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1em;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
}

.event-arrows button {
  display: grid;
  place-items: center;
  padding: 0;
  font-family: Arial, sans-serif;
}

.pbtn svg,
.back-to-top svg,
.vpn-download svg,
.telegram-link svg,
.cast-button svg {
  display: block;
  flex: 0 0 auto;
}

.cast-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.latency-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 42px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.latency-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 420px) {
  .latency-toggle span {
    display: none;
  }
}

.latency-toggle[aria-pressed="true"]:not(:disabled) {
  border-color: var(--accent, #e0b47d);
  background: color-mix(in srgb, var(--accent, #e0b47d) 22%, #0b0f16);
  color: var(--accent, #e0b47d);
}

.latency-toggle:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.cast-status {
  flex: 1 1 100%;
  color: #f1d5a8;
  font-size: 12px;
  line-height: 1.4;
  text-shadow: 0 1px 3px #000;
}

/* Sports API cards have a title and poster instead of separate team fields. */
.event-card--fixture .event-fixture {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 130px;
  overflow: hidden;
  border-radius: 10px;
  background: #0d0c0a;
}

.event-card--fixture .event-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
}

.event-card--fixture .event-title {
  position: relative;
  padding: 16px 12px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 1px 5px #000;
}

/* Context shown on direct channel/category URLs; it follows existing tokens. */
.route-intro {
  margin: 18px 0 8px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line, #393229);
  border-radius: 15px;
  background: linear-gradient(145deg, #211d17, #15130f);
}

.route-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(21px, 4vw, 30px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.route-intro p {
  max-width: 75ch;
  margin: 0;
  color: var(--muted, #aaa);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.route-intro a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent, #e0b47d) 48%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #e0b47d) 10%, transparent);
  color: var(--accent, #e0b47d);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.route-intro a::after {
  content: "›";
  font-size: 20px;
  line-height: .8;
}

.route-intro a:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #e0b47d);
  background: color-mix(in srgb, var(--accent, #e0b47d) 17%, transparent);
}

.route-intro a:focus-visible {
  outline: 2px solid var(--accent, #e0b47d);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .route-intro a {
    max-width: 100%;
    font-size: 13px;
  }
}

.events-loading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.loading-indicator {
  display: inline-flex;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--accent, #e0b47d);
}

.loading-indicator svg {
  width: 100%;
  height: 100%;
  animation: events-loader-spin .8s linear infinite;
}

.loading-track,
.loading-arc {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.loading-track {
  opacity: .25;
}

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

a.channel {
  color: inherit;
  text-decoration: none;
}

.player.native-media-active .side {
  bottom: 78px;
}

.player-swipe-hint {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  padding: 11px 17px;
  border: 1px solid #ffffff35;
  border-radius: 999px;
  background: #0b0f16df;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  backdrop-filter: blur(10px);
}

.player-swipe-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.player-gesture-rail {
  position: absolute;
  z-index: 5;
  top: 30%;
  display: none;
  width: 26px;
  height: 40%;
  background: transparent;
  touch-action: none;
}

.player.frame-gesture-enabled .player-gesture-rail {
  display: block;
}

.player-gesture-rail--left {
  left: 0;
}

.player-gesture-rail--right {
  right: 0;
}

.player-gesture-rail::after {
  position: absolute;
  top: 50%;
  left: 4px;
  content: "↕";
  color: #ffffff9c;
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 1px 5px #000;
  transform: translateY(-50%);
}

.player.native-media-active .info {
  display: none;
}

.player.native-media-active .show-controls {
  bottom: 78px;
}

.native-player-controls {
  position: absolute;
  z-index: 4;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: none;
  align-items: center;
  gap: 12px;
  width: min(720px, calc(100% - 24px));
  min-height: 58px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid #ffffff26;
  border-radius: 15px;
  background: #0b0f16e8;
  color: #fff;
  box-shadow: 0 12px 36px #0009;
  backdrop-filter: blur(14px);
}

.player.native-media-active .native-player-controls {
  display: flex;
}

.player.controls-hidden .native-player-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.native-control-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid #ffffff30;
  border-radius: 11px;
  background: #ffffff0c;
  color: inherit;
  cursor: pointer;
}

.native-control-button:hover {
  border-color: var(--accent, #e0b47d);
  color: var(--accent, #e0b47d);
}

.native-control-button:focus-visible,
.native-seek:focus-visible,
.native-volume:focus-visible {
  outline: 2px solid var(--accent, #e0b47d);
  outline-offset: 3px;
}

.native-control-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.native-control-button[data-action="play"] svg path {
  fill: currentColor;
  stroke: none;
}

.native-timeline {
  display: grid;
  flex: 1 1 auto;
  min-width: 80px;
  gap: 5px;
}

.native-seek,
.native-volume {
  height: 5px;
  margin: 0;
  border-radius: 99px;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff2e;
  cursor: pointer;
}

.native-seek {
  width: 100%;
  background: linear-gradient(to right, var(--accent, #e0b47d) var(--seek-progress, 0%), #ffffff73 var(--seek-progress, 0%), #ffffff73 var(--seek-buffer, 0%), #ffffff2e var(--seek-buffer, 0%));
}

.native-seek::-webkit-slider-thumb,
.native-volume::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent, #e0b47d);
}

.native-seek::-moz-range-thumb,
.native-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent, #e0b47d);
}

.native-time {
  display: flex;
  justify-content: space-between;
  color: #d8d5d0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.native-volume {
  width: 76px;
  flex: 0 0 76px;
  background: linear-gradient(to right, var(--accent, #e0b47d) var(--volume-level, 100%), #ffffff2e var(--volume-level, 100%));
}

@media (max-width: 480px) {
  .native-player-controls {
    gap: 8px;
    min-height: 54px;
    padding: 8px;
    border-radius: 13px;
  }

  .native-control-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .native-volume {
    width: 48px;
    flex-basis: 48px;
  }
}

@media (max-width: 700px) {
  .player.native-media-active .side {
    bottom: 72px;
  }

  .player.native-media-active .show-controls {
    bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .native-player-controls,
  .native-control-button {
    transition: none;
  }

  .loading-indicator svg {
    animation-duration: 1.8s;
  }

  .channel,
  .pbtn,
  .event-card {
    scroll-behavior: auto;
    transition-duration: .01ms;
  }
}
