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

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.app {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.logo {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.logo span {
  color: #7d6ff0;
}

.platforms {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.platforms span {
  padding: 4px 10px;
  border: 1px solid #292929;
  border-radius: 20px;
  color: #777;
  font-size: 12px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.platforms span.active {
  border-color: #6c5ce7;
  background: rgb(108 92 231 / 12%);
  color: #c9c2ff;
}

.input-group {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid #292929;
  border-radius: 12px;
  background: #111;
  transition: border-color 0.2s;
}

.input-group:focus-within {
  border-color: #7d6ff0;
}

.input-group input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font-size: 14px;
}

.input-group input::placeholder {
  color: #666;
}

button {
  border: 0;
  border-radius: 10px;
  background: #6c5ce7;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  transition: background 0.2s, color 0.2s;
}

button:hover:not(:disabled) {
  background: #5a4bd1;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #a99eff;
  outline-offset: 3px;
}

button:disabled {
  background: #292929;
  color: #777;
  cursor: not-allowed;
}

.input-group button {
  padding: 12px 20px;
  white-space: nowrap;
  font-size: 14px;
}

.privacy-option {
  padding: 12px 14px;
  border: 1px solid #292929;
  border-radius: 10px;
  background: #101010;
}

.privacy-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  font-size: 13px;
  cursor: pointer;
}

.privacy-option input {
  width: 16px;
  height: 16px;
  accent-color: #6c5ce7;
}

.privacy-option p {
  margin: 7px 0 0 24px;
  color: #888;
  font-size: 11px;
  line-height: 1.45;
}

.status {
  display: none;
  min-height: 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

.status.show {
  display: block;
}

.status.error {
  color: #ff766c;
}

.status.success {
  color: #4ddb88;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 2px solid #3a3a3a;
  border-top-color: #8c7ff5;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.6s linear infinite;
}

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

.result {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.result.show {
  display: flex;
}

.video-card {
  overflow: hidden;
  border: 1px solid #242424;
  border-radius: 12px;
  background: #111;
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d0d0d;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
}

.title {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info {
  color: #777;
  font-size: 12px;
}

.download-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.limits,
.footer {
  text-align: center;
  color: #666;
  font-size: 11px;
  line-height: 1.5;
}

.footer a {
  color: #999;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.download-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 420px) {
  body {
    align-items: flex-start;
    padding: 20px 16px;
  }

  .app {
    gap: 18px;
  }

  .input-group button {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
