/**
 * PlayRank Video Overlay Styles — Спортивное табло для трансляций (YouTube / VK / OBS)
 * Раскладка LIVE: Игрок 1 сверху, счёт геймов МЕЖДУ ними, Игрок 2 снизу.
 * Буквы не срезаются по высоте, стрелка подачи перед именем, шрифты крупные.
 */

:root {
  --vo-font: "Outfit", "Montserrat", "Roboto", system-ui, -apple-system, sans-serif;
  --vo-accent-red: #EF3340;
  --vo-won-pill: #e4e5ed;
  --vo-next-bg: #1a2b49;
}

/* ══════════════════════════════════════════════════════════════
   1. СТИЛИ ОВЕРЛЕЯ ДЛЯ ТРАНСЛЯЦИЙ (/tournament/{id}/video/{court}/print/)
   ══════════════════════════════════════════════════════════════ */
html.video-overlay-standalone-page,
body.video-overlay-standalone {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: transparent !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  user-select: none !important;
  font-feature-settings: "tnum" 1, "cv01" 1 !important;
}

body.video-overlay-standalone #video-overlay-box {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
}

body.video-overlay-standalone #rankedin-match-widget,
body.video-overlay-standalone #court-widget,
body.video-overlay-standalone .vo-card {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: var(--vo-font) !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
}

body.video-overlay-standalone #rankedin-match-widget *,
body.video-overlay-standalone #court-widget *,
body.video-overlay-standalone .vo-card * {
  box-sizing: border-box !important;
}

/* ── LIVE РЕЖИМ (СУДЕЙСТВО МАТЧА) ── */
body.video-overlay-standalone #rankedin-match-widget {
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

body.video-overlay-standalone .rankedin-match-scoreboard-container {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  padding: 2vmin 4vmin !important;
  box-sizing: border-box !important;
}

/* Строка игрока в LIVE */
body.video-overlay-standalone .scoreboard-player {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body.video-overlay-standalone .scoreboard-player.winner {
  background: rgba(228, 229, 237, 0.6) !important;
  border-radius: 2vmin !important;
}

body.video-overlay-standalone .scoreboard-name-row {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding-right: 2vmin !important;
}

/* Красный треугольник подачи ▶ слева от имени */
body.video-overlay-standalone .serving-tri-cell {
  width: 8vmin !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 1.5vmin !important;
}

body.video-overlay-standalone .vo-tri {
  color: transparent !important;
  font-size: 8vmin !important;
  line-height: 1 !important;
  display: inline-block !important;
  transform: scale(0.9) !important;
  transition: all 0.15s ease !important;
}

body.video-overlay-standalone .vo-tri.active,
.vo-tri.active {
  color: #EF3340 !important;
  transform: scale(1.15) !important;
  text-shadow: 0 2px 5px rgba(239, 51, 64, 0.5) !important;
}

/* Имя игрока - КРУПНОЕ, ЖИРНОЕ, БЕЗ СРЕЗАНИЯ ПО ВЫСОТЕ */
body.video-overlay-standalone .scoreboard-player-name {
  font-style: normal !important;
  font-weight: 800 !important;
  font-size: 15vmin !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
  padding-bottom: 1.5vmin !important;
  padding-top: 0.5vmin !important;
  color: #000000 !important;
  letter-spacing: -0.02em !important;
}

/* БЛОК СЫГРАННЫХ ГЕЙМОВ - СТРОГО МЕЖДУ ИГРОКАМИ */
body.video-overlay-standalone .scoreboard-games-middle {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.2vmin !important;
  padding-left: 9.5vmin !important;
  margin: 1vmin 0 !important;
  flex-shrink: 0 !important;
}

body.video-overlay-standalone .scoreboard-player-score-container {
  display: flex !important;
  flex-flow: row nowrap !important;
  gap: 1.5vmin !important;
  align-items: center !important;
}

body.video-overlay-standalone .scoreboard-player-score {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-weight: 800 !important;
  aspect-ratio: 1 / 1 !important;
  width: 13vmin !important;
  height: 13vmin !important;
  font-size: 9.5vmin !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  color: #1e293b !important;
}

body.video-overlay-standalone .scoreboard-player-score.won-set {
  font-weight: 900 !important;
  background: var(--vo-won-pill) !important;
  border-radius: 1.8vmin !important;
  color: #000000 !important;
}

/* Чёрный квадрат текущего счёта справа */
body.video-overlay-standalone .scoreboard-player-live-score {
  font-weight: 800 !important;
  font-size: 24vmin !important;
  width: 34vmin !important;
  height: 34vmin !important;
  background: black !important;
  color: white !important;
  border-radius: 2vmin !important;
  aspect-ratio: 1 / 1 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2) !important;
}

