:root {
  --bg: #0d0b14;
  --surface: #17141f;
  --surface-2: #211d2c;
  --border: #2e2940;
  --text: #f1edf8;
  --muted: #a49cb8;
  --accent: #e0b04a;
  --accent-ink: #1a1305;
  --violet: #8b5cf6;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 16px;
}

* { box-sizing: border-box; }

/* Elements styled with display:flex/inline-block must still disappear when hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Cairo', system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(224, 176, 74, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; letter-spacing: .5px; }
.brand svg { width: 34px; height: 34px; fill: var(--accent); }

.badge {
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

main { max-width: 820px; margin: 0 auto; padding: 0 16px 40px; }

.hero { text-align: center; padding: 24px 0 28px; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 0 0 8px; line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 { font-size: 1.1rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .9rem;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 32px 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
}
.drop span { color: var(--muted); font-size: .9rem; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(224, 176, 74, .05); }

.info {
  margin-top: 12px;
  font-size: .9rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  overflow-wrap: anywhere;
}
.info strong { color: var(--text); }

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.platform input { position: absolute; opacity: 0; }
.platform span {
  display: block;
  text-align: center;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.platform input:checked + span { border-color: var(--accent); background: rgba(224, 176, 74, .12); color: var(--accent); }
.platform input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

.row { display: flex; flex-wrap: wrap; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; font-size: .9rem; color: var(--muted); }
.field select, .field input {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.tip { font-size: .85rem; color: var(--muted); margin: 14px 0 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

button, .primary {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

.progress { margin-top: 16px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--accent)); transition: width .3s; }
#status { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

.result { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.result video { width: 100%; max-height: 420px; background: #000; border-radius: 12px; }
.sizes { font-size: .9rem; color: var(--muted); }
.sizes strong { color: var(--ok); }

.error { color: var(--danger); margin: 12px 0 0; }

.notes { padding: 4px 4px 0; color: var(--muted); font-size: .9rem; }
.notes h3 { color: var(--text); font-size: 1rem; }
.notes ul { padding-inline-start: 20px; }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px 32px; }

@media (max-width: 480px) {
  .top { flex-direction: column; }
  .platforms { grid-template-columns: 1fr; }
  .actions button, .result .primary { width: 100%; text-align: center; }
}
