:root {
  --bg: #070b14;
  --surface: #101726;
  --surface-2: #162033;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #94a3b8;
  --emerald: #22c55e;
  --amber: #f59e0b;
  --cyan: #06b6d4;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.bg-ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(34, 197, 94, 0.12), transparent 38%),
    radial-gradient(circle at 85% 18%, rgba(6, 182, 212, 0.12), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.08), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
}

.logo-cube {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-nav {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Hero */
.hero {
  padding-top: 36px;
  padding-bottom: 24px;
}

.hero-copy {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-emerald {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pill-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.12;
  margin-bottom: 12px;
}

.grad {
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-sub code,
.feat-card code,
.section-head code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  color: #e2e8f0;
}

/* Studio Shell */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.studio-shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: stretch;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 9px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-tab small {
  font-weight: 500;
  opacity: 0.75;
}

.mode-tab.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

textarea,
select,
input[type="email"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
}

textarea:focus,
select:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--cyan);
}

.presets-wrap {
  margin: 14px 0 18px;
}

.presets-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--cyan);
  color: #fff;
}

.row-2 {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 12px;
  align-items: end;
}

.btn-primary,
.btn-secondary,
.btn-export {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.32);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-export {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f17;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-export:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-export:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.86rem;
}

/* Preview Card */
.studio-preview {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.preview-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
}

.view-toggles {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.view-btn.active {
  background: var(--surface-2);
  color: var(--text);
}

.preview-stage {
  background: radial-gradient(circle at 50% 45%, #162238, #090d16);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 290px;
}

#characterCanvas {
  image-rendering: pixelated;
  max-width: 100%;
}

.uv-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
}

.uv-box img,
.uv-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b101b;
  image-rendering: pixelated;
}

.uv-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

/* Addon Stage */
.addon-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  min-height: 290px;
}

.addon-hero {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.addon-hero img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
}

.addon-id {
  display: inline-block;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.addon-lore {
  font-size: 0.84rem;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.stat-pill span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

.stat-pill strong {
  font-size: 0.98rem;
  color: #4ade80;
}

.files-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.files-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.files-box ul {
  list-style: none;
  font-family: monospace;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.files-box li {
  padding: 2px 0;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.palette-dots {
  display: flex;
  gap: 6px;
}

.palette-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* History Bar */
.history-bar {
  margin-top: 22px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--cyan);
}

.history-item img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: var(--bg);
}

.history-item strong {
  display: block;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

/* Sections */
.section {
  padding: 52px 20px 16px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head.center {
  text-align: center;
}

.section-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin-bottom: 6px;
}

.section-head p {
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feat-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.feat-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.feat-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.price-card {
  display: flex;
  flex-direction: column;
}

.price-featured {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 20px 50px rgba(34, 197, 94, 0.12);
}

.popular-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  margin-bottom: 12px;
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.price-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
}

.price-row {
  margin: 12px 0 18px;
}

.price-big {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.price-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 6px;
}

.check-list {
  list-style: none;
  margin-bottom: 22px;
  flex: 1;
}

.check-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.check-list li::before {
  content: "✓ ";
  color: var(--emerald);
  font-weight: 700;
}

.price-note {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 18px;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
}

.faq-list p {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Footer */
.footer {
  margin-top: 52px;
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  z-index: 2;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  margin: 8px 0;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.restore-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.restore-status {
  margin-top: 10px;
  font-size: 0.86rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 880px) {
  .studio-shell,
  .grid-3,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
