/* www.kidori.com's stylesheet, as the site had it until 2026-11-01: a navy page, a column 600 pixels wide, the
   browser's own type. The rules down to "Recursive's pages" are that stylesheet's, unchanged. */

body {
  background-color: #0E1A2C;
  padding: 20px 40px;
  max-width: 600px;
  margin: auto;
}

body, a {
  color: #ffffff;
}

header {
  width: 100%;
  height: 20px;
}

.header-left {
  float:left;
  text-align: left;
}

.header-right {
  float:right;
  text-align: right;
}

.main {
  text-align: center;
}

.main, .content {
  margin-top: 40px;
  margin-bottom: 40px;
}

.download-badge {
  height: 48px;
}

.badge-link {
  text-decoration: none;
}

.social-icon {
  height: 16px;
  vertical-align: middle;
}

.centered {
  width: 100%;
  text-align: center;
  margin: auto;
}

.container {
  position: relative;
}

.slide {
  display: none;
}

.slide img {
  width: 60%;
  display:block;
  margin-left:auto;
  margin-right:auto;
}

/* Add a pointer when hovering over the thumbnail images */
.cursor {
  cursor: pointer;
}

/* Next & previous buttons */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 40%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

/* Container for image text */
.caption-container {
  text-align: center;
  padding: 2px 16px;
  color: white;
}

.row:after {
  content: "";
  display: table;
  clear: both;
}

/* Six columns side by side */
.column {
  float: left;
  width: 11.11%;
}

/* Add a transparency effect for thumnbail images */
.slide-thumbnail {
  opacity: 0.6;
}

.active,
.slide-thumbnail:hover {
  opacity: 1;
}

/* What the pages have that the site of 2021 hadn't. Its pictures now say their size, so that the page keeps their
   place while they load: each keeps its shape at the width the page gives it, and is no wider than the column, as
   the editor's example was on a phone. The slideshow's arrows are buttons, which the keyboard reaches, drawn as the
   links they were. And the press kit's table. */

/* The pages' type is the game's, as the user asked on 2026-11-26: the system's font, San Francisco on an iPhone,
   an iPad and a Mac, and elsewhere the system's own sans-serif, the stack the demo beside the site is set in
   (css/demo.css's --font). The site of 2021 had the browser's own, a serif. Smoothed as the demo's is, so that
   white text on the navy isn't heavier on a Mac than in the phone beside it. */

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.slide img, .slide-thumbnail, .content img {
  height: auto;
}

.content img {
  max-width: 100%;
}

button.prev, button.next {
  border: 0;
  background-color: transparent;
  font-family: inherit;
}

/* The slideshow's screenshots are the game's screens alone, on the page's navy, where the App Store's are set on
   white under their captions. A slide is a screen as wide as it was in its screenshot, under its caption as the
   slide's title, in the page's white, with room for a caption's two lines so that the screen stays in place from a
   slide to the next. A thumbnail is the screen in a tile, in the game's stage color, a little lighter than the
   page, which sets it apart from it; the tile of the slide shown, and the one under the pointer, is in the game's
   raised color, lighter again, with its screen as bright as the slide's. */

.slide {
  margin: 0;
}

.slide-title {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 2.4em;
  margin-bottom: 4px;
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
  line-height: 1.2;
}

.slide img {
  width: 50%;
}

.thumbnail {
  margin: 0 3px;
  padding: 10%;
  border-radius: 8px;
  background-color: #15233A;
}

.thumbnail img {
  display: block;
}

.thumbnail:hover, .thumbnail:has(.active) {
  background-color: #24375A;
}

.thumbnail:hover .slide-thumbnail {
  opacity: 1;
}

.content th {
  text-align: left;
  vertical-align: top;
  padding: 0 16px 8px 0;
}

/* A cell breaks a long address rather than widen the page on a phone. */
.content td {
  vertical-align: top;
  padding: 0 0 8px;
  overflow-wrap: anywhere;
}

