.livetvpage-main-container {
  position: relative;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  background-position: center;
  padding-right: 40px;
  color: white;
  padding-left: 40px;
  background-image: url("../assets/bg-gradient.png");
  height: calc(100 * var(--vh, 1vh));
  animation: fadeInOut 1s ease-in-out;
}

/* In basso, fisso: come si aggiunge un canale ai preferiti (28 settembre 2026). */
.livetv-suggerimento {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

/* Header */

/* Search */

.livetv-content-container {
  padding-top: 2%;
  padding-bottom: 30px;
  display: flex;
  width: 100%;
}

.livetv-channels-list {
  width: 25%;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  height: calc(81 * var(--vh, 1vh));
  overflow-y: scroll;
  padding: 10px 15px;
}

.livetv-channel-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  color: #e3e2ff;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
}

.livetv-channel-category:hover {
  background-color: var(--gold);
  color: white;
}

.livetv-channel-category-focused {
  background-color: var(--gold) !important;
  color: white !important;
}

.livetv-channel-category-active {
  color: var(--gold);
}

.livetv-channel-category-name {
  flex: 1;
  text-align: left;
  font-size: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.livetv-channel-category-count {
  font-size: 24px;
  text-align: right;
  margin-left: 10px;
}

/* Right: Channels grid */
.livetv-channels-list-container {
  width: 30%;
  max-height: calc(81 * var(--vh, 1vh));
  overflow-y: auto;
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 20px;
  padding-right: 30px;
  margin-left: 20px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.4);
}

