:root {
  --bg: #0e1621;
  --bg-soft: #16202d;
  --card: #1b2838;
  --card-2: #22354a;
  --border: #2a475e;
  --border-control: #557a94;
  --text: #c7d5e0;
  --muted: #8f98a0;
  --accent: #66c0f4;
  --accent-2: #8fd0f8;
  --green: #a4d007;
  --danger: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(102, 192, 244, 0.1), transparent 60%),
    radial-gradient(700px 420px at 10% 0%, rgba(42, 71, 94, 0.45), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- badge ---------- */
.badge {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; background: var(--bg-soft);
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 34px 0 30px; }
.hero .badge { display: inline-block; margin-bottom: 16px; }

.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto; line-height: 1.55; }

/* ---------- search ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.search-card { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4); }
.search { display: flex; gap: 10px; }
.search input {
  flex: 1;
  min-width: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border-control);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 192, 244, 0.22);
}
.search button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--vd-btn-ink, #0b1a26);
  font-size: 15px;
  font-weight: 800;
  padding: 0 26px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.search button:hover { background: var(--accent-2); }
.search button:active { transform: scale(0.98); }
.search button[disabled] { opacity: 0.6; cursor: default; }

.hint { margin: 12px 2px 2px; font-size: 13px; color: var(--muted); }
.linklike {
  background: none; border: 0; padding: 6px 0;
  color: var(--accent); font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.linklike:hover { text-decoration: underline; }

.error {
  margin: 12px 2px 0;
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

/* ---------- result ---------- */
.result { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }

.post-card { padding: 16px 18px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); }
.post-meta { min-width: 0; }
.post-name { font-weight: 700; font-size: 15px; }
.post-handle { color: var(--muted); font-size: 13px; }
.post-stats { margin-inline-start: auto; text-align: end; color: var(--muted); font-size: 12px; line-height: 1.5; }
.post-text { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: #b8c6d4; word-break: break-word; white-space: pre-wrap; }

.video-block { padding: 0; overflow: hidden; }
.video-preview { position: relative; background: #000; aspect-ratio: 16 / 9; }
.video-preview img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.duration {
  position: absolute; inset-inline-end: 10px; bottom: 10px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.video-tag {
  position: absolute; inset-inline-start: 10px; top: 10px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
  color: #c7d5e0;
  text-transform: uppercase;
}
.variants { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.variant-row { display: flex; align-items: center; gap: 10px; }
.variant-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.variant-label { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.variant-sub { color: var(--muted); font-size: 12px; }

.chip {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 7px;
  border: 1px solid transparent;
}
.chip-clean { color: var(--accent); background: rgba(102, 192, 244, 0.1); border-color: rgba(102, 192, 244, 0.3); }
.chip-wm { color: var(--muted); background: var(--bg-soft); border-color: var(--border); }
.chip-hd { color: var(--green); background: rgba(164, 208, 7, 0.1); border-color: rgba(164, 208, 7, 0.32); }
.chip-music { color: #ffcf4d; background: rgba(255, 207, 77, 0.1); border-color: rgba(255, 207, 77, 0.28); }

.dl-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: var(--vd-btn-ink, #0b1a26);
  border: 0; border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.dl-btn:hover { background: var(--accent-2); }
.dl-btn:disabled { opacity: 0.75; cursor: default; }
.dl-icon { width: 15px; height: 15px; fill: currentColor; flex: 0 0 auto; }
.dl-text { position: relative; }
.progress {
  position: absolute; inset: 0;
  width: 0%;
  background: rgba(6, 17, 26, 0.22);
  transition: width 0.15s linear;
  pointer-events: none;
}
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- photo slideshow ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 14px;
}
.photo-cell { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.photo-cell img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; opacity: 0.9; }
.photo-cell a {
  position: absolute; inset-inline: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  text-decoration: none;
  font-size: 11.5px; font-weight: 700;
  text-align: center;
  padding: 5px 4px;
}
.photo-cell a:hover { background: var(--green); color: var(--vd-btn-ink, #0b1a26); }

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 34px 0 10px;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.step-n {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: rgba(102, 192, 244, 0.14);
  color: var(--accent);
  font-weight: 800; font-size: 13px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.step h2 { margin: 0 0 6px; font-size: 14px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- FAQ ---------- */
.faq { margin: 26px 0 36px; }
.faq h2 { font-size: 20px; margin: 0 0 12px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 16px;
  margin-bottom: 8px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 0;
  list-style-position: inside;
}
.faq-item summary:hover { color: var(--accent); }
.faq-item p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- footer ---------- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.langnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; }
.langnav a { color: var(--muted); text-decoration: none; font-size: 12.5px; padding: 6px 8px; }
.langnav a:hover { color: var(--accent); text-decoration: underline; }
.langnav a.cur { color: var(--text); font-weight: 700; }

/* ---------- focus ---------- */
/* A real ring on every keyboard-reachable control: the input's own focus style
 * is a translucent halo, and the buttons/links ship no focus treatment at all. */
.search input:focus-visible,
.search button:focus-visible,
.linklike:focus-visible,
.dl-btn:focus-visible,
.copy-btn:focus-visible,
.langnav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .search { flex-direction: column; }
  .search button { padding: 13px; }
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 22px; }
  .card { padding: 14px; }
  .post-card { padding: 14px; }
  .post-stats { text-align: start; margin-inline-start: 0; }
  .variant-row { flex-wrap: wrap; }
  .variant-info { flex: 1 1 100%; }
  .dl-btn, .copy-btn { flex: 1; justify-content: center; }
  .langnav { gap: 4px 12px; }
}

/* ---------- steam result header ---------- */
.cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--bg-soft); }
.trailer-name { margin: 0; padding: 14px 14px 0; font-size: 15px; }

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