/* ==========================================================================
   Sections 2 to 4, in page order: the import path, what you get, co-op.
   (Privacy, downloads, questions, the closing band and the footer are in
   sections-lower.css.) Night and parchment alternate; nothing here is a
   uniform card grid.
   ========================================================================== */

/* ---- 2. Import: the game's map, three stops on one path ----------------------- */
.route {
  --route-gap: clamp(20px, 3vw, 56px);
  /* The game's map symbols are small (their ink is 60-90px of a 128px
     picture), so the badge is sized to them, not the other way round. */
  --route-badge: 76px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 0.9fr);
  gap: var(--route-gap);
}
/* The path: a dashed ink line, like the map's. Each stop draws its own
   stretch, from the middle of its icon to the start of whatever comes next,
   so the last one leads into the call at the end of the row. */
.route-stop::before {
  content: "";
  position: absolute;
  top: calc(var(--route-badge) / 2 - 2px);
  right: calc(var(--route-gap) * -1);
  left: calc(var(--route-badge) / 2);
  border-top: 4px dashed var(--v-on-paper);
  opacity: 0.55;
}
.route-stop {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-content: start;
  align-items: end;
  row-gap: 10px;
}
/* Each icon sits in an inked badge, like a node on the game's map: a
   container of its own, so it never reads as a cut-out on the page. */
.route-badge {
  position: relative;
  display: grid;
  grid-column: 1;
  place-items: center;
  width: var(--route-badge);
  height: var(--route-badge);
  border: var(--v-outline);
  border-radius: 50%;
  background: var(--v-paper-2);
  box-shadow: var(--v-shadow);
}
.route-icon {
  width: 64px;
  height: 64px;
}
.route-num {
  position: relative;
  grid-column: 2;
  align-self: center;
  justify-self: start;
  padding: 0 14px 4px;
  border: var(--v-outline);
  border-radius: var(--v-radius-pill);
  background: var(--v-paper);
  box-shadow: var(--v-shadow-sm);
  font-family: var(--v-font-display);
  font-size: 2.5rem;
  font-weight: var(--v-display-weight);
  line-height: 1;
}
.route-stop h3,
.route-stop p {
  grid-column: 1 / -1;
}
.route-stop h3 {
  font-family: var(--v-font-heading);
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2.125rem);
  font-weight: 800;
  line-height: 1.05;
}
.route-stop p {
  max-width: 30rem;
  color: var(--v-on-paper-2);
  font-size: var(--t-lg);
}
/* Where the path ends: a way in. */
.route-end {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: var(--s-5);
  border: var(--v-outline);
  border-radius: var(--v-radius-lg);
  background: var(--v-paper-2);
  box-shadow: var(--v-shadow-lg);
}
.route-end h3 {
  font-family: var(--v-font-heading);
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2.125rem);
  font-weight: 800;
  line-height: 1.05;
}
.route-end p {
  margin-bottom: 6px;
  color: var(--v-on-paper-2);
  font-size: var(--t-lg);
}
.route-stop code {
  padding: 1px 6px;
  border: 1.5px solid var(--v-on-paper);
  border-radius: 6px;
  background: var(--v-paper-2);
  color: var(--v-on-paper);
}

.paths {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  border: var(--v-outline);
  border-radius: var(--v-radius-lg);
  background: var(--v-paper-2);
  box-shadow: var(--v-shadow-lg);
}
.paths-title {
  font-family: var(--v-font-heading);
  font-size: var(--t-xl);
  font-weight: 800;
  line-height: 1.1;
}
.paths-list {
  display: grid;
  gap: 8px;
}
.paths-list div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.paths-list dt {
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.paths-list dd {
  min-width: 0;
}
.paths-list code {
  overflow-wrap: normal;
  font-size: var(--t-sm);
  font-weight: 600;
}

/* ---- 3. What you get: one framed picture and a button per screen -------------- */
.viewer {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 40px);
  align-items: stretch;
}
/* The six buttons share the picture's height, so both columns end together.
   Rows keep their own height and split what is left over; equal (1fr) rows
   would all grow to the tallest button and stand taller than the picture. */
