/* GTA Clipper — dark dashboard. Desktop: sidebar; phone: bottom tab bar. */
:root {
  --bg: #0c0d11; --surface: #14161c; --surface-2: #1b1e26; --surface-3: #232733; --line: #282c37; --line-2: #343948;
  --text: #ecedf1; --muted: #8d93a3; --faint: #5d6373;
  --accent: #8b5cf6; --accent-2: #a78bfa; --accent-bg: rgba(139, 92, 246, .14);
  --ok: #22c55e; --ok-bg: rgba(34, 197, 94, .13); --bad: #f43f5e; --bad-bg: rgba(244, 63, 94, .13);
  --warn: #f59e0b; --warn-bg: rgba(245, 158, 11, .13);
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14.5px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-3);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 10px; font-weight: 650; color: var(--text); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.err { color: #fb7185; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px; border-right: 1px solid var(--line); background: #0f1015; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); font-weight: 700;
  font-size: 15.5px; text-decoration: none !important; }
.logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 12px;
  background: linear-gradient(135deg, var(--accent), #ec4899); color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted);
  text-decoration: none !important; font-weight: 500; }
.nav:hover { background: var(--surface-2); color: var(--text); }
.nav.on { background: var(--accent-bg); color: var(--text); }
.nav.on svg { color: var(--accent-2); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11.5px;
  padding: 0 7px; font-weight: 600; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 9px; color: var(--text); flex: 1; min-width: 0; padding: 6px; border-radius: var(--r-sm); }
