:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1120;
  color: #eef2ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 0, rgb(59 130 246 / 16%), transparent 48%),
    #0b1120;
}

.card {
  width: min(100%, 850px);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid #26334b;
  border-radius: 20px;
  background: #111a2b;
  box-shadow: 0 24px 80px rgb(0 0 0 / 32%);
}

.eyebrow {
  margin: 0 0 10px;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: -0.04em;
}

.intro {
  max-width: 70ch;
  margin: 14px 0 20px;
  color: #bac6d8;
  line-height: 1.65;
}

.notice {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid #684d2a;
  border-radius: 10px;
  background: #2b2114;
  color: #f4d6a0;
  line-height: 1.55;
}

.step {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #26334b;
  border-radius: 14px;
  background: #0e1727;
}

.step h2,
.media-section h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.step p {
  margin: 0 0 14px;
  color: #bac6d8;
  line-height: 1.55;
}

.step label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 650;
}

textarea,
input[type="url"] {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #44536c;
  border-radius: 10px;
  background: #080d17;
  color: #eef2ff;
  font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="url"] {
  min-width: 0;
  min-height: 44px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-row .button {
  flex: 0 0 auto;
  margin-top: 0;
}

input[type="url"]:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 2px;
}

textarea:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 2px;
}

.button {
  min-height: 44px;
  margin: 8px 8px 0 0;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.button:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 3px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  background: #2563eb;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.button-secondary {
  border-color: #44536c;
  background: transparent;
  color: #eef2ff;
}

.button-secondary:hover:not(:disabled) {
  background: #1e293b;
}

.button-danger {
  background: #991b1b;
  color: #fff;
}

.button-danger:hover:not(:disabled) {
  background: #7f1d1d;
}

.media-section {
  margin-top: 28px;
}

.media-section h3 {
  margin: 12px 0 8px;
  font-size: 0.92rem;
}

.media-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
}

.preview {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 180px;
  aspect-ratio: 16 / 9;
  place-items: center;
  border: 1px solid #33425d;
  border-radius: 12px;
  background: #080d17;
}

.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#local-video {
  transform: scaleX(-1);
}

.placeholder {
  padding: 14px;
  color: #91a0b7;
  text-align: center;
}

.status {
  min-height: 1.5em;
  margin: 16px 0 8px;
  color: #cbd5e1;
  line-height: 1.5;
}

.status[data-state="error"] {
  color: #fca5a5;
}

.note {
  margin: 22px 0 0;
  color: #91a0b7;
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .step {
    padding: 16px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}