.viewer-tabs {
  display: grid;
  align-self: stretch;
  gap: 12px;
}
.viewer-tab {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 12px 16px 12px 18px;
  border: var(--v-outline);
  border-left-width: 10px;
  border-radius: var(--v-radius-md);
  background: var(--v-surface-1);
  box-shadow: var(--v-shadow-sm);
  color: var(--v-text);
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-1) ease;
}
.viewer-tab strong {
  font-family: var(--v-font-heading);
  font-size: var(--t-xl);
  font-weight: 800;
  line-height: 1.1;
}
.viewer-tab span {
  text-wrap: balance;
  color: var(--v-text-2);
  font-size: var(--t-sm);
  line-height: 1.4;
}
.viewer-tab:hover {
  background: var(--v-surface-2);
  box-shadow: var(--v-shadow-pressed);
  transform: translate(var(--v-press), var(--v-press));
}
.viewer-tab.is-on {
  --focus: var(--v-accent);
  border-color: var(--v-ink);
  border-left-color: var(--v-accent);
  background: var(--v-paper);
  box-shadow: var(--v-shadow);
  color: var(--v-on-paper);
  transform: none;
}
.viewer-tab.is-on span {
  color: var(--v-on-paper-2);
}
.viewer-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--v-outline);
  border-radius: var(--v-radius-lg);
  background: var(--v-ink);
  box-shadow: var(--v-shadow-lg);
}
/* The beta label sits in the caption, beside the words it belongs to, so it
   never covers the picture. */
.viewer-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
/* The screen takes whatever height the buttons beside it need, so both
   columns end on one line. Its picture is never squashed: if the frame is
   taller than the picture's own shape it is cropped from the right. It fades
   out at the bottom, so the cut reads as "more below". */
.viewer-screen {
  --look-swap: 640ms;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: 1440 / 900;
  border-radius: calc(var(--v-radius-lg) - var(--v-outline-w)) calc(var(--v-radius-lg) - var(--v-outline-w)) 0 0;
  background: var(--v-bg);
}
.viewer-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  height: 48px;
  background: linear-gradient(transparent, var(--v-ink));
  opacity: 0.85;
  pointer-events: none;
}
.viewer-picture {
  position: absolute;
  inset: 0;
  display: block;
}
/* "Try me": the classic look lies on top, cut away to nothing at the left
   edge, and wipes across the new look (and back) behind an inked seam. */
.viewer-picture--classic {
  z-index: 1;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--look-swap) var(--ease-out);
}
.viewer-screen[data-look="classic"] .viewer-picture--classic {
  clip-path: inset(0 0 0 0);
}
/* The seam rides the wipe's edge: the layer is the screen's own width, so
   moving it by 100% carries the bar from the left edge to the right. */
.viewer-seam {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--look-swap) var(--ease-out),
    opacity var(--dur-2) ease;
}
.viewer-seam::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -5px;
  width: 10px;
  border-inline: var(--v-outline);
  background: var(--v-gold);
  box-shadow: 0 0 24px 6px rgb(255 210 74 / 0.45);
}
.viewer-screen[data-look="classic"] .viewer-seam {
  transform: translateX(100%);
}
.viewer-screen.is-swapping .viewer-seam {
  opacity: 1;
}
.viewer-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}
.viewer-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 12px 16px;
  border-top: var(--v-outline);
  border-radius: 0 0 calc(var(--v-radius-lg) - var(--v-outline-w)) calc(var(--v-radius-lg) - var(--v-outline-w));
  background: var(--v-surface-1);
  color: var(--v-text);
  font-size: var(--t-sm);
  font-weight: 600;
}
.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
/* Gold like the classic look it opens, tilted like the app's tags; it
   straightens as you reach for it. Once the classic look shows, it turns the
   new look's violet and offers the way back. */
.btn--try {
  background: var(--v-gold);
  color: var(--v-ink);
  font-family: var(--v-font-heading);
  font-size: var(--t-lg);
  letter-spacing: 0.01em;
  transform: rotate(-3deg);
}
.btn--try:hover {
  background: var(--v-gold);
  filter: brightness(1.06);
  transform: translate(var(--v-press), var(--v-press));
}
.btn--try:active {
  transform: translate(calc(var(--v-press) + 1px), calc(var(--v-press) + 1px));
}
.btn--try.is-on {
  background: var(--v-violet);
  transform: none;
}
.btn--try.is-on:hover {
  transform: translate(var(--v-press), var(--v-press));
}
.btn--try[aria-busy="true"] {
  cursor: progress;
}

