/* RISE Guides. Colors and fonts from therisecollection.co (#0b0b0b ground, Pixelify Sans,
   Inter, source code labels, red accent). Booklet layout from design direction A.
   With JS on, a booklet fits the screen: header, page (or spread) and pager are all in
   view, so Prev and Next never need a scroll. Without JS every page shows in order. */
:root {
  --ground: #0b0b0b;
  --ink: #111;
  --paper: #fff;
  --red: #d40000;
  --muted: #444;
  --rule: #cfcfcf;
  --display: 'Pixelify Sans', system-ui, sans-serif;
  --body: Inter, -apple-system, system-ui, sans-serif;
  --mono: 'Source Code Pro', 'SF Mono', Menlo, Consolas, monospace;
  --head-h: 64px;
  --pager-h: 64px;
}
* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: #fff; font-family: var(--body); line-height: 1.5; }
img { max-width: 100%; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; color: #111; padding: 10px 14px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }

/* site header and footer */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: var(--head-h); padding: 6px max(16px, calc((100% - 1200px) / 2)); border-bottom: 1px solid #222; }
.brand { display: flex; align-items: center; text-decoration: none; min-height: 44px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: clamp(19px, 2.6vw, 30px); letter-spacing: .02em; }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #ddd; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: #fff; }
.crumbs [aria-current] { color: #ff6b6b; }
.site-foot { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px 16px 40px;
  border-top: 1px solid #222; font-size: 13px; color: #bbb; font-family: var(--mono); letter-spacing: .06em; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; color: #fff; }

/* the booklet: base (no JS) layout, pages stacked */
.book-wrap { padding: 32px 16px 56px; }
.book { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.page { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; min-height: 600px;
  background: var(--paper); color: var(--ink); padding: 24px 22px 20px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.page[hidden] { display: none; }
.rh { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); padding-bottom: 7px; flex: 0 0 auto; }
.h { font-family: var(--display); font-size: 32px; font-weight: 700; line-height: 1.05; margin: 16px 0 12px; }
.h--big { font-size: 40px; margin-top: 4px; }
.h2, .sec--next .h { font-family: var(--display); font-size: 23px; font-weight: 700; margin: 14px 0 8px; }
.sec { margin-bottom: 16px; }
.pn { flex: 0 0 auto; margin-top: auto; width: 34px; height: 34px; background: var(--ink); color: #fff; font-family: var(--mono);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pn--odd { align-self: flex-end; }

/* sections */
.lede { font-size: 18px; font-weight: 500; line-height: 1.5; margin: 0; }
.story { display: flex; gap: 20px; align-items: flex-start; }
.story .lede { flex: 1; }
.story .shot { width: 38%; max-width: 180px; object-fit: cover; border: 3px solid var(--ink); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; margin: 0 0 10px; }
.num { flex: 0 0 26px; height: 26px; background: var(--red); color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  text-align: left; padding: 8px 12px; font-weight: 600; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:nth-child(even) td { background: #f3f3f3; }
.tbl td.mono { font-size: 12px; overflow-wrap: break-word; }
.band { display: block; width: 100%; height: 120px; object-fit: cover; object-position: center 45%; border: 3px solid var(--ink); margin-top: 16px; }
.qa { margin: 0; }
.qa dt { font-weight: 700; font-size: 15px; margin: 14px 0 4px; }
.qa dd { margin: 0; font-size: 15px; }
.code { background: var(--ink); color: #fff; font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 14px 16px; margin: 14px 0 0;
  white-space: pre; overflow-x: auto; }
.code .verb { color: #ff8a8a; }

/* controls diagram: tap zones drawn over the real in-play screenshot */
.ctl { margin: 0; }
.ctl-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ctl-side { width: 96px; font-size: 13px; line-height: 1.35; }
.ctl-side--left { text-align: right; }
.zl { display: flex; flex-direction: column; margin: 6px 0; }
.zl strong { font-size: 14px; }
.ctl-phone { --ph: 270px; position: relative; flex: 0 0 auto; height: var(--ph); width: calc(var(--ph) * .48);
  border: 6px solid var(--ink); border-radius: 20px; overflow: hidden; }
.ctl-phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.zone { position: absolute; border: 3px dashed var(--red); }
.zone--left { left: 3px; top: 3px; bottom: 3px; width: calc(50% - 5px); }
.zone--right { right: 3px; top: 3px; bottom: 3px; width: calc(50% - 5px); }
.zone--top { left: 3px; right: 3px; top: 3px; height: calc(50% - 5px); }
.zone--bottom { left: 3px; right: 3px; bottom: 3px; height: calc(50% - 5px); }
.zone--full { inset: 3px; }
.ctl-other { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; text-align: center; font-size: 13px; }
.ctl figcaption { font-family: var(--mono); text-align: center; font-size: 13px; margin-top: 8px; color: #333; }

/* cover, contents, back cover */
.page--cover { padding: 0; }
.cover-band, .back-foot { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.cover-band { flex: 0 0 auto; background: var(--ink); color: #fff; height: 50px; padding: 0 22px; }
.cover-body { padding: 22px 22px 0; min-height: 0; display: flex; flex-direction: column; }
.cover-title { font-family: var(--display); font-size: clamp(36px, 10vw, 58px); font-weight: 700; line-height: .98; margin: 0; }
.cover-sub { font-family: var(--mono); color: var(--red); font-size: 14px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; margin: 10px 0 16px; }
.cover-art { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 4px solid var(--ink); min-height: 0; }
.cover-icon-big { display: block; width: 160px; height: 160px; border-radius: 34px; }
.cover-foot { flex: 0 0 auto; margin-top: auto; padding: 16px 22px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cover-icon { width: 56px; height: 56px; border-radius: 12px; }
.seal { font-family: var(--mono); border: 2px solid var(--ink); padding: 9px 12px; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.toc { margin: 12px 0 16px; }
.toc a { display: flex; align-items: flex-end; min-height: 44px; font-size: 17px; font-weight: 500; text-decoration: none; padding-bottom: 6px; }
.toc a:hover span:first-child { color: var(--red); text-decoration: underline; }
.dots { flex: 1; border-bottom: 2px dotted #999; margin: 0 10px 6px; }
.page--back .h { margin-top: 0; }
.bl { font-size: 15px; margin: 0 0 10px; }
.lbl { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--ink); color: #fff; text-decoration: none;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.btn:hover { background: var(--red); }
.strip { display: flex; gap: 12px; margin-bottom: 16px; }
.strip img { width: calc((100% - 24px) / 3); max-width: 132px; aspect-ratio: 132 / 286; object-fit: cover; border: 3px solid var(--ink); }
.back-foot { flex: 0 0 auto; margin-top: auto; border-top: 2px solid var(--ink); padding-top: 14px; }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 560px; margin: 18px auto 0; }
.pager[hidden] { display: none; }
.pbtn { width: 48px; height: 48px; border: 1px solid #4a4a4a; background: #161616; color: #fff; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pbtn:disabled { opacity: .35; cursor: default; }
.ptxt { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: #c8c8c8; text-transform: uppercase; }

/* JS on: the booklet fits the screen. Page height = screen minus header and pager. Art and
   diagrams scale with the page (cqh = 1% of page height); text stays at its size, and a page
   whose text cannot fit is split into two pages in the guide data. A page only scrolls inside
   itself on very short screens (a phone held sideways). */
.js .booklet .site-head { height: var(--head-h); flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
.js .booklet .book-wrap { height: calc(100vh - var(--head-h)); height: calc(100svh - var(--head-h)); display: flex; flex-direction: column;
  padding: 10px 12px 0; }
.js .booklet .book { flex: 1 1 auto; min-height: 0; flex-direction: row; justify-content: center; align-items: stretch; gap: 0; }
.js .booklet .page { height: 100%; min-height: 0; overflow-y: auto; container-type: size; }
.js .booklet .pager { flex: 0 0 var(--pager-h); height: var(--pager-h); margin: 0 auto; }
.js .booklet .cover-art { max-height: 40cqh; }
.js .booklet .cover-icon-big { width: min(160px, 30cqh); height: min(160px, 30cqh); }
.js .booklet .ctl-phone { --ph: min(300px, 40cqh); }
.js .booklet .story .shot { max-height: 55cqh; }
.js .booklet .band { height: min(120px, 13cqh); }
.js .booklet .strip img { max-height: 28cqh; }
@media (max-width: 640px) {
  .js .booklet .crumbs span { display: none; }
}

/* wide screens: two-page spreads with the center fold and two staples */
@media (min-width: 1100px) {
  :root { --head-h: 72px; }
  .book-wrap { padding: 48px 24px 64px; }
  .page { width: 520px; max-width: none; min-height: 740px; padding: 32px 40px 24px; }
  .page--cover { padding: 0; }
  .cover-band { padding: 0 28px; height: 54px; }
  .cover-body { padding: 28px 40px 0; }
  .cover-foot { padding: 16px 40px 28px; }
  .h { font-size: 38px; }
  .h--big { font-size: 44px; }
  .ctl-phone { --ph: 300px; }
  .ctl-side { width: 110px; }
  .pager { max-width: 1040px; justify-content: center; gap: 18px; }
  .pbtn { width: 44px; height: 44px; }
  .js .booklet .book-wrap { padding: 16px 24px 0; }
  .js .booklet .book { position: relative; }
  .js .booklet .page { width: auto; max-width: calc(50vw - 24px); aspect-ratio: 520 / 740; box-shadow: none; }
  .js .booklet .book { filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .6)); }
  .js .booklet .book.is-spread::before { content: ''; position: absolute; left: calc(50% - 1px); top: 0; bottom: 0; width: 2px; background: var(--rule); z-index: 1; }
  .js .booklet .book.is-spread::after { content: ''; position: absolute; left: calc(50% - 3px); top: 0; bottom: 0; width: 6px; z-index: 2;
    background: linear-gradient(#7a7a7a, #7a7a7a) 0 23% / 6px 34px no-repeat, linear-gradient(#7a7a7a, #7a7a7a) 0 72% / 6px 34px no-repeat; }
  .js .booklet .ctl-phone { --ph: min(300px, 40cqh); }
}

/* the shelf */
.shelf-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 16px 72px; }
.shelf-title { font-family: var(--display); font-size: clamp(40px, 7vw, 64px); margin: 0 0 8px; }
.shelf-group { margin-top: 36px; }
.shelf-h { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #c8c8c8; margin: 0 0 16px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.mini { position: relative; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); text-decoration: none;
  min-height: 400px; padding-bottom: 70px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); transition: transform .15s ease; }
.mini:hover { transform: translateY(-4px); }
.mini-band { display: flex; align-items: center; background: var(--ink); color: #fff; height: 40px; padding: 0 14px;
  font-family: var(--display); font-weight: 700; font-size: 14px; }
.mini-title { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; padding: 16px 14px 0; }
.mini-sub { font-family: var(--mono); color: var(--red); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 8px 14px 12px; }
.mini-art { display: block; margin: 0 14px; width: calc(100% - 28px); aspect-ratio: 16 / 10; object-fit: cover; border: 3px solid var(--ink); }
.mini-icon { display: block; margin: 0 14px; width: 110px; height: 110px; border-radius: 24px; }
.mini-seal { position: absolute; left: 14px; bottom: 16px; font-family: var(--mono); border: 2px solid var(--ink); padding: 7px 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
@media (prefers-reduced-motion: reduce) { .mini { transition: none; } .mini:hover { transform: none; } }

/* landscape games: the phone lies on its side */
.ctl-phone--landscape { height: calc(var(--ph) * .5); width: calc(var(--ph) * .72); }
.ctl-phone--landscape img { object-position: center; }
.code:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }

/* short pages (small laptops, small phones): tighter spacing, same text sizes */
@container (max-height: 660px) {
  .h { font-size: 28px; margin: 10px 0 8px; }
  .h--big { font-size: 34px; }
  .tbl th, .tbl td { padding: 6px 10px; }
  .steps li { margin-bottom: 6px; }
  .toc a { min-height: 40px; }
  .qa dt { margin-top: 10px; }
}

/* fit mode: pictures take only the room the words leave, so a page never runs long */
.js .booklet .sec--text { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.js .booklet .story { flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: center; gap: 14px; }
.js .booklet .story .lede { flex: 0 0 auto; align-self: stretch; }
.js .booklet .story .shot { flex: 1 1 0; min-height: 0; width: auto; max-width: 100%; max-height: 420px; border: 0; object-fit: contain; }
.js .booklet .strip { flex: 1 1 0; min-height: 0; max-height: 286px; }
.js .booklet .strip img { height: 100%; width: auto; max-height: none; }
@container (max-height: 660px) {
  .lede { font-size: 16px; }
  .tbl { font-size: 13px; }
}
@container (max-height: 620px) {
  .tbl th, .tbl td { padding: 5px 8px; }
}

/* a page that scrolls inside itself (very short screens) is reachable by keyboard */
.page:focus-visible { outline: 3px solid #ffd23f; outline-offset: 3px; }
