:root {
  color-scheme: dark;
  --bg: #04070f;
  --card: rgba(8, 15, 30, 0.76);
  --card-border: rgba(148, 163, 184, 0.2);
  --text: #dbe7ff;
  --muted: #94a3b8;
  --primary: #2f7cff;
  --primary-strong: #0052e6;
  --accent: #7c3aed;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(47, 124, 255, 0.28), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(124, 58, 237, 0.22), transparent 32%),
    radial-gradient(circle at 60% 90%, rgba(6, 182, 212, 0.18), transparent 36%);
  filter: blur(6px);
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1080px, 94vw);
  margin: 30px auto 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 35px rgba(3, 8, 24, 0.35);
}

.hero h1 {
  margin: 8px 0;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.24;
}

.eyebrow {
  margin: 0;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subtext {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.controls label {
  display: block;
  margin-bottom: 8px;
  color: #c7d2fe;
  font-size: 0.92rem;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 10px;
}

input[type='password'],
input[type='text'] {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus {
  border-color: rgba(47, 124, 255, 0.95);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  color: #eff6ff;
  font-weight: 600;
  font-size: 0.92rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.ghost {
  background: rgba(51, 65, 85, 0.6);
}

button.accent {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status,
.resolution {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.status {
  color: #bfdbfe;
}

.resolution {
  color: #a7f3d0;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.media-frame {
  border-radius: 14px;
  border: 1px solid rgba(100, 116, 139, 0.38);
  overflow: hidden;
  background: #000;
}

video,
#resultImage {
  width: 100%;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.link {
  color: #93c5fd;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

button.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 680px) {
  .layout {
    margin-top: 14px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }
}
