/* An app's own page, laid out like a game's page in a store: the screenshots first with a card
   beside them saying what it is and holding Play, then more about it. It wears the navy studio
   of style.css (load that first): the side card and the Play card are the only things that cast
   shadows, Live Teal is only on Play and on the chosen thumbnail, the app's suit colour is the
   band across its cards, Silkscreen only for labels of three words at most. */

/* ── The bar across the top: back to the start page, then the app as the crumb ── */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(clamp(20px, 4vw, 40px), env(safe-area-inset-right)) 0 max(clamp(20px, 4vw, 40px), env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 6px;
}
.brand img { width: 24px; height: 24px; border-radius: 6px; }
.brand:hover { color: var(--teal-hover); }
.crumb { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb::before { content: '›'; color: var(--faint); margin-right: 10px; }

.sheet {
  max-width: 1120px;
  margin-inline: auto;
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: max(40px, calc(24px + env(safe-area-inset-bottom)));
  padding-left: max(clamp(20px, 4vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(20px, 4vw, 40px), env(safe-area-inset-right));
}

/* ── The app's name ──────────────────────────────────────────────────────────── */
.intro { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 22px); }
/* An icon's own navy square would vanish on the page's navy: a hairline gives it its edge. */
.app-icon {
  width: clamp(64px, 9vw, 88px);
  height: clamp(64px, 9vw, 88px);
  border-radius: 22%;
  flex: none;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.intro h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tagline { color: var(--muted); font-style: italic; margin-top: 8px; font-size: 15.5px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.kinds .public { color: var(--leaf); }
.kinds .private { color: var(--muted); }
/* Play under the name, where a narrow screen shows it first (the side card's waits below the screenshots). */
.intro-play { display: none; max-width: 420px; }
.intro-play .play { margin-top: 0; }

/* ── Screenshots beside the side card; one column below 960 px ─────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-top: clamp(20px, 3vw, 28px);
}

.shots { position: relative; min-width: 0; }
/* One picture at a time: the track scrolls a whole slide per swipe, arrow or thumbnail. */
.track {
  position: relative;
  display: flex;
  aspect-ratio: 4 / 3;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 5%;
}
.slide a { display: block; height: 100%; border-radius: inherit; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
/* Phone shots come in pairs, top-aligned, each as tall as its share of a whole phone screen. */
.slide.pair { padding-top: 5.5%; }
.slide.pair a { height: 90%; display: flex; align-items: flex-start; }
.slide.pair img {
  width: auto;
  height: var(--h, 100%);
  border-radius: 10% / 4.6%;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.step {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(19, 29, 51, 0.92);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out, opacity 160ms ease-out;
}
.step svg { width: 18px; height: 18px; }
.step:hover { background: var(--lift); border-color: var(--line-hover); }
.stage { position: relative; }
.stage .step { transform: translateY(-50%); opacity: 0; }
.stage .step.prev { left: 12px; }
.stage .step.next { right: 12px; }
.stage:hover .step,
.stage .step:focus-visible { opacity: 1; }
@media (hover: none) { .stage .step { display: none; } }

.thumbs {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6%;
  width: 112px;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  opacity: 0.62;
  cursor: pointer;
  transition: opacity 160ms ease-out, border-color 160ms ease-out;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.pair { gap: 4px; padding: 7px 8px 0; }
.thumb.pair img { flex: 1; min-width: 0; object-position: top; border-radius: 5px 5px 0 0; }
.thumb:hover { opacity: 1; }
.thumb[aria-current='true'] { opacity: 1; border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }

/* ── The side card: what it is, the facts, and Play ──────────────────────────── */
/* Both take the app's suit colour from the page (body.suit-<colour>, style.css). */
.side-card,
.again {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sleeve-shadow);
}
.side-card::before,
.again::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--suit);
}
.side-card { padding: 28px 22px 22px; }
.blurb { font-size: 15px; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  align-items: baseline;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.facts dd { color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags li {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

/* Play: the page's one action, Live Teal, the Action face, 52px like Studio's Try it. */
.play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  margin-top: 20px;
  padding: 0 28px;
  border-radius: 9px;
  background: var(--teal);
  color: var(--teal-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: background 160ms ease-out, transform 120ms ease-out;
}
.play svg { width: 16px; height: 16px; flex: none; }
.play:hover { background: var(--teal-hover); }
.play:active { transform: translateY(1px); }
.play-note { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── More about it: the main column and Details beside it ─────────────────────── */
.more {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0 24px;
  align-items: start;
  margin-top: clamp(36px, 6vw, 56px);
}
.more > div > section + section,
.more > aside > section + section { margin-top: 40px; }
.more h2 {
  font-family: var(--label);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.prose { max-width: 66ch; }
.prose p + p { margin-top: 12px; }
.prose p { color: var(--ink); }

.rules { display: grid; gap: 10px; max-width: 66ch; list-style: none; counter-reset: rule; }
.rules li {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: var(--raised);
  border-radius: 10px;
  counter-increment: rule;
}
.rules li::before {
  content: counter(rule);
  flex: none;
  width: 14px;
  font-family: var(--display);
  font-weight: 700;
  color: var(--faint);
}
.rules + h3 { margin-top: 22px; }
.moves h3,
.rules + h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.moves { margin-top: 22px; max-width: 66ch; }
.moves ul { list-style: disc; padding-left: 20px; margin-top: 10px; color: var(--muted); }
.moves li + li { margin-top: 6px; }

/* Ways to play, or what an app does: tiles sitting flat on Raised Navy. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.tiles li {
  padding: 16px 16px 15px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tiles h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tiles p { margin-top: 6px; color: var(--muted); font-size: 14px; }

/* A group's games (Play's two pages): each with the top of its own screen, its line, and its
   name as a link straight to that game on Play. */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.games li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 4px 14px;
  padding: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.games img {
  grid-row: span 2;
  width: 56px;
  height: 121px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top;
}
.games h3 {
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.games h3 a { text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 4px; }
.games h3 a:hover { color: var(--teal); }
.games p { color: var(--muted); font-size: 14px; }

.news li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 2px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.news li:first-child { border-top: 0; padding-top: 0; }
.news time { color: var(--faint); font-size: 13px; padding-top: 2px; }
.news h3 { font-size: 15px; font-weight: 600; }
.news p { grid-column: 2; color: var(--muted); font-size: 14px; }

.details > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.details > div:first-child { border-top: 0; padding-top: 0; }
.details dt { flex: none; }
.details dd { text-align: right; font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ── The Play card at the end, and the way back ──────────────────────────────── */
.again {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(40px, 6vw, 56px);
  padding: 28px 24px 24px;
}
.again .app-icon { width: 64px; height: 64px; }
.again h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(21px, 2.4vw, 25px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.again p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.again .play { margin: 0 0 0 auto; flex: none; }
.back { margin-top: 24px; font-size: 14.5px; }
.back a { color: var(--muted); border-radius: 6px; }
.back a:hover { color: var(--ink); }

/* ── A phone: one column, and a bar with Play pinned to the bottom ──────────── */
.pinned {
  visibility: hidden;
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, 0.8);
  transform: translateY(110%);
  transition: transform 200ms ease-out, visibility 0s linear 200ms;
}
.pinned.shown { visibility: visible; transform: none; transition: transform 200ms ease-out; }
.pinned .app-icon { width: 36px; height: 36px; border-radius: 9px; }
.pinned .name { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned .play { margin: 0; height: 44px; padding: 0 22px; font-size: 15.5px; }

@media (max-width: 959px) {
  .hero,
  .more { grid-template-columns: minmax(0, 1fr); }
  .more > aside { margin-top: 40px; }
  .intro-play { display: block; margin-top: 18px; }
  .side-card .play-row,
  .side-card .play-note { display: none; }
}
@media (max-width: 759px) {
  .pinned { display: flex; }
  .sheet { padding-bottom: max(96px, calc(80px + env(safe-area-inset-bottom))); }
  .thumb { width: 84px; }
  .again { flex-wrap: wrap; }
  .again .play { width: 100%; margin-top: 4px; }
  .news li { grid-template-columns: minmax(0, 1fr); }
  .news p { grid-column: 1; }
}

/* ── Full screen: one picture as large as the window allows ───────────────────── */
.full {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #05070d; /* Studio's Game Screen, the ground under a picture of the game */
  color: var(--ink);
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}
.full[open] { display: grid; place-items: center; }
.full::backdrop { background: rgba(5, 8, 16, 0.6); }
/* The picture at its own shape, so the dark around it is the dialog: a click there closes it. */
.full img {
  max-width: calc(100% - 2 * max(16px, env(safe-area-inset-left)));
  max-height: calc(100% - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  user-select: none;
  -webkit-user-select: none;
}
.full .count {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.full .close { top: calc(10px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.full .step.prev { left: max(12px, env(safe-area-inset-left)); }
.full .step.next { right: max(12px, env(safe-area-inset-right)); }
.full .step:not(.close) { transform: translateY(-50%); }
@media (hover: none) { .full .step:not(.close) { display: none; } }
body:has(.full[open]) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .step,
  .thumb,
  .play,
  .pinned { transition: none; }
  .play:active { transform: none; }
}
