/* Раскладка: на телефоне одна колонка (ролик сверху, настройки ниже), от 900 px две колонки.
   Цвета и шрифты в духе баннеров RizzBro: тёмный фон, голубой неон, фиолетовый акцент. */
:root {
  --bg: #080b14;
  --panel: #0f1424;
  --panel-2: #151b30;
  --line: #222b4d;
  --fg: #e9eeff;
  --mute: #8f9abf;
  --accent: #58dcff;
  --accent-2: #b98cff;
  --ok: #62f5c6;
  --bad: #ff7a96;
  --f-disp: "Unbounded", "Manrope", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 500 15px/1.5 var(--f-body);
  -webkit-text-size-adjust: 100%;
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  padding-block: 0 24px;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding-block: 14px;
}
.brand { font: 700 17px var(--f-disp); letter-spacing: -.01em; }
.brand span { color: var(--accent); font-weight: 500; margin-left: 6px; }

.layout { display: grid; gap: 22px; max-width: 1180px; margin: 0 auto; }
.col-stage, .col-panel { min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(340px, 480px) 1fr; align-items: start; gap: 32px; }
  .col-stage { position: sticky; top: 12px; }
}

/* ---- ролик ---- */
.stage-wrap { display: grid; place-items: center; }
.drop {
  position: relative; display: grid; place-items: center; gap: 6px; width: 100%; min-height: 300px; padding: 28px 20px; text-align: center;
  border: 2px dashed var(--line); border-radius: 20px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel-2); }
.drop strong { font: 700 18px var(--f-disp); }
.drop span { color: var(--mute); font-size: 13px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.stage { position: relative; overflow: hidden; border-radius: 18px; background: #000; box-shadow: 0 0 0 1px var(--line), 0 20px 50px #0009; touch-action: pan-y; }
.stage video.main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .nopreview { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--mute); font-size: 13px; }

.banner { position: absolute; z-index: 5; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.banner.drag { cursor: grabbing; outline: 2px dashed var(--accent); outline-offset: 3px; }
.banner img, .banner video { display: block; width: 100%; height: auto; pointer-events: none; }

.zones { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.zones div {
  position: absolute; display: grid; place-items: center; color: #ffd9e1; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: repeating-linear-gradient(135deg, #ff5a7c2e 0 6px, #ff5a7c14 6px 12px); border: 1px dashed #ff7a96aa;
}
.zones .z-top { left: 0; right: 0; top: 0; height: 12%; }
.zones .z-bottom { left: 0; right: 0; bottom: 0; height: 22%; }
.zones .z-right { right: 0; width: 16%; top: 38%; height: 44%; }

.stage-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip, .tool {
  border: 1px solid var(--line); background: var(--panel); color: var(--mute); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
  min-height: 38px;
}
.chip:hover, .tool:hover { border-color: var(--accent); color: var(--fg); }
.chip[aria-pressed="true"], .tool[aria-pressed="true"] { background: #58dcff1f; border-color: var(--accent); color: var(--fg); }

/* ---- панель ---- */
.col-panel h2 { margin: 0 0 10px; font: 700 14px var(--f-disp); letter-spacing: .02em; }
.block { margin-bottom: 24px; }
.hint { color: var(--mute); font-size: 13px; margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
@media (min-width: 560px) { .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 54vh; } }
.thumb { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; text-align: left; }
.thumb img { display: block; width: 100%; aspect-ratio: 20 / 9; object-fit: cover; background: #0b1020; }
.thumb span { display: block; padding: 7px 9px 8px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.thumb small { display: block; color: var(--mute); font-weight: 500; font-size: 11px; }
.thumb:hover { border-color: var(--accent-2); }
.thumb[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px #58dcff55; }
.thumb .star { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px; background: #0009; color: #ffd36b; font-size: 11px; font-weight: 700; }

.range { width: 100%; accent-color: var(--accent); height: 28px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row output { color: var(--accent); font-weight: 700; }

.field { display: grid; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--mute); }
.field input[type="text"], .field input[type="password"] {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 16px;
}
.field input:focus { border-color: var(--accent); outline: none; }

.primary {
  width: 100%; min-height: 54px; border: 0; border-radius: 14px; font: 700 15px var(--f-disp); color: #05101c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px #58dcff33;
}
.primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--mute); font-size: 13px; font-weight: 700; }
.ghost:hover { color: var(--fg); border-color: var(--accent); }

.buildbar { position: sticky; bottom: 0; z-index: 20; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--bg) 70%, #080b1400); }
@media (min-width: 900px) { .buildbar { position: static; margin: 0; padding: 0; background: none; } }

.status { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.status .bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: 10px; }
.status .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.status.err { border-color: var(--bad); color: #ffd9e1; }

.result { margin-top: 18px; display: grid; gap: 12px; }
.result video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.result .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.result a.primary { display: grid; place-items: center; text-decoration: none; flex: 1 1 200px; }

/* ---- вход ---- */
.login-wrap { min-height: 100svh; display: grid; place-items: center; }
.login { width: min(100%, 380px); padding: 28px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 20px 60px #000a; }
.login h1 { margin: 0 0 4px; font: 700 20px var(--f-disp); }
.login p { margin: 0 0 20px; color: var(--mute); font-size: 14px; }
.login .err { margin: 0 0 12px; color: var(--bad); font-size: 13px; min-height: 18px; }
