:root {
  --bg: #0a0b10;
  --bg-soft: #12131c;
  --card: #171826;
  --line: #262838;
  --text: #f4f6ff;
  --muted: #9aa0b8;
  --accent: #8a7bff;
  --accent-2: #4fd6ff;
  --shine: #ffffff;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(138,123,255,0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(79,214,255,0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== Header ===== */
.site-header { text-align: center; padding: 56px 20px 28px; }
.brand { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.brand-spark { color: var(--accent-2); margin-right: 6px; filter: drop-shadow(0 0 10px var(--accent-2)); }
.brand-white { color: #fff; text-shadow: 0 0 18px rgba(255,255,255,0.85), 0 0 38px rgba(138,123,255,0.6); }
.brand-tag { color: var(--muted); margin-top: 10px; font-size: 16px; }

.container { max-width: 980px; margin: 0 auto; padding: 0 20px 80px; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

/* ===== Dropzone ===== */
.dropzone {
  margin: 8px; padding: 60px 24px; border-radius: 14px;
  border: 2px dashed var(--line);
  text-align: center; cursor: pointer; transition: 0.2s;
}
.dropzone:hover, .dropzone:focus, .dropzone.drag {
  border-color: var(--accent); background: rgba(138,123,255,0.06); outline: none;
}
.upload-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(138,123,255,0.55);
}
.dropzone h2 { font-size: 22px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); }

/* ===== Workspace ===== */
.workspace { padding: 22px; }
.hidden { display: none !important; }

.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stage-pane {
  background: #05060b; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; position: relative; min-height: 220px;
  display: grid; place-items: center;
}
.stage-label {
  position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: rgba(0,0,0,0.5); padding: 4px 9px; border-radius: 999px;
}
.shine-label { color: #fff; text-shadow: 0 0 12px rgba(255,255,255,0.9); }
.stage-pane canvas,
.stage-pane img { max-width: 100%; max-height: 360px; border-radius: 8px; display: block; }

.result-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; color: var(--muted); padding: 24px; min-height: 180px;
}
.result-placeholder .rp-spark {
  font-size: 38px; color: var(--accent-2); opacity: 0.7;
  filter: drop-shadow(0 0 14px rgba(79,214,255,0.6)); animation: rpFloat 2.4s ease-in-out infinite;
}
.result-placeholder p { font-size: 14px; max-width: 220px; }
.result-placeholder strong { color: var(--text); }
@keyframes rpFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.controls { margin: 20px 2px 8px; display: grid; gap: 14px; }
.slider-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.slider-row input[type=range] { -webkit-appearance: none; height: 6px; border-radius: 999px; background: var(--line); }
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer;
  box-shadow: 0 0 10px rgba(138,123,255,0.8);
}

.mode-toggle-wrap { margin-top: 20px; }
.mode-toggle {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px;
  background: #0d0e18; border: 1px solid var(--line);
}
.mode-btn {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--muted);
  background: transparent; border: 0; border-radius: 9px; padding: 9px 22px; cursor: pointer;
  transition: 0.15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(138,123,255,0.35);
}
.mode-hint { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }

