:root {
  --ink: #08111f;
  --ink-soft: #172439;
  --paper: #f5f7fb;
  --white: #ffffff;
  --muted: #68758a;
  --line: rgba(8, 17, 31, 0.13);
  --blue: #2855ff;
  --blue-bright: #4e72ff;
  --coral: #ff5c47;
  --cyan: #77e5e1;
  --display: "Bodoni Moda", Georgia, serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% -10%, rgba(40, 85, 255, 0.18), transparent 31rem),
    var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, video:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.site-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 10px 18px;
  color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 0.92rem; letter-spacing: -0.02em; }
.brand-copy small { color: rgba(255,255,255,0.55); font-size: 0.69rem; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }
.media-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
  transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--coral); color: var(--white); }
.button-primary:hover { background: #ff735f; }
.button-quiet { color: var(--white); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); }
.button-light { background: var(--white); color: var(--ink); }
.button-outline-light { color: var(--white); background: transparent; border: 1px solid rgba(255,255,255,0.28); }

.sound-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #738094;
  box-shadow: 0 0 0 4px rgba(115,128,148,0.13);
  transition: background 180ms ease, box-shadow 180ms ease;
}
.sound-button[aria-pressed="true"] .sound-icon { background: var(--cyan); box-shadow: 0 0 0 4px rgba(119,229,225,0.15); }

.booklet-app {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 16px;
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  padding: 24px 12px 84px 4px;
}

.chapter-nav-label {
  margin: 0 0 24px;
  color: rgba(255,255,255,0.38);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.chapter-list { display: grid; gap: 4px; }

.chapter-link {
  position: relative;
  min-height: 47px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding: 0 10px;
  color: rgba(255,255,255,0.45);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}
.chapter-link::before {
  content: "";
  position: absolute;
  left: -4px;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--cyan);
  transition: height 200ms var(--ease);
}
.chapter-link:hover { color: var(--white); transform: translateX(3px); }
.chapter-link.active { color: var(--white); background: rgba(255,255,255,0.07); }
.chapter-link.active::before { height: 24px; }
.chapter-link span { font-size: 0.62rem; font-weight: 800; color: rgba(255,255,255,0.3); }
.chapter-link strong { font-size: 0.76rem; font-weight: 600; }
.chapter-link.active span { color: var(--cyan); }

.booklet-stage {
  position: relative;
  min-width: 0;
  height: calc(100vh - 108px);
  min-height: 620px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,0.32);
}

.stage-progress {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  height: 3px;
  background: rgba(255,255,255,0.16);
}
.stage-progress span {
  display: block;
  width: calc(100% / 8);
  height: 100%;
  background: var(--coral);
  transition: width 500ms var(--ease);
}

.book-pages { position: absolute; inset: 0 0 76px; overflow: hidden; }

.page {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow-x: hidden;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translate3d(34px, 0, 0) scale(0.992);
  pointer-events: none;
  transition: opacity 420ms var(--ease), transform 520ms var(--ease), visibility 0s linear 520ms;
}
.page.active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}
.page.exiting {
  z-index: 1;
  visibility: visible;
  opacity: 0;
  transform: translate3d(-24px, 0, 0) scale(0.992);
  transition-delay: 0s;
}
.page.entering-back { transform: translate3d(-34px, 0, 0) scale(0.992); }
.page.exiting-back { transform: translate3d(24px, 0, 0) scale(0.992); }

.page-inner { position: relative; z-index: 2; min-height: 100%; padding: clamp(38px, 5vw, 76px); }
.chapter-kicker { margin: 0; color: var(--blue); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.19em; text-transform: uppercase; }

