/* Player de mídia DOM (webOS 5 / Chromium 68) replicando o player Flutter
   (bitmovin_video_player _Player*). Valores base = 720p, que é a resolução da
   TV Pro:Centric; no Flutter o scale nesse tamanho é 1.0, então os números
   batem 1:1 (scrim, dock inferior, botões circulares, cartão de status). */
.hm-player,
.hm-player * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.hm-player {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 180px;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Roboto', Arial, Helvetica, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.hm-player__engine,
.hm-player__bitmovin,
.hm-player__bitmovin > div,
.hm-player__video {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  background: #000;
}

.hm-player__video,
.hm-player__bitmovin video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.hm-player__icon {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Overlay: scrim + topo + dock ---------- */
.hm-player__overlay {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  /* Scrim do Flutter: preto 0.18 no topo, transparente no miolo, preto 0.40
     embaixo (stops 0 / 0.25 / 0.60 / 1). */
  background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.40) 100%);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.40) 100%);
}

.hm-player[data-controls-visible="true"] .hm-player__overlay,
.hm-player[data-media-state="paused"] .hm-player__overlay,
.hm-player[data-media-state="ended"] .hm-player__overlay,
.hm-player[data-media-state="stopped"] .hm-player__overlay {
  display: block;
}

/* ---------- Barra de topo (voltar + pílula do canal) ---------- */
.hm-player__topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  padding: 22px 20px 0;
}

.hm-player__icon-button {
  display: inline-block;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
}

.hm-player__pill {
  float: right;
  display: none;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: rgba(255, 255, 255, 0.70);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---------- Dock inferior ---------- */
.hm-player__dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.hm-player__dock-bar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.72);
}

.hm-player__nowplaying {
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  min-width: 0;
}

.hm-player__logo {
  position: relative;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin-right: 12px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
}

.hm-player__logo--empty {
  background: rgba(255, 255, 255, 0.10);
}

.hm-player__logo-img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.hm-player__logo-ph {
  display: none;
  width: 100%;
  height: 100%;
  padding: 8px;
  color: rgba(255, 255, 255, 0.70);
}

.hm-player__logo--empty .hm-player__logo-ph {
  display: block;
}

.hm-player__live {
  position: absolute;
  top: -6px;
  right: -8px;
  display: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: #c11c36;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.hm-player__title {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* O Flutter recebe subtitle/description mas não os desenha. */
.hm-player__subtitle {
  display: none;
}

.hm-player__controls {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-left: 16px;
  white-space: nowrap;
}

.hm-player__control {
  width: 44px;
  height: 44px;
  margin-left: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  cursor: pointer;
}

.hm-player__control:first-child {
  margin-left: 0;
}

.hm-player__control--primary,
.hm-player__control:focus,
.hm-player__icon-button:focus {
  outline: none;
  border: 2px solid #fff;
  background: rgba(255, 255, 255, 0.22);
}

.hm-player__control:disabled {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.38);
  cursor: default;
}

/* ---------- Barra de progresso (rente ao dock) ---------- */
.hm-player__progress {
  position: relative;
  height: 3px;
}

.hm-player__progress-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}

.hm-player__progress-value {
  width: 0;
  height: 100%;
  background: #4254d2;
}

.hm-player__time {
  position: absolute;
  right: 20px;
  bottom: 9px;
  display: none;
  color: rgba(255, 255, 255, 0.70);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Cartão central de status / erro ---------- */
.hm-player__status {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  background: rgba(0, 0, 0, 0.42);
}

.hm-player[data-media-state="idle"] .hm-player__status,
.hm-player[data-media-state="loading"] .hm-player__status,
.hm-player[data-media-state="buffering"] .hm-player__status,
.hm-player[data-media-state="error"] .hm-player__status {
  display: block;
}

.hm-player__status-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 440px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
  background: rgba(0, 0, 0, 0.82);
  text-align: center;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.hm-player[data-media-state="error"] .hm-player__status-card {
  border-color: #c11c36;
}

.hm-player__spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border: 5px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  border-radius: 50%;
  -webkit-animation: hm-player-spin 0.9s linear infinite;
  animation: hm-player-spin 0.9s linear infinite;
}

.hm-player__error-icon {
  display: none;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  color: #c11c36;
}

.hm-player__status-text {
  margin: 0 auto;
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.hm-player__error-actions {
  display: none;
  margin-top: 20px;
}

.hm-player__button {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin: 6px;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.hm-player__button--primary {
  border-color: #c11c36;
  background: #c11c36;
}

.hm-player__button:focus {
  outline: none;
  border: 2px solid #fff;
}

.hm-player__button .hm-player__icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.hm-player__button-label {
  display: inline-block;
}

/* ---------- Avisos flutuantes ---------- */
.hm-player__mute-badge {
  position: absolute;
  z-index: 30;
  right: 16px;
  bottom: 16px;
  display: none;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.70);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.hm-player__number-badge {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 50%;
  display: none;
  min-width: 120px;
  padding: 20px 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

@-webkit-keyframes hm-player-spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes hm-player-spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
