/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0b0b18;
  --bg-card:    #13131f;
  --bg-choice:  #181826;
  --border:     #2a2640;
  --border-gold:#4a3e20;
  --gold:       #c9a84c;
  --gold-light: #e8c86d;
  --text:       #e0d4be;
  --text-muted: #7a6f5a;
  --text-dim:   #4a4535;
  --accent:     #9c7c3a;
  --radius:     6px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ── */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#screen-game.active,
#screen-ending.active {
  display: block;
  justify-content: unset;
  align-items: unset;
}

/* ── Title Screen ── */
.title-card {
  text-align: center;
  max-width: 520px;
  padding: 3rem 2rem;
}

.campaign-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.game-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.game-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

.game-tagline {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.8rem;
}

.resume-prompt {
  margin-bottom: 1.5rem;
}

.resume-prompt p {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.resume-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ── Buttons ── */
.btn {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Game Screen ── */
.game-layout {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.header-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.header-node {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.game-main {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.node-card {
  margin-bottom: 2.5rem;
}

.node-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-gold);
}

.node-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.node-text p {
  margin-bottom: 1rem;
}

.node-text p:last-child {
  margin-bottom: 0;
}

.node-text em {
  font-style: italic;
  color: #d4c49e;
}

.node-text strong {
  font-weight: 600;
  color: var(--gold-light);
}

.node-prompt {
  font-style: italic;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1.8rem;
  font-size: 1rem;
}

/* ── Choices ── */
.choices {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-choice);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  position: relative;
}

.choice-btn::before {
  content: attr(data-num);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-right: 0.75rem;
  letter-spacing: 0.05em;
}

.choice-btn em {
  font-style: italic;
  color: #d4c49e;
}

.choice-btn:hover {
  background: #1e1e30;
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.choice-btn:hover::before {
  color: var(--gold);
}

/* Single-continue button (narrative nodes) */
.choice-btn.continue-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  border-style: dashed;
  padding: 0.75rem;
}

.choice-btn.continue-btn::before {
  content: none;
}

.choice-btn.continue-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  border-style: solid;
}

/* ── Ending Screen ── */
.ending-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
}

.ending-card {
  max-width: 680px;
  width: 100%;
  animation: fadeIn 0.5s ease;
}

.ending-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.ending-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-gold);
}

.ending-text {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 3rem;
}

.ending-text p {
  margin-bottom: 1.1rem;
}

.ending-text p:last-child {
  margin-bottom: 0;
}

.ending-text em {
  font-style: italic;
  color: #d4c49e;
}

.ending-text strong {
  font-weight: 600;
  color: var(--gold-light);
}

/* DM Note */
.dm-note-wrapper {
  margin-bottom: 2.5rem;
}

.btn-dm-toggle {
  background: none;
  border: none;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.15s;
}

.btn-dm-toggle:hover {
  color: var(--text-muted);
}

.dm-note {
  margin-top: 1rem;
  padding: 1.1rem 1.3rem;
  background: #0f0f1a;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-gold);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
}

.restart-btn {
  display: block;
  margin: 0 auto;
}

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Mobile ── */
@media (max-width: 480px) {
  html { font-size: 17px; }
  .game-layout { padding: 0 1rem 3rem; }
  .title-card { padding: 2rem 1rem; }
}
