/* The Story page (game world, 24 Oct 2026): painted scenes from The Art of Ragnarok II (assets/story, cut from
   assets/artbook) as wide banners, one chapter per place, each with its own colour (--area). Built on styles.css. */
.story-page { --area: #111827; --area-soft: #f3f4f6; max-width: 1120px; margin: 96px auto 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 72px; color: var(--text-main); }
.story-page img { display: block; max-width: 100%; }
.sp-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }

/* Hero: the Mother Tree */
.sp-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #1f2937; min-height: 420px; display: grid; align-items: end; }
.sp-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.sp-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17, 24, 39, 0) 30%, rgba(17, 24, 39, 0.82) 100%); }
.sp-hero-text { position: relative; z-index: 1; color: #fff; padding: clamp(24px, 5vw, 48px); max-width: 680px; display: grid; gap: 12px; }
.sp-hero-text .sp-eyebrow { color: #e9d5ff; }
.sp-hero h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin: 0; }
.sp-hero p.sp-lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.55; margin: 0; color: #f3f4f6; }

/* The two gods */
.sp-gods { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.sp-gods-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-gods-pair figure { margin: 0; display: grid; gap: 6px; }
.sp-gods-pair img { border-radius: var(--radius-md); aspect-ratio: 1; object-fit: cover; width: 100%; }
.sp-gods-pair figcaption { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.sp-gods h2, .sp-section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.15; }
.sp-gods p, .sp-text p { font-size: 1.075rem; line-height: 1.7; margin: 0 0 14px; max-width: 64ch; }

/* The route */
.sp-route { display: grid; gap: 14px; }
.sp-route-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sp-stop { position: relative; display: grid; border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: #fff; min-height: 190px; align-items: end; background: #374151; box-shadow: var(--shadow-sm); }
.sp-stop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.sp-stop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.75)); }
.sp-stop span { position: relative; z-index: 1; padding: 14px 16px; display: grid; gap: 2px; }
.sp-stop b { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.sp-stop small { font-size: 0.85rem; opacity: 0.9; }
.sp-stop .sp-step { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.sp-stop:hover img { transform: scale(1.04); }
.sp-stop:focus-visible { outline: 3px solid var(--text-main); outline-offset: 3px; }
.sp-route-note { margin: 0; color: var(--text-muted); font-size: 0.98rem; }

/* One place */
.sp-area { display: grid; gap: 28px; scroll-margin-top: 90px; }
.sp-banner { position: relative; margin: 0; border-radius: var(--radius-lg); overflow: hidden; min-height: 300px; display: grid; align-items: end; background: #374151; }
.sp-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.72)); }
.sp-banner figcaption { position: relative; z-index: 1; color: #fff; padding: clamp(20px, 4vw, 36px); display: grid; gap: 4px; }
.sp-banner .sp-eyebrow { opacity: 0.85; }
.sp-banner h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; margin: 0; }
.sp-banner p { margin: 0; font-size: 1.05rem; color: #f3f4f6; }
.sp-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; }
.sp-text { min-width: 0; }
.sp-area h3 { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--area); margin: 0 0 12px; }
.sp-side { margin: 0; display: grid; gap: 10px; min-width: 0; }
.sp-side img { border-radius: var(--radius-md); width: 100%; box-shadow: var(--shadow-md); }
.sp-side figcaption { font-size: 0.85rem; color: var(--text-muted); }