.section-header {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.section-header h2 {
  margin: -0.14em 0 16px;
  font-family: var(--display);
  font-size: clamp(3rem, 6.1vw, 6.4rem);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.84;
}
.section-header p:last-child { max-width: 46ch; margin: 0; color: var(--muted); line-height: 1.7; font-size: 0.87rem; }
.section-header-light, .section-header-light p:last-child { color: var(--white); }
.section-header-light p:last-child { color: rgba(255,255,255,0.64); }
.section-header-light .chapter-kicker { color: var(--cyan); }

.page-cover { color: var(--white); background: var(--blue); }
.cover-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.075) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.075) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, transparent, black 28%, black);
}
.cover-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(8,17,31,0.5), transparent 55%);
}
.cover-ball {
  position: absolute;
  width: min(48vw, 680px);
  aspect-ratio: 1;
  right: -7%;
  top: 50%;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--coral);
  box-shadow: -35px 40px 100px rgba(8,17,31,0.34);
  animation: ballFloat 7s ease-in-out infinite;
}
.cover-ball::before, .cover-ball::after {
  content: "";
  position: absolute;
  left: 49%;
  top: -4%;
  width: 8px;
  height: 108%;
  border-radius: 50%;
  border-left: 2px dashed rgba(255,255,255,0.65);
  border-right: 2px dashed rgba(255,255,255,0.65);
  transform: rotate(22deg);
}
.cover-ball::after { transform: rotate(22deg) translateX(13px); }
.cover-ball span { position: absolute; inset: 10%; border-radius: 50%; border: 1px solid rgba(255,255,255,0.12); }

.cover-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: center; gap: 40px; padding-bottom: 90px; }
.cover-copy { position: relative; z-index: 2; max-width: 810px; }
.cover-copy .chapter-kicker { color: var(--cyan); margin-bottom: 25px; }
.cover-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.5rem, 10vw, 10.4rem);
  font-weight: 600;
  line-height: 0.76;
  letter-spacing: -0.09em;
}
.cover-copy h1 em { color: var(--cyan); font-weight: 500; }
.cover-intro { max-width: 49ch; margin: 35px 0 0; color: rgba(255,255,255,0.72); font-size: 0.95rem; line-height: 1.8; }
.cover-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 28px; }
.text-link {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 6px 0;
  color: var(--ink);
  background: none;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}
.page-cover .text-link, .text-link-light { color: var(--white); }

.cover-aside {
  position: relative;
  z-index: 2;
  align-self: end;
  border-top: 1px solid rgba(255,255,255,0.32);
  padding-top: 16px;
}
.cover-aside > p { margin: 0 0 20px; font-family: var(--display); font-size: 1.25rem; }
.cover-aside dl { margin: 0; }
.cover-aside dl div { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.13); padding: 10px 0; }
.cover-aside dt { color: rgba(255,255,255,0.5); font-size: 0.67rem; }
.cover-aside dd { margin: 0; font-size: 0.82rem; font-weight: 700; }
.cover-ticker {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  width: max-content;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
}
.cover-ticker span { width: max-content; padding-right: 3rem; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; animation: ticker 18s linear infinite; }

