:root {
  --bg: #070018;
  --panel: rgba(18, 6, 44, 0.9);
  --panel-2: rgba(8, 2, 24, 0.95);
  --surface: rgba(15, 5, 38, 0.82);
  --line: rgba(150, 90, 255, 0.22);
  --card-border: rgba(255, 77, 240, 0.26);
  --field-bg: rgba(20, 8, 48, 0.65);
  --field-border: rgba(56, 214, 255, 0.28);
  --text: #f6ecff;
  --muted: #b9a3d6;
  --accent: #38d6ff;
  --accent-2: #ff4df0;
  --danger: #ff5f7e;
  --warn: #ffb347;
  --gold: #ffd34d;
  --violet: #8a2be2;
  --success: #5dff9b;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  background:
    radial-gradient(60% 45% at 12% 0%, rgba(255, 40, 210, 0.18), transparent 65%),
    radial-gradient(50% 40% at 92% 4%, rgba(40, 170, 255, 0.16), transparent 62%),
    radial-gradient(70% 55% at 50% 105%, rgba(120, 20, 255, 0.22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 30px 40px, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 90px, rgba(140, 230, 255, 0.85) 50%, transparent 51%),
    radial-gradient(1px 1px at 185px 35px, rgba(255, 160, 255, 0.85) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75px 160px, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 205px 185px, rgba(160, 210, 255, 0.7) 50%, transparent 51%);
  background-size: 220px 200px;
  background-repeat: repeat;
  opacity: 0.65;
}

::selection { background: rgba(255, 77, 240, 0.4); color: #fff; }

a { color: var(--accent); }
a:hover { color: #9fefff; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.wrap.narrow { max-width: 560px; }

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 0 18px rgba(56, 214, 255, 0.35);
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px rgba(255, 77, 240, 0.9), 0 0 30px rgba(56, 214, 255, 0.5);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; color: #fff; }
h1 {
  font-size: 30px;
  letter-spacing: -0.01em;
  text-shadow: 0 0 18px rgba(56, 214, 255, 0.35), 0 0 34px rgba(255, 77, 240, 0.2);
}
h2 { font-size: 21px; text-shadow: 0 0 16px rgba(56, 214, 255, 0.25); }
h3 { font-size: 16px; }

p { margin: 0 0 12px; color: var(--muted); }
p.strong { color: var(--text); }

.card {
  position: relative;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 40, 210, 0.1), transparent 55%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow:
    0 0 30px rgba(120, 20, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

label.field {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}

label.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: #fff;
  font: inherit;
  font-size: 16px;
}

input::placeholder, textarea::placeholder { color: rgba(169, 143, 201, 0.75); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(255, 77, 240, 0.4), 0 0 18px rgba(255, 77, 240, 0.18);
}

textarea { min-height: 84px; resize: vertical; }

input[type="checkbox"] { accent-color: var(--accent-2); width: 16px; height: 16px; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #ff3ed8, #7c2cff 55%, #2cc7ff);
  color: #120022;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 12px 30px -12px rgba(255, 62, 216, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: filter 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

button:hover, .button:hover { filter: brightness(1.07); color: #120022; }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

button.ghost, .button.ghost {
  background: rgba(56, 214, 255, 0.07);
  border-color: rgba(56, 214, 255, 0.28);
  color: #eaf9ff;
  font-weight: 700;
  box-shadow: none;
}
button.ghost:hover, .button.ghost:hover {
  background: rgba(56, 214, 255, 0.14);
  border-color: rgba(56, 214, 255, 0.5);
}

button.small { padding: 7px 14px; font-size: 14px; }

button.danger {
  background: transparent;
  border-color: rgba(255, 95, 126, 0.55);
  color: var(--danger);
  box-shadow: 0 0 18px rgba(255, 95, 126, 0.12);
}
button.danger:hover { background: rgba(255, 95, 126, 0.1); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 1 auto; }
.grow { flex: 1 1 220px !important; }
.spacer { flex: 1; }

.hint { font-size: 14px; color: var(--muted); }
.error { color: var(--danger); font-size: 15px; margin: 10px 0 0; }
.ok { color: var(--success); }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid rgba(56, 214, 255, 0.35);
  color: #9fefff;
  background: rgba(56, 214, 255, 0.08);
}
.badge.live { color: #05140f; background: linear-gradient(180deg, #7dffc0, #2fd98a); border-color: transparent; box-shadow: 0 0 18px rgba(93, 255, 155, 0.4); }
.badge.waiting { color: #2a1500; background: linear-gradient(180deg, #ffe08a, #ffb02e); border-color: transparent; box-shadow: 0 0 18px rgba(255, 176, 46, 0.35); }
.badge.ended { color: var(--muted); background: rgba(120, 90, 160, 0.12); border-color: rgba(150, 90, 255, 0.25); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  position: relative;
  padding: 0 0 16px 46px;
  color: var(--muted);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(74, 32, 200, 0.9), rgba(30, 8, 80, 0.9));
  border: 1px solid rgba(56, 214, 255, 0.55);
  color: #9fefff;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(56, 214, 255, 0.25);
}
.steps li strong { color: #fff; }

.callout {
  border-left: 3px solid var(--accent);
  background: rgba(56, 214, 255, 0.08);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 16px 0;
  color: var(--text);
  font-size: 15px;
}
.callout.warn { border-color: var(--warn); background: rgba(255, 176, 32, 0.09); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid rgba(56, 214, 255, 0.55);
  background: linear-gradient(180deg, rgba(74, 32, 200, 0.55), rgba(30, 8, 80, 0.35));
}
tbody tr:hover { background: rgba(120, 40, 200, 0.12); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  background: rgba(20, 8, 48, 0.6);
  border: 1px solid rgba(56, 214, 255, 0.22);
  color: var(--muted);
  font-weight: 700;
  box-shadow: none;
}
.tabs button[aria-selected="true"] {
  background: linear-gradient(180deg, #ff6cf5, #b32fce);
  color: #120022;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(255, 77, 240, 0.4);
}

.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 214, 255, 0.07);
  border: 1px solid rgba(56, 214, 255, 0.3);
  font-size: 13px;
  color: #9fefff;
}

.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13px; word-break: break-all; }

.copybox {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--field-bg);
  border: 1px dashed rgba(56, 214, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
}

.footer { margin-top: 28px; font-size: 13px; color: #735a94; text-align: center; }

.video-wrap {
  position: relative;
  background: #04000e;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 77, 240, 0.4);
  aspect-ratio: 16 / 9;
  box-shadow:
    0 0 0 1px rgba(56, 214, 255, 0.15),
    0 0 34px rgba(255, 47, 220, 0.18),
    inset 0 0 30px rgba(90, 20, 200, 0.18);
}
.video-wrap video, .video-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.pointer {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  pointer-events: none;
  display: none;
}

.dock {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 214, 255, 0.22);
  background: linear-gradient(180deg, rgba(18, 6, 44, 0.9), rgba(8, 2, 24, 0.92));
}
.dock-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dock-row + .dock-row { margin-top: 10px; }
.dock-row input[type="text"] { flex: 1 1 220px; width: auto; }
.dock .hint { margin: 10px 0 0; }

.video-wrap:fullscreen {
  aspect-ratio: auto;
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  border: 0;
}
.video-wrap:fullscreen video { object-fit: contain; }
#fs-exit {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.hidden { display: none !important; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(7, 0, 24, 0.9); }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #7c2cff, #ff4df0); border-radius: 999px; border: 2px solid rgba(7, 0, 24, 0.9); }

@media (max-width: 640px) {
  .wrap { padding: 16px 14px 48px; }
  .card { padding: 18px; border-radius: 14px; }
  h1 { font-size: 24px; }
  .dock { padding: 12px; }
  .dock-row button { flex: 1 1 auto; }
  header.top { flex-wrap: wrap; }
  header.top .brand { width: 100%; }
  header.top .row { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
