/* GDD Builder (index.html). Built on gdd-theme.css + site.css. */

/* ── layout ─────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  max-width: 1300px; width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}
.main-col { padding: var(--space-8) var(--space-6); max-width: 820px; width: 100%; }

/* ── back / next row ────────────────────────────────────── */
.nav-row {
  position: sticky; top: var(--nav-offset); z-index: 998;
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.step-badge { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle); }

.btn-back, .btn-next {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  font-family: var(--font-body); font-size: 15px; font-weight: 650; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn-back { background: transparent; color: var(--ink-muted); border-color: var(--border); }
.btn-back:hover { color: var(--ink); background: var(--surface-raised); }
.btn-next { background: var(--accent); color: var(--accent-ink); }
.btn-next:hover { background: var(--accent-hover); }
.btn-back:active, .btn-next:active { transform: translateY(1px); }
.btn-back:disabled, .btn-next:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── question ───────────────────────────────────────────── */
.question-text {
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; letter-spacing: -0.015em;
  color: var(--ink); margin-bottom: var(--space-2); text-wrap: balance;
}
.question-hint { font-size: 17px; color: var(--ink-muted); margin-bottom: var(--space-6); max-width: var(--measure); }
.multi-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-sm);
  background: var(--moss-soft); color: var(--moss);
  margin-bottom: var(--space-3);
}
.suggest-hint {
  font-size: 15px; line-height: 1.55; color: var(--ink-muted);
  background: var(--accent-soft); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: var(--space-4);
}

/* ── options ────────────────────────────────────────────── */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.options-grid.cols-1 { grid-template-columns: 1fr; }

.option-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; width: 100%; padding: 0;
  text-align: left; cursor: pointer;
  font-family: var(--font-body); color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}
.option-btn:hover { border-color: var(--border-strong); }
.option-btn:active { transform: translateY(1px); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }

.opt-preview { width: 100%; height: clamp(64px, 10vw, 92px); overflow: hidden; position: relative; background: #121110; flex-shrink: 0; }
.opt-preview svg, .opt-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }

.opt-hover-info {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px; text-align: center;
  background: rgba(18, 17, 16, .9); color: #f2eee8;
  font-size: 14px; line-height: 1.45;
  opacity: 0; transition: opacity .2s ease;
}
.option-btn:hover .opt-hover-info { opacity: 1; }
@media (hover: none) { .opt-hover-info { display: none; } }

.opt-text { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.option-label { font-weight: 700; font-size: 16px; line-height: 1.35; color: var(--ink); padding-right: 22px; }
.option-desc { font-size: 14px; line-height: 1.45; color: var(--ink-muted); }

.sel-dot {
  position: absolute; top: 15px; right: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border-strong); font-size: 0; color: transparent;
}
.option-btn.selected .sel-dot { background: var(--accent); border-color: var(--accent); }

/* ── custom answer ──────────────────────────────────────── */
.custom-input-wrap { margin-top: var(--space-3); }
.custom-input {
  width: 100%; min-height: 48px; padding: 12px 16px;
  font-family: var(--font-body); font-size: 17px; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.custom-input::placeholder { color: var(--ink-subtle); }
.custom-input:hover { border-color: var(--ink-subtle); }
.custom-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── sidebar ────────────────────────────────────────────── */
.side-col {
  position: sticky; top: calc(var(--nav-offset) + 69px); align-self: start;
  margin: var(--space-8) var(--space-6) var(--space-8) 0;
  padding: var(--space-6);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-height: calc(100vh - var(--nav-offset) - 110px); overflow-y: auto;
}
.codex-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle);
  margin-bottom: var(--space-3);
}
.game-desc {
  font-size: 15px; line-height: 1.65; color: var(--ink);
  min-height: 70px; padding-left: 12px; border-left: 2px solid var(--accent);
}
.game-desc.empty { color: var(--ink-subtle); border-color: var(--border); }
.tags-row { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: 6px; }
.s-tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink-subtle); border: 1px solid var(--border);
}
.s-tag.filled { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.sdivider { height: 1px; background: var(--border); margin: var(--space-4) 0; }
.missing-lbl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle); margin-bottom: var(--space-2);
}
.missing-item { font-size: 14px; color: var(--ink-muted); padding: 3px 0; display: flex; align-items: center; gap: 8px; }
.missing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }

