:root {
  --tv-surface: #171b24;
  --tv-surface-raised: #1d222c;
  --tv-border: rgba(255, 255, 255, 0.1);
  --tv-text: #f4f6fb;
  --tv-muted: #a8afbf;
  --tv-accent: #6275ff;
  --tv-accent-2: #7658ff;
  --tv-live: #45d487;
  --tv-radius: 22px;
}

.tv2026-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(1480px, calc(100% - 40px));
  margin: 22px auto 40px;
}

.tvChannelCard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius);
  background: linear-gradient(
    145deg,
    rgba(29, 34, 44, 0.98),
    rgba(18, 21, 28, 0.98)
  );
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.tvChannelCard .channelInfo {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 20px 20px 14px;
}

.tvChannelCard .channelInfo .image {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 19px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.07),
    0 8px 20px rgba(0, 0, 0, 0.24);
}

.tvChannelCard .channelInfo .image > a {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.channelLogoOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14),
    transparent 60%
  );
}

.channelMeta {
  flex: 1;
  min-width: 0;
}

.tvChannelCard .channelMeta > .name,
.radioChannelCard .channelMeta > .name {
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--tv-text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tvChannelCard .current {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--tv-muted);
  font-size: 13px;
}

.currentDot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tv-live);
  box-shadow: 0 0 0 4px rgba(69, 212, 135, 0.1);
}

.currentLabel {
  flex: 0 0 auto;
  color: var(--tv-live);
  font-weight: 700;
}

.currentProgramme {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channelActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 0 20px 20px;
}

.channelActions.radioActions {
  grid-template-columns: 1fr;
}

.channelActions .showEpg,
.channelActions .play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--tv-border);
  border-radius: 14px;
  color: var(--tv-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.channelActions .showEpg {
  background: rgba(255, 255, 255, 0.06);
}

.channelActions .play {
  border-color: rgba(112, 101, 255, 0.65);
  background: linear-gradient(135deg, var(--tv-accent), var(--tv-accent-2));
}

.channelActions .showEpg:hover,
.channelActions .showEpg:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.channelActions .play:hover,
.channelActions .play:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #7182ff, #866cff);
}

.actionIcon {
  position: relative;
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.actionIconPlay::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.actionIconEpg::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow:
    0 4px 0 currentColor,
    0 8px 0 currentColor;
}

.channelEpg {
  margin: 0 14px 16px;
  overflow: hidden;
  border: 1px solid var(--tv-border);
  border-radius: 16px;
  background: rgba(5, 7, 11, 0.38);
}

.epgHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--tv-border);
}

.epgTitle {
  color: var(--tv-text);
  font-weight: 700;
}

.epgDay {
  display: flex;
  align-items: center;
  gap: 7px;
}

.epgDay select,
.prevDay,
.nextDay {
  min-height: 36px;
  border: 1px solid var(--tv-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tv-text);
}

.epgDay select {
  padding: 0 10px;
}

.prevDay,
.nextDay {
  position: relative;
  width: 36px;
  cursor: pointer;
}

.prevDay::before,
.nextDay::before {
  content: "";
  position: absolute;
  top: 13px;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--tv-muted);
  border-right: 2px solid var(--tv-muted);
}

.prevDay::before {
  left: 14px;
  transform: rotate(-135deg);
}
.nextDay::before {
  left: 11px;
  transform: rotate(45deg);
}

.channelEpg ul {
  max-height: 420px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.channelEpg li {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.channelEpg li:last-child {
  border-bottom: 0;
}
.channelEpg li.epgCurrent {
  background: rgba(98, 117, 255, 0.1);
}
.epgTime {
  color: var(--tv-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.epgContent {
  min-width: 0;
}
.epgContent .name {
  color: var(--tv-text);
  font-size: 14px;
  font-weight: 700;
}
.epgContent .descr {
  margin-top: 5px;
  color: var(--tv-muted);
  font-size: 12px;
  line-height: 1.45;
}
.epgActions {
  align-self: center;
}
.playTimeShift,
.curr {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.playTimeShift {
  border: 1px solid var(--tv-border);
  color: var(--tv-text);
  background: rgba(255, 255, 255, 0.07);
}
.curr {
  color: var(--tv-live);
  background: rgba(69, 212, 135, 0.1);
}

.channelPlayer,
.radioPlayer {
  position: relative;
  z-index: 3;
  isolation: isolate;
  flex: 0 0 auto;
  width: 100%;
  padding: 0 20px 20px;
  box-sizing: border-box;
}

.channelPlayer .player,
.channelPlayer .my-video {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  border-radius: 15px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.channelPlayer video,
.standalonePlayer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.standalonePlayer {
  width: min(1100px, calc(100% - 40px));
  margin: 24px auto;
  overflow: hidden;
  border-radius: var(--tv-radius);
  background: #000;
  aspect-ratio: 16 / 9;
}

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

@media (max-width: 860px) {
  .tv2026-grid {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 24px));
    gap: 15px;
    margin-top: 14px;
  }

  .tvChannelCard .channelInfo {
    padding: 16px 16px 12px;
  }
  .tvChannelCard .channelInfo .image {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }
  .channelActions {
    padding: 0 16px 16px;
  }
  .channelPlayer,
  .radioPlayer {
    padding: 0 16px 16px;
  }
}

@media (max-width: 480px) {
  .channelActions {
    grid-template-columns: 1fr;
  }
  .epgHeader {
    align-items: stretch;
    flex-direction: column;
  }
  .epgDay select {
    flex: 1;
    min-width: 0;
  }
  .channelEpg li {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .epgActions {
    grid-column: 2;
  }
}
