* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  height: 100%;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 64px 24px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wrap > footer,
footer {
  margin-top: auto;
  padding-top: 48px;
  font-size: 0.75rem;
  color: #3f3f46;
  text-align: center;
}

footer a {
  color: #52525b;
  text-decoration: none;
}

footer a:hover {
  color: #a1a1aa;
}

header {
  margin-bottom: 48px;
}

header .brand {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 16px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

header p {
  color: #a1a1aa;
  font-size: 0.95rem;
  max-width: 36ch;
}

.field {
  margin-bottom: 32px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #71717a;
  margin-bottom: 8px;
}

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

input[type="text"] {
  flex: 1;
  min-width: 0;
  background: #111;
  border: 1px solid #222;
  border-radius: 999px;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus {
  border-color: #52525b;
}

input[type="text"]::placeholder {
  color: #52525b;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    opacity 0.15s,
    background 0.15s,
    transform 0.1s;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #8b5cf6;
  color: #fff;
  padding: 14px 22px;
}

.btn-primary:hover:not(:disabled) {
  background: #7c3aed;
}

.btn-download {
  background: #8b5cf6;
  color: #fff;
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-download:hover {
  background: #7c3aed;
}

.btn-sm {
  background: transparent;
  border: 1px solid #333;
  color: #a1a1aa;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-sm:hover {
  border-color: #52525b;
  color: #fff;
}

.status {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #71717a;
  min-height: 1.2em;
}

.status.err {
  color: #f87171;
}
.status.ok {
  color: #a1a1aa;
}

.result {
  display: none;
}

.result.on {
  display: block;
}

.preview {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1a1a1a;
  margin-bottom: 16px;
  aspect-ratio: 9 / 16;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  background: #111;
  border: 1px solid #222;
  border-radius: 999px;
  padding: 3px;
}

.seg button {
  border: none;
  background: transparent;
  color: #71717a;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.seg button.on {
  background: #8b5cf6;
  color: #fff;
}

.seg button:not(.on):hover {
  color: #fff;
}

.block {
  margin-bottom: 24px;
}

.block-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #71717a;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.camel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 14px 16px;
}

.camel code {
  flex: 1;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e4e4e7;
  word-break: break-all;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 12px 14px;
}

.link .tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
  min-width: 44px;
}

.link a.url {
  flex: 1;
  min-width: 0;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.8rem;
  font-family: ui-monospace, "SF Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link a.url:hover {
  color: #fff;
}

.preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.link .url-label {
  flex: 1;
  min-width: 0;
  color: #a1a1aa;
  font-size: 0.85rem;
}

@media (min-width: 520px) {
  .preview {
    aspect-ratio: 16 / 10;
    max-height: 340px;
  }
}
