@font-face {
  font-family: 'Comic Neue';
  src: url('../../paws-and-ladders/fonts/ComicNeue-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Comic Neue';
  src: url('../../paws-and-ladders/fonts/ComicNeue-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

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

:root {
  --bg-start: #1a0b2e;
  --bg-end: #000010;
  --parchment: #f4e6c8;
  --parchment-border: #8a6d3b;
  --ink: #3a2a1a;
  --purple: #6b2bd9;
  --purple-glow: rgba(147, 112, 219, 0.6);
  --gold: #f5c518;
  --red: #c0392b;
  --rainbow: linear-gradient(90deg,#ff6b6b,#ffd93d,#6bcb77,#4d96ff,#b983ff);
}

body {
  min-height: 100vh;
  font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  color: white;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Stars background */
.starry-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 25% 70%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 40% 35%, #fff 50%, transparent 50%),
    radial-gradient(2px 2px at 55% 55%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 15%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 80%, #fff 50%, transparent 50%),
    radial-gradient(2px 2px at 92% 40%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 5%  85%, #fff 50%, transparent 50%);
  opacity: 0.7;
}

.story-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  width: 100%;
  max-width: 640px;
}

.story-header h1 {
  font-size: 2.4rem;
  color: white;
  text-shadow: 0 0 12px var(--purple-glow);
}

.story-header .subtitle {
  font-size: 1rem;
  opacity: 0.75;
  margin-top: 0.25rem;
}

.power-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(107, 43, 217, 0.35);
  border: 1px solid var(--purple);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
  box-shadow: 0 0 10px var(--purple-glow);
}

.story-main {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.story-box {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--parchment-border);
  border-radius: 14px;
  padding: 1.5rem 1.5rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.55;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: opacity 0.3s ease;
}

.story-box.fading { opacity: 0; }

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.choice-btn {
  background: var(--purple);
  color: white;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(147,112,219,0);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 52px;
  text-align: left;
}

.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 18px var(--purple-glow);
  outline: none;
}

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.progress { letter-spacing: 0.25rem; }

.start-over {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.start-over:hover { background: rgba(255,255,255,0.08); }

/* Ending variants */
.story-box.ending-good   { box-shadow: 0 0 30px var(--gold); border-color: var(--gold); }
.story-box.ending-bad    { box-shadow: 0 0 30px var(--red);  border-color: var(--red); filter: saturate(0.7); }
.story-box.ending-secret { border-image: var(--rainbow) 1; box-shadow: 0 0 30px #b983ff; }

/* Responsive */
@media (max-width: 600px) {
  body { padding: 1rem 0.75rem; }
  .story-header h1 { font-size: 1.8rem; }
  .power-badge { position: static; display: inline-block; margin-top: 0.5rem; }
  .story-box { font-size: 1rem; padding: 1.2rem; }
}