.page-film { color: var(--white); background: #050b14; }
.film-layout { padding-bottom: 64px; }
.film-player { margin: 40px 0 0; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 24px 70px rgba(0,0,0,0.4); }
.film-player video { display: block; width: 100%; max-height: 56vh; background: #000; }
.film-caption { min-height: 40px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 16px; color: rgba(255,255,255,0.5); background: #0c1421; font-size: 0.64rem; }
.film-controls { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.film-controls p { margin-left: auto; color: rgba(255,255,255,0.45); font-size: 0.67rem; }
.poster-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 38px; }
.poster-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  color: var(--white);
  background: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 260ms var(--ease), border-color 180ms ease;
}
.poster-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(5,11,20,0.84)); }
.poster-card::after { content: "▶"; position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink); font-size: 0.68rem; }
.poster-card:hover { transform: translateY(-5px); border-color: rgba(119,229,225,0.6); }
.poster-card > * { position: relative; z-index: 1; }
.poster-card span { color: var(--cyan); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.poster-card strong { margin-top: 8px; font-family: var(--display); font-size: 1.7rem; letter-spacing: -0.04em; }
.poster-card small { margin-top: 5px; color: rgba(255,255,255,0.52); }
.poster-card-one { background: linear-gradient(145deg, rgba(40,85,255,0.75), rgba(5,11,20,0.6)), url("./media/afi-poster.png") center/cover; }
.poster-card-two { background: linear-gradient(145deg, rgba(255,92,71,0.76), rgba(5,11,20,0.72)), url("./media/afi-poster.png") 70% center/cover; }
.poster-card-three { background: linear-gradient(145deg, rgba(119,229,225,0.52), rgba(5,11,20,0.8)), url("./media/afi-poster.png") 25% center/cover; }

.page-paper { background: var(--paper); }
.story-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 38px 64px; align-content: center; }
.story-layout .section-header { grid-column: 1 / -1; }
.editorial-copy { max-width: 55ch; padding-left: clamp(0px, 4vw, 80px); }
.editorial-copy p { color: #3f4b5d; font-size: 0.88rem; line-height: 1.85; }
.drop-cap::first-letter { float: left; margin: 0.07em 0.1em 0 0; color: var(--blue); font-family: var(--display); font-size: 5.2em; line-height: 0.72; }
.story-notes { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.story-notes article { min-height: 180px; padding: 18px 17px; border-right: 1px solid var(--line); }
.story-notes article:last-child { border-right: 0; }
.story-notes span { color: var(--blue); font-size: 0.61rem; font-weight: 800; }
.story-notes h3 { margin: 35px 0 8px; font-family: var(--display); font-size: 1.5rem; }
.story-notes p { margin: 0; color: var(--muted); font-size: 0.71rem; line-height: 1.65; }

.page-squads { background: #eaf0ff; }
.squads-layout { align-content: center; display: grid; }
.squad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 46px; }
.player-card { position: relative; min-height: 305px; overflow: hidden; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--white); }
.player-featured { color: var(--white); background: var(--blue); }
.player-number { position: absolute; top: 17px; right: 17px; color: var(--blue); font-size: 0.62rem; font-weight: 800; }
.player-featured .player-number { color: var(--cyan); }
.player-monogram { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: clamp(4rem, 6vw, 7rem); color: #dbe3f2; letter-spacing: -0.08em; }
.player-featured .player-monogram { color: rgba(255,255,255,0.16); }
.player-card p { margin: 0 0 5px; color: var(--coral); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.player-card h3 { margin: 0; font-family: var(--display); font-size: 2rem; letter-spacing: -0.04em; }
.player-card small { margin-top: 4px; color: var(--muted); font-size: 0.66rem; }
.player-featured small { color: rgba(255,255,255,0.62); }

.page-match { color: var(--white); background: var(--ink-soft); }
.match-lines { position: absolute; inset: 0; opacity: 0.18; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(255,255,255,0.2) 25%); }
.match-lines::after { content: ""; position: absolute; width: 340px; height: 340px; border: 1px solid var(--cyan); border-radius: 50%; right: -90px; bottom: -130px; }
.match-layout { display: grid; align-content: center; }
.match-details { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 58px; border-top: 1px solid rgba(255,255,255,0.18); }
.match-details article { min-height: 210px; padding: 18px 20px 0 0; }
.match-details article + article { padding-left: 20px; border-left: 1px solid rgba(255,255,255,0.18); }
.match-details span { display: block; color: var(--cyan); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.match-details strong { display: block; margin-top: 35px; font-family: var(--display); font-size: clamp(1.55rem, 2.8vw, 2.7rem); font-weight: 500; line-height: 1; letter-spacing: -0.055em; }
.match-details small { display: block; margin-top: 12px; color: rgba(255,255,255,0.5); font-size: 0.65rem; }

.rules-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 30px 74px; align-content: center; }
.rules-layout .section-header { grid-column: 1 / -1; }
.rules-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rules-list li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.rules-list li > span { color: var(--blue); font-size: 0.61rem; font-weight: 800; }
.rules-list strong { font-family: var(--display); font-size: 1.3rem; }
.rules-list p { margin: 4px 0 0; color: var(--muted); font-size: 0.71rem; line-height: 1.6; }
.rules-layout blockquote { margin: 0; color: var(--ink); font-family: var(--display); font-size: clamp(3rem, 6vw, 6rem); line-height: 0.88; letter-spacing: -0.07em; }
.rules-layout blockquote em { color: var(--coral); }

.page-rules-document { color: var(--white); background: #071522; }
.pdf-layout {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: clamp(28px, 3.5vw, 52px);
  padding-bottom: clamp(28px, 3.5vw, 52px);
}
.pdf-section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; }
.pdf-section-header .chapter-kicker { color: var(--cyan); }
.pdf-section-header h2 { margin: 8px 0 0; font-family: var(--display); font-size: clamp(2.8rem, 5.4vw, 5.8rem); font-weight: 600; line-height: 0.78; letter-spacing: -0.075em; }
.pdf-section-header h2 em { color: var(--coral); font-weight: 500; }
.pdf-section-header > p { max-width: 43ch; margin: 0; color: rgba(255,255,255,0.62); font-size: 0.78rem; line-height: 1.65; }
.pdf-reader { flex: 1; min-height: 390px; overflow: hidden; border: 1px solid rgba(255,255,255,0.14); border-radius: 16px; display: flex; flex-direction: column; background: #d8dee7; box-shadow: 0 24px 70px rgba(0,0,0,0.35); }
.pdf-toolbar { min-height: 58px; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); align-items: center; gap: 16px; padding: 7px 10px 7px 16px; color: var(--white); background: #101d2d; }
.pdf-toolbar-title { display: grid; gap: 2px; min-width: 0; }
.pdf-toolbar-title strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.pdf-toolbar-title span { color: rgba(255,255,255,0.45); font-size: 0.59rem; }
.pdf-zoom-controls { display: flex; align-items: center; gap: 5px; }
.pdf-zoom-controls button { min-width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.15); border-radius: 9px; display: grid; place-items: center; color: var(--white); background: rgba(255,255,255,0.07); cursor: pointer; font-weight: 800; }
.pdf-zoom-controls button:hover { background: rgba(255,255,255,0.16); }
.pdf-zoom-controls span { min-width: 48px; color: var(--cyan); font-size: 0.65rem; font-weight: 800; text-align: center; }
.pdf-zoom-controls .pdf-fit-button { min-width: 46px; padding-inline: 9px; font-size: 0.64rem; }
.pdf-open-link { justify-self: end; border-radius: 9px; padding: 11px 13px; color: var(--white); background: var(--blue); text-decoration: none; font-size: 0.67rem; font-weight: 800; }
.pdf-frame-wrap { flex: 1; min-height: 0; overflow: hidden; background: #d8dee7; }
.pdf-document { width: 100%; height: 100%; overflow: auto; padding: 14px; background: #d8dee7; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
.pdf-page { position: relative; margin: 0 auto 14px; overflow: hidden; background: var(--white); box-shadow: 0 6px 20px rgba(8,17,31,0.2); }
.pdf-page:last-child { margin-bottom: 0; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page-number { position: absolute; z-index: 2; right: 8px; bottom: 8px; min-width: 28px; border-radius: 999px; padding: 5px 8px; color: var(--white); background: rgba(8,17,31,0.78); font-size: 0.58rem; font-weight: 800; text-align: center; }
.pdf-loading, .pdf-error { min-height: 100%; margin: 0; display: grid; place-items: center; color: #344156; font-size: 0.76rem; text-align: center; }
.pdf-error { padding: 30px; color: #9b2131; }
.pdf-reader.is-rendering .pdf-zoom-controls button { opacity: 0.48; pointer-events: none; }

.page-close { color: var(--white); background: var(--blue); }
.close-orbit { position: absolute; width: min(66vw, 860px); aspect-ratio: 1; right: -13%; top: 50%; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; transform: translateY(-50%); }
.close-orbit::before, .close-orbit::after { content: ""; position: absolute; inset: 16%; border: 1px solid rgba(255,255,255,0.18); border-radius: 50%; }
.close-orbit::after { inset: 33%; background: var(--coral); border: 0; }
.close-layout { display: grid; align-content: center; justify-items: start; }
.close-layout .chapter-kicker { color: var(--cyan); }
.close-layout h2 { position: relative; margin: 25px 0; font-family: var(--display); font-size: clamp(4.6rem, 10vw, 10rem); line-height: 0.78; letter-spacing: -0.09em; }
.close-layout > p:not(.chapter-kicker) { max-width: 43ch; color: rgba(255,255,255,0.67); font-size: 0.87rem; line-height: 1.7; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; }
.contact-links a { min-width: 190px; border: 1px solid rgba(255,255,255,0.22); border-radius: 12px; padding: 13px 15px; display: grid; gap: 4px; color: var(--white); text-decoration: none; background: rgba(8,17,31,0.1); transition: background 180ms ease, transform 180ms var(--ease); }
.contact-links a:hover { background: rgba(8,17,31,0.25); transform: translateY(-3px); }
.contact-links span { color: var(--cyan); font-size: 0.59rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.contact-links strong { font-size: 0.82rem; }

.stage-controls {
  position: absolute;
  z-index: 20;
  inset: auto 0 0;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-top: 1px solid rgba(8,17,31,0.1);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
}
.step-button { border: 0; padding: 12px 0; display: inline-flex; align-items: center; gap: 11px; color: var(--ink); background: none; cursor: pointer; justify-self: start; }
.step-button-next { justify-self: end; }
.step-button strong { font-size: 0.7rem; }
.step-button span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: var(--white); background: var(--ink); transition: transform 180ms var(--ease), background 180ms ease; }
.step-button:hover span { transform: scale(1.08); background: var(--blue); }
.step-button:disabled { opacity: 0.28; cursor: not-allowed; }
.step-button:disabled span { transform: none; background: var(--ink); }
.page-status { display: flex; align-items: center; gap: 13px; }
.page-status strong { font-family: var(--display); font-size: 1rem; }
.page-status span { color: var(--muted); font-size: 0.63rem; font-weight: 800; letter-spacing: 0.1em; }

@keyframes ballFloat { 0%,100% { transform: translateY(-50%) rotate(-3deg); } 50% { transform: translateY(calc(-50% - 10px)) rotate(3deg); } }
@keyframes ticker { to { transform: translateX(-100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 980px) {
  .site-shell { padding: 12px; }
  .topbar { padding-inline: 4px; }
  .booklet-app { grid-template-columns: 1fr; min-height: 0; }
  .chapter-nav { order: 2; padding: 10px 0 0; overflow-x: auto; }
  .chapter-nav-label { display: none; }
  .chapter-list { display: flex; min-width: max-content; gap: 4px; }
  .chapter-link { width: auto; min-width: 102px; grid-template-columns: 22px auto; }
  .chapter-link::before { left: 10px; bottom: 2px; width: 0; height: 2px; }
  .chapter-link.active::before { width: calc(100% - 20px); height: 2px; }
  .booklet-stage { height: calc(100vh - 145px); min-height: 600px; }
  .cover-layout { grid-template-columns: 1fr; }
  .cover-aside { display: none; }
  .cover-ball { width: 58vw; right: -16%; opacity: 0.74; }
  .section-header { grid-template-columns: 1fr; gap: 24px; }
  .story-layout, .rules-layout { grid-template-columns: 1fr; }
  .story-layout .section-header, .rules-layout .section-header { grid-column: auto; }
  .editorial-copy { padding-left: 0; }
  .squad-grid { grid-template-columns: repeat(2, 1fr); }
  .match-details { grid-template-columns: repeat(2, 1fr); }
  .match-details article:nth-child(3) { border-left: 0; }
  .rules-layout blockquote { padding: 20px 0; }
  .pdf-toolbar { grid-template-columns: 1fr auto; }
  .pdf-open-link { grid-column: 1 / -1; width: 100%; text-align: center; }
}

@media (max-width: 640px) {
  :root {
    --mobile-header-height: calc(66px + var(--safe-top));
    --mobile-chapters-height: 54px;
    --mobile-controls-height: calc(66px + var(--safe-bottom));
  }
  html, body { height: 100%; }
  body { min-height: 100dvh; overscroll-behavior: none; }
  .site-shell { width: 100%; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .topbar {
    height: var(--mobile-header-height);
    min-height: var(--mobile-header-height);
    padding: calc(9px + var(--safe-top)) max(12px, var(--safe-right)) 9px max(12px, var(--safe-left));
    gap: 12px;
  }
  .brand { min-width: 0; gap: 9px; }
  .brand-mark { width: 42px; height: 42px; flex: 0 0 42px; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { font-size: 0.82rem; line-height: 1.15; }
  .brand-copy small, .sound-button #soundLabel { display: none; }
  .topbar-actions { flex: 0 0 auto; gap: 7px; }
  .sound-button { width: 44px; padding: 0; }
  .button-primary { padding: 0 14px; font-size: 0.68rem; }
  .booklet-app {
    height: calc(100dvh - var(--mobile-header-height));
    min-height: 0;
    grid-template-rows: var(--mobile-chapters-height) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
  }
  .chapter-nav {
    order: 0;
    height: var(--mobile-chapters-height);
    padding: 5px max(8px, var(--safe-right)) 5px max(8px, var(--safe-left));
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chapter-nav::-webkit-scrollbar { display: none; }
  .chapter-list { height: 44px; }
  .chapter-link { min-width: 98px; min-height: 44px; }
  .booklet-stage { height: auto; min-height: 0; border-radius: 0; box-shadow: none; }
  .book-pages { bottom: var(--mobile-controls-height); }
  .page { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .page-inner { padding: 34px max(22px, var(--safe-right)) calc(52px + var(--safe-bottom)) max(22px, var(--safe-left)); }
  .cover-layout { padding-bottom: 72px; align-content: center; }
  .cover-copy h1 { font-size: clamp(4.1rem, 23vw, 7rem); }
  .cover-intro { max-width: 32ch; font-size: 0.82rem; }
  .cover-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .cover-ball { width: 90vw; right: -53%; }
  .section-header h2 { font-size: clamp(3.2rem, 15vw, 5.4rem); }
  .film-player { margin-top: 28px; border-radius: 10px; }
  .film-caption { align-items: flex-start; flex-direction: column; justify-content: center; }
  .film-controls { flex-wrap: wrap; }
  .film-controls p { width: 100%; margin: 4px 0 0; }
  .poster-list { grid-template-columns: 1fr; }
  .poster-card { min-height: 175px; }
  .story-notes { grid-template-columns: 1fr; }
  .story-notes article { min-height: 130px; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-notes h3 { margin-top: 18px; }
  .squad-grid { grid-template-columns: 1fr; }
  .player-card { min-height: 240px; }
  .match-details { grid-template-columns: 1fr; }
  .match-details article, .match-details article + article { min-height: 150px; padding: 16px 0; border-left: 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
  .match-details strong { margin-top: 18px; }
  .pdf-layout { gap: 14px; padding-top: 24px; padding-bottom: calc(18px + var(--safe-bottom)); }
  .pdf-section-header { display: block; }
  .pdf-section-header h2 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
  .pdf-section-header > p { margin-top: 13px; font-size: 0.7rem; }
  .pdf-reader { min-height: 360px; border-radius: 10px; }
  .pdf-toolbar { min-height: 104px; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 8px; }
  .pdf-toolbar-title { padding-left: 4px; }
  .pdf-zoom-controls button { min-width: 36px; height: 36px; }
  .pdf-open-link { grid-column: 1 / -1; }
  .close-orbit { width: 115vw; right: -60%; opacity: 0.8; }
  .close-layout h2 { font-size: clamp(4.6rem, 23vw, 7.4rem); }
  .contact-links { flex-direction: column; width: 100%; }
  .stage-controls {
    height: var(--mobile-controls-height);
    padding: 0 max(14px, var(--safe-right)) var(--safe-bottom) max(14px, var(--safe-left));
  }
  .step-button strong { display: none; }
}

@media (max-width: 380px) {
  .brand-copy { display: none; }
  .button-primary { padding-inline: 12px; }
  .cover-copy h1 { font-size: clamp(3.7rem, 22vw, 5.3rem); }
  .page-inner {
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
  }
}

@media (max-width: 980px) and (max-height: 500px) and (orientation: landscape) {
  :root {
    --mobile-header-height: calc(56px + var(--safe-top));
    --mobile-controls-height: calc(58px + var(--safe-bottom));
  }
  html, body { height: 100%; }
  body { min-height: 100dvh; overscroll-behavior: none; }
  .site-shell { width: 100%; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .topbar {
    height: var(--mobile-header-height);
    min-height: var(--mobile-header-height);
    padding: calc(6px + var(--safe-top)) max(10px, var(--safe-right)) 6px max(10px, var(--safe-left));
  }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .brand-copy small, .sound-button #soundLabel { display: none; }
  .sound-button { width: 44px; padding: 0; }
  .booklet-app {
    height: calc(100dvh - var(--mobile-header-height));
    min-height: 0;
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    padding: 0 max(8px, var(--safe-right)) max(8px, var(--safe-bottom)) max(8px, var(--safe-left));
    overflow: hidden;
  }
  .chapter-nav {
    order: 0;
    height: auto;
    padding: 6px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .chapter-nav::-webkit-scrollbar { display: none; }
  .chapter-list { display: grid; min-width: 0; width: 100%; gap: 2px; }
  .chapter-link { width: 100%; min-width: 0; min-height: 38px; grid-template-columns: 22px 1fr; padding-inline: 8px; }
  .chapter-link::before { left: 0; bottom: auto; width: 2px; height: 0; }
  .chapter-link.active::before { width: 2px; height: 22px; }
  .booklet-stage { height: auto; min-height: 0; border-radius: 14px; }
  .book-pages { bottom: var(--mobile-controls-height); }
  .page { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .page-inner { padding: 26px 30px calc(38px + var(--safe-bottom)); }
  .stage-controls {
    height: var(--mobile-controls-height);
    padding: 0 max(14px, var(--safe-right)) var(--safe-bottom) 14px;
  }
}