/* Spoilers */
.sp-spoiler { border: 1px solid var(--border-color); border-left: 4px solid var(--area); border-radius: var(--radius-md); background: var(--bg-gray); margin-top: 8px; }
.sp-spoiler > summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-spoiler > summary::-webkit-details-marker { display: none; }
.sp-spoiler > summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--area); color: #fff; font-size: 0.95rem; line-height: 1; flex: none; }
.sp-spoiler[open] > summary::before { content: '−'; }
.sp-spoiler > summary small { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.sp-spoiler > summary:focus-visible { outline: 3px solid var(--area); outline-offset: 2px; border-radius: var(--radius-md); }
.sp-spoiler-body { padding: 0 18px 18px; display: grid; gap: 14px; }
.sp-spoiler-body p { margin: 0; font-size: 1.04rem; line-height: 1.7; }
.sp-with-art { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.sp-with-art img { width: 120px; border-radius: var(--radius-sm); background: var(--surface); }
.sp-quote { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--area); font-style: italic; color: var(--text-main); }
.sp-quote cite { display: block; font-style: normal; font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* People */
.sp-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sp-person { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.sp-person img { width: 100%; height: 230px; object-fit: contain; object-position: center bottom; background: linear-gradient(180deg, var(--surface) 55%, var(--area-soft)); padding-top: 8px; }
.sp-person div { padding: 12px 14px 14px; display: grid; gap: 4px; align-content: start; }
.sp-person b { font-size: 1.02rem; }
.sp-person span { font-size: 0.93rem; color: var(--text-muted); line-height: 1.45; }
.sp-person.plain { border-top: 3px solid var(--area); }

/* Side stories */
.sp-quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sp-quest { background: var(--area-soft); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.sp-quest b { font-size: 1rem; }
.sp-quest span { font-size: 0.93rem; color: var(--text-strong); line-height: 1.5; }

/* Monsters */
.sp-monsters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; align-items: stretch; }
.sp-monster { margin: 0; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; display: grid; grid-template-rows: 190px auto; }
.sp-monster.wide { grid-column: span 2; }
.sp-monster img { width: 100%; height: 190px; object-fit: contain; padding: 10px; }
.sp-monster figcaption { padding: 10px 14px 14px; font-size: 0.92rem; color: var(--text-muted); border-top: 1px solid var(--border-color); }
.sp-monster figcaption b { color: var(--text-main); display: block; font-size: 1rem; }
.sp-trouble { margin: 0; font-size: 0.98rem; color: var(--text-muted); }

/* Smaller places */
.sp-shores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sp-shore { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-color); background: var(--surface); display: grid; grid-template-rows: auto 1fr; scroll-margin-top: 90px; }
.sp-shore > img { width: 100%; height: 220px; object-fit: cover; }
.sp-shore > div { padding: 20px 22px 22px; display: grid; gap: 10px; align-content: start; }
.sp-shore h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; margin: 0; color: var(--area); }
.sp-shore p, .sp-shore li { font-size: 0.99rem; line-height: 1.6; margin: 0; }
.sp-shore ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.sp-shore .sp-mini { display: flex; gap: 12px; align-items: flex-end; }
.sp-shore .sp-mini img { width: 96px; height: 120px; object-fit: contain; flex: none; }

/* Chapters */
.sp-chapters ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sp-chapters li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-color); }
.sp-chapters li:first-child { border-top: 0; }
.sp-chapters .n { font-weight: 800; font-size: 1.4rem; color: var(--area); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sp-chapters li b { display: block; }
.sp-chapters li span { color: var(--text-muted); font-size: 0.97rem; line-height: 1.5; }
.sp-chapters .sp-chapter-cast { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.sp-chapters .sp-chapter-cast figure { margin: 0; display: grid; gap: 4px; width: 132px; }
.sp-chapters .sp-chapter-cast img { width: 132px; height: 150px; object-fit: contain; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.sp-chapters .sp-chapter-cast figcaption { font-size: 0.82rem; color: var(--text-muted); }

/* The world behind it */
.sp-world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sp-world-grid div { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.sp-world-grid b { font-size: 1rem; }
.sp-world-grid span { font-size: 0.94rem; color: var(--text-muted); line-height: 1.5; }
.sp-credit { margin: 0; font-size: 0.9rem; color: var(--text-muted); border-top: 1px solid var(--border-color); padding-top: 18px; }

@media (max-width: 860px) {
  .sp-gods, .sp-cols, .sp-shores { grid-template-columns: minmax(0, 1fr); }
  .sp-route-row { grid-template-columns: minmax(0, 1fr); }
  .sp-stop { min-height: 150px; }
  .story-page { gap: 56px; margin-top: 84px; }
}
@media (max-width: 520px) {
  .sp-hero { min-height: 360px; }
  .sp-banner { min-height: 220px; }
  .sp-monster.wide { grid-column: auto; }
  .sp-with-art { grid-template-columns: 84px minmax(0, 1fr); }
  .sp-with-art img { width: 84px; }
}
@media (prefers-reduced-motion: reduce) { .sp-stop img { transition: none; } }
/* 24 Oct preview round: portraits and text-only people in separate rows; stronger shade under titles on bright paintings. */
.sp-folk { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.sp-folk .sp-person { grid-template-rows: auto; }
.sp-people { grid-template-columns: repeat(auto-fill, minmax(200px, 240px)); }
.sp-banner::after { background: linear-gradient(180deg, rgba(0,0,0,0) 25%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.85)); }
.sp-banner figcaption, .sp-stop span, .sp-hero-text { text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
.sp-hero::after { background: linear-gradient(180deg, rgba(17,24,39,0.1) 0%, rgba(17,24,39,0.45) 45%, rgba(17,24,39,0.88) 100%); }
.sp-monsters { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 520px) {
  .sp-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sp-person img { height: 180px; }
  .sp-person div { padding: 10px 12px 12px; }
  .sp-gods-pair { max-width: 360px; }
}
