:root {
  --bg: #0d0c14;
  --panel: #17151f;
  --line: #2a2734;
  --text: #f2f0f7;
  --muted: #a39fb2;
  --accent: #ff4f7b;
  --accent-2: #ffd166;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Fredoka, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
.top { padding: 28px 24px 8px; max-width: 1200px; margin: 0 auto; }
.top h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.top p { margin: 0; color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 24px;
  padding: 20px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .stage { order: -1; }
  #preview { max-height: 56vh; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > span, .field > legend { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0; }
.sub { font-size: 12px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grow { flex: 1; }

input[type="text"], input[type="number"], select {
  background: #0f0e16;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }

.avatar-row { display: flex; gap: 14px; align-items: center; }
.avatar-drop {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px dashed var(--line);
  cursor: pointer;
  flex: none;
}
.avatar-drop.has { border-style: solid; border-color: var(--accent); }
.avatar-drop canvas { width: 100%; height: 100%; display: block; }
.avatar-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.avatar-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; text-align: center; color: var(--muted);
  pointer-events: none;
}
.avatar-drop.has .avatar-hint { display: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1; min-width: 90px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.seg input:checked + span { border-color: var(--accent); color: var(--text); background: rgba(255, 79, 123, 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }

button, .primary, .ghost {
  font: inherit;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
}
.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a4c);
  color: #fff;
  font-weight: 600;
  display: inline-block;
}
.primary:disabled { opacity: 0.5; cursor: progress; }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.export { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.progress { height: 8px; background: #0f0e16; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.1s; }
.status { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }

.stage { display: flex; flex-direction: column; gap: 12px; align-items: center; min-width: 0; }
.preview-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 12px;
}
#preview {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  background: #000;
}
.transport { display: flex; gap: 10px; align-items: center; width: 100%; }
.icon { width: 44px; height: 40px; padding: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line); font-size: 13px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); width: 48px; text-align: right; font-size: 13px; }

.result {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.result video { max-width: 100%; max-height: 60vh; border-radius: 8px; background: #000; }
.result-actions { display: flex; gap: 10px; width: 100%; }
.result-actions > * { flex: 1; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 28px; }

/* ---------------------------------------------------------------- header + content sections */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; margin-bottom: 14px;
}
.brand img { border-radius: 8px; }
.top h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; max-width: 22ch; }
.lede { max-width: 70ch; font-size: 16px; }
.noscript { max-width: 1200px; margin: 0 auto; padding: 0 24px; color: var(--accent-2); }

.info { max-width: 1200px; margin: 0 auto; padding: 8px 24px 32px; display: grid; gap: 36px; }
.info h2 { font-size: 24px; margin: 0 0 14px; }
.info p, .info li { color: var(--muted); }
.info strong { color: var(--text); font-weight: 600; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 70ch; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; max-width: 80ch; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq details p { margin: 8px 0 0; }
.platform-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.platform-links a {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--text); text-decoration: none; font-size: 14px;
}
.platform-links a:hover, .platform-links a[aria-current="page"] { border-color: var(--accent); background: rgba(255, 79, 123, 0.12); }
@media (max-width: 820px) { .info { padding: 8px 16px 24px; } }

/* ---------------------------------------------------------------- landing + tool layout */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.topbar .brand { margin-bottom: 0; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.tool .top h1 { font-size: 26px; margin: 4px 0 0; max-width: none; }

.landing .top { padding-top: 24px; padding-bottom: 12px; }
.landing .top h1 { font-size: clamp(30px, 5vw, 52px); max-width: 18ch; margin: 18px 0 12px; }
.landing .lede { font-size: 17px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-actions .primary, .hero-actions .ghost { display: inline-block; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.hero-points li::before { content: "✓ "; color: var(--accent-2); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--accent); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 17px; color: var(--text); }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.card .go { font-size: 14px; font-weight: 600; color: var(--accent); }
@media (max-width: 520px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; } .card p { display: none; } }

.tpl-details {
  max-width: 1200px; margin: 0 auto 32px; padding: 0 24px;
  display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start;
}
.tpl-details img { width: 180px; height: auto; aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.tpl-details h2 { margin: 0 0 6px; font-size: 24px; }
.tpl-details h3 { margin: 18px 0 8px; font-size: 16px; }
.tpl-details p { color: var(--muted); margin: 0; max-width: 70ch; }
.beats { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); }
.beats strong { display: inline-block; min-width: 72px; color: var(--accent-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.specs { margin-top: 16px !important; font-size: 13px; }
@media (max-width: 640px) { .tpl-details { grid-template-columns: 1fr; padding: 0 16px; } .tpl-details img { width: 140px; } }