.slider-row.disabled { opacity: 0.4; pointer-events: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions.solo { justify-content: center; }
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 13px 22px;
  cursor: pointer; transition: 0.15s; color: #fff;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px rgba(138,123,255,0.4); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-secondary { background: #20223a; border: 1px solid var(--line); }
.btn-secondary:hover:not(:disabled) { background: #2a2d4a; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: #fff; }

/* ===== Examples ===== */
.examples { margin-top: 56px; }
.section-title { text-align: center; font-size: 26px; font-weight: 800; }
.section-sub { text-align: center; color: var(--muted); margin: 8px 0 26px; }
.examples-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.example-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.example-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.example-pair figure { margin: 0; }
.example-pair canvas,
.example-pair img { width: 100%; height: auto; border-radius: 10px; display: block; background: #05060b; }
.example-pair figcaption {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 8px;
}
.example-pair .cap-shine { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.85); }
.example-title { font-size: 14px; font-weight: 600; margin: 4px 4px 12px; color: var(--text); }

/* ===== Footer ===== */
.site-footer { text-align: center; color: var(--muted); padding: 30px 20px 60px; font-size: 14px; }
.footer-fine { margin-top: 6px; font-size: 12px; opacity: 0.7; }

/* ===== Ad overlay ===== */
.ad-overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(4,5,11,0.82); backdrop-filter: blur(8px);
}
.ad-modal {
  width: min(440px, 92vw); background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6); animation: pop 0.25s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ad-headline { text-align: center; margin-bottom: 14px; min-height: 56px; }
.ad-phrase {
  font-size: 20px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25;
  background: linear-gradient(90deg, #fff, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(79,214,255,0.25);
}
.ad-phrase.flip { animation: phraseIn 0.4s ease; }
@keyframes phraseIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ad-subline { margin-top: 6px; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.ad-progress-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.ad-progress-bar { height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.1s linear; }

.ad-video-wrap {
  position: relative; margin: 18px 0 14px; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
}
.ad-video-wrap.hidden { display: none; }
.ad-video-wrap #adContentVideo { width: 100%; height: 100%; object-fit: contain; background: #000; }
.ad-video-container { position: absolute; inset: 0; }
.ad-video-wrap .ad-badge {
  position: absolute; top: 8px; left: 10px; right: auto; z-index: 2;
}

.ad-creative {
  margin: 18px 0 16px; padding: 16px; border-radius: 14px; position: relative;
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(138,123,255,0.25), rgba(79,214,255,0.12));
  border: 1px solid var(--line);
}
.ad-badge {
  position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); background: rgba(0,0,0,0.4); padding: 2px 7px; border-radius: 6px;
}
.ad-art {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 24px rgba(138,123,255,0.6);
}
.ad-copy { display: flex; flex-direction: column; gap: 2px; }
.ad-copy strong { font-size: 15px; }
.ad-copy span { font-size: 13px; color: var(--muted); }
.ad-cta {
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  background: #20223a; border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}
.ad-cta:hover { background: #2a2d4a; }
.ad-close {
  width: 100%; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  background: #20223a; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.ad-close:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 720px) {
  .stage, .examples-grid { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 110px 1fr; }
}

/* ===== Social proof ===== */
.home-proof { margin-top: 12px; font-size: 14px; color: var(--accent-2); font-weight: 600; min-height: 18px; }

/* ===== Share button + modals ===== */
.btn-share {
  background: linear-gradient(135deg, #1f8f5f, #2bd47f); color: #fff;
  box-shadow: 0 10px 30px rgba(43,212,127,0.3);
}
.btn-share:hover { transform: translateY(-1px); }

.share-modal { text-align: center; }
.share-art {
  margin: 0 auto 14px; width: 60px; height: 60px; border-radius: 16px; font-size: 28px;
}
.share-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.share-desc { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.share-desc strong { color: var(--text); }
.share-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.share-link-row { display: flex; gap: 8px; margin: 4px 0 14px; }
.share-link-input {
  flex: 1; font: inherit; font-size: 13px; color: var(--text);
  background: #0d0e18; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.share-btn {
  font: inherit; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer;
  background: #20223a; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px;
  text-decoration: none; white-space: nowrap;
}
.share-btn:hover { background: #2a2d4a; }

/* ===== Public share page (/s/:id) ===== */
.share-main { text-align: center; padding-top: 10px; }
.mac-note {
  display: inline-block; margin: 0 auto 18px; padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--accent-2);
  background: rgba(79,214,255,0.08); border: 1px solid var(--line);
}
.share-stage {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; margin-bottom: 24px;
}
.share-pane { position: relative; margin: 0; background: #05060b; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.share-pane img { width: 100%; display: block; }
.btn-cta { display: inline-block; text-decoration: none; font-size: 17px; padding: 15px 34px; }
.share-proof { margin: 16px 0 20px; color: var(--muted); font-size: 14px; }
.share-main .share-row { margin-top: 6px; }

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

/* ===== Admin control panel ===== */
.admin-field { display: grid; gap: 6px; margin-bottom: 22px; }
.admin-field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.admin-field input {
  font: inherit; color: var(--text); background: #0d0e18; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px;
}
.admin-toggle-row {
  display: flex; align-items: center; gap: 18px; justify-content: space-between;
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #0d0e18;
}
.admin-toggle-title { font-weight: 700; font-size: 15px; }
.admin-toggle-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.admin-switch {
  flex: 0 0 auto; width: 58px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: #2a2d4a; position: relative; cursor: pointer; transition: 0.2s; padding: 0;
}
.admin-switch.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.admin-switch:disabled { opacity: 0.6; cursor: wait; }
.admin-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; transition: 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.admin-switch.on .admin-knob { left: 29px; }
.admin-status { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; min-height: 18px; }