.share {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 40px);
  align-items: center;
  margin-top: var(--s-section);
}
.share-copy {
  display: grid;
  gap: var(--s-4);
  justify-items: start;
}
.share-copy p {
  color: var(--v-text-2);
  font-size: var(--t-lg);
}
.share-link {
  position: relative;
  display: block;
  width: 100%;
  max-width: 900px;
  justify-self: center;
  border-radius: 20px;
}
.share-tag {
  position: absolute;
  top: -12px;
  left: -8px;
  z-index: 1;
}
.share-card {
  width: 100%;
  border: var(--v-outline);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--v-ink);
  transform: rotate(1.5deg);
}

/* ---- 4. Co-op: the steps, the real Play screen and the live ticket ------------ */
.coop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 390px);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.coop-main {
  display: grid;
  gap: var(--s-6);
  min-width: 0;
}
/* A real screenshot of the co-op screen on a phone, at the phone's own size
   (780px across, shown 390 wide), framed like the app pictures above. */
.play-shot {
  width: 100%;
  max-width: 390px;
  justify-self: end;
  overflow: hidden;
  border: var(--v-outline);
  border-radius: var(--v-radius-lg);
  background: var(--v-bg);
  box-shadow: 8px 8px 0 var(--v-ink);
}
/* The ledger's first row opens with 18px of padding: start the phone level
   with step 1, not above it. */
@media (min-width: 900px) {
  .play-shot {
    margin-top: 18px;
  }
}
.play-shot img {
  width: 100%;
}
.play-shot figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  border-top: var(--v-outline);
  background: var(--v-surface-1);
  color: var(--v-text);
  font-size: var(--t-sm);
  font-weight: 600;
}
/* The four steps, two by two. */
.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 48px);
}
.ledger li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-block: 18px;
  border-bottom: 3px dashed var(--v-on-paper-2);
}
.ledger li:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.ledger-num {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: var(--v-outline);
  border-radius: 50%;
  background: var(--v-gold);
  box-shadow: var(--v-shadow-sm);
  font-family: var(--v-font-display);
  font-size: 2rem;
  font-weight: var(--v-display-weight);
  line-height: 1;
}
.ledger h3 {
  font-family: var(--v-font-heading);
  font-size: clamp(1.375rem, 1.1rem + 0.7vw, 1.75rem);
  font-weight: 800;
  line-height: 1.1;
}
.ledger p {
  max-width: 40rem;
  margin-top: 4px;
  color: var(--v-on-paper-2);
  font-size: var(--t-lg);
}

/* The live count: a night-coloured ticket on the parchment, a touch askew.
   Under the steps it lies on its side: the number, then the rows. */
.ticket {
  --focus: var(--v-title);
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: var(--s-5) var(--s-5) var(--s-6);
  border: var(--v-outline);
  border-radius: var(--v-radius-lg);
  background: var(--v-bg);
  box-shadow: 8px 8px 0 var(--v-ink);
  color: var(--v-text);
  text-align: center;
  rotate: -0.8deg;
}
.ticket-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: var(--v-outline);
  border-radius: var(--v-radius-pill);
  background: var(--v-bg-deep);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ticket-num {
  color: var(--v-title);
  font-family: var(--v-font-display);
  font-size: clamp(5rem, 3rem + 7vw, 9.5rem);
  font-weight: var(--v-display-weight);
  line-height: 0.9;
  text-shadow: 5px 5px 0 var(--v-ink);
}
.ticket-label {
  font-family: var(--v-font-heading);
  font-size: var(--t-xl);
  font-weight: 800;
  line-height: 1.1;
}
.ticket-rows {
  display: grid;
  width: 100%;
  margin-block: var(--s-4);
  border-top: 2px dashed var(--v-line);
}
.ticket-rows div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-block: 9px;
  border-bottom: 2px dashed var(--v-line);
  font-size: var(--t-sm);
}
.ticket-rows dt {
  color: var(--v-text-2);
  font-weight: 600;
  text-align: left;
}
.ticket-rows dd {
  font-weight: 800;
  white-space: nowrap;
}
.ticket-cta {
  width: 100%;
}
@media (min-width: 700px) {
  .coop-main .ticket {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--s-6);
    justify-items: stretch;
    align-items: center;
    padding: var(--s-4) var(--s-5) var(--s-5);
    text-align: left;
  }
  .coop-main .ticket-head {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .coop-main .ticket-num {
    grid-row: 2;
    grid-column: 1;
    font-size: clamp(4.5rem, 2.5rem + 4.5vw, 7.5rem);
  }
  .coop-main .ticket-label {
    grid-row: 3;
    grid-column: 1;
  }
  .coop-main .ticket-rows {
    grid-row: 2 / span 2;
    grid-column: 2;
    margin-block: 0;
  }
  .coop-main .ticket-cta {
    grid-column: 1 / -1;
    margin-top: var(--s-3);
  }
}
.ticket.is-empty .ticket-num {
  color: var(--v-text-3);
}

