:root {
  --bg: #0f1117;
  --surface: #171b24;
  --border: #2a3142;
  --text: #eef2ff;
  --muted: #9aa6bf;
  --primary: #00be63;
  --primary-hover: #06af5e;
  --accent: #195fd7;
  --danger: #ff6b6b;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  width: min(760px, 100% - 2rem);
  margin: 0 auto;
}

.container-wide {
  width: min(960px, 100% - 2rem);
  margin: 0 auto;
}

.topnav .logo {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.hero {
  background: linear-gradient(160deg, #195fd7 0%, #0f2d6b 100%);
  padding: 2rem 0 3rem;
}

.logo {
  display: flex;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  margin-bottom: 1.5rem;
  justify-content: center;
  align-items: center;
}

img.logo-mark {
  margin-top: 5px;
  width: 1.65em;
  height: 1.65em;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
}

.logo-text {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.logo-text span {
  color: #00be63;
  letter-spacing: -0.02em;
}

.topnav {
  background: #0a0d14;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.content {
  padding: 2rem 0 3rem;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lang-menu {
  position: relative;
}

.lang-menu summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 0.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lang-dropdown a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-dropdown a.active,
.lang-dropdown a:hover {
  color: #fff;
  background: var(--border);
}

.flag {
  width: 1.1rem;
  text-align: center;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: start;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #7eb8ff;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.legal h1 {
  margin-top: 0;
}

.legal p {
  color: var(--muted);
  line-height: 1.65;
}

.link-input {
  width: 100%;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

.content h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
}

.content h2:first-child {
  margin-top: 0;
}

.content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.content p,
.content li {
  color: var(--muted);
  line-height: 1.65;
}

.content ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature strong {
  color: var(--text);
}

.feature span {
  font-size: 0.88rem;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.disclaimer {
  margin-top: 2rem;
  font-size: 0.88rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.subtitle {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.85);
}

.download-form {
  display: grid;
  gap: 0.75rem;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 0.35rem;
}

.input-wrap .link-input {
  flex: 1;
  min-width: 0;
}

.btn-input-action {
  flex-shrink: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

input[type='url'] {
  border: none;
  outline: none;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  color: #111;
}

button,
.btn-standard {
  border: none;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary,
.btn-hd,
.btn-standard,
.btn-mp3 {
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-hd:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e8eeff;
  color: #1a3fbf;
  border-radius: 8px;
  padding: 0.5rem;
  font-weight: 600;
}

.btn-primary:disabled,
.btn-hd:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  margin: 0.75rem 0 0;
  color: #ffd5d5;
  background: rgba(255, 0, 0, 0.15);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

main > .container {
  padding: 2rem 0 0;
}

.loader {
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

.result {
  display: grid;
  gap: 1.25rem;
}

.slideshow-section {
  display: grid;
  gap: 0.75rem;
}

.slideshow-section .btn-secondary {
  justify-self: start;
}

.slideshow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.slideshow-item {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.slideshow-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.btn-photo {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
}

.btn-mp3 {
  background: #7c3aed;
  color: #fff;
}

.btn-mp3:hover {
  background: #6d28d9;
}

.result[hidden],
.loader[hidden],
.form-error[hidden] {
  display: none !important;
}

.video-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.video-card.no-cover {
  grid-template-columns: 1fr;
}

.cover {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.meta h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta p {
  margin: 0;
}

.stats {
  margin-top: 0.35rem !important;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: grid;
  gap: 0.75rem;
}

.btn-hd {
  background: #0063f9;
  color: #fff;
  flex-direction: column;
  gap: 0.15rem;
}

.btn-sub {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.85;
}

.btn-standard {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.25rem 0;
  justify-self: center;
}

.btn-link:hover {
  color: var(--text);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-card {
  position: relative;
  width: min(420px, calc(100% - 2rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.modal-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.ad-sim {
  margin: 1rem 0;
  background: #0b0d12;
  border-radius: 8px;
  padding: 1rem;
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 0.75rem;
}

.ad-progress {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.ad-progress::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s linear;
}

.ad-progress.running::after {
  width: 100%;
  transition-duration: 5s;
}

.btn-dev {
  width: 100%;
  background: #2a3142;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 0.85rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .download-form {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .btn-primary {
    height: 100%;
    min-width: 140px;
  }
}
