:root {
  --bg: #0b0f19;
  --bg2: #121826;
  --card: #161d2e;
  --border: #243047;
  --text: #eef2ff;
  --muted: #9aa6c1;
  --primary: #7c5cff;
  --primary-2: #5b8cff;
  --danger: #ff6b8a;
  --ok: #3dd68c;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: -20% auto auto 50%;
  transform: translateX(-50%);
  width: 70vw;
  height: 45vh;
  background: radial-gradient(ellipse at center, rgba(124, 92, 255, 0.28), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.header, .main, .footer {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}

.header { padding: 2rem 0 1rem; }
.brand { display: flex; gap: 1rem; align-items: center; }
.logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
}
.tagline { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }

.card {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.search-card { margin-bottom: 1.25rem; }

.label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.input-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
input[type="url"], select {
  flex: 1 1 220px;
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="url"]:focus, select:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, white);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}
input::placeholder { color: #6f7c99; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s, opacity .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(91, 140, 255, 0.28);
}
.btn.wide { width: 100%; margin-top: 0.85rem; }

.platforms {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.9rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
}
.chip.x { color: #e7e9ee; }
.chip.ig { color: #ff8cc8; }
.chip.tt { color: #6ef0ff; }
.chip.yt { color: #ff8b8b; }
.chip.fb { color: #6ea8ff; }
.chip.dm { color: #5ad0ff; }

.error {
  margin: 0.9rem 0 0;
  color: var(--danger);
  background: rgba(255, 107, 138, 0.08);
  border: 1px solid rgba(255, 107, 138, 0.25);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.preview-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
}
.thumb-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 10;
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badge {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.meta h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.35;
}
.muted { color: var(--muted); margin: 0.15rem 0; }
.actions { margin-top: 0.25rem; }
.progress {
  margin: 0.75rem 0 0;
  color: var(--ok);
  font-size: 0.95rem;
}

.footer {
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer p { margin: 0.35rem 0; }

@media (max-width: 720px) {
  .preview-layout { grid-template-columns: 1fr; }
  .input-row { flex-direction: column; }
  .btn { width: 100%; }
  .header { padding-top: 1.4rem; }
}

.logo-img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}
.install-card {
  margin-bottom: 1rem;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: linear-gradient(135deg, rgba(124,92,255,0.14), rgba(22,29,46,0.95));
}
.install-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.install-row strong { display: block; }
.small { font-size: 0.88rem; margin: 0.2rem 0 0; }
.ios-hint {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
