:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --card: #17191c;
  --line: #2a2d32;
  --text: #ecedef;
  --muted: #8b9098;
  --accent: #ff3b3b;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }
header { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
h1 span { color: var(--accent); font-weight: 600; }
form { display: flex; gap: 8px; flex: 1; min-width: 280px; }
input, select, button {
  font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; outline: none;
}
input { flex: 1; min-width: 0; }
input:focus, select:focus { border-color: #4a4f57; }
button { background: var(--accent); border-color: var(--accent); font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; border-color: var(--line); font-weight: 500; padding: 6px 12px; font-size: 13px; }
.frame { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; }
video { width: 100%; height: 100%; display: block; background: #000; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(0, 0, 0, 0.55); pointer-events: none;
}
.overlay[hidden] { display: none; }
.overlay p { margin: 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #ffffff22; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.meta { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-top: 14px; }
.meta h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.side { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.badge:empty { display: none; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
.progress { position: relative; margin-top: 14px; height: 22px; background: var(--card); border-radius: 8px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: #ff3b3b33; transition: width 0.4s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font-size: 12px; color: var(--muted); }
.error { color: #ff7a7a; background: #ff3b3b14; border: 1px solid #ff3b3b33; border-radius: 10px; padding: 10px 14px; }
.hint { margin-top: 28px; font-size: 13px; }
code { background: var(--card); border-radius: 5px; padding: 1px 5px; }
body.login { display: grid; place-items: center; min-height: 100vh; }
.card { flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 320px; flex: none; }
.card h1 { margin-bottom: 8px; }
.card input { background: var(--bg); }
.card .error { margin: 0; font-size: 13px; }
@media (max-width: 640px) {
  .meta { flex-direction: column; }
  form { flex-wrap: wrap; }
  input { flex-basis: 100%; }
}