.channel-card {
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-left: 24px;
  background-color: black;
  padding-right: 24px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.channel-card-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.channel-card .channel-card-name {
  padding-left: 14px;
  font-size: 22px;
}

/* Scrollbars off */
.livetv-channels-list::-webkit-scrollbar,
.livetv-channels-list-container::-webkit-scrollbar {
  display: none;
}
.livetv-channels-list,
.livetv-channels-list-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Focus helpers */

.livetv-no-data {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(50 * var(--vh, 1vh));
  width: 100%;
  font-size: 40px;
  color: var(--gold);
}

.channel-card-focused {
  box-shadow: inset 0 0 0 2px var(--gold) !important;
}

/* Selected channel (currently playing) */
.channel-card-selected {
  border: 2px solid var(--gold);
  background: rgba(245, 197, 24, 0.1);
}

/* NESSUN CLIP SUL CONTENITORE DEL <video> (The Frame 2020, Tizen 5.5, 12
   settembre 2026). Qui c'erano border-radius: 10px e overflow-y: hidden:
   su Tizen un clip arrotondato su un antenato del <video> nativo ne
   impedisce la composizione - il decoder lavorava (1280x720, readyState 4,
   currentTime che avanzava) e l'anteprima era SOLO AUDIO; a schermo intero
   il player e' position: fixed, sfugge al clip, e si vedeva. Misurato con
   un foglio che toglieva solo quelle due proprieta': il video e' comparso.
   test-anteprima 1 tiene fermo che nessun antenato del <video> clippi. */
.livetv-video-wrapper {
  margin-left: 20px;
  width: 45%;
  height: calc(81 * var(--vh, 1vh));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative; /* Add this */
}
.livetv-video-wrapper > * + * {
  margin-top: 17px; /* era gap: 17px (Chromium 84); qui webOS 5 */
}

.live-video-player-div {
  width: 100%;
  height: 50%;
  position: relative;
  z-index: 2; /* Add this */
}

.livetv-player-epg {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  height: 100%;
  margin-top: 20px; /* Change from 20px to 0 */
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 1; /* Add this */
}

.livetv-player-epg::-webkit-scrollbar {
  display: none;
}

.livetv-player-epg-item {
  margin-bottom: 25px;
}

.livetv-player-epg-item .livetv-player-epg-title:first-child {
  font-size: 26px;
  color: var(--gold);
}

.livetv-player-epg-description {
  font-size: 26px;
  width: 100%;
  color: rgba(188, 188, 188, 1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.livetv-loading {
  text-align: center;
  padding: 50px;
  font-size: 18px;
  color: #fff;
}

.channel-card-logo {
  object-fit: contain;
}

.livetv-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(50 * var(--vh, 1vh));
  width: 100%;
}

.live-video-player-div {
  width: 100%;
  height: 50%;
  position: relative;
}

/* Top overlays container */
.live-top-overlays {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 30;
  pointer-events: none;
}

.live-channel-name {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 18px;
  color: #fff;
}
.live-channel-name > * + * {
  margin-left: 8px; /* era gap: 8px (Chromium 84); qui webOS 5 */
}

.live-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: red;
  color: white;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.livetv-video-wrapper .live-video-player-div .video-js {
  height: 100% !important;
  width: 100% !important;
}

/* Flowplayer should fill container and hide native controls */
.live-video-player-div .flowplayer,
.live-video-player-div .flowplayer video {
  height: 100% !important;
  width: 100% !important;
}
.live-video-player-div .fp-ui,
.live-video-player-div .fp-controls,
.live-video-player-div .fp-engine {
  background: transparent !important;
}
.live-video-player-div .fp-controls,
.live-video-player-div .fp-playbtn,
.live-video-player-div .fp-fullscreen,
.live-video-player-div .fp-time,
.live-video-player-div .fp-embed,
.live-video-player-div .fp-brand,
.live-video-player-div .fp-volume,
.live-video-player-div .fp-qualities,
.live-video-player-div .fp-chromecast,
.live-video-player-div .fp-settings {
  display: none !important;
}

/* Hide Flowplayer internal waiting spinner; use our loader instead */
.live-video-player-div .fp-waiting {
  display: none !important;
}

/* Responsive adjustments for live video controls */
@media (max-width: 1200px) {
  /* gap tolto (Chromium 84): su un TV 1920 questa media non vale. */
  .live-control-btn {
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 768px) {
  .live-control-btn {
    width: 40px;
    height: 40px;
  }

  .live-video-loader {
    font-size: 16px;
  }

  .live-spinner {
    width: 35px;
    height: 35px;
  }
}

/* Live Video Player Loading and Controls */
.live-video-loader {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  zoom: 1.5;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1250;
  color: var(--gold);
  font-size: 18px;
}
/* Live Video Player Loading and Controls */ .live-video-loader > * + * {
  margin-top: 16px; /* era gap: 16px (Chromium 84); qui webOS 5 */
}

.live-video-loader.hidden {
  display: none;
}

.live-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(245, 197, 24, 0.3);
  border-top: 3px solid var(--gold);
  border-radius: 50%;
  animation: liveSpin 1s linear infinite;
}

@keyframes liveSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error Overlay */
.live-video-error {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  color: var(--gold);
  font-size: 18px;
}
/* Error Overlay */ .live-video-error > * + * {
  margin-top: 16px; /* era gap: 16px (Chromium 84); qui webOS 5 */
}

.live-video-error.hidden {
  display: none;
}

.live-video-error .error-icon {
  font-size: 48px;
}

.live-video-error .retry-btn {
  padding: 10px 20px;
  background: var(--gold);
  color: black;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.live-video-error .retry-btn:hover {
  background: white;
}

.live-video-controls {
  left: 50%;
  position: absolute;
  bottom: 0%;
  transform: translate(-50%, -50%);
  display: flex;
  zoom: 1.4;
  padding-right: 20px;
  z-index: 15;
  width: 100%;
  justify-content: flex-end;

  /* opacity: 0; */
  transition: opacity 0.3s ease;
}
.live-video-controls > * + * {
  margin-left: 20px; /* era gap: 20px (Chromium 84); qui webOS 5 */
}

.live-video-player-div:hover .live-video-controls {
  opacity: 1;
}

.live-control-btn {
  width: 40px;
  height: 40px;
  /* border-radius: 50%; */
  border: 2px solid var(--gold);
  background: rgba(0, 0, 0, 0.7);
  color: var(--gold);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-control-btn:hover {
  background: var(--gold);
  color: black;
  transform: scale(1.1);
}

.live-control-btn:active {
  transform: scale(0.95);
}

.live-control-btn-focused {
  background: var(--gold) !important;
  color: white !important;
  transform: scale(1.1);
  /* box-shadow: 0 0 20px rgba(245, 197, 24, 0.5); */
}

/* Hide controls when video is loading or has error */
.live-video-loader:not(.hidden) ~ .live-video-controls,
.live-video-error:not(.hidden) ~ .live-video-controls {
  opacity: 0 !important;
}

.live-fullscreen-btn-icon {
  font-size: 26px;
}

.channel-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.channel-card {
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-left: 24px;
  background-color: black;
  padding-right: 24px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.channel-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.channel-fav-btn {
  border-radius: 6px; /* il raggio sta sull'elemento: l'anello lo legge da qui */
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  zoom: 1.8;
  justify-content: center;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.channel-fav-btn-focused {
  box-shadow: inset 0 0 0 2px white;
}

.channel-remove-btn-focused {
  box-shadow: inset 0 0 0 2px white;
}
.channel-fav-btn .fa-solid {
  color: red;
}

.livetv-no-data-channel {
  display: flex;
  justify-content: center;
  align-items: center;
  zoom: 1.6;
  height: calc(50 * var(--vh, 1vh));
  width: 100%;
  font-size: 40px;
  color: var(--gold);
}

.livetv-no-data-channel-category {
  display: flex;
  height: calc(50 * var(--vh, 1vh));
  width: 100%;
  font-size: 30px;
  color: var(--gold);
}

.livetv-no-results-full-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
}

.livetv-no-results-content {
  text-align: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  border: 2px solid var(--gold);
}

.livetv-no-results-title {
  font-size: 48px;
  color: var(--gold);
  margin-bottom: 20px;
}

.livetv-no-results-message {
  font-size: 32px;
  color: white;
}

.livetv-no-results-message span {
  color: var(--gold);
}

.livetv-no-results-message {
  font-size: 40px;
  color: white;
  margin-bottom: 15px;
  font-weight: 400;
}

.livetv-no-results-suggestion {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.livetv-no-results-message span {
  color: var(--gold);
}

/* Lock icon styling for Live TV categories */
.livetv-category-lock-icon {
  position: absolute;
  color: #ff6b6b;
  transform: translate(-50%, -50%);
  text-align: center;
  top: 50%;
  left: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  width: 100%;
  font-size: 24px;
  padding: 20px;
  z-index: 10;
}

/* No URL Message Styles */
.live-no-url-message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 10;
  color: var(--gold);
}
/* No URL Message Styles */ .live-no-url-message > * + * {
  margin-top: 20px; /* era gap: 20px (Chromium 84); qui webOS 5 */
}

.no-url-icon {
  font-size: 80px;
  opacity: 0.7;
}

.no-url-text {
  font-size: 32px;
  color: white;
  text-align: center;
  font-weight: 500;
  margin: 0;
}

.sidebar-container-live {
  position: absolute;
  top: 80px;
  right: 0;
  left: 50;
  z-index: 9999;
}

.channel-card-playing {
  background-color: var(--gold);
  color: white;
}

.live-video-player-div .video-js .vjs-tech {
  height: 100% !important;
}

/* flow-player */
.fp-message .fp-shown {
  opacity: 0 !important;
}

.fp-ui {
  background-color: black !important;
}

.flowplayer .fp-player {
  background: black !important;
}
.fp-waiting {
  display: none !important;
}

.channel-card-buttons {
  display: flex;
  align-items: center;
}

.channel-remove-btn {
  border-radius: 6px; /* il raggio sta sull'elemento: l'anello lo legge da qui */
  margin-left: 10px;
}

.channel-remove-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  zoom: 1.8;
  justify-content: center;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.channel-remove-btn:hover,
.channel-remove-btn-focused {
  box-shadow: inset 0 0 0 2px white;
}

.channel-remove-btn i {
  color: #ff4444;
  font-size: 14px !important;
  font-weight: 900 !important;
}
.channel-history-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  zoom: 1.4;
  height: 100%;
  z-index: 9999; /* Increased z-index */
  display: block;
}

.dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* Darker overlay */
}

.dialog-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: black;
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 20px;
  min-width: 300px;
  z-index: 10000; /* Higher than overlay */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

.dialog-content h3 {
  margin: 0 0 15px 0;
  color: white;
  text-align: center;
  font-size: 18px;
}

.dialog-option {
  display: flex;
  align-items: center;
  padding: 12px;
  margin: 8px 0;
  border-radius: 4px;
  border: 2px solid white;
  cursor: pointer;
  transition: background-color 0.2s;
  color: white;
}

.dialog-option:hover {
  background-color: #333;
}

.dialog-option.focused {
  background-color: var(--gold);
  color: white;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.dialog-option i {
  margin-right: 10px;
  font-size: 18px;
  width: 20px;
  text-align: center;
}/* Il player a schermo intero: le regole stanno in coda al foglio (fisso, 100vw x 100vh). */
:-webkit-full-screen .live-top-overlays {
  display: flex !important;
  z-index: 1000;
}
:fullscreen .live-top-overlays {
  display: flex !important;
  z-index: 1000;
}
:-webkit-full-screen .live-video-controls {
  display: flex !important;
  z-index: 1000;
}
:fullscreen .live-video-controls {
  display: flex !important;
  z-index: 1000;
}
:fullscreen .live-top-overlays {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
}
:-webkit-full-screen .live-top-overlays {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
}
:fullscreen .live-video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  transform: none;
  left: auto;
}
:-webkit-full-screen .live-video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  transform: none;
  left: auto;
}

.live-top-overlays {
  z-index: 1000;
}

.live-video-controls {
  z-index: 1000;
}

.live-video-loader,
.live-video-error {
  z-index: 1250; /* sopra l'OSD (1200): la rotella non finisce sotto il Play/Stop */
}

:fullscreen .video-js {
  height: 100% !important;
  width: 100% !important;
}
:fullscreen .flowplayer {
  height: 100% !important;
  width: 100% !important;
}
:fullscreen video {
  height: 100% !important;
  width: 100% !important;
}
:-webkit-full-screen .video-js {
  height: 100% !important;
  width: 100% !important;
}
:-webkit-full-screen .flowplayer {
  height: 100% !important;
  width: 100% !important;
}
:-webkit-full-screen video {
  height: 100% !important;
  width: 100% !important;
}

.live-top-overlays,
.live-video-controls {
  transition: opacity 0.3s ease;
}

.live-video-player-div:hover .live-video-controls {
  opacity: 1;
}

.live-channel-name,
.live-badge {
  display: flex !important;
}/* ===== FULLSCREEN UI FIXES ===== */

/* Make sure overlays stay visible in fullscreen */
:-webkit-full-screen .live-top-overlays {
  display: flex !important;
  z-index: 1250;
}
:fullscreen .live-top-overlays {
  display: flex !important;
  z-index: 1250;
}
:-webkit-full-screen .live-top-overlays {
  display: flex !important;
  z-index: 1250;
}
:-webkit-full-screen .live-video-controls {
  display: flex !important;
  z-index: 1250;
}
:fullscreen .live-video-controls {
  display: flex !important;
  z-index: 1250;
}
:-webkit-full-screen .live-video-loader {
  z-index: 1250;
}
:fullscreen .live-video-loader {
  z-index: 1250;
}
:-webkit-full-screen .live-video-error {
  z-index: 1250;
}
:fullscreen .live-video-error {
  z-index: 1250;
}/* Position elements correctly in fullscreen */
:fullscreen .live-top-overlays {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
}
/* Position elements correctly in fullscreen */
:-webkit-full-screen .live-top-overlays {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
}
:fullscreen .live-video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  transform: none;
  left: auto;
}
:-webkit-full-screen .live-video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  transform: none;
  left: auto;
}

