:root {
  --bg: #0f0f14;
  --panel: #1a1a24;
  --panel-2: #23232f;
  --text: #f4f4f7;
  --muted: #9a9aae;
  --accent: #d62976;
  --accent-2: #fa7e1e;
  --accent-3: #962fbf;
  --ring: rgba(214, 41, 118, 0.4);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(150, 47, 191, 0.25), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(250, 126, 30, 0.15), transparent 55%),
    var(--bg);
  display: flex;
  justify-content: center;
}

.wrap {
  width: 100%;
  max-width: 720px;
  padding: 48px 20px 40px;
  /* respect iPhone notch / home-indicator safe areas */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

button, input { -webkit-tap-highlight-color: transparent; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.hero { text-align: center; margin-bottom: 28px; }

.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* language switcher */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { background: var(--panel-2); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 320px;
}
[dir="rtl"] .lang-menu { right: auto; left: 0; }
.lang-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-menu a:hover { background: var(--panel-2); color: var(--text); }
.lang-menu a.active { color: var(--accent-2); font-weight: 600; }

@media (max-width: 480px) {
  .lang-menu { min-width: 240px; grid-template-columns: 1fr; }
}

/* RTL: mirror the left-anchored accents in the SEO content */
[dir="rtl"] .features li { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .features li::before { left: auto; right: 0; }
[dir="rtl"] .faq summary::after { float: left; }
[dir="rtl"] .steps li { text-align: right; }

h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.1;
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub { color: var(--muted); font-size: 16px; margin: 0; }
.sub strong { color: var(--text); }

.grab {
  display: flex;
  gap: 10px;
  background: var(--panel);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

#url {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
}
#url::placeholder { color: #6b6b7d; }

#submit {
  border: none;
  cursor: pointer;
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.08s ease, filter 0.15s ease;
}
#submit:hover { filter: brightness(1.08); }
#submit:active { transform: scale(0.98); }
#submit:disabled { opacity: 0.6; cursor: default; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  margin: 16px 2px 0;
  color: #ff9a9a;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.results { margin-top: 28px; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ghost:hover { background: #2c2c3a; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media img, .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}

.card .dl {
  border: none;
  cursor: pointer;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 13px 11px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.card .dl:hover { filter: brightness(1.1); }
.card .dl:disabled { cursor: default; opacity: 0.85; }
.card .dl.busy { filter: none; opacity: 0.9; }

/* SEO content */
.content { margin-top: 56px; }
.content h2 {
  font-size: 22px;
  margin: 40px 0 18px;
  color: var(--text);
}
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .step-n {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.steps strong { display: block; color: var(--text); margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.features li {
  color: var(--muted);
  font-size: 15px;
  padding-left: 26px;
  position: relative;
}
.features li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: #4ade80; font-weight: 700;
}
.features strong { color: var(--text); }

.faq details {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 4px 16px;
  margin-bottom: 10px;
  background: var(--panel);
}
.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.5; }

.ad-slot {
  margin: 22px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  overflow: hidden;
}
.ad-slot img { max-width: 100%; height: auto; }
.ad-top { margin-top: 8px; }

.foot {
  margin-top: 40px;
  text-align: center;
  color: #63637a;
  font-size: 12px;
}
.foot .copyright { margin-top: 8px; opacity: 0.8; }
.foot a { color: #8ab4ff; text-decoration: none; }

/* legal pages */
.legal { max-width: 720px; }
.legal .lead { font-size: 17px; color: var(--text); line-height: 1.5; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: #8ab4ff; text-decoration: none; }
.crumbs span { color: var(--muted); }

.guide-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 16px 18px; margin: 24px 0;
}
.guide-cta span { color: var(--muted); font-size: 14px; }
.btn-cta {
  text-decoration: none; color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 10px; white-space: nowrap;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
}
.guide-list { display: grid; gap: 12px; margin-top: 20px; }
.guide-card {
  display: block; text-decoration: none; padding: 16px 18px;
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  transition: border-color 0.15s ease;
}
.guide-card:hover { border-color: var(--accent); }
.guide-card strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.guide-card span { color: var(--muted); font-size: 14px; }
.legal h1 { font-size: 30px; }
.legal .muted { color: var(--muted); font-size: 13px; margin-top: -8px; }
.legal ul { color: var(--muted); font-size: 15px; line-height: 1.6; padding-left: 20px; }
.legal p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.legal strong { color: var(--text); }

/* cookie consent banner */
/* cookie/terms consent — centered modal (robust tap targets on mobile) */
.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.consent-modal[hidden] { display: none; }
.consent-box {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.consent-box h2 { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.consent-box p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.consent-box p a { color: #8ab4ff; }
.consent-btns { display: flex; gap: 12px; }
.consent-btns button {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 16px;
  min-height: 48px;
  border-radius: 12px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.c-reject { background: var(--panel-2); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.12); }
.c-accept { background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3)); color: #fff; }
@media (max-width: 380px) { .consent-btns { flex-direction: column-reverse; } }

/* PWA "add to home screen" banner */
.pwa-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}
.pwa-banner[hidden] { display: none; }
.pwa-ico { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; }
.pwa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pwa-text strong { color: var(--text); font-size: 14px; }
.pwa-text span { color: var(--muted); font-size: 12px; }
.pwa-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pwa-add {
  border: none; cursor: pointer; color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 18px; min-height: 44px; border-radius: 10px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pwa-x {
  border: none; cursor: pointer; background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; padding: 8px; min-width: 40px; min-height: 40px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}

@media (max-width: 560px) {
  .wrap { padding-top: 32px; }
  .grab { flex-direction: column; }
  #submit { padding: 14px; justify-content: center; font-size: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}
