:root {
  color-scheme: dark;
  --page: #141a2a;
  --panel: #1d2639;
  --dark: #101728;
  --line: #37435a;
  --text: #fff3df;
  --muted: #c5cada;
  --mint: #a2e0c8;
  --peach: #ffc18b;
  --font-heading: Georgia, "Times New Roman", serif;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--mint); text-underline-offset: .24em; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: wait; opacity: .72; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2 { font-family: var(--font-heading); font-weight: 700; text-wrap: balance; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3.25rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.48rem, 2.8vw, 2.25rem); letter-spacing: -.025em; }
p, figcaption, .prose li {
  text-align: justify;
  text-align-last: start;
  hyphens: auto;
  overflow-wrap: anywhere;
  line-height: 1.7;
  color: var(--muted);
}
p { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.skip { position: absolute; z-index: 6; inset: 5px auto auto 10px; transform: translateY(-180%); padding: 10px; background: var(--dark); }
.skip:focus { transform: none; }
.top { border-bottom: 1px solid #344058; background: #161e30; }
.top-inner { min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 700 1.64rem/1 var(--font-heading); letter-spacing: -.045em; min-height: 44px; }
.brand img { border-radius: 11px; }
.brand-dot { color: var(--peach); }
.top nav { display: flex; align-items: center; gap: 8px; }
.top nav a, .jump-links a, .after-player a {
  min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: .88rem;
}
.top nav a:hover, .jump-links a:hover, .after-player a:hover { background: #2b354b; color: var(--text); }
.top nav .play-link { color: var(--peach); animation: play-more-bounce 1s ease-in-out infinite both; will-change: transform; }
@keyframes play-more-bounce {
  0%, 100% { transform: translate3d(0, 0, 0); }
  40% { transform: translate3d(0, -8px, 0); }
  58% { transform: translate3d(0, -3px, 0); }
}
.button, .icon-button {
  border-radius: 10px; border: 1px solid var(--line); min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; padding: 8px 14px; font-weight: 700; text-decoration: none; color: var(--text); background: var(--panel);
  transition: background-color .18s, border-color .18s;
}
.install { justify-self: end; white-space: nowrap; font-size: .86rem; }
.button:hover, .icon-button:hover { border-color: var(--mint); background: #29384f; }
.primary { background: var(--peach); border-color: var(--peach); color: #291a21; }
.primary:hover { background: #ffe0b9; border-color: #ffe0b9; }
.secondary { background: #27334a; }
.icon-button { width: 44px; height: 44px; padding: 0; }
.icon-button[aria-pressed="true"] { color: var(--peach); border-color: var(--peach); }
#save[aria-pressed="true"] svg { fill: currentColor; }
.play-section { width: min(1120px, calc(100% - 40px)); margin-top: 24px; }
@media (min-width: 801px) {
  .play-section { width: min(1120px, calc(100% - 40px), max(730px, (100svh - 250px) * 16 / 9)); }
}
.game-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.game-heading h1 { margin-bottom: 5px; }
.game-heading p { color: var(--mint); font-size: .92rem; }
.page-actions, .player-actions { display: flex; gap: 6px; }
.player { border-radius: 17px; background: var(--dark); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 17px 48px #0004; }
.player-bar { display: flex; min-height: 53px; justify-content: space-between; align-items: center; padding: 4px 8px 4px 14px; gap: 6px; }
.player-bar > span { display: inline-flex; gap: 8px; align-items: center; font-size: .83rem; font-weight: 700; white-space: nowrap; }
.player-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.viewport { width: 100%; aspect-ratio: 16 / 9; position: relative; background: #151929; }
.launch-cover, .launch-cover::after, .viewport iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.launch-cover img { width: 100%; height: 100%; object-fit: cover; }
.launch-cover::after { content: ""; background: linear-gradient(90deg, #10162ad9, #10162a55 49%, transparent 75%); pointer-events: none; }
.cover-copy { position: absolute; z-index: 1; inset: 0 auto 0 6.5%; display: flex; flex-direction: column; align-items: start; justify-content: center; gap: clamp(5px, 2vw, 22px); }
.cover-copy > span { color: var(--mint); font-weight: 750; font-size: clamp(.67rem, 1.4vw, .84rem); letter-spacing: .11em; text-transform: uppercase; }
.cover-copy strong { font: 700 clamp(1.45rem, 5.5vw, 4.7rem)/.97 var(--font-heading); letter-spacing: -.05em; }
.cover-copy .button { margin-top: 4px; }
.player:fullscreen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; place-items: center; background: var(--dark); }
.player:fullscreen > .player-bar, .player:fullscreen > .player-status { width: 100%; }
.player:fullscreen .viewport { align-self: center; width: min(100%, (100dvh - 104px) * 16 / 9); }
.player-status { margin: 0; padding: 8px 14px; font-size: .85rem; }
.after-player { min-height: 49px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.after-player span { color: var(--mint); font-size: .83rem; margin-left: auto; }
.reading { width: min(1050px, calc(100% - 40px)); padding: 30px 0 60px; }
.panel { border-radius: 18px; border: 1px solid var(--line); padding: clamp(16px, 4vw, 36px); background: var(--panel); }
.overview { background: linear-gradient(130deg, #24394a, var(--panel) 68%); }
.jump-links { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.jump-links a { border: 1px solid var(--line); color: var(--mint); }
.chapter { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); align-items: center; gap: clamp(22px, 4vw, 48px); padding-block: 32px; border-bottom: 1px solid var(--line); }
.chapter figure { margin: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.chapter figure a { display: block; border-radius: 15px 15px 0 0; }
.chapter figure img { width: 100%; aspect-ratio: 100 / 62; height: auto; object-fit: cover; border-radius: inherit; }
.chapter figcaption { padding: 9px 14px; font-size: .85rem; }
.calculator { margin-block: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.calculator form { display: grid; gap: 12px; }
.score-inputs, .score-result { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.score-inputs label { display: grid; gap: 6px; font-size: .87rem; font-weight: 650; }
.score-inputs select, .share-field input { min-height: 44px; width: 100%; border: 1px solid #657491; border-radius: 8px; padding: 6px 9px; color: var(--text); background: var(--dark); }
.score-result span { display: flex; flex-direction: column; justify-content: space-between; padding: 9px; border-radius: 9px; background: #14263a; color: var(--muted); font-size: .8rem; }
.score-result strong { color: var(--mint); font: 700 2rem/1.15 var(--font-heading); }
.faq { margin-top: 28px; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { padding: 12px 0; min-height: 44px; color: var(--text); font-weight: 700; }
.faq summary::marker { color: var(--mint); }
.faq details p { padding: 0 0 14px; }
.final-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 25px; margin-top: 30px; }
.prose section { margin-top: 26px; }
.prose h2 { font-size: 1.5rem; }
.info { min-height: 45vh; }
.footer { background: #101728; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)); gap: 28px; padding-block: 30px; }
.footer-grid nav h2 { font: 750 .87rem/1.5 system-ui, sans-serif; min-height: 24px; margin: 0; }
.footer-grid nav a { min-height: 44px; width: fit-content; display: flex; align-items: center; color: var(--muted); }
.footer-grid p { margin-top: 10px; font-size: .9rem; }
.copyright { padding-block: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
dialog { padding: 0; border: 1px solid #657491; border-radius: 17px; background: var(--panel); color: var(--text); width: min(470px, calc(100% - 30px)); max-height: calc(100dvh - 30px); }
dialog::backdrop { background: #080d19d9; }
.dialog-body { position: relative; padding: 24px; }
.dialog-body h2 { margin-right: 45px; }
.dialog-body > .icon-button { position: absolute; top: 10px; right: 10px; }
.dialog-body > .button { margin-block: 8px; }
.share-field { display: block; }
#art-dialog { width: min(1050px, calc(100% - 24px)); }
#art-dialog .dialog-body { padding-top: 62px; }
#art-dialog img { max-height: calc(100dvh - 130px); object-fit: contain; margin: auto; }
@media (max-width: 700px) {
  .wrap, .play-section, .reading { width: calc(100% - 28px); }
  .play-section { margin-top: 15px; }
  .top-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding-block: 5px; }
  .top nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; }
  .top nav a { padding-inline: 9px; }
  .install { grid-column: 2; grid-row: 1; }
  .chapter, .calculator, .final-cta { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
  .game-heading { align-items: start; flex-direction: column; gap: 7px; }
  .game-heading p { font-size: .84rem; }
  .game-heading { position: relative; }
  .page-actions { order: 2; }
  .cover-copy { inset-inline-start: 5%; }
  .cover-copy .button { padding-inline: 10px; }
  .footer-grid > :last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .footer-grid > :last-child h2 { grid-column: 1 / -1; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .top-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding-block: 0; min-height: 52px; }
  .top nav { grid-column: 2; grid-row: 1; }
  .install { grid-column: 3; grid-row: 1; }
  .play-section { margin-top: 8px; }
  .game-heading h1 { font-size: 1.7rem; }
  .play-section { width: min(calc(100% - 28px), max(360px, (100svh - 178px) * 16 / 9)); }
  .cover-copy strong { font-size: clamp(1.55rem, 7svh, 3rem); }
}
@media (max-width: 540px) and (max-height: 540px) and (orientation: landscape) {
  .top nav .guide-link, .top nav .faq-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .top nav .play-link { animation: none; }
  .button, .icon-button { transition: none; }
}