/* ── PAST РЕЖИМ (ПРЕДЫДУЩИЙ + ДАЛЕЕ) ── */
body.video-overlay-standalone .previous-container {
  background: #ffffff !important;
  display: flex !important;
  justify-content: center !important;
  flex-flow: row !important;
  height: 50% !important;
  width: 100% !important;
}

body.video-overlay-standalone .previous-section {
  background: #ffffff !important;
  color: #000000 !important;
  display: flex !important;
  justify-content: space-between !important;
  flex-flow: column nowrap !important;
  padding: 3vmin 4vmin 4vmin 4vmin !important;
  width: 100% !important;
  height: 100% !important;
}

body.video-overlay-standalone .top-labels {
  display: flex !important;
  justify-content: space-between !important;
  flex-flow: row !important;
}

body.video-overlay-standalone .previous-label {
  color: #000000 !important;
  font-weight: 800 !important;
  font-size: 3.5vw !important;
  text-transform: uppercase !important;
}

body.video-overlay-standalone .previous-section .scoreboard-player-name {
  font-style: normal !important;
  font-size: 9vmin !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
  padding-bottom: 1vmin !important;
  color: #334155 !important;
}

body.video-overlay-standalone .previous-section .scoreboard-player.winner .scoreboard-player-name {
  font-weight: 900 !important;
  color: #000000 !important;
}

body.video-overlay-standalone .scoreboard-player-score-container-finished {
  display: flex !important;
  flex-flow: row !important;
  justify-content: flex-end !important;
  gap: 1.2vmin !important;
  padding-left: 2vmin !important;
  flex-shrink: 0 !important;
}

body.video-overlay-standalone .previous-section .scoreboard-player-score {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-weight: 700 !important;
  aspect-ratio: 1 / 1 !important;
  width: 11vmin !important;
  height: 11vmin !important;
  font-size: 6.5vmin !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
}

body.video-overlay-standalone .previous-section .scoreboard-player-score.won-set {
  font-weight: 900 !important;
  background: var(--vo-won-pill) !important;
  border-radius: 1.5vmin !important;
  color: #000000 !important;
}

body.video-overlay-standalone .next-container {
  background: var(--vo-next-bg) !important;
  color: #ffffff !important;
  display: flex !important;
  justify-content: center !important;
  flex-flow: row !important;
  height: 50% !important;
  width: 100% !important;
  border-top: 2px solid rgba(255, 255, 255, 0.15) !important;
}

body.video-overlay-standalone .next-section {
  display: flex !important;
  justify-content: space-between !important;
  flex-flow: column nowrap !important;
  padding: 3vmin 4vmin 4vmin 4vmin !important;
  width: 100% !important;
  height: 100% !important;
}

body.video-overlay-standalone .next-label {
  font-weight: 800 !important;
  font-size: 3.5vw !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
}

body.video-overlay-standalone .onerow {
  display: flex !important;
  flex-flow: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}

body.video-overlay-standalone .court-scoreboard-player-name {
  font-style: normal !important;
  font-size: 9vmin !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
  padding-bottom: 1vmin !important;
  color: #ffffff !important;
}

body.video-overlay-standalone .court-scoreboard-player-vs {
  margin: 0 2vw !important;
  min-width: 8vmin !important;
  text-align: center !important;
  opacity: 0.85 !important;
  font-size: 6vmin !important;
}

/* Красный брендовый логотип playrank.ru в левом нижнем углу */
body.video-overlay-standalone .vo-brand-badge {
  position: fixed !important;
  bottom: 4vmin !important;
  left: 4vmin !important;
  background: #dc2626 !important;
  color: #ffffff !important;
  padding: 1.6vmin 3.5vmin !important;
  border-radius: 1.2vmin !important;
  font-family: var(--vo-font) !important;
  font-weight: 800 !important;
  font-size: 4vmin !important;
  line-height: 1 !important;
  letter-spacing: -0.01em !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 1.5vmin !important;
  z-index: 9999 !important;
  user-select: none !important;
}

