@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --accent: #FF6600;
  --accent-dim: #cc5200;
  --gold: #ffb347;
  --text: #f5f5f5;
  --text-muted: #888;
  --border: #2a2a2a;
  --success: #22c55e;
  --warn: #eab308;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, .font-display { font-family: 'Cinzel', serif; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.screen { display: none; min-height: 100vh; flex-direction: column; padding: 1rem; padding-bottom: 2rem; }
.screen.active { display: flex; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-family: Cinzel, serif; font-weight: 700; font-size: 1rem; color: var(--gold); }
.logo svg { width: 28px; height: 28px; }
.tagline { font-size: 0.7rem; color: var(--text-muted); max-width: 140px; text-align: right; }

main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1rem 0; }

.hero {
  text-align: center;
  padding: 2rem 0;
}
.hero h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); color: var(--gold); margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-dim); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: rgba(255,102,0,0.15); }

.carousel-section, .leaderboard-section { width: 100%; max-width: 480px; margin-top: 1.5rem; }
.section-title { font-family: Cinzel, serif; font-size: 1.1rem; color: var(--gold); margin-bottom: 0.75rem; }
.carousel {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.carousel-card {
  flex: 0 0 160px;
  height: 220px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.carousel-card .thumb { width: 100%; height: 120px; background: var(--border); object-fit: cover; }
.carousel-card .info { padding: 0.5rem; font-size: 0.8rem; }
.carousel-card .views { color: var(--text-muted); font-size: 0.75rem; }

.leaderboard-chart { background: var(--surface); border-radius: 10px; padding: 1rem; border: 1px solid var(--border); min-height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  max-width: 400px; width: 100%; padding: 1.5rem;
}
.modal h3 { font-family: Cinzel, serif; margin-bottom: 0.75rem; color: var(--gold); }
.modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.modal input { width: 100%; padding: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); margin-bottom: 0.75rem; }
.modal .actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }

.stepper { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; justify-content: center; }
.stepper span { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.stepper span.done { background: var(--accent); border-color: var(--accent); color: #000; }
.stepper span.current { border-color: var(--gold); color: var(--gold); }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 360px; margin: 0 auto 1rem; }
.upload-box {
  aspect-ratio: 3/4; background: var(--surface); border: 2px dashed var(--border); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.2s;
}
.upload-box:hover, .upload-box.filled { border-color: var(--accent); }
.upload-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.upload-box .label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-row { margin-bottom: 1rem; max-width: 320px; margin-left: auto; margin-right: auto; }
.form-row label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-muted); }
.form-row input, .form-row select { width: 100%; padding: 0.65rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }

.dropdown-select { margin-bottom: 1rem; max-width: 320px; margin-left: auto; margin-right: auto; }
.dropdown-select label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-muted); }
.dropdown-select select { width: 100%; padding: 0.65rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }

.prompt-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.8rem; margin-top: 0.5rem; }
.prompt-badge.optimal { background: rgba(34,197,94,0.2); color: var(--success); }
.prompt-badge.complex { background: rgba(234,179,8,0.2); color: var(--warn); }
.prompt-badge.too-long { background: rgba(239,68,68,0.2); color: var(--danger); }

.progress-screen { justify-content: center; text-align: center; }
.progress-bar-wrap { width: 100%; max-width: 280px; height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; margin: 1rem auto; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); width: 0%; transition: width 0.3s; }
.progress-text { color: var(--text-muted); margin-top: 0.5rem; }

.video-container { max-width: 360px; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #000; }
.video-container video { width: 100%; display: block; }
.cta-overlay { text-align: center; padding: 1.5rem; }
.cta-overlay .btn { margin-top: 0.5rem; }
.share-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.share-row button { padding: 0.5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; font-size: 0.85rem; }
.share-row button:hover { border-color: var(--accent); color: var(--accent); }
.token-display { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

.paywall-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 360px; margin: 1rem auto; }
.pack-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; text-align: center; }
.pack-card .price { font-family: Cinzel; color: var(--gold); font-size: 1.5rem; }
.pack-card .tokens { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.pack-card .btn { width: 100%; }

.guest-banner { background: rgba(255,102,0,0.15); border: 1px solid var(--accent); border-radius: 8px; padding: 0.5rem 1rem; font-size: 0.8rem; margin-bottom: 1rem; text-align: center; }
footer { padding: 1rem; text-align: center; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); }

.add-to-home { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; background: var(--surface); border: 1px solid var(--accent); border-radius: 10px; padding: 0.75rem 1rem; display: none; z-index: 50; }
.add-to-home.active { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.add-to-home .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

@media (max-width: 400px) {
  .upload-grid { grid-template-columns: 1fr; }
  .carousel-card { flex: 0 0 140px; }
}
