/* ============================================================
   Nebula Video Portal — стили
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #07070b;
  --bg-soft: #0d0d14;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f7;
  --muted: #9d9dad;
  --muted-2: #6d6d7e;

  --accent: #7c6cff;
  --accent-2: #b16cff;
  --accent-3: #ff6bd6;
  --grad: linear-gradient(115deg, #7c6cff 0%, #b16cff 48%, #ff6bd6 100%);
  --danger: #ff5c72;
  --ok: #43e08b;

  --radius: 20px;
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, 0.9);
  --shadow-glow: 0 10px 40px -12px rgba(124, 108, 255, 0.55);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

::selection {
  background: rgba(124, 108, 255, 0.45);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Фон
   ------------------------------------------------------------ */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(124, 108, 255, 0.16), transparent 60%),
    radial-gradient(1000px 600px at 90% 0%, rgba(255, 107, 214, 0.1), transparent 55%),
    var(--bg);
}

.bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.bg__blob--1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: #5b4bff;
  animation: float1 24s ease-in-out infinite;
}

.bg__blob--2 {
  width: 460px;
  height: 460px;
  top: -80px;
  right: -140px;
  background: #a64dff;
  opacity: 0.35;
  animation: float2 28s ease-in-out infinite;
}

.bg__blob--3 {
  width: 420px;
  height: 420px;
  bottom: -220px;
  left: 40%;
  background: #ff4fb8;
  opacity: 0.18;
  animation: float3 32s ease-in-out infinite;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

@keyframes float1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 40px, 0) scale(1.1); }
}

@keyframes float2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-50px, 60px, 0) scale(1.08); }
}

@keyframes float3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, -40px, 0) scale(1.12); }
}

/* ------------------------------------------------------------
   Верхняя панель
   ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 13px clamp(16px, 4vw, 40px);
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  box-shadow: 0 8px 22px -8px rgba(124, 108, 255, 0.8);
  color: #fff;
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__name {
  font-size: 18px;
}

.brand__tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  transform: translateY(1px);
}

.topbar__stats {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar__stats strong {
  color: var(--text);
  font-weight: 600;
}

.stat__sep {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
}

/* ------------------------------------------------------------
   Кнопки
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, color 0.18s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn--primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(124, 108, 255, 0.65);
}

.btn--primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 14px 38px -12px rgba(124, 108, 255, 0.85);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn--danger {
  background: linear-gradient(135deg, #ff4d6a, #e0304f);
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(255, 77, 106, 0.6);
}

.btn--danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px -12px rgba(255, 77, 106, 0.85);
}

.btn--lg {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 14px;
}

.btn--sm {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 10px;
}

.btn--sm svg {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  flex: none;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}

.icon-btn--glass {
  background: rgba(10, 10, 16, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.icon-btn--glass:hover {
  background: rgba(20, 20, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ------------------------------------------------------------
   Страница и hero
   ------------------------------------------------------------ */

.page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 90px;
}

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(44px, 7vw, 78px) 0 clamp(34px, 5vw, 56px);
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 22px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(67, 224, 139, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
  flex: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero__title {
  font-size: clamp(34px, 6.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 9s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero__lead {
  margin: 20px auto 32px;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17.5px);
  line-height: 1.62;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero__hint {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted-2);
  letter-spacing: 0.01em;
}

/* ------------------------------------------------------------
   Библиотека
   ------------------------------------------------------------ */

.library {
  scroll-margin-top: 88px;
}

.library__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.library__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transform: translateY(1px);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  width: 280px;
  max-width: 100%;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: rgba(124, 108, 255, 0.65);
  background: rgba(124, 108, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.15);
}

.search svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.select-wrap {
  position: relative;
  color: var(--muted);
}

.select-wrap svg {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  pointer-events: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.select:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}

.select:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.select option {
  background: #12121a;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 18px;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   Карточка видео
   ------------------------------------------------------------ */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022));
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.45s ease both;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 108, 255, 0.1);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg,
      hsl(var(--ph, 250) 62% 33% / 0.55),
      hsl(calc(var(--ph, 250) + 55) 68% 20% / 0.65));
}

.thumb__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease, opacity 0.3s ease;
}

.card:hover .thumb__img {
  transform: scale(1.05);
}

.thumb__ph {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.2);
}

.thumb__ph svg {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.thumb__preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.thumb__preview.is-live {
  opacity: 1;
}

.thumb__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #fff;
}

.thumb__play svg {
  width: 53px;
  height: 53px;
  padding: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.22s ease;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.card:hover .thumb__play svg,
.thumb__play:focus-visible svg {
  opacity: 1;
  transform: scale(1);
}

.thumb__play:hover svg {
  background: rgba(124, 108, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.45);
}

.thumb__dur {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 4;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.card__actions {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 6;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover .card__actions,
.card:focus-within .card__actions {
  opacity: 1;
  transform: translateY(0);
}

.card__del:hover {
  background: var(--danger) !important;
  border-color: transparent !important;
}

.card__body {
  padding: 12px 14px 15px;
}

.card__title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.card__meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.card__meta .dot {
  width: 3px;
  height: 3px;
  background: currentColor;
  box-shadow: none;
  animation: none;
  opacity: 0.55;
}

/* ------------------------------------------------------------
   Скелетоны и пустое состояние
   ------------------------------------------------------------ */

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
}

.skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.09) 45%,
    rgba(255, 255, 255, 0.04) 100%);
  background-size: 220% 100%;
  animation: shimmer 1.45s ease-in-out infinite;
}

