:root {
  --bg: #0f0e13;
  --bg-elevated: #1a1825;
  --bg-card: #221f30;
  --bg-card-hover: #2a2640;
  --bg-card-selected: #352f55;
  --border: #3a3555;
  --border-light: #4e4770;
  --text: #e8e4f0;
  --text-muted: #9d95b8;
  --text-faint: #6b6388;
  --accent: #c9a84c;
  --accent-hover: #dfbc6a;
  --accent-dim: rgba(201, 168, 76, 0.15);
  --danger: #c94c4c;
  --success: #4cc97a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Georgia', 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.logo:hover { color: var(--accent-hover); text-decoration: none; }
.logo svg { flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 24px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.main-nav a { color: var(--text-muted); }
.main-nav a:hover { color: var(--text); }

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.preset-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-right: 4px;
}

.preset-btn {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.forge-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}

.step-tracker {
  position: sticky;
  top: 72px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.tracker-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.2s;
}
.step-item:hover { background: var(--bg-card); color: var(--text-muted); }
.step-item.active { color: var(--accent); background: var(--accent-dim); }
.step-item.completed { color: var(--success); }
.step-item.completed .step-num { background: var(--success); color: var(--bg); }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-card);
  flex-shrink: 0;
}
.step-item.active .step-num { background: var(--accent); color: var(--bg); }

.forge-main {
  min-width: 0;
}

.step-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
}
.step-panel.hidden { display: none; }

.step-panel h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.step-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.choice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.choice-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.choice-card.selected {
  border-color: var(--accent);
  background: var(--bg-card-selected);
  box-shadow: 0 0 0 1px var(--accent);
}
.choice-card.locked {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}
.choice-card strong {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
}
.choice-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.constraint-note {
  margin-top: 16px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--accent);
  min-height: 1.4em;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.btn {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--border-light); }

.culture-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 20px;
  min-height: 200px;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.7;
}

.empty-state {
  color: var(--text-faint);
  font-style: italic;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 16px;
}

.content-section p {
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 720px;
}

.mistake-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mistake-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}
.mistake-list li strong { color: var(--text); }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.scenario-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.scenario-card h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}
.scenario-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.genre-table-wrap {
  overflow-x: auto;
}

.genre-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.genre-table th {
  font-family: var(--font-ui);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.genre-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1.5;
}

.genre-table tr:hover td {
  background: var(--bg-elevated);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

@media (max-width: 860px) {
  .forge-layout {
    grid-template-columns: 1fr;
  }
  .step-tracker {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }
  .tracker-title { display: none; }
  .step-list { flex-direction: row; flex-wrap: wrap; }
  .step-item { padding: 6px 10px; }
  .step-name { display: none; }
  .step-panel { padding: 20px; }
  .choice-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 16px 16px; }
  .content-section { padding: 32px 16px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0; }
  .main-nav { gap: 14px; font-size: 0.82rem; }
  .preset-bar { gap: 6px; }
  .preset-btn { font-size: 0.75rem; padding: 5px 10px; }
  .export-actions { flex-direction: column; }
  .export-actions .btn { width: 100%; text-align: center; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
