/* ==========================================================================
   OUR STORY (story.html only)
   A timeline on one sheet of paper: a pencil line down the page, five
   chapters along it. On a wide screen the line runs down the middle with
   each chapter's words on one side and two photographs on the other,
   swapping sides as it goes; on a phone it runs down the left with
   everything to its right. story.js draws the line in pencil as the page
   scrolls; without it a plain line stands in.
   ========================================================================== */

.tl {
  --lane: 46px;                                  /* room the line takes */
  --line-x: calc(var(--gutter) + 15px);          /* from the wrap's left edge */
  background-color: var(--cream); background-image: var(--paper);
  /* the banner above already has its own padding, so the top here is small */
  padding-block: clamp(8px, 4vw, 64px) clamp(130px, 15vw, 210px);  /* the heart sits in the foot */
}
.tl__wrap { position: relative; }

/* stand-in line until story.js has drawn the pencil one */
.tl__wrap::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1.5px;
  left: calc(var(--line-x) - .75px); background: rgba(74, 76, 71, .3);
}
.tl--drawn .tl__wrap::before { display: none; }
.tl__probe { position: absolute; top: 0; left: var(--line-x); width: 0; height: 0; }

/* the drawing (story.js): the line in a strip revealed by a sliding clip,
   and a small drawing for each circle and the heart */