/* Ensure proper z-index for all overlay elements */
.live-top-overlays {
  z-index: 1000;
}

.live-video-controls {
  z-index: 1000;
}

.live-video-loader,
.live-video-error {
  z-index: 1250; /* Higher than other overlays */
}/* Make sure video element fills container in fullscreen */
:fullscreen .video-js {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}
:fullscreen .flowplayer {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}
:fullscreen video {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}
/* Make sure video element fills container in fullscreen */
:-webkit-full-screen .video-js {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}
:-webkit-full-screen .flowplayer {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}
:-webkit-full-screen video {
  height: 100% !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}

/* Additional styles to ensure UI elements remain visible */
.live-top-overlays,
.live-video-controls {
  transition: opacity 0.3s ease;
}

.live-video-player-div:hover .live-video-controls {
  opacity: 1;
}

/* Keep channel name and badge visible at all times */
.live-channel-name,
.live-badge {
  display: flex !important;
}/* Fix for Flowplayer in fullscreen */
:fullscreen .flowplayer {
  background: #000 !important;
}
/* Fix for Flowplayer in fullscreen */
:-webkit-full-screen .flowplayer {
  background: #000 !important;
}
:fullscreen .flowplayer .fp-player {
  background: #000 !important;
}
:-webkit-full-screen .flowplayer .fp-player {
  background: #000 !important;
}
#live-fullscreen-btn {
  opacity: 0 !important;
}