/* ---- Tablets and phones -------------------------------------------------------- */
@media (max-width: 1099px) {
  .viewer,
  .share {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The steps go one under another beside the picture. */
  .ledger {
    grid-template-columns: minmax(0, 1fr);
  }
  .ledger li:nth-last-child(2) {
    border-bottom: 3px dashed var(--v-on-paper-2);
  }
  /* Three stops across, the call on a row of its own: the last stop's path
     stops at its number instead of running on past the page's edge. */
  .route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .route-stop:nth-child(3)::before {
    right: auto;
    width: 88px;
  }
  /* Across the full row the call lies flat: words on the left, button on the right. */
  .route-end {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
  }
  /* The screen buttons become a swipe row of names above the picture. The
     padding leaves room for a focus ring inside the scroll box. */
  .viewer-tabs {
    display: flex;
    gap: 10px;
    margin-inline: calc(var(--site-gutter) * -1);
    padding: 8px var(--site-gutter) 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .viewer-tabs::-webkit-scrollbar {
    display: none;
  }
  .viewer-tab {
    flex: none;
    align-content: center;
    padding: 8px 16px;
    border-left-width: var(--v-outline-w);
  }
  .viewer-tab span {
    display: none;
  }
  .viewer-tab.is-on {
    border-left-color: var(--v-ink);
    background: var(--v-gold);
  }
  .share-card {
    transform: none;
  }
}
/* Small laptops: only the chosen screen keeps its description, so the six
   buttons never stand taller than the picture. */
@media (min-width: 1100px) and (max-width: 1439px) {
  .viewer-tab:not(.is-on) span {
    display: none;
  }
}
@media (max-width: 699px) {
  /* A whole phone screen, down to the app's own tab bar: nothing to fade out. */
  .viewer-screen {
    aspect-ratio: 780 / 1688;
  }
  .viewer-screen::after {
    display: none;
  }
}
@media (max-width: 899px) {
  .coop-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .play-shot {
    justify-self: center;
  }
  .route {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }
  .route-end {
    display: grid;
    grid-column: auto;
    justify-content: stretch;
  }
  .route-end .btn {
    width: 100%;
  }
  /* The path runs down the page, behind the icons only, from each stop to
     whatever comes next: each stop keeps its icon in a column of its own,
     with the number and words beside it. */
  .route-stop::before,
  .route-stop:nth-child(3)::before {
    top: calc(var(--route-badge) / 2);
    right: auto;
    left: calc(var(--route-badge) / 2 - 2px);
    width: auto;
    height: calc(100% + var(--s-6));
    border-top: 0;
    border-left: 4px dashed var(--v-on-paper);
  }
  .route-stop {
    grid-template-columns: var(--route-badge) minmax(0, 1fr);
    align-items: start;
    row-gap: 4px;
  }
  .route-badge {
    grid-row: 1 / span 3;
  }
  .route-num,
  .route-stop h3,
  .route-stop p {
    grid-column: 2;
  }
  .paths {
    padding: var(--s-5);
  }
  .paths-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .ticket {
    rotate: none;
  }
}
@media (max-width: 699px) {
  /* 780 pixels fill 270 CSS px on a 3x phone: the app's own text stays sharp. */
  .play-shot {
    max-width: 270px;
  }
}