.tl__ink { position: absolute; inset: 0; pointer-events: none; }
.tl__defs { position: absolute; width: 0; height: 0; }
.tl__reveal { position: absolute; overflow: hidden; will-change: transform; }
.tl__reveal-in { position: absolute; inset: 0; will-change: transform; }
.tl__reveal svg { display: block; overflow: visible; }
.tl__spot { position: absolute; overflow: visible; }
/* the checkpoints still to come: a ghosted circle and year for each */
.tl__ghost { transition: opacity .1s linear; }
.tl__ghost text { font-family: var(--display); font-size: 21px; fill: #8b8e88; }
.tl__ghost.is-gone { opacity: 0; }
/* the tool at the tip: .tl__tip is moved onto the end of the line every
   frame, and .tl__arm inside it leans (story.js sets rotate). The arm
   holds each tool's drawing, point at the origin; as the tip passes a
   year the old tool goes and the next one appears in its place. */
.tl__tip { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.tl__arm { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform, translate, rotate, scale; }   /* its own layer: the drawn tool rocks without being redrawn */
/* the line's reveal and the tool's travel, run by the compositor straight
   off the scroll position where the browser can (story.js sets the ends
   and the scroll range; see track()) */
@keyframes tlTrack {
  from { transform: translate3d(0, var(--tl-from), 0); }
  to   { transform: translate3d(0, var(--tl-to), 0); }
}
.tl__ink.is-scrolly .tl__reveal,
.tl__ink.is-scrolly .tl__reveal-in,
.tl__ink.is-scrolly .tl__tip {
  animation: tlTrack linear both;
  animation-timeline: scroll(root block);
  animation-range: var(--tl-a) var(--tl-b);
}
.tl__tool {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  opacity: 0; transition: opacity .06s linear;
}
.tl__tool.is-on { opacity: 1; transition: opacity .14s cubic-bezier(.32, .72, 0, 1); }
.tl__tool svg { position: absolute; left: -30px; top: -76px; overflow: visible; }
.tl__cursor { animation: tlBlink 1.05s steps(1) infinite; }
@keyframes tlBlink { 50% { opacity: 0; } }

/* the stone fills and catches the light only once it has been drawn */
.tl__shine { opacity: 0; transition: opacity .2s var(--ease); }
.tl__shine.is-on { opacity: 1; transition: opacity .7s var(--ease) 1.7s; }
.tl__spark { transform-box: fill-box; transform-origin: 50% 50%; animation: tlGlint 2.6s ease-in-out infinite; }
@keyframes tlGlint {
  0%, 60%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  75% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* the heart at the tip beats: two quick swells, then a rest */
.tl__beat { transform-box: fill-box; transform-origin: 50% 50%; animation: tlBeat 1.3s ease-in-out infinite; }
@keyframes tlBeat {
  0%, 40%, 100% { transform: scale(1); }
  12% { transform: scale(1.14); }
  26% { transform: scale(1.06); }
}

/* graphite, a little blue-grey the way pencil catches the light */
.tl__lead { fill: #43464a; opacity: .92; }
.tl__trace { fill: none; stroke: #43464a; stroke-width: .9; stroke-linecap: round; opacity: .4; }
.tl__mark {
  fill: none; stroke: #43464a; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke-dashoffset .95s cubic-bezier(.45, .05, .35, 1);
}

/* ---------- a chapter ---------- */
.tl__ch + .tl__ch { margin-top: clamp(80px, 11vw, 160px); }
.tl__ch { padding-left: var(--lane); }

.tl__years {
  margin: 0 0 .12em;
  font-family: var(--display); font-weight: 300;
  font-size: clamp(40px, 5.4vw, 76px); line-height: 1; letter-spacing: -0.015em;
  color: var(--dusty-deep);
}
.tl__title {
  font-size: clamp(26px, 3vw, 40px); font-weight: 400; line-height: 1.12;
  color: var(--ink); text-wrap: balance;
}
.tl__place {
  margin: 8px 0 0; color: var(--muted);
  font-size: clamp(15px, 1.25vw, 17px); line-height: 1.4;
}
.tl__body { margin-top: clamp(18px, 2vw, 26px); max-width: 46ch; }
.tl__body p { margin: 0; color: var(--ink); font-size: clamp(16px, 1.2vw, 17px); line-height: 1.65; }
.tl__body p + p { margin-top: 1em; }

/* ---------- two photographs, one overlapping the other ---------- */
.tl__photos {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 30px;
}
.tl__ph { margin: 0; grid-row: 1; will-change: transform; }
.tl__ph img { display: block; width: 100%; height: auto; }
.tl__ph--a { grid-column: 1 / 9; }
.tl__ph--b {
  grid-column: 6 / 13; align-self: start; margin-top: 46%; z-index: 1;
  border: 7px solid var(--cream);   /* a cut in the paper, not a shadow */
}

/* the third photograph, tucked under the other two, opens every photo
   from the chapter's years (story.js counts them into the tag) */
.tl__ph--c {
  grid-column: 2 / 7; grid-row: 2; align-self: start; margin-top: -16%; z-index: 2;
  border: 7px solid var(--cream);
}
.tl__more {
  position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tl__more img { transition: scale .6s var(--out); }
/* the tag is the site's glass button, the one used over the hero photo */
.tl__more-tag { position: absolute; left: 10px; bottom: 10px; padding-inline: 16px; letter-spacing: .2em; white-space: nowrap; }
/* on a phone the third photo is wider, so the button fits on it */
@media (max-width: 859.98px) {
  .tl__ph--c { grid-column: 2 / 11; margin-top: -10%; }
}
@media (hover: hover) {
  .tl__more:hover img { scale: 1.05; }
  .tl__more:hover .tl__more-tag {
    background: rgba(255,255,255,.95); color: var(--ink);
    backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  }
}
.tl__more:focus-visible { outline: 2px solid var(--dusty-deep); outline-offset: 3px; }

/* ---------- wide: the line down the middle ---------- */
@media (min-width: 860px) {
  .tl { --lane: clamp(90px, 10vw, 140px); --line-x: 50%; }
  .tl__ch {
    padding-left: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) var(--lane) minmax(0, 1fr);
    align-items: start;
  }
  .tl__text { grid-column: 1; grid-row: 1; justify-self: end; width: min(100%, 440px); }
  .tl__photos { grid-column: 3; grid-row: 1; margin-top: clamp(10px, 3vw, 40px); }
  .tl__ch:nth-of-type(even) .tl__text { grid-column: 3; justify-self: start; }
  .tl__ch:nth-of-type(even) .tl__photos { grid-column: 1; }
  .tl__ch:nth-of-type(even) .tl__ph--a { grid-column: 5 / 13; }
  .tl__ch:nth-of-type(even) .tl__ph--b { grid-column: 1 / 8; }
  .tl__ch:nth-of-type(even) .tl__ph--c { grid-column: 7 / 12; }
}

/* ==========================================================================
   THE CAROUSEL (opened from a chapter's third photo)
   One photo in the middle, its neighbours peeking in either side, dimmed
   and a touch smaller, and every photo as a square thumbnail along the
   bottom. story.js moves the row: it follows a finger, stretches with
   resistance past either end and springs back, and settles on a photo.
   ========================================================================== */
.reel {
  --slide: min(64vw, 560px);
  --gap: clamp(10px, 1.6vw, 22px);
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: #181915; color: var(--ivory);   /* solid: the cream page behind would read through any tint */
  opacity: 0; transition: opacity .35s var(--ease);
}
.reel.is-open { opacity: 1; }
.reel__bar {
  display: flex; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 6px;
}
.reel__title {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--display); font-size: clamp(19px, 2.4vw, 28px); line-height: 1.15; color: #fff;
}
.reel__count { margin: 0; white-space: nowrap; font-size: 13px; letter-spacing: .06em; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.reel__close {
  width: 44px; height: 44px; margin-right: -10px; border: 0; background: none;
  color: #fff; font-size: 30px; line-height: 1; cursor: pointer; opacity: .8;
}
.reel__close:hover { opacity: 1; }

.reel__view {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.reel__view.is-dragging { cursor: grabbing; }
.reel__track {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; gap: var(--gap);
  will-change: transform;
}
.reel__track.is-settling { transition: transform .55s cubic-bezier(.22, 1, .36, 1); }
.reel__slide {
  flex: 0 0 var(--slide); height: 100%; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.reel__cap {
  margin-top: 12px; max-width: 100%; padding: 0 12px; color: rgba(255, 255, 255, .85);
  font-size: 11px; letter-spacing: 0.15em; line-height: 1.5; text-transform: uppercase; text-align: center;
  opacity: 0; transition: opacity .3s var(--ease); pointer-events: none;
}
.reel__slide.is-here .reel__cap { opacity: 1; }

.reel__slide img {
  max-width: 100%; max-height: calc(100% - 60px); min-height: 0; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
  opacity: .42; scale: .9;
  transition: opacity .28s var(--ease), scale .4s cubic-bezier(.32, .72, 0, 1);
}
.reel__slide.is-here img { opacity: 1; scale: 1; }
.reel__slide:not(.is-here) { cursor: pointer; }

.reel__arrow {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 1;
  width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(24, 25, 21, .45); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), opacity .3s var(--ease);
}
.reel__arrow:hover { background: rgba(255, 255, 255, .95); color: var(--ink); }
.reel__arrow[disabled] { opacity: 0; pointer-events: none; }
.reel__arrow--prev { left: max(12px, calc(50% - var(--slide) / 2 - 76px)); }
.reel__arrow--next { right: max(12px, calc(50% - var(--slide) / 2 - 76px)); }

/* every photo, square, along the bottom */
.reel__thumbs {
  position: relative;   /* the frame is placed from the thumbnails' offsets */
  display: flex; gap: 6px; padding: 10px var(--gutter) max(16px, env(safe-area-inset-bottom));
  overflow-x: auto; scrollbar-width: none; overscroll-behavior: contain;
}
.reel__thumbs::-webkit-scrollbar { display: none; }
.reel__thumb {
  flex: 0 0 auto; width: 54px; height: 54px; padding: 0; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .06); opacity: .5;
  transition: opacity .18s var(--ease);
}
.reel__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* centred when they fit; when they don't, the row still scrolls from the
   very first one (plain justify-content: center would cut the start off) */
.reel__thumb:first-of-type { margin-left: auto; }
.reel__thumb:last-of-type { margin-right: auto; }
.reel__thumb:hover { opacity: .85; }
.reel__thumb.is-here { opacity: 1; }
/* one frame that slides to the current thumbnail, rather than an outline
   on each that fades out while the next fades in */
.reel__frame {
  position: absolute; left: 0; top: 0; pointer-events: none;
  border: 2px solid #fff;
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}
.reel__frame.is-placing { transition: none; }
.reel :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* phones swipe; the arrows would only sit on the photo */
@media (hover: none), (max-width: 640px) {
  .reel { --slide: 74vw; }
  .reel__arrow { display: none; }
  .reel__thumb { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .reel, .reel__slide img, .reel__track.is-settling { transition: none; }
}

/* ==========================================================================
   SUBSTRIKE (the high school game, opened from the 2015–2019 chapter)
   The game draws a 1920 x 1080 picture; the window scales it to fit,
   letterboxed on the night-sea colour of its own menus.
   ========================================================================== */
.tl__game { margin-top: 1em; }
.tl__game-play { margin-top: 18px; display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
/* The game's buttons (Play SubStrike, and Dive / Fire / Music / Exit in
   the game window), in the style of a Minecraft menu button, in the
   submarine's yellow: a blotchy pixel texture (button.png, scaled up with
   hard edges), a light bevel along the top and left and a dark one along
   the bottom and right, a dark gold outline with stepped pixel corners,
   and white pixel text (the game's own font, Kongtext) with a hard shadow.
   The outline is the button itself, cut to a stair-stepped shape; the
   textured face is a layer inside it cut the same way, so outline and
   bevels both step at the corners. Hover deepens the outline and turns
   the text pale yellow, as Minecraft's buttons do. */
@font-face { font-family: "Kongtext"; src: url("../games/substrike/kongtext.ttf") format("truetype"); font-display: swap; }
.pixel-btn {
  --s: 3px;   /* one pixel of the button's art */
  --steps: polygon(
    0 calc(var(--s) * 2), var(--s) calc(var(--s) * 2), var(--s) var(--s), calc(var(--s) * 2) var(--s), calc(var(--s) * 2) 0,
    calc(100% - var(--s) * 2) 0, calc(100% - var(--s) * 2) var(--s), calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(var(--s) * 2), 100% calc(var(--s) * 2),
    100% calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s) * 2) calc(100% - var(--s)), calc(100% - var(--s) * 2) 100%,
    calc(var(--s) * 2) 100%, calc(var(--s) * 2) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - var(--s) * 2), 0 calc(100% - var(--s) * 2));
  position: relative; isolation: isolate; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 24px; border: 0; border-radius: 0; cursor: pointer;
  font: 12px/1 "Kongtext", var(--body); letter-spacing: 0; text-transform: uppercase; white-space: nowrap;
  color: #fff; text-shadow: 2px 2px 0 #5c4300;
  background: #8a6614;   /* the outline: the sub's own dark gold, softer on the cream than black */
  clip-path: var(--steps);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pixel-btn::before {
  /* the face: textured, bevelled, stepped like the outline around it */
  content: ""; position: absolute; inset: var(--s); z-index: -1;
  /* the texture at one fixed scale (40 x 10 texels, ~4.6px each), tiled,
     so a tall button gets more of it rather than bigger blotches */
  background: #ffd800 url("../games/substrike/button.png") 0 0 / 184px 46px repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
  box-shadow: inset var(--s) var(--s) 0 0 #fff3a0, inset calc(var(--s) * -1) calc(var(--s) * -1) 0 0 #9c7400;
  clip-path: var(--steps);
}
@media (hover: hover) {
  .pixel-btn:hover { background: #5c4300; color: #ffffa0; }
}
.pixel-btn:active { translate: 1px 1px; }
.pixel-btn:active::before { box-shadow: inset var(--s) var(--s) 0 0 #9c7400, inset calc(var(--s) * -1) calc(var(--s) * -1) 0 0 #fff3a0; }
.pixel-btn:focus-visible { outline: 2px solid #0094ff; outline-offset: 4px; }
.pixel-btn[disabled] { opacity: .6; cursor: progress; }
.pixel-btn--sm { height: 40px; padding: 0 16px; font-size: 10px; }

/* the game's own submarine on the page, no backdrop: its 4-frame sprite
   strip playing so the propeller turns, riding as if on water and
   trailing bubbles. Hover spins it up and nudges it forward; a tap plays. */
.tl__game-sub {
  --win: clamp(112px, 10vw, 136px);
  position: relative; flex: none; display: block;
  width: var(--win); aspect-ratio: 320 / 172; cursor: pointer;
}
.tl__sub {
  position: absolute; inset: 0;
  animation: tlRide 3.4s ease-in-out infinite;
}
.tl__sub-body {
  position: absolute; inset: 0;
  background: url("../games/substrike/sub.png") 0 0 / 400% 100% no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
  animation: tlProp .2s steps(4) infinite;
  transition: translate .5s cubic-bezier(.34, 1.56, .64, 1);
}
/* the Easter-egg torpedo: launched from under the sub (which sits above
   it), out past its nose and off the page to the right */
.tl__torpedo {
  position: absolute; left: 0; z-index: 0; height: auto; pointer-events: none;
  image-rendering: pixelated; image-rendering: crisp-edges; will-change: transform;
}
.tl__sub { z-index: 1; }
@keyframes tlProp { to { background-position-x: 133.333%; } }
@keyframes tlRide {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3px, -4px) rotate(-3deg); }
  50% { transform: translate(5px, -1px) rotate(1deg); }
  75% { transform: translate(1px, -5px) rotate(-2deg); }
}
/* bubbles leave the propeller and rise behind the sub as they fade */
.tl__sub i {
  position: absolute; left: 2%; top: 46%;
  width: 5px; height: 5px; border-radius: 50%;
  border: 1.2px solid rgba(70, 140, 200, .7); background: rgba(160, 210, 240, .3);
  opacity: 0; animation: tlBubble 2.2s ease-out infinite;
}
.tl__sub i:nth-of-type(2) { animation-delay: .55s; width: 3px; height: 3px; }
.tl__sub i:nth-of-type(3) { animation-delay: 1.1s; width: 6px; height: 6px; }
.tl__sub i:nth-of-type(4) { animation-delay: 1.65s; width: 4px; height: 4px; }
@keyframes tlBubble {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-20px, -26px) scale(1.15); }
}
@media (hover: hover) {
  .tl__game-sub:hover .tl__sub-body { translate: 6px 0; animation-duration: .08s; }
}
@media (prefers-reduced-motion: reduce) {
  .tl__sub, .tl__sub-body { animation: none; }
  .tl__sub i { display: none; }
}
/* a phone's column is narrow: a smaller window and a tighter button share it */
@media (max-width: 480px) {
  .tl__game-sub { --win: 96px; }
  .tl__play { font-size: 11px; height: 50px; padding-inline: 17px; }
}
.ss {
  position: fixed; inset: 0; z-index: 210;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; color: var(--ink);
  background-color: var(--cream); background-image: var(--paper);   /* the site's own paper */
  opacity: 0; transition: opacity .3s var(--ease);
}
.ss.is-open { opacity: 1; }
.ss__stage {
  position: relative; isolation: isolate;
  width: min(calc(100vw - 48px), calc((100vh - 250px) * 16 / 9));   /* room for Exit above, the note and hint below */
  aspect-ratio: 16 / 9;
}
@supports (height: 100svh) {
  .ss__stage { width: min(calc(100vw - 48px), calc((100svh - 250px) * 16 / 9)); }
}
/* a pixel frame round the game, two rings in the buttons' style: the dark
   gold outline, then the textured yellow, both with stepped corners. They
   sit behind the canvas and show only round its edge. */
.ss__stage::before,
.ss__stage::after {
  --s: 4px;
  content: ""; position: absolute; z-index: -1;
  clip-path: polygon(
    0 calc(var(--s) * 2), var(--s) calc(var(--s) * 2), var(--s) var(--s), calc(var(--s) * 2) var(--s), calc(var(--s) * 2) 0,
    calc(100% - var(--s) * 2) 0, calc(100% - var(--s) * 2) var(--s), calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(var(--s) * 2), 100% calc(var(--s) * 2),
    100% calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s) * 2) calc(100% - var(--s)), calc(100% - var(--s) * 2) 100%,
    calc(var(--s) * 2) 100%, calc(var(--s) * 2) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - var(--s) * 2), 0 calc(100% - var(--s) * 2));
}
.ss__stage::before { inset: -12px; background: #8a6614; }
.ss__stage::after {
  inset: -8px;
  background: #ffd800 url("../games/substrike/button.png") 0 0 / 184px 46px repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
  box-shadow: inset 4px 4px 0 0 #fff3a0, inset -4px -4px 0 0 #9c7400;
}
.ss__canvas { display: block; width: 100%; height: 100%; background: #0a2ce0; touch-action: none; cursor: crosshair; }
/* a line about the game under the screen, set like the story's own
   paragraphs */
.ss__note {
  margin: 22px auto 0; max-width: 52ch; text-align: center;
  font-family: var(--body); font-size: clamp(16px, 1.2vw, 17px); line-height: 1.65; color: var(--ink);
}
.ss__hint { margin: 10px 0 0; font: 10px/1.6 "Kongtext", var(--body); letter-spacing: 0; color: #8a6614; text-align: center; text-transform: uppercase; }
.ss__close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 2; }
.ss :focus-visible { outline: 2px solid #0094ff; outline-offset: 3px; }
/* a phone held sideways: Dive and Fire over the game's lower corners, as
   the game's pixel buttons */
.ss__touch {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; padding: 0 3% 4%; pointer-events: none;
}
.ss__touch .pixel-btn { pointer-events: auto; min-width: 104px; height: 56px; touch-action: none; }
.ss { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* held upright, Game Boy style: the game spans the full width at the top
   and the controls sit as a compact group in the middle of the space
   below it, as the game's pixel buttons: Dive and Fire side by side,
   Music across under them.
   They stay put on the menus, dimmed, so nothing jumps when play starts. */
@media (hover: none) and (orientation: portrait) {
  .ss { justify-content: flex-start; padding: calc(max(8px, env(safe-area-inset-top)) + 48px) 0 0; }
  .ss__stage { width: calc(100vw - 32px); margin-top: 12px; }
  .ss__touch, .ss__hint { display: none; }
  .ss__note { margin-top: 18px; padding-inline: 24px; font-size: 16px; }
  .ss__deck {
    flex: 1; width: min(100%, 360px); min-height: 0; margin-inline: auto;
    display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 14px;
    padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  }
  .ss__deck .pixel-btn { height: 96px; font-size: 14px; touch-action: none; }
  .ss__deck [data-act="music"] { grid-column: 1 / -1; grid-row: 2; height: 44px; font-size: 11px; }
  .ss__deck.is-idle .pixel-btn { opacity: .4; pointer-events: none; }
}
@media not all and (hover: none) and (orientation: portrait) {
  .ss__deck { display: none; }
}
/* a phone held sideways: the game takes the whole screen */
@media (hover: none) and (orientation: landscape) {
  .ss { padding: 0; }
  .ss__hint { display: none; }
  .ss__stage { width: min(calc(100vw - 32px), calc((100vh - 28px) * 16 / 9)); }
  @supports (height: 100svh) { .ss__stage { width: min(calc(100vw - 32px), calc((100svh - 28px) * 16 / 9)); } }
  .ss__close { top: 6px; right: 6px; height: 34px; padding: 0 10px; font-size: 9px; }
  .ss__note { display: none; }   /* the game fills the screen */
}