.livetv-fullpage-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: calc(calc(100 * var(--vh, 1vh)) - 200px); /* Exclude header height */
  width: 100%;
  background: var(--background);
  color: white;
}

/* Il velo di caricamento sta sulla LISTA dei canali (12 settembre, il lampo
   sul 2019): la lista e' il suo contenitore posizionato. */
.livetv-channels-list-container {
  position: relative;
}
.livetv-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.livetv-loading-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  border-radius: 10px;
}

.retry-btn-focused {
  box-shadow: inset 0 0 0 4px white !important;
}
.play-pause-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  font-size: 60px;
  width: 120px; /* circle width */
  height: 120px; /* circle height */
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.play-pause-icon i {
  display: flex;
  justify-content: center;
  height: 100%;
  align-items: center;
}

#live-play-pause-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  border: none;
  outline: none;
  font-size: 40px;
  background: none !important;
  transform: translate(-50%, -50%);
}

.play-pause-btn-focused {
  box-shadow: 0 0 0 4px var(--gold);
}

#live-play-pause-btn.play-pause-btn-focused {
  box-shadow: 0 0 0 4px var(--gold);
}

.livetv-player-epg-focused {
  box-shadow: 0 0 0 4px var(--gold) !important;
}

/* Disable CSS transitions on older devices for better performance */
.channel-card,
.livetv-channel-category {
  transition: none !important;
}

