@font-face {
  font-family: "Playfair Display SC";
  src: url("/fonts/PlayfairDisplaySC-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/PlayfairDisplay.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Luckiest Guy";
  src: url("/fonts/LuckiestGuy-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Anton";
  src: url("/fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #121212;
  --card: #171719;
  --card2: #1d1d21;
  --input-bg: #141416;
  --border: rgba(201, 165, 92, 0.24);
  --border-strong: rgba(201, 165, 92, 0.48);
  --text: #ede6d6;
  --muted: #b8b0a0;
  --gold: #c9a55c;
  --gold-soft: #d7b978;
  --gold-deep: #9e7f41;
  --gold-grad: linear-gradient(135deg, #d5b878 0%, #c9a55c 55%, #ad8b46 100%);
  --gold-grad-hover: linear-gradient(135deg, #dec58a 0%, #d1ae68 55%, #b9964f 100%);
  --green: #4ade80;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(11px + env(safe-area-inset-top)) 16px 11px;
  background: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 46px; height: auto; }
.brand-title {
  font-family: "Playfair Display SC", "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-soft);
}
.brand-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.badge-free {
  background: rgba(201, 165, 92, 0.14);
  color: var(--gold-soft);
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch {
  display: inline-flex;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lang-btn.active {
  background: var(--gold-grad);
  color: #121212;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.dot.online { background: var(--green); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0;
  font-family: "Playfair Display SC", "Playfair Display", Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.35;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gold-grad);
  color: #121212;
  font-family: system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

textarea, input[type="text"], select {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.98rem;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.15s ease;
}
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.preset-chip {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.preset-chip:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
  color: var(--text);
}
.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: opacity 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--gold-grad);
  color: #121212;
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-grad-hover);
}
.btn-secondary {
  background: var(--card2);
  color: var(--gold-soft);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(201, 165, 92, 0.12);
}
.btn-accent {
  background: #1b1915;
  color: var(--gold-soft);
  border: 1px solid var(--gold);
}
.btn-accent:hover:not(:disabled) {
  background: #24211b;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-soft);
}
.btn-sm { padding: 8px 13px; min-height: 36px; font-size: 0.84rem; border-radius: 9px; }
.btn-block { width: 100%; }

.hook-row { margin-bottom: 14px; }

.scenes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.scene-card {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Playfair Display SC", Georgia, serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-soft);
}
.scene-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 290px;
  background: #101012;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}
.scene-img-box img { width: 100%; height: 100%; object-fit: cover; }
.scene-img-placeholder {
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}
.scene-img-btns { display: flex; gap: 6px; }
.scene-img-btns .btn { flex: 1; }
.scene-kw-row {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 6px;
}

.caption-box { display: flex; flex-direction: column; gap: 8px; }
.caption-box .btn { align-self: flex-start; }

.render-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 720px) {
  .render-grid { grid-template-columns: 1fr; }
}

.preview-wrap {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  background: #101012;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.preview-wrap canvas,
.preview-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.render-controls { display: flex; flex-direction: column; gap: 11px; }
.hint { font-size: 0.9rem; color: var(--muted); margin: 0 0 8px; line-height: 1.55; }

.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress-bar {
  height: 10px;
  background: var(--input-bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-grad);
  transition: width 0.2s ease;
}
.progress-text { font-size: 0.86rem; color: var(--gold-soft); font-weight: 700; }

.download-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.sample-item {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sample-item video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  background: #101012;
  border-radius: 10px;
  border: 1px solid rgba(201, 165, 92, 0.16);
}
.sample-meta { font-size: 0.88rem; font-weight: 700; color: var(--gold-soft); display: flex; justify-content: space-between; gap: 8px; }
.sample-cap { font-size: 0.82rem; color: var(--muted); white-space: pre-wrap; max-height: 98px; overflow: auto; margin: 0; line-height: 1.45; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 14, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  max-width: 440px;
  width: 100%;
}
.modal-box h3 {
  margin-top: 0;
  font-family: "Playfair Display SC", "Playfair Display", Georgia, serif;
  font-size: 1.18rem;
  color: var(--gold-soft);
}
.modal-box ol { padding-left: 20px; line-height: 1.65; color: var(--text); font-size: 0.95rem; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 20px 16px 30px;
  border-top: 1px solid rgba(201, 165, 92, 0.14);
}

.toggles-group { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.legal-doc h1 {
  font-family: "Playfair Display SC", "Playfair Display", Georgia, serif;
  font-size: 1.48rem;
  color: var(--gold-soft);
  margin-top: 0;
  line-height: 1.35;
}
.legal-doc h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.12rem;
  color: var(--gold);
  margin: 22px 0 8px;
}
.legal-doc p, .legal-doc li { font-size: 0.96rem; line-height: 1.68; color: var(--text); }
.legal-doc a { color: var(--gold-soft); }

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: 960px;
  margin: 0 auto;
  background: var(--card2);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 15px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { flex: 1 1 320px; font-size: 0.88rem; line-height: 1.5; }
.cookie-text strong { color: var(--gold-soft); }
.cookie-text p { margin: 4px 0 0; color: var(--muted); }
.cookie-text a { color: var(--gold-soft); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-opts { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; }

.footer-disclaimers { max-width: 820px; margin: 0 auto 12px; color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
.footer-disclaimers p { margin: 5px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.footer a { color: var(--gold-soft); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; color: var(--gold-soft); font-size: inherit; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.music-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 100%;
}
.music-options {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 165, 92, 0.22);
  border-radius: 12px;
  background: #1a1a1a;
}
.music-options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.music-options input[type="range"] {
  accent-color: var(--gold);
  width: min(200px, 55vw);
}
.music-options input[type="file"] {
  max-width: 100%;
  color: var(--text);
  font-size: 0.85rem;
}