body.video-overlay-standalone .vo-brand-dot {
  width: 1.8vmin !important;
  height: 1.8vmin !important;
  background: #ffffff !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   2. СТИЛИ ДЛЯ ПРЕВЬЮ НА СТРАНИЦЕ САЙТА (/tournament/{id}/video/)
   Высота превью 195px, оба игрока и счёт видны полностью без обрезания!
   ══════════════════════════════════════════════════════════════ */
.video-courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.video-court-box {
  background: var(--surface, #ffffff);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.video-court-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border, #e2e8f0);
}

.video-court-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.video-court-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-vo-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--surface-border, #cbd5e1);
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  text-decoration: none;
}

.btn-vo-action:hover {
  background: var(--surface-hover, #f8fafc);
  border-color: var(--teal, #0d9488);
  color: var(--teal, #0d9488);
}

.btn-vo-action.primary {
  background: var(--teal, #0d9488);
  border-color: var(--teal, #0d9488);
  color: #ffffff;
}

.btn-vo-action.primary:hover {
  background: #0f766e;
  border-color: #0f766e;
}

.video-court-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #2b394e 0%, #17202e 100%);
  border-radius: 8px;
  min-height: 220px;
  position: relative;
}

.vo-preview-wrapper {
  width: 100%;
  max-width: 490px;
  height: 190px;
  display: flex;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background: #ffffff;
}

.vo-preview-wrapper #rankedin-match-widget,
.vo-preview-wrapper #court-widget,
.vo-preview-wrapper .vo-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  font-family: var(--vo-font);
}

/* Превью: LIVE */
.vo-preview-wrapper .rankedin-match-scoreboard-container {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.vo-preview-wrapper .scoreboard-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.vo-preview-wrapper .scoreboard-name-row {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 10px;
}

.vo-preview-wrapper .serving-tri-cell {
  width: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.vo-preview-wrapper .vo-tri {
  color: transparent;
  font-size: 14px;
}

.vo-preview-wrapper .vo-tri.active {
  color: var(--vo-accent-red);
}

.vo-preview-wrapper .scoreboard-player-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vo-preview-wrapper .scoreboard-games-middle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 22px;
  margin: 4px 0;
}

.vo-preview-wrapper .scoreboard-player-score-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

.vo-preview-wrapper .scoreboard-player-score {
  width: 22px;
  height: 22px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vo-preview-wrapper .scoreboard-player-score.won-set {
  background: var(--vo-won-pill);
  border-radius: 3px;
  font-weight: 900;
}

.vo-preview-wrapper .scoreboard-player-live-score {
  width: 52px;
  height: 52px;
  background: black;
  color: white;
  border-radius: 4px;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Превью: PAST (Предыдущий + Далее) */
.vo-preview-wrapper .previous-container {
  height: 50%;
  background: #ffffff;
  display: flex;
  padding: 8px 12px;
  box-sizing: border-box;
}

.vo-preview-wrapper .previous-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vo-preview-wrapper .top-labels {
  display: flex;
  justify-content: space-between;
}

.vo-preview-wrapper .previous-label {
  font-size: 11px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.05em;
}

.vo-preview-wrapper .previous-section .scoreboard-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0;
}

.vo-preview-wrapper .previous-section .scoreboard-player-name {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  line-height: 1.25;
}

.vo-preview-wrapper .previous-section .scoreboard-player.winner .scoreboard-player-name {
  font-weight: 800;
  color: #000000;
}

.vo-preview-wrapper .scoreboard-player-score-container-finished {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-left: 8px;
}

.vo-preview-wrapper .previous-section .scoreboard-player-score {
  width: 22px;
  height: 22px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vo-preview-wrapper .previous-section .scoreboard-player-score.won-set {
  background: var(--vo-won-pill);
  border-radius: 3px;
  font-weight: 900;
}

.vo-preview-wrapper .next-container {
  height: 50%;
  background: var(--vo-next-bg);
  color: #ffffff;
  display: flex;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

.vo-preview-wrapper .next-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vo-preview-wrapper .next-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.vo-preview-wrapper .onerow {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vo-preview-wrapper .court-scoreboard-player-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.vo-preview-wrapper .court-scoreboard-player-vs {
  font-size: 12px;
  font-weight: 600;
  color: var(--vo-next-sub);
  margin: 0 8px;
}

.video-court-obs-hint {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-hover, #f8fafc);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px dashed var(--surface-border, #cbd5e1);
}

.video-court-obs-hint code {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal, #0d9488);
  background: rgba(13, 148, 136, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