/* Use GPU acceleration for scrolling containers */
.livetv-channels-list,
.livetv-channels-list-container {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: scroll-position;
}

/* Optimize rendering */
.channel-card-focused,
.livetv-channel-category-focused {
  transform: translateZ(0);
}

.channel-card-locked {
  opacity: 0.6;
  filter: blur(5px);
  position: relative;
}

.channel-card-lock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: var(--gold);
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-card-logo-wrapper {
  position: relative;
}

.livetv-player-epg-item-focused {
  box-shadow: inset 0 0 0 2px var(--gold) !important;
  z-index: 10;
  position: relative;
}

.live-top-overlays {
  opacity: 0 !important;
}

/* Live Player Focus Styles */
/* .aspect-ratio-button.focused,
.play-pause-icon.focused,
.live-control-btn.focused {
  outline: 2px solid var(--gold) !important;
  outline-offset: -2px;
  background: rgba(255, 215, 0, 0.1) !important;
  transform: scale(1.05);
}

.play-pause-icon {
  transition: all 0.2s ease;
}

.aspect-ratio-container {
  position: absolute;
  bottom: 80px;
  right: 20px;
  z-index: 100;
} */

.videojs-aspect-ratio-div {
  position: absolute;
  z-index: 10;
  color: #fff;
  border-radius: 50%;
  bottom: -20px;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#videojs-aspect-ratio {
  padding: 20px;
  border: 2px solid white;
  color: white;
  font-size: 20px;
  background: black;
  display: flex;
  white-space: nowrap;
  align-items: center;
  cursor: pointer;
}

#videojs-aspect-ratio:hover {
  padding: 10px;
  border: 2px solid white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}

#videojs-aspect-ratio-focused {
  box-shadow: inset 0 0 0 2px white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}

#videojs-aspect-ratio i {
  margin-right: 10px;
}

#flowplayer-live {
  position: relative;
}
.flow-aspect-ratio-div {
  position: absolute;
  bottom: 0px;
  left: 50%;
  z-index: 10;
  border: none;
  outline: none;
  font-size: 40px;
  background: none !important;
  transform: translate(-50%, -50%);
}

