/* Киберпанк-неон по референсу: тёмно-синяя сцена, градиенты cyan→violet→pink */
:root {
  --bg0: #070b1e;
  --bg1: #0b1130;
  --panel: rgba(17, 24, 66, .55);
  --line: rgba(122, 108, 255, .28);
  --text: #dfe5ff;
  --muted: #8d97c9;
  --neon1: #35d6ff;
  --neon2: #7a5cff;
  --neon3: #e14dff;
  --grad: linear-gradient(90deg, var(--neon1), var(--neon2), var(--neon3));
}
* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh; background: radial-gradient(120% 100% at 50% -10%, var(--bg1), var(--bg0) 70%);
  color: var(--text); font-family: Montserrat, -apple-system, sans-serif;
  display: flex; flex-direction: column;
}
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(500px 320px at 12% 8%, rgba(53, 214, 255, .10), transparent 70%),
    radial-gradient(600px 400px at 88% 20%, rgba(225, 77, 255, .09), transparent 70%),
    radial-gradient(700px 500px at 50% 110%, rgba(122, 92, 255, .12), transparent 70%);
}
main { position: relative; z-index: 1; width: min(1100px, 94vw); margin: 26px auto; flex: 1; }
footer { position: relative; z-index: 1; text-align: center; color: #55609a; font-size: 12px; padding: 22px; }

/* ---------- шапка ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 28px;
  width: min(1100px, 94vw); margin: 18px auto 0; padding: 14px 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(10px);
}
.logo {
  font-family: Unbounded, Montserrat, sans-serif; font-weight: 900; font-size: 15px;
  letter-spacing: .12em; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; font-size: 13px;
  background: var(--grad); color: #0b0f28;
  box-shadow: 0 0 18px rgba(122, 92, 255, .55);
}
.top nav { display: flex; gap: 20px; flex: 1; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.top nav a:hover, .top nav a.on { color: #fff; text-shadow: 0 0 12px rgba(53, 214, 255, .8); }

/* ---------- типографика ---------- */
h1.neon, h2.neon {
  font-family: Unbounded, Montserrat, sans-serif; font-weight: 900;
  letter-spacing: .02em; margin: 26px 0 16px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(122, 92, 255, .45));
}
h1.neon { font-size: clamp(26px, 4vw, 40px); }
h2.neon { font-size: 20px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 640px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 800 14px/1 Montserrat, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; padding: 15px 30px; border-radius: 999px; background: var(--grad);
  box-shadow: 0 6px 26px rgba(122, 92, 255, .45), inset 0 0 0 1px rgba(255, 255, 255, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(122, 92, 255, .65); }
.btn-sm { padding: 11px 20px; font-size: 12px; }
.btn-ghost {
  background: transparent; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-danger { background: linear-gradient(90deg, #ff3d68, #b3186c); }

/* ---------- карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; backdrop-filter: blur(10px);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: rgba(53, 214, 255, .5); box-shadow: 0 0 24px rgba(53, 214, 255, .12); }
.card-link { position: relative; cursor: pointer; }
.card-link:hover { transform: translateY(-2px); transition: transform .12s ease; }
.card-del { position: absolute; top: 10px; right: 12px; z-index: 3; margin: 0; }
.card-del .x {
  width: 30px; height: 30px; border-radius: 50%; line-height: 1;
  background: rgba(7, 11, 32, .82); border: 1px solid var(--line);
  color: #8d97c9; opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.card-link:hover .card-del .x { opacity: 1; }
.card-del .x:hover { color: #fff; background: #ff3d68; border-color: #ff3d68; }
.timer { color: var(--muted); font-variant-numeric: tabular-nums; }
.timer.live { color: var(--neon1); }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card h3 a { color: #fff; text-decoration: none; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.thumb-wrap {
  aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
  background: linear-gradient(135deg, #10173f, #0a0e28);
  display: flex; align-items: center; justify-content: center; color: #444e86; font-size: 12px;
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* статусы */
.badge {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.badge.done { background: rgba(46, 229, 157, .15); color: #2ee59d; box-shadow: 0 0 12px rgba(46, 229, 157, .25); }
.badge.running { background: rgba(53, 214, 255, .14); color: var(--neon1); box-shadow: 0 0 12px rgba(53, 214, 255, .3); }
.badge.queued { background: rgba(122, 92, 255, .16); color: #a696ff; }
.badge.retry { background: rgba(255, 176, 46, .16); color: #ffc46b; }
.badge.error { background: rgba(255, 61, 104, .15); color: #ff5d82; }
.badge.cancelled { background: rgba(255, 176, 32, .14); color: #ffb020; }
.badge.new { background: rgba(141, 151, 201, .12); color: var(--muted); }

/* ---------- формы ---------- */
form.panel, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px; backdrop-filter: blur(10px);
}
.f { display: block; margin-bottom: 18px; }
.f > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; background: rgba(7, 11, 32, .8); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  font: 500 14px/1.5 Montserrat, sans-serif; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--neon1); box-shadow: 0 0 0 3px rgba(53, 214, 255, .15);
}
textarea { min-height: 220px; resize: vertical; }
.hint { font-size: 12px; color: #66719f; margin-top: 6px; line-height: 1.5; }
.hint a { color: var(--neon1); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .row2 { grid-template-columns: 1fr; } }

/* дропзона превью */
.drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center;
  color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .15s;
  background: rgba(7, 11, 32, .5);
}
.drop:hover, .drop.over { border-color: var(--neon3); color: #fff; }
.drop img { max-height: 160px; border-radius: 10px; margin-top: 10px; }

/* ---------- страница проекта ---------- */
.stages { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.stage {
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(7, 11, 32, .7); color: #55609a; border: 1px solid transparent;
}
.stage.active { color: #fff; border-color: var(--neon1);
  box-shadow: 0 0 14px rgba(53, 214, 255, .35); animation: pulse 1.6s infinite; }
.stage.past { color: #2ee59d; }
@keyframes pulse { 50% { box-shadow: 0 0 4px rgba(53, 214, 255, .15); } }
.progressbar { height: 10px; border-radius: 999px; background: rgba(7, 11, 32, .8);
  overflow: hidden; margin: 10px 0 4px; }
.progressbar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px;
  transition: width .6s ease; }
video.player, audio.player { width: 100%; border-radius: 14px; margin-top: 12px; }
.error-box {
  background: rgba(255, 61, 104, .1); border: 1px solid rgba(255, 61, 104, .4);
  color: #ffb3c4; padding: 16px; border-radius: 14px; font-size: 13px;
  white-space: pre-wrap; line-height: 1.6; margin-top: 14px;
}
.cutout-preview { max-height: 220px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .6)); }

/* ---------- материалы проекта: обложка / модель / вырезка ---------- */
.mats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mat { background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mat-h { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mat img { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; align-self: flex-start; }
.mat p.sub { margin: 0; font-size: 13px; }
.mat form { margin: 0; margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mat input[type=file] { max-width: 100%; font-size: 12px; color: var(--muted); }

/* ---------- стоки ---------- */
.stock-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 18px; }
.stock-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.stock-item form { margin: 0; }
.x { background: none; border: 0; color: #ff5d82; cursor: pointer; font-size: 15px; }
.upitem { font-size: 12px; color: var(--muted); margin-top: 6px; }
.upitem b.ok { color: #2ee59d; } .upitem b.fail { color: #ff5d82; }

/* ---------- голоса ---------- */
.voice-card audio { width: 100%; margin-top: 10px; height: 34px; }
.voice-id { font-family: monospace; font-size: 11px; color: var(--neon1); word-break: break-all; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters select, .filters input { width: auto; min-width: 140px; }

/* ---------- логин ---------- */
.login-wrap { min-height: 72vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: min(400px, 92vw); text-align: center; }
.login-card .logo-badge { width: 54px; height: 54px; font-size: 20px; border-radius: 16px; margin: 0 auto 18px; }

/* ---------- выбор стиля картинками ---------- */
.style-pick {
  display: flex; align-items: center; gap: 16px; width: 100%; cursor: pointer;
  background: rgba(7, 11, 32, .8); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; color: var(--text); text-align: left; font-family: inherit;
  transition: border-color .15s;
}
.style-pick:hover { border-color: var(--neon1); }
.style-pick-img, .style-card-img {
  flex: none; width: 168px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #10173f, #0a0e28);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.style-pick-img img, .style-card-img img { width: 100%; height: 100%; object-fit: cover; }
.style-pick-img.empty::after, .style-card-img.empty::after {
  content: 'нет кадра'; font-size: 12px; color: #444e86;
}
.style-pick-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.style-pick-text b { font-size: 15px; }
.style-pick-text i { font-style: normal; font-size: 12px; color: var(--muted); }
.style-pick-arrow { color: var(--muted); font-size: 18px; }

.style-modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 20, .8);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.style-modal[hidden] { display: none; }
.style-modal-box {
  width: min(1000px, 96vw); max-height: 88vh; overflow: auto;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
}
.style-modal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.style-modal-head b { font-size: 17px; }
.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .style-grid { grid-template-columns: 1fr; } }
.style-card {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; color: var(--text); font-family: inherit; transition: border-color .15s, transform .12s;
}
.style-card:hover { border-color: var(--neon1); transform: translateY(-2px); }
.style-card .style-card-img { width: 100%; }
.style-card b { font-size: 14px; }
.style-card i { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.4; }
.style-card-img .dice, .style-pick-img .dice { font-size: 34px; }

/* ---------- темп речи голосов ---------- */
.pace-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px;
  background: rgba(7, 11, 32, .55); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; font-size: 13px; color: var(--muted);
}
.pace-form input[type=number] {
  width: 90px; background: rgba(7, 11, 32, .8); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font: 700 14px Montserrat, sans-serif; outline: none;
}
.pace-form b { color: var(--text); }
.pace-form i { flex-basis: 100%; }
.pace-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px; color: var(--muted);
}
.pace-arrow { color: #55609a; }
.pace-out { color: var(--neon1); font-weight: 700; }
.pace-none { color: #66719f; }

/* ---------- библиотека голосов: рамка на язык, внутри рамка на пол ---------- */
/* блок языка — та же карточка, что и ролики на главной (класс .card),
   здесь только отступы и внутренняя раскладка */
.lang-block { margin-top: 18px; }
.lang-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 28px; padding: 0 10px; border-radius: 9px;
  background: var(--grad); color: #0b0f28;
  font: 900 12px/1 Unbounded, Montserrat, sans-serif; letter-spacing: .08em;
  box-shadow: 0 0 16px rgba(122, 92, 255, .45);
}
.lang-name {                      /* название языка — тоже плашкой */
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: rgba(7, 11, 32, .75); border: 1px solid var(--line); color: #fff;
}
.lang-count {
  padding: 5px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(141, 151, 201, .1); border: 1px solid var(--line); color: var(--muted);
}

.gender-box {                     /* вложенная рамка на каждый пол */
  margin-top: 16px; padding: 14px 16px 16px;
  background: rgba(7, 11, 32, .5); border: 1px solid var(--line); border-radius: 16px;
}
.gender-box.gender-female { border-color: rgba(225, 77, 255, .3); }
.gender-box.gender-male { border-color: rgba(53, 214, 255, .3); }
.gender-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gender-tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px;
  border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  background: rgba(141, 151, 201, .12); color: var(--muted);
}
.gender-tag i { font-style: normal; font-size: 14px; line-height: 1; }
.gender-female .gender-tag { background: rgba(225, 77, 255, .16); color: #ef8dff; }
.gender-male .gender-tag { background: rgba(53, 214, 255, .16); color: var(--neon1); }
.gender-count {
  padding: 5px 11px; border-radius: 999px; font-size: 11px;
  background: rgba(7, 11, 32, .7); border: 1px solid var(--line); color: #55609a;
}

.voice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 12px;
}
.voice-card {
  background: rgba(17, 24, 66, .75); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 15px; transition: border-color .15s, transform .12s;
}
.voice-card:hover { transform: translateY(-2px); border-color: rgba(53, 214, 255, .5); }
.gender-female .voice-card:hover { border-color: rgba(225, 77, 255, .5); }
.voice-top { display: flex; align-items: flex-start; gap: 10px; }
.voice-top h4 { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.35; }
.voice-top form { margin: 0; }
.voice-top .x { font-size: 13px; opacity: .45; transition: opacity .12s, color .12s; }
.voice-card:hover .voice-top .x { opacity: 1; }
.voice-card .voice-id { font-size: 11px; color: #55609a; margin-top: 5px; }
.voice-card audio { width: 100%; height: 32px; margin-top: 11px; }
.pace-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pace-chip {
  background: rgba(7, 11, 32, .75); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; color: var(--text);
}
.pace-chip.pace-out { color: var(--neon1); font-weight: 700; border-color: rgba(53, 214, 255, .35); }
.pace-chip.pace-none { color: #66719f; }
.pace-arrow { color: #55609a; font-size: 11px; }

.warn-box {
  background: rgba(255, 176, 46, .1); border: 1px solid rgba(255, 176, 46, .4);
  color: #ffc46b; padding: 16px; border-radius: 14px; font-size: 13px;
  line-height: 1.6; margin-top: 14px;
}

/* ярлык сервера в шапке: различает вкладки двух одинаковых панелей */
.srv-tag {
  margin-left: 12px; padding: 5px 12px; border-radius: 999px;
  font: 800 11px/1 Montserrat, sans-serif; letter-spacing: .1em;
  color: var(--srv); border: 1px solid var(--srv);
  background: color-mix(in srgb, var(--srv) 14%, transparent);
  text-shadow: 0 0 12px var(--srv);
}

/* «скачано» на карточке + панель массового скачивания */
.badge.dl-mark { background: rgba(66, 245, 152, .14); color: #42f598; border: 1px solid rgba(66, 245, 152, .4); }
.dl-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dl-bar .sub { margin: 0; }
