/* ============================================================
   TV Sim Player — chrome "broadcast": preto absoluto, verde-sinal
   ============================================================ */

:root {
  --tvs-green: #1ac984;
  --tvs-green-dim: rgba(26, 201, 132, 0.35);
  --tvs-black: #060807;
  --tvs-white: #f2f5f3;
  --tvs-muted: rgba(242, 245, 243, 0.62);
  --tvs-glass: rgba(9, 12, 10, 0.82);
  --tvs-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body.embed-page {
  background: var(--tvs-black);
  overflow: hidden;
}
body.embed-page .tvsim-player {
  position: fixed;
  inset: 0;
}

/* -------------------------------------------------- container */
.tvsim-player {
  position: relative;
  background: var(--tvs-black);
  font-family: var(--tvs-font);
  color: var(--tvs-white);
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  overflow: hidden;
}
.tvsim-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--tvs-black);
}

.tvsim-player.no-cursor { cursor: none; }

/* -------------------------------------------------- overlay central */
.tvs-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}
.tvs-bigplay {
  pointer-events: auto;
  width: 84px;
  height: 84px;
  border: 1px solid rgba(242, 245, 243, 0.14);
  border-radius: 22px;
  background: rgba(6, 8, 7, 0.66);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.22s, box-shadow 0.22s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.tvs-bigplay:hover {
  transform: scale(1.07);
  border-color: var(--tvs-green-dim);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(26, 201, 132, 0.08);
}
.tvs-bigplay svg { width: 34px; height: 34px; fill: var(--tvs-green); margin-left: 4px; }
.tvsim-player.is-playing .tvs-bigplay,
.tvsim-player.is-error .tvs-bigplay,
.tvsim-player.is-loading .tvs-bigplay { display: none; }

/* flash de feedback play/pause */
.tvs-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}
.tvs-flash span {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(6, 8, 7, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
}
.tvs-flash span svg { width: 30px; height: 30px; fill: var(--tvs-white); }
.tvs-flash.go span { animation: tvs-flash 0.55s ease-out forwards; }
@keyframes tvs-flash {
  0% { opacity: 0.9; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.25); }
}

/* -------------------------------------------------- spinner */
.tvs-spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.tvsim-player.is-loading .tvs-spinner { display: flex; }
.tvs-spinner div {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(242, 245, 243, 0.12);
  border-top-color: var(--tvs-green);
  animation: tvs-spin 0.8s linear infinite;
}
@keyframes tvs-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------- erro / processando */
.tvs-notice {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 6;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, #0c100e 0%, var(--tvs-black) 75%);
}
.tvsim-player.is-error .tvs-notice { display: flex; }
.tvs-notice .tvs-notice-badge {
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--tvs-green);
  border: 1px solid var(--tvs-green-dim);
  border-radius: 999px;
  padding: 5px 12px;
}
.tvs-notice p { font-size: 14px; color: var(--tvs-muted); max-width: 380px; line-height: 1.5; }

/* -------------------------------------------------- barra de controles */
.tvs-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 130px;
  background: linear-gradient(to top, rgba(4, 6, 5, 0.88) 0%, rgba(4, 6, 5, 0.4) 55%, transparent 100%);
  z-index: 7;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tvs-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  padding: 0 14px 10px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.tvsim-player.hide-ui .tvs-controls { opacity: 0; transform: translateY(8px); pointer-events: none; }
.tvsim-player.hide-ui .tvs-scrim { opacity: 0; }

/* ---------------- timeline */
.tvs-timeline {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.tvs-track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(242, 245, 243, 0.18);
  overflow: visible;
  transition: height 0.15s ease;
}
.tvs-timeline:hover .tvs-track,
.tvs-timeline.scrubbing .tvs-track { height: 5px; }
.tvs-buffered, .tvs-played {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  width: 0;
}
.tvs-buffered { background: rgba(242, 245, 243, 0.28); }
.tvs-played {
  background: var(--tvs-green);
  box-shadow: 0 0 12px rgba(26, 201, 132, 0.45);
}
.tvs-knob {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tvs-green);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
  box-shadow: 0 0 0 4px rgba(26, 201, 132, 0.18);
  pointer-events: none;
}
.tvs-timeline:hover .tvs-knob,
.tvs-timeline.scrubbing .tvs-knob { transform: translate(-50%, -50%) scale(1); }

