/* Dark fantasy style for Act I of The Crownless King */
:root {
  color-scheme: dark;
  --bg-top: #141212;
  --bg: #09080a;
  --panel-a: rgba(18, 18, 18, 0.92);
  --panel-b: rgba(10, 10, 11, 0.98);
  --text: #e4ded8;
  --muted: #9a968d;
  --border: #2b292b;
  --choice-bg: rgba(24, 23, 25, 0.9);
  --choice-hover: rgba(40, 36, 38, 0.95);
  --art-a: rgba(20, 18, 20, 0.9);
  --art-b: rgba(12, 11, 12, 0.98);
  --toggle-bg: rgba(15, 14, 16, 0.86);
  --toggle-pill-active: #ede8de;
  --toggle-text-active: #121114;
  --accent-safe: #5d6659;
  --accent-risky: #6e2c2c;
  --accent-emotional: #5b403b;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-top: #d7d3cc;
  --bg: #f2ece3;
  --panel-a: rgba(255, 252, 246, 0.95);
  --panel-b: rgba(247, 241, 232, 0.97);
  --text: #261f1d;
  --muted: #6a625d;
  --border: #c5b9ad;
  --choice-bg: rgba(255, 251, 244, 0.95);
  --choice-hover: rgba(246, 238, 228, 0.96);
  --art-a: rgba(249, 243, 234, 0.92);
  --art-b: rgba(239, 232, 220, 0.98);
  --toggle-bg: rgba(246, 240, 230, 0.88);
  --toggle-pill-active: #2f2521;
  --toggle-text-active: #f3ece3;
  --accent-safe: #4c6a54;
  --accent-risky: #8d3a38;
  --accent-emotional: #7c5a43;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, var(--bg-top) 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Palatino Linotype", Georgia, "Times New Roman", serif;
  line-height: 1.8;
  transition: background 0.35s ease, color 0.35s ease;
}

body {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.page-shell {
  width: min(100%, 44rem);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  padding: 2rem 2.5rem;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.scene-label {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 1.35rem;
  color: var(--text);
}

.scene-copy {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.choice-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--choice-bg);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.choice:hover,
.choice:focus-visible {
  background: var(--choice-hover);
  transform: translateY(-1px);
}

.choice.safe {
  border-color: var(--accent-safe);
}

.choice.risky {
  border-color: var(--accent-risky);
}

.choice.emotional {
  border-color: var(--accent-emotional);
}

.scene-art {
  margin: 1.75rem 0 2rem;
  min-height: 16rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, var(--art-a), var(--art-b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.scene-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.loading-indicator {
  margin: 0 0 1.35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: loading-dots 1.2s steps(4, end) infinite;
}

@keyframes loading-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2rem;
  margin-left: auto;
  padding: 0.38rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--toggle-bg);
  backdrop-filter: blur(4px);
}

.theme-switcher button {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease;
}

.theme-switcher button:hover,
.theme-switcher button:focus-visible {
  transform: translateY(-1px);
}

.theme-switcher button.active {
  background: var(--toggle-pill-active);
  color: var(--toggle-text-active);
}

.theme-switcher span {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.story-navigator {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.story-navigator a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.story-navigator a:hover,
.story-navigator a:focus-visible {
  background: var(--choice-hover);
  transform: translateY(-1px);
}

footer a {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .page-shell {
    padding: 1.5rem 1.25rem;
  }

  .story-navigator {
    justify-content: flex-start;
  }
}
