.up-wrap {
  --up-bg: #0b0f17;
  --up-panel: rgba(10, 12, 16, .72);
  --up-txt: #eaf0ff;
  --up-muted: #9aa6c2;
  --up-accent: #4aa3ff;
  --up-accent2: #00e5ff;
  --up-radius: 1px;
  --up-shadow: 0 18px 50px rgba(0,0,0,.45);
  --up-gap: 14px;
  --up-control-h: 40px;

  width: 100%;
  max-width: 980px;
  display: grid;
  gap: var(--up-gap);
  margin: 0 auto;
  font-family: system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.up-wrap *, .up-wrap *::before, .up-wrap *::after {
  box-sizing: inherit;
}

.up-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--up-radius);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.up-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--up-txt);
}

.up-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(74,163,255,.16);
  border: 1px solid rgba(74,163,255,.28);
  color: #cfe6ff;
  text-transform: uppercase;
}

.up-player-body {
  position: relative;
  border-radius: calc(var(--up-radius) + 6px);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
  touch-action: manipulation;
}

.up-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.up-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.up-spinner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: var(--up-accent);
  border-radius: 50%;
  animation: up-spin 1s linear infinite;
  display: none;
}
.up-spinner.show { display: block; }

@keyframes up-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.up-center-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 50px;
  color: #fff;
  opacity: 0;
  transition: all 0.2s;
}
.up-center-hint.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.up-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 15px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  z-index: 5;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.up-player-body.hide-ui .up-controls { opacity: 0; pointer-events: none; }

.up-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.up-progress {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  flex-grow: 1;
  transition: height 0.1s;
}
.up-progress:hover { height: 8px; }

.up-buffered { position: absolute; height: 100%; background: rgba(255,255,255,0.2); border-radius: 10px; }
.up-played { position: absolute; height: 100%; background: linear-gradient(90deg, var(--up-accent), var(--up-accent2)); border-radius: 10px; }
.up-knob {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.up-time {
  font-size: 13px;
  color: var(--up-txt);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.up-btns-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap; /* Для респонсива */
}

.up-left-group, .up-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.up-icon-btn {
  width: var(--up-control-h);
  height: var(--up-control-h);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.2s;
}
.up-icon-btn:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }

.up-vol-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.up-vol-slider {
  width: 80px;
  cursor: pointer;
  accent-color: var(--up-accent);
}

.up-select {
  height: var(--up-control-h);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  padding: 0 5px;
  cursor: pointer;
  outline: none;
}
.up-select option { background: #1a1d24; }

.up-toast {
  position: absolute;
  top: 20px; left: 20px;
  background: rgba(0,0,0,0.6);
  padding: 6px 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: 0.2s;
}
.up-toast.show { opacity: 1; }

.up-error {
  display: none;
  background: rgba(255, 74, 74, 0.15);
  border: 1px solid rgba(255, 74, 74, 0.3);
  color: #ffbaba;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
}


@media (max-width: 600px) {
  .up-player-body { aspect-ratio: 16 / 9; }

  .up-vol-slider { width: 60px; }

  .up-btns-row {
    justify-content: center;
  }

  .up-right-group {
    width: 100%;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
  }

  .up-left-group {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .up-vol-slider { display: none; }
  .up-time { font-size: 11px; }
  .up-icon-btn { width: 34px; height: 34px; }
}