#flow-aspect-ratio {
  padding: 10px;
  border: 2px solid white;
  color: white;
  background: black;
  display: flex;
  white-space: nowrap;
  align-items: center;
  cursor: pointer;
}

#flow-aspect-ratio:hover {
  padding: 10px;
  border: 2px solid white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}

#flow-aspect-ratio-focused {
  box-shadow: inset 0 0 0 2px white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}

#flow-aspect-ratio i {
  margin-right: 10px;
}

#videojs-aspect-ratio.videojs-aspect-ratio-btn-focused,
#flow-aspect-ratio.flow-aspect-ratio-btn-focused {
  box-shadow: inset 0 0 0 2px white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}

/* Uscita dal fullscreen ---------------------------------------------------
   Sta nella stessa barra del pulsante Aspect Ratio e ne condivide la sorte:
   compare entrando in fullscreen, sparisce con gli altri dopo 5 secondi.
   Prima l'unica via d'uscita era il tasto Back del telecomando, e quando
   quello non funziona non se ne esce piu'. */
.videojs-aspect-ratio-div,
.flow-aspect-ratio-div {
  display: flex;
  align-items: center;
}
/* Uscita dal fullscreen ---------------------------------------------------
   Sta nella stessa barra del pulsante Aspect Ratio e ne condivide la sorte:
   compare entrando in fullscreen, sparisce con gli altri dopo 5 secondi.
   Prima l'unica via d'uscita era il tasto Back del telecomando, e quando
   quello non funziona non se ne esce piu'. */ .videojs-aspect-ratio-div > * + *,
.flow-aspect-ratio-div > * + * {
  margin-left: 14px; /* era gap: 14px (Chromium 84); qui webOS 5 */
}

#live-exit-fullscreen-btn {
  padding: 20px;
  border: 2px solid white;
  color: white;
  font-size: 20px;
  background: black;
  display: flex;
  white-space: nowrap;
  align-items: center;
  cursor: pointer;
}

#live-exit-fullscreen-btn i {
  margin-right: 10px;
}

#live-exit-fullscreen-btn:hover,
#live-exit-fullscreen-btn.live-exit-fullscreen-btn-focused {
  box-shadow: inset 0 0 0 2px white;
  color: white;
  background: var(--gold);
  cursor: pointer;
}
/* Schermo intero sul CONTENITORE dell'anteprima ---------------------------
   Ci si va col contenitore e non col player, perche' cambiare canale
   ricostruisce il player: chiedendolo a quello, ogni zap faceva uscire e
   rientrare, e si vedeva la lista per un istante. Il contenitore
   sopravvive, quindi qui dentro va detto che i figli devono riempirlo.
   (12 settembre: questo commento era stato spezzato dallo strumento che
   divideva le liste di selettori: il suo testo era diventato "selettori"
   e la regola qui sotto era invalida. test-compat 2e.) */
.livetv-video-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #000;
}
.livetv-video-wrapper:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
}
.livetv-video-wrapper:fullscreen .live-video-player-div {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  z-index: 1000 !important; /* sotto OSD (1200), rotella (1250) e messaggi (toaster) */
  background: #000 !important;
}
.livetv-video-wrapper:-webkit-full-screen .live-video-player-div {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  z-index: 1000 !important; /* sotto OSD (1200), rotella (1250) e messaggi (toaster) */
  background: #000 !important;
}
.livetv-video-wrapper:fullscreen .video-js .vjs-tech {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.livetv-video-wrapper:fullscreen .video-js {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}
.livetv-video-wrapper:-webkit-full-screen .video-js .vjs-tech {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.livetv-video-wrapper:-webkit-full-screen .video-js {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}/* L'EPG non entra a schermo intero. Con !important: la guida sta DENTRO
   .live-video-player-div e una vecchia regola la forzava visibile a
   schermo intero (display: flex !important): si prendeva meta' altezza e
   il video restava a 520 px (Samsung 2019, 12 settembre). */
.livetv-video-wrapper:fullscreen .livetv-player-epg {
  display: none !important;
}
.livetv-video-wrapper:-webkit-full-screen .livetv-player-epg {
  display: none !important;
}