.tvs-tooltip {
  position: absolute;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--tvs-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(242, 245, 243, 0.1);
  color: var(--tvs-white);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.12s;
}
.tvs-timeline:hover .tvs-tooltip,
.tvs-timeline.scrubbing .tvs-tooltip { opacity: 1; }

/* ---------------- linha de botões */
.tvs-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}
.tvs-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--tvs-white);
  width: 38px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex: none;
}
.tvs-btn:hover { background: rgba(242, 245, 243, 0.1); }
.tvs-btn svg { width: 19px; height: 19px; fill: currentColor; }
.tvs-btn.active { color: var(--tvs-green); }

.tvs-time {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--tvs-muted);
  padding: 0 8px;
  white-space: nowrap;
  flex: none;
}
.tvs-time b { color: var(--tvs-white); font-weight: 500; }

.tvs-spacer { flex: 1; }

.tvs-brand {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: rgba(242, 245, 243, 0.4);
  padding: 0 10px;
  white-space: nowrap;
  flex: none;
  pointer-events: none;
}
.tvs-brand i { color: var(--tvs-green); font-style: normal; }

/* volume */
.tvs-vol {
  display: flex;
  align-items: center;
  flex: none;
}
.tvs-vol-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
  display: flex;
  align-items: center;
}
.tvs-vol:hover .tvs-vol-slider,
.tvs-vol.dragging .tvs-vol-slider { width: 64px; }
.tvs-vol-slider input {
  appearance: none;
  -webkit-appearance: none;
  width: 56px;
  height: 3px;
  margin: 0 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--tvs-green) var(--vol, 100%), rgba(242,245,243,0.2) var(--vol, 100%));
  cursor: pointer;
}
.tvs-vol-slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tvs-white);
  cursor: pointer;
}
.tvs-vol-slider input::-moz-range-thumb {
  width: 11px; height: 11px; border: 0;
  border-radius: 50%; background: var(--tvs-white); cursor: pointer;
}

/* ---------------- menu de configurações */
.tvs-menu-wrap { position: relative; flex: none; }
.tvs-menu {
  position: absolute;
  right: 0;
  bottom: 44px;
  min-width: 190px;
  background: var(--tvs-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(242, 245, 243, 0.1);
  border-radius: 12px;
  padding: 6px;
  display: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.tvs-menu.open { display: block; }
.tvs-menu-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--tvs-muted);
  padding: 8px 10px 5px;
  text-transform: uppercase;
}
.tvs-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--tvs-white);
  font-family: var(--tvs-font);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.tvs-menu-item:hover { background: rgba(242, 245, 243, 0.08); }
.tvs-menu-item .check { color: var(--tvs-green); font-size: 12px; opacity: 0; }
.tvs-menu-item.selected .check { opacity: 1; }
.tvs-menu-item small { color: var(--tvs-muted); font-size: 11px; }
.tvs-menu-sep { height: 1px; background: rgba(242, 245, 243, 0.08); margin: 5px 8px; }

/* -------------------------------------------------- página /v/:id */
body.watch-page {
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(26, 201, 132, 0.055), transparent 60%),
    #0a0d0b;
  min-height: 100%;
  font-family: var(--tvs-font);
  padding: clamp(16px, 4vw, 48px);
  display: flex;
  justify-content: center;
}
.watch-wrap { width: min(1080px, 100%); }
.watch-page .tvsim-player {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(242, 245, 243, 0.06);
}
.watch-meta { padding: 22px 6px 40px; color: var(--tvs-white); }
.watch-meta h1 {
  font-size: clamp(19px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.watch-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--tvs-muted);
  font-variant-numeric: tabular-nums;
}
.watch-brand {
  color: var(--tvs-green);
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 10px;
}
.watch-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(242,245,243,0.3); }
.watch-desc { margin-top: 14px; font-size: 14px; line-height: 1.65; color: var(--tvs-muted); max-width: 720px; }

/* -------------------------------------------------- responsivo */
@media (max-width: 520px) {
  .tvs-time.duration-part small { display: none; }
  .tvs-brand { display: none; }
  .tvs-bigplay { width: 64px; height: 64px; border-radius: 17px; }
  .tvs-bigplay svg { width: 26px; height: 26px; }
}