/* A tutorial's two screens, side by side where there's room: the screen as it opens, and over its word, the screen
   with the solution. The pictures of 2021 had the word written in them. */
.screens {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.screens img {
  display: block;
}

.screens figure {
  margin: 0;
  text-align: center;
}

/* Recursive's pages: the site beside the demo. The site is the page as it was, in the column it had (.site has
   the body's box); the demo is a page of its own (play/), shown in a frame.

   On a computer's screen, 900 pixels wide and 524 tall or more, the demo stays at the window's right, in a phone,
   and the site scrolls in the middle of what the phone leaves. The phone is drawn once, a screen of 375 by 812
   pixels in its frame, and scaled to the window's height, from its own size down to 0.6 of it: the demo inside is
   laid out for the same screen at any scale. The shortest window that has it is the one a phone at 0.6 fits in.

   On a smaller screen, a phone's or a tablet's, one of the two shows at a time, by the switch at the top: two radio
   buttons (.view), which come before the switch and both parts, so that the stylesheet alone shows the one chosen.
   The demo then fills the screen under the switch, over the site, which keeps its place for the way back. */

.shell {
  padding: 0;
  max-width: none;
  --switch: 44px;
}

.site {
  padding: 20px 40px;
  max-width: 600px;
  margin: auto;
}

.phone-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The radio buttons themselves aren't shown: their labels are the switch. They stay in reach of the keyboard, and
   fixed to the screen, so that the page doesn't scroll to the one a tap on its label focuses. */
.view {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

/* The bar to the demo, on Recursive's page: on a small screen only, below. */
.demo-bar {
  display: none;
}

@media (min-width: 900px) and (min-height: 524px) {
  .shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  /* The column the site had, with its margins, in the middle of what the phone leaves. */
  .site {
    box-sizing: border-box;
    width: 100%;
    max-width: 680px;
    margin: 0;
    justify-self: center;
  }

  .view, .switch {
    display: none;
  }

  /* The phone's place: as tall as the window, as wide as the phone at its scale, with the page's margin on its
     right. The scale is what the window's height leaves, a number: a length over a length, as the tangent of the
     angle the two make. */
  .phone {
    --screen-width: 375px;
    --screen-height: 812px;
    --bezel: 10px;
    --margin: 12px;
    --phone-width: calc(var(--screen-width) + 2 * var(--bezel));
    --phone-height: calc(var(--screen-height) + 2 * var(--bezel));
    --scale: clamp(0.6, tan(atan2(100dvh - 2 * var(--margin), var(--phone-height))), 1);
    position: sticky;
    top: 0;
    width: calc(var(--phone-width) * var(--scale));
    height: 100dvh;
    padding-right: 40px;
  }

  /* The phone, laid out at its own size, then scaled from its corner into the middle of its place's height. */
  .phone-frame {
    position: absolute;
    top: calc(50% - var(--phone-height) * var(--scale) / 2);
    left: 0;
    box-sizing: content-box;
    width: var(--screen-width);
    height: var(--screen-height);
    border: var(--bezel) solid #000000;
    border-radius: 46px;
    background-color: #0E1A2C;
    box-shadow: 0 0 0 1px #5d6b82;
    overflow: hidden;
    transform-origin: 0 0;
    transform: scale(var(--scale));
  }

  /* The demo is the phone's whole screen, so that what it dims, it dims to the frame. The sensor's housing and the
     home indicator are drawn over it, and the frame says how much of the screen they take at its top and its
     bottom, which demo.js reads and the demo keeps clear of. */
  .phone-frame iframe {
    --inset-top: 30px;
    --inset-bottom: 12px;
  }

  .phone-frame::before, .phone-frame::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .phone-frame::before {
    top: 6px;
    width: 84px;
    height: 20px;
    border-radius: 10px;
    background-color: #000000;
  }

  .phone-frame::after {
    bottom: 4px;
    width: 120px;
    height: 4px;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.45);
  }
}

@media (max-width: 899.98px), (max-height: 523.98px) {
  /* A link to a part of the page, the tutorials' contents', stops under the switch. */
  html {
    scroll-padding-top: 52px;
  }

  .switch {
    position: sticky;
    top: 0;
    z-index: 2;
    box-sizing: border-box;
    height: var(--switch);
    padding: 6px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: #0E1A2C;
  }

  .switch label {
    display: grid;
    place-items: center;
    border: 1px solid #ffffff;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  .switch label:first-child {
    border-radius: 3px 0 0 3px;
  }

  .switch label:last-child {
    border-radius: 0 3px 3px 0;
  }

  #view-site:checked ~ .switch label[for="view-site"],
  #view-demo:checked ~ .switch label[for="view-demo"] {
    background-color: #ffffff;
    color: #0E1A2C;
  }

  #view-site:focus-visible ~ .switch label[for="view-site"],
  #view-demo:focus-visible ~ .switch label[for="view-demo"] {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
  }

  .phone {
    display: none;
    position: fixed;
    top: var(--switch);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    background-color: #0E1A2C;
  }

  #view-demo:checked ~ .phone {
    display: block;
  }

  .phone-frame {
    height: 100%;
  }

  /* The site doesn't scroll under the demo. */
  html:has(#view-demo:checked) {
    overflow: hidden;
  }

  /* The bar to the demo, which Recursive's page keeps at the screen's bottom while it shows the site: a panel in
     the color of the slideshow's tile under the pointer, with the hairline the phone's frame has on a computer's
     screen; a browser's window, as the page's glyphs are drawn; Play demo in your browser, the first two words
     bold, over the line the demo opens on, smaller; and the play button the demo opens on, a white circle, which
     pulses as that one does, a ring that grows out of it and fades, within the bar. A label of the switch's Demo:
     a tap shows the demo, where the bar isn't. It is the site's last part, which stays at the screen's bottom
     (sticky) until the page is scrolled to its end, where it rests under the badge, whatever its words' lines: as
     wide as the screen less its margins, wider than the column, and in its middle. It rises into place as the page
     opens. No rise and no ring where the system asks for less motion. */
  .demo-bar {
    position: sticky;
    bottom: 14px;
    box-sizing: border-box;
    width: min(420px, 100vw - 24px);
    margin: 0 0 -6px 50%;
    transform: translateX(-50%);
    padding: 10px 12px 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 30px;
    background-color: #24375A;
    box-shadow: 0 0 0 1px #5d6b82, 0 12px 28px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  #view-demo:checked ~ .site .demo-bar {
    display: none;
  }

  .demo-bar svg {
    display: block;
  }

  .demo-bar-glyph svg {
    width: 28px;
    height: 28px;
  }

  .demo-bar-text {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
    line-height: 1.3;
  }

  /* Where the title takes two lines, its second is the words that aren't bold, whole. */
  .demo-bar-where {
    white-space: nowrap;
  }

  .demo-bar-line {
    font-size: 13px;
    opacity: 0.64;
  }

  .demo-bar-play {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #0E1A2C;
  }

  .demo-bar-play svg {
    width: 20px;
    height: 20px;
  }

  /* On the narrowest phones, the words take the window's place. */
  @media (max-width: 359.98px) {
    .demo-bar-glyph {
      display: none;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .demo-bar {
      animation: bar-rise 0.5s 0.3s ease-out both;
    }

    .demo-bar-play {
      animation: bar-pulse 1.6s ease-out infinite;
    }
  }
}

@keyframes bar-rise {
  from {
    transform: translate(-50%, calc(100% + 40px));
  }
}

@keyframes bar-pulse {
  from {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  }

  75%, to {
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0);
  }
}

/* A shorter switch on the shortest screens, an iPhone SE's in Safari or a phone's on its side, where the demo's board
   needs the room. */
@media (max-height: 600px) {
  .shell {
    --switch: 36px;
  }

  .switch {
    padding: 4px 40px;
  }
}