/* ── summary ────────────────────────────────────────────── */
.summary-screen { padding: var(--space-8) var(--space-6); max-width: 780px; margin: 0 auto; }
.summary-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.5vw, 44px);
  line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); margin-bottom: var(--space-2); text-wrap: balance;
}
.summary-sub { font-size: 19px; line-height: 1.6; color: var(--ink-muted); margin-bottom: var(--space-8); }

.final-desc-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6); margin-bottom: var(--space-6);
}
.final-desc-box::before {
  content: 'Game summary'; display: block; margin-bottom: var(--space-2);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.final-desc-text { font-size: 19px; line-height: 1.65; color: var(--ink); }

.gdd-sec { border-top: 1px solid var(--border); padding: var(--space-6) 0 var(--space-2); }
.gdd-sec-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-2);
}
.gdd-val.unassigned { color: var(--ink-subtle); font-weight: 400; font-style: italic; }
.gdd-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  font-size: 15px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.gdd-row:last-child { border-bottom: none; }
.gdd-key { color: var(--ink-muted); flex: 0 0 42%; }
.gdd-val { color: var(--ink); font-weight: 600; text-align: right; flex: 1; line-height: 1.5; }
/* the control layout table inside a GDD row */
.gdd-val .ctl { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 500; text-align: left; margin-top: 4px; }
.gdd-val .ctl th { color: var(--ink-muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.gdd-val .ctl td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gdd-val .ctl td:first-child { color: var(--ink-muted); white-space: nowrap; }
.gdd-row:has(.ctl) { flex-wrap: wrap; }
.gdd-row:has(.ctl) .gdd-val { flex: 1 1 100%; overflow-x: auto; }

/* ── buttons on the summary ─────────────────────────────── */
.export-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.btn-exp, .btn-restart {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  font-family: var(--font-body); font-size: 16px; font-weight: 650; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn-exp { flex: 1 1 180px; }
.btn-exp:active, .btn-restart:active { transform: translateY(1px); }
.btn-exp.primary { background: var(--accent); color: var(--accent-ink); }
.btn-exp.primary:hover { background: var(--accent-hover); }
.btn-exp.sec { background: var(--surface-raised); color: var(--ink); border-color: var(--border); }
.btn-exp.sec:hover { border-color: var(--border-strong); }
.btn-restart { width: 100%; margin-top: var(--space-3); background: transparent; color: var(--ink-muted); }
.btn-restart:hover { color: var(--ink); background: var(--surface-raised); }

/* ── Unity guide call-to-action ─────────────────────────── */
.guide-cta {
  margin-top: var(--space-6); padding: var(--space-6);
  background: var(--moss-soft); border-radius: var(--radius-lg);
  display: grid; gap: var(--space-3);
}
.guide-cta-title {
  font-family: var(--font-display); font-weight: 650; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink);
}
.guide-cta-text { font-size: 16px; color: var(--ink-muted); line-height: 1.6; }
.guide-cta .btn-exp { flex: 0 0 auto; justify-self: start; }

/* ── tag pill (summary values) ──────────────────────────── */
.tag {
  display: inline-flex; align-items: center; padding: 2px 10px; margin: 0 0 4px 4px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--ink);
}

/* ── footer columns ─────────────────────────────────────── */
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.footer-logo-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); margin-bottom: var(--space-2); }
.footer-tagline { font-size: 15px; color: var(--ink-muted); line-height: 1.6; max-width: 260px; }
.footer-section-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle); margin-bottom: var(--space-3);
}
.footer-links { list-style: none; padding: 0; display: grid; gap: 6px; }
.footer-links li { font-size: 15px; color: var(--ink-muted); display: flex; align-items: baseline; gap: 8px; }
.footer-links li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; transform: translateY(-2px); }
.footer-bottom {
  max-width: 1200px; margin: var(--space-8) auto 0; padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}

/* ── responsive ─────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1100px) { .layout { grid-template-columns: 66% 34%; } }
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { display: none; }
  .main-col { max-width: 100%; padding: var(--space-6) 16px; }
  .nav-row { padding: var(--space-3) 16px; }
  .options-grid { grid-template-columns: 1fr; }
  .summary-screen { padding: var(--space-6) 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
.total-note { margin-left: 6px; padding: 1px 7px; border: 1px solid currentColor; border-radius: 999px; font-weight: 600; }
