.story-page {
  max-width: 1080px;
  padding-block: clamp(24px, 5vw, 60px);
  --story-bg: #182b30;
  --story-line: #41676b;
  --story-accent: #a7e1cb;
}
.snaky-story { max-width: 800px; }
.rome-story {
  --story-bg: #30231e;
  --story-line: #76503c;
  --story-accent: #ffbd88;
}
.story-header { margin-bottom: 24px; }
.story-header h1 {
  max-width: 20ch;
  margin-bottom: 7px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.story-header > p { color: var(--muted); margin-bottom: 0; }
.story-header .text-link { color: var(--story-accent); margin-bottom: 9px; }

.story-slides { display: grid; gap: 18px; list-style: none; margin: 0; padding: 0; }
.story-slide {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--story-line);
  border-radius: 20px;
  background: var(--story-bg);
}
.story-slide[hidden], .story-controls[hidden] { display: none; }
.snaky-story .story-slide { grid-template-columns: minmax(0, 290px) minmax(0, 1fr); }
.story-media { min-width: 0; align-self: start; overflow: hidden; }
.story-media img { width: 100%; height: auto; }
.story-media.trim-white-edge img { transform: scale(1.012); }
.story-copy { min-width: 0; align-self: center; padding: clamp(18px, 3.5vw, 38px); }
.story-copy h2 { color: var(--story-accent); font-size: clamp(25px, 3.3vw, 38px); margin-bottom: 11px; }
.story-copy p { max-width: 38ch; margin-bottom: 9px; font-size: clamp(15px, 1.8vw, 18px); }
.story-copy p:last-child { margin-bottom: 0; }

.story-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  align-items: center;
  justify-content: space-between;
  margin-block: 13px 26px;
}
.story-position { color: var(--muted); margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.story-nav-buttons, .story-game-links { display: flex; flex-wrap: wrap; gap: 8px; }
.story-game-links { align-items: center; gap: 10px; }
.story-nav-buttons button { font-family: inherit; cursor: pointer; border: 1px solid var(--story-line); }
.story-nav-buttons button:focus-visible { outline: 3px solid var(--story-accent); outline-offset: 3px; }
.story-previous { color: var(--ink); background: var(--story-bg); }
.story-next { color: var(--on-bright); background: var(--story-accent); }
.story-previous:disabled { opacity: .54; cursor: default; }

.story-game { border-top: 1px solid var(--story-line); margin-top: 22px; padding-top: 18px; }
.story-game h2 { font-size: clamp(22px, 3.2vw, 32px); margin-bottom: 8px; }
.story-game > p { color: var(--muted); max-width: 65ch; margin-bottom: 12px; }
.story-game .story-button { color: var(--story-accent); border-color: var(--story-line); }
.story-game .story-button:hover { background: var(--story-bg); }
.story-game .story-button:focus-visible { outline-color: var(--story-accent); }

@media (max-width: 700px) {
  .snaky-story { max-width: 410px; }
  .story-slide, .snaky-story .story-slide { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
  .story-copy { min-height: 145px; }
}