.me:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3);
  font-weight: 700; font-size: 12.5px; text-transform: uppercase; flex: none; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: rgba(12, 13, 17, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .chips { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.content { padding: 20px 24px 40px; max-width: 1280px; width: 100%; }
.notices { padding: 12px 24px 0; display: flex; flex-direction: column; gap: 8px; max-width: 1280px; }
.alert, .flash { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.5px; }
.alert { background: var(--bad-bg); border: 1px solid rgba(244, 63, 94, .3); color: #fecdd3; }
.flash { background: var(--ok-bg); border: 1px solid rgba(34, 197, 94, .3); color: #bbf7d0; }
.tabbar { display: none; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid .card { margin: 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 550;
  white-space: nowrap; text-decoration: none !important; cursor: default; }
a.chip, button.chip { cursor: pointer; }
a.chip:hover, button.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.ok { color: #86efac; } .chip.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.chip.bad { color: #fda4af; } .chip.bad .dot { background: var(--bad); }
.chip.warn { color: #fcd34d; background: var(--warn-bg); border-color: rgba(245, 158, 11, .35); } .chip.warn .dot { background: var(--warn); }
.chip.accent { color: #ddd6fe; background: var(--accent-bg); border-color: rgba(139, 92, 246, .4); }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 1px 7px; font-size: 11.5px;
  font-weight: 600; background: var(--surface-3); color: #c9cdd6; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: #86efac; } .badge.bad { background: var(--bad-bg); color: #fda4af; }
.badge.warn { background: var(--warn-bg); color: #fcd34d; } .badge.accent { background: var(--accent-bg); color: #ddd6fe; }

button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px;
  padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-weight: 550; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s; }
button:hover, .btn:hover { background: var(--surface-3); border-color: #414757; }
button:active, .btn:active { transform: translateY(1px); }
button[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #7c4ff0; border-color: #7c4ff0; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #04210f; }
.btn-ok:hover { background: #2fd36b; border-color: #2fd36b; }
.btn-bad { background: transparent; border-color: rgba(244, 63, 94, .45); color: #fda4af; }
.btn-bad:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15.5px; border-radius: 10px; }
form.inline { display: inline; margin: 0; }

input[type=text], input[type=password], input[type=number], input:not([type]), textarea, select {
  font: inherit; color: var(--text); background: #0f1116; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 8px 11px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea { resize: vertical; min-height: 70px; font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span:first-child { font-weight: 550; font-size: 13.5px; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.field.changed > span:first-child::after { content: " • изменено"; color: var(--accent-2); font-weight: 500; font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }

.seg { display: inline-flex; background: #0f1116; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  color: var(--muted); font-weight: 550; font-size: 13px; }
.seg input { display: none; }
.seg label:has(input:checked), .seg a.on { background: var(--accent); color: #fff; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; text-decoration: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 550; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .5; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
td.actions { text-align: right; white-space: nowrap; }
.sub { color: var(--muted); font-size: 12.5px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list .item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.chat { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.chat li { display: flex; gap: 8px; word-break: break-word; font-size: 13.5px; }
.chat .cnt { color: var(--accent-2); font-weight: 650; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.review-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.review-side .card { margin: 0; }
.player { padding: 12px; }
.stage { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.stage video { width: 100%; max-height: 62vh; display: block; background: #000; }
.cam-layer { position: absolute; inset: 0; pointer-events: none; }
.stage.drawing .cam-layer { pointer-events: auto; cursor: crosshair; touch-action: none; background: rgba(0, 0, 0, .35); }
.cam-box { position: absolute; display: none; border: 2px solid var(--accent-2); background: rgba(139, 92, 246, .12);
  border-radius: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.game-box { position: absolute; display: none; border: 2px dashed rgba(255, 255, 255, .85); border-radius: 4px;
  background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); cursor: ew-resize; touch-action: none; }
.game-box span { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: rgba(0, 0, 0, .75);
  padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.game-box.drag { border-color: var(--accent-2); }
.stage.drawing .game-box { display: none !important; }
canvas.preview916.pannable { cursor: ew-resize; touch-action: pan-y; }
.draw-hint { display: none; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .8);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.stage.drawing .draw-hint { display: block; }

.transport { display: flex; align-items: center; gap: 8px; margin: 12px 2px 8px; flex-wrap: wrap; }
.play-btn { width: 42px; height: 42px; padding: 0; border-radius: 50%; background: var(--text); color: #0c0d11; border: 0; }
.play-btn:hover { background: #fff; }
.play-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.tc { font: 600 13.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.tc b { color: var(--text); }
.transport .grow { flex: 1; }

.timeline { user-select: none; -webkit-user-select: none; touch-action: none; padding: 6px 0 2px; }
.tl-track { position: relative; height: 46px; border-radius: 8px; background:
  repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, .06) calc(10% - 1px) 10%), #0f1116;
  border: 1px solid var(--line-2); cursor: pointer; }
.tl-out { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .55); pointer-events: none; }
.tl-out.l { left: 0; border-radius: 8px 0 0 8px; } .tl-out.r { right: 0; border-radius: 0 8px 8px 0; }
.tl-sel { position: absolute; top: -1px; bottom: -1px; border-top: 3px solid var(--accent); border-bottom: 3px solid var(--accent);
  background: rgba(139, 92, 246, .16); cursor: grab; }
.tl-sel:active { cursor: grabbing; }
.tl-h { position: absolute; top: -1px; bottom: -1px; width: 16px; background: var(--accent); cursor: ew-resize; z-index: 2;
  display: grid; place-items: center; }
.tl-h::after { content: ""; width: 3px; height: 16px; border-radius: 2px; background: rgba(255, 255, 255, .85); }
.tl-h.in { transform: translateX(-100%); border-radius: 8px 0 0 8px; }
.tl-h.out { border-radius: 0 8px 8px 0; }
.tl-h:hover, .tl-h.drag { background: var(--accent-2); }
.tl-ph { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #fff; z-index: 3; pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, .6); }
.tl-ph::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.tl-info { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.tl-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.kbd-hint { margin-left: auto; font-size: 12px; color: var(--faint); }

.decide { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 12px; }
.decide .btn-lg { width: 100%; }
.meta-title { font-weight: 650; font-size: 15.5px; }
.preview-wrap { display: flex; justify-content: center; margin-top: 12px; }
canvas.preview916 { width: 189px; height: 336px; border-radius: 10px; background: #000; box-shadow: 0 0 0 1px var(--line-2); }

.ready-card video { width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; object-fit: contain; background: #000; border-radius: 10px; display: block; }
.ready-card .row.btns { margin-top: 10px; }
.ready-card .row.btns .btn-ok { flex: 1; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(700px 400px at 50% 0%, rgba(139, 92, 246, .18), transparent); }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { justify-content: center; padding-bottom: 18px; font-size: 18px; }
.login-card button { width: 100%; }

/* ---------- phone ---------- */
@media (max-width: 960px) {
  .review { grid-template-columns: 1fr; }
  .review-side { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 17px; }
  .topbar .chips { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .content { padding: 14px 12px 96px; }
  .notices { padding: 10px 12px 0; }
  .card { padding: 12px; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }
  .kbd-hint { display: none; }
  .decide { position: sticky; bottom: 62px; z-index: 5; background: var(--bg); padding: 8px 0; margin-top: 8px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(15, 16, 21, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar summary { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px;
    color: var(--muted); text-decoration: none; padding: 4px 0; position: relative; cursor: pointer; }
  .tabbar summary::before { content: none; }
  .tabbar a.on { color: var(--accent-2); }
  .tabbar .count { position: absolute; top: 0; right: calc(50% - 20px); background: var(--accent); color: #fff; border-radius: 999px;
    font-size: 10px; padding: 0 5px; }
  .tabbar details { position: relative; }
  .tabbar .menu { position: absolute; bottom: calc(100% + 10px); right: 4px; min-width: 190px; background: var(--surface-2);
    border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
  .tabbar .menu a { flex-direction: row; gap: 10px; font-size: 14px; padding: 10px; color: var(--text); border-radius: var(--r-sm); }
  canvas.preview916 { width: 162px; height: 288px; }
}