.skeleton--thumb {
  aspect-ratio: 16 / 9;
}

.skeleton--line {
  height: 12px;
  border-radius: 6px;
  margin: 14px 14px 0;
}

.skeleton--line:last-child {
  margin-bottom: 16px;
}

.skeleton--short {
  width: 55%;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.empty {
  padding: clamp(48px, 8vw, 84px) 20px;
  text-align: center;
  animation: fadeUp 0.4s ease both;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-2);
}

.empty__icon svg {
  width: 32px;
  height: 32px;
}

.empty h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

/* ------------------------------------------------------------
   Футер
   ------------------------------------------------------------ */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 26px 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12.5px;
}

.footer__sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

/* ------------------------------------------------------------
   Очередь загрузки
   ------------------------------------------------------------ */

.uploader {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(392px, calc(100vw - 32px));
  background: rgba(14, 14, 22, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.uploader__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 13px 17px;
  border-bottom: 1px solid var(--border);
}

.uploader__title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.uploader__title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(177, 108, 255, 0.18);
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
}

.qitem {
  padding: 12px 17px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.qitem:last-child {
  border-bottom: 0;
}

.qitem__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qitem__name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qitem__cancel {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
}

.qitem__cancel:hover {
  background: rgba(255, 92, 114, 0.16);
  color: #ff8a9a;
}

.qbar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.qbar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad);
  transition: width 0.25s ease, background 0.3s ease;
}

.qitem__status {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.qitem--done .qbar__fill {
  background: linear-gradient(90deg, #2bc974, var(--ok));
}

.qitem--done .qitem__cancel {
  display: none;
}

.qitem--failed .qbar__fill {
  background: var(--danger);
}

.qitem--failed .qitem__status {
  color: #ff8a9a;
}

.qitem--failed .qitem__name {
  color: #ffb3bd;
}

/* ------------------------------------------------------------
   Drag & drop оверлей
   ------------------------------------------------------------ */

.drop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(5, 5, 10, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.18s ease both;
}

.drop__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(124, 108, 255, 0.65);
  border-radius: 28px;
  background:
    radial-gradient(600px 300px at 50% 50%, rgba(124, 108, 255, 0.16), transparent 70%);
  animation: dropPulse 2s ease-in-out infinite;
}

.drop__icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.drop__icon svg {
  width: 40px;
  height: 40px;
}

.drop__inner p {
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

@keyframes dropPulse {
  0%, 100% { border-color: rgba(124, 108, 255, 0.55); }
  50% { border-color: rgba(255, 107, 214, 0.85); }
}

/* ------------------------------------------------------------
   Модальные окна
   ------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 7, 0.76);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 0.2s ease both;
}

.player {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1060px, 100%);
  max-height: calc(100vh - 2 * clamp(12px, 3vw, 28px));
  background: #0b0b12;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scaleIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.player__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 15px 22px;
  border-bottom: 1px solid var(--border);
}

.player__titles {
  min-width: 0;
}

.player__titles h3 {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.player__meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.player__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.player__stage {
  background: #000;
  display: flex;
  min-height: 0;
}

.player__stage video {
  display: block;
  width: 100%;
  max-height: min(72vh, 780px);
  background: #000;
  outline: none;
}

.confirm {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 30px 26px 26px;
  text-align: center;
  background: rgba(15, 15, 23, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.confirm__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: rgba(255, 92, 114, 0.14);
  border: 1px solid rgba(255, 92, 114, 0.32);
  color: #ff7b8e;
}

.confirm__icon svg {
  width: 28px;
  height: 28px;
}

.confirm h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.confirm p {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.confirm__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.confirm__actions .btn {
  flex: 1;
}

/* ------------------------------------------------------------
   Тосты
   ------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 8px;
  width: min(460px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: rgba(16, 16, 25, 0.96);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  font-size: 13.5px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast--ok {
  border-color: rgba(67, 224, 139, 0.35);
}

.toast--error {
  border-color: rgba(255, 92, 114, 0.42);
}

.toast--info {
  border-color: rgba(124, 108, 255, 0.4);
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
}

.toast--ok .toast__icon { color: var(--ok); }
.toast--error .toast__icon { color: #ff7b8e; }
.toast--info .toast__icon { color: var(--accent-2); }

.toast--out {
  animation: toastOut 0.22s ease forwards;
}

/* ------------------------------------------------------------
   Анимации
   ------------------------------------------------------------ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ------------------------------------------------------------
   Адаптивность
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .topbar__stats {
    display: none;
  }

  .topbar__actions {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  .brand__tag {
    display: none;
  }

  .page {
    padding-bottom: 70px;
  }

  .library__head {
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
  }

  .search {
    flex: 1;
    width: auto;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
  }

  .uploader {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .player__head {
    padding: 13px 13px 12px 16px;
  }

  .player__titles h3 {
    font-size: 14.5px;
  }

  .player__tools .btn span,
  .player__tools .btn {
    font-size: 12.5px;
  }

  .player__stage video {
    max-height: 62vh;
  }

  .toasts {
    left: 50%;
    top: 72px;
    bottom: auto;
    transform: translateX(-50%);
    align-items: center;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 430px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .topbar {
    gap: 12px;
  }

  .topbar__actions .btn {
    padding: 10px 13px;
  }
}

@media (hover: none) {
  .card__actions {
    opacity: 1;
    transform: none;
  }

  .thumb__play svg {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
