/* ==========================================================================
   Co-op Play — the one card on the Co-op tab (lib/coop-play*.js).

   Structure and the classic look live here. This file is loaded in both
   looks: as a plain stylesheet in classic, inside the `legacy` cascade layer
   in the new look, where styles/src/surfaces/coop.css re-points the --cp-*
   tokens at the Inked Codex palette and adds the inked borders. So both
   skins always show the same card; only paint differs.
   ========================================================================== */

.cp-page {
  padding: 20px clamp(12px, 3vw, 28px) 48px;
}

.cp {
  --cp-card: var(--card, #14111e);
  --cp-raised: var(--card-raised, #1a1626);
  --cp-line: var(--border-strong, #3a3450);
  --cp-line-soft: var(--border, #28233a);
  --cp-text: var(--text, #f4eddc);
  --cp-text-2: var(--text-2, #b6abc4);
  --cp-text-3: var(--text-3, #6c647a);
  --cp-accent: var(--accent, #ff6b1a);
  --cp-accent-hi: var(--accent-hi, #ffa05c);
  --cp-on-accent: #1a0d05;
  --cp-gold: var(--gold, #d4af37);
  --cp-win: var(--win, #6dd97c);
  --cp-steam: #1b2838;
  --cp-steam-hi: #66c0f4;
  --cp-discord: #5865f2;
  --cp-discord-press: #4752c4;
  --cp-title-color: var(--cp-text);
  --cp-radius: var(--radius, 12px);
  --cp-radius-sm: 8px;
  --cp-border: 1px;
  --cp-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --cp-btn-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  --cp-btn-pressed: 0 2px 6px rgba(0, 0, 0, 0.3);
  --cp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cp-font-display: "Cinzel", "Playfair Display", Georgia, serif;
  --cp-font-heading: "Cinzel", Georgia, serif;
  --cp-dur: 180ms;
  --cp-ease: cubic-bezier(0.16, 1, 0.3, 1);

  color: var(--cp-text);
  font-family: var(--cp-font);
  max-width: 1480px;
  margin: 0 auto;
  container: cp / inline-size;
}

/* ---- The card --------------------------------------------------------------- */
.cp-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: clamp(18px, 3vw, 36px);
  background: var(--cp-card);
  border: var(--cp-border) solid var(--cp-line);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
}
.cp-card--loading,
.cp-card--error,
.cp-card--ended {
  grid-template-columns: minmax(0, 1fr);
  max-width: 640px;
}
.cp-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.cp-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: sticky;
  top: 16px;
  /* The sign in the room's sky is sized by the room's width (see below). */
  container: cp-side / inline-size;
}
/* Before a match the controls are the taller column. The room then grows to
   the foot of the card instead of leaving the space under it empty. */
.cp-card--idle > .cp-side,
.cp-card--searching > .cp-side {
  align-self: stretch;
  position: static;
}
.cp-card--idle > .cp-side > .cp-scene,
.cp-card--searching > .cp-side > .cp-scene {
  flex: 1 0 auto;
}

/* ---- Heading ------------------------------------------------------------------ */
.cp-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cp-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-text-3);
}
.cp-title {
  margin: 0;
  font-family: var(--cp-font-display);
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem);
  line-height: 1.02;
  color: var(--cp-title-color);
}
.cp-sub,
.cp-hint {
  margin: 0;
  color: var(--cp-text-2);
  font-size: 0.95rem;
  line-height: 1.5;
}
.cp-live {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 0;
  color: var(--cp-text-2);
  font-size: 1rem;
  line-height: 1.45;
}
.cp-live-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cp-text-3);
  transform: translateY(-1px);
}
.cp-live--on {
  color: var(--cp-text);
}
.cp-live--on .cp-live-dot,
.cp-timer .cp-live-dot,
.cp-float .cp-live-dot {
  background: var(--cp-win);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cp-win) 60%, transparent);
  animation: cp-beat 1.6s ease-out infinite;
}
@keyframes cp-beat {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cp-win) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 9px transparent; }
}

/* No line of copy on this tab ends on one word alone ("does.", "closed",
   "again.", "Steam"). Sentences wrap pretty; the short labels (the step
   pills, the link card's title, panel titles, party names) wrap balanced.
   text-wrap inherits, so it reaches the spans inside each of these. */
.cp-live,
.cp-sub,
.cp-hint,
.cp-notice,
.cp-ping,
.cp-step-text,
.cp-climbs-note p,
.cp-post-line,
.cp-post-embed-text span,
.cp-help p {
  text-wrap: pretty;
}
.cp-title,
.cp-step-title,
.cp-help summary,
.cp-howto li,
.cp-post-embed-text b,
.cp-panel-title,
.cp-recent-meta {
  text-wrap: balance;
}
/* Party names wrap pretty, not balanced: WebKit balancing the nowrap
   "Name +" spans (coop-play-more.js) pushed a line up to 3px past its column.
   Each name keeps its "+" with it, so a line only breaks between names, and
   pretty keeps one name from standing alone on the last line. */
.cp-recent-names {
  text-wrap: pretty;
}

.cp-notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--cp-radius-sm);
  background: color-mix(in srgb, var(--cp-gold) 16%, transparent);
  border: var(--cp-border) solid color-mix(in srgb, var(--cp-gold) 55%, transparent);
  color: var(--cp-text);
  font-size: 0.9rem;
}

/* ---- Fields --------------------------------------------------------------------- */
.cp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cp-text-2);
}

/* Climber picker: the real inked figures, standing. */
/* One row of climbers (Any + five, or six on the beta branch). */
.cp-pick {
  display: grid;
  grid-template-columns: repeat(var(--cp-pick-n, 6), minmax(0, 1fr));
  gap: 6px;
}
.cp-pick-opt {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 2px;
  border: var(--cp-border) solid var(--cp-line-soft);
  border-radius: var(--cp-radius-sm);
  background: var(--cp-raised);
  color: var(--cp-text-2);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--cp-dur) var(--cp-ease), border-color var(--cp-dur), background var(--cp-dur), box-shadow var(--cp-dur);
}
.cp-pick-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 58px;
}
.cp-pick-art .cp-figure-img {
  height: 100%;
  width: auto;
  max-width: 64px;
  object-fit: contain;
  object-position: bottom;
}
.cp-pick-opt:hover {
  transform: translateY(-2px);
  border-color: var(--cp-line);
  color: var(--cp-text);
}
.cp-pick-opt[aria-checked="true"] {
  border-color: var(--cp-accent);
  background: color-mix(in srgb, var(--cp-accent) 14%, var(--cp-raised));
  color: var(--cp-text);
  box-shadow: inset 0 0 0 1px var(--cp-accent);
}
/* A name is never cut, and never touches its tile's edge: one that cannot fit
   breaks at its soft hyphen ("Necro-binder", set in coop-play-view.js) and
   takes a second line. */
.cp-pick-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
}
/* "Necrobinder" needs a tile about 71px wide (74px with room to spare). A
   row of six such tiles needs 474px, seven need 554px.
   Where the picker is narrower than that (the two-column card at about
   1130-1190px wide in the new look and 1170-1270px in classic, with the
   wider controls column below; and the beta branch's seven on small
   tablets) the climbers stand in two even rows, as on phones, so every
   name stays on one line. */
.cp-field--pick {
  container: cp-pick / inline-size;
}
@container cp-pick (max-width: 473.9px) {
  html:not([data-ui="next"]) .cp-pick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* The new look's Figtree sets "Necrobinder" 62px wide (classic's Inter: 66px),
   so its six tiles fit down to 456px. */
@container cp-pick (max-width: 455.9px) {
  html[data-ui="next"] .cp-pick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container cp-pick (max-width: 553.9px) {
  .cp-pick[data-cp-n="7"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.cp-figure-blank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 52px;
  border: 2px dashed currentColor;
  border-radius: 40% 40% 10px 10px;
  font-family: var(--cp-font-display);
  font-size: 1.3rem;
  opacity: 0.75;
}

/* Game version: a two-way switch. */
.cp-branch {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  border: var(--cp-border) solid var(--cp-line-soft);
  border-radius: 999px;
  background: var(--cp-raised);
}
.cp-branch-opt {
  appearance: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cp-text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.cp-branch-opt[aria-checked="true"] {
  background: var(--cp-text);
  color: var(--cp-card);
}

/* ---- The Play button ---------------------------------------------------------- */
.cp-play {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  min-height: 68px;
  padding: 0 28px;
  border: var(--cp-border) solid color-mix(in srgb, var(--cp-accent) 70%, black);
  border-radius: calc(var(--cp-radius) + 2px);
  background: linear-gradient(180deg, var(--cp-accent-hi), var(--cp-accent));
  color: var(--cp-on-accent);
  font-family: var(--cp-font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--cp-btn-shadow);
  transition: transform var(--cp-dur) var(--cp-ease), box-shadow var(--cp-dur), filter var(--cp-dur);
}
.cp-play:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.cp-play:active {
  transform: translateY(2px);
  box-shadow: var(--cp-btn-pressed);
}
.cp-play:disabled {
  cursor: progress;
  filter: saturate(0.6) brightness(0.9);
  transform: none;
}

/* ---- Secondary buttons ---------------------------------------------------------- */
.cp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.cp-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: var(--cp-border) solid var(--cp-line);
  border-radius: var(--cp-radius-sm);
  background: var(--cp-raised);
  color: var(--cp-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--cp-dur) var(--cp-ease), background var(--cp-dur), border-color var(--cp-dur);
}
.cp-btn:hover {
  transform: translateY(-1px);
  border-color: var(--cp-text-2);
}
.cp-btn:active {
  transform: translateY(1px);
}
.cp-btn--primary {
  background: var(--cp-accent);
  border-color: color-mix(in srgb, var(--cp-accent) 70%, black);
  color: var(--cp-on-accent);
}
.cp-btn--steam {
  background: var(--cp-steam);
  border-color: color-mix(in srgb, var(--cp-steam-hi) 45%, var(--cp-steam));
  color: #e9f6ff;
}
/* Share to Discord (lib/coop-play-share.js). Discord's own blurple: white on
   it measures 4.6:1, enough for this bold label. */
.cp-btn--discord {
  display: inline-grid;
  background: var(--cp-discord);
  border-color: color-mix(in srgb, white 28%, var(--cp-discord));
  color: #fff;
}
/* The label and the "Post copied" face share one cell, so the button never
   changes width when it flips between them. */
.cp-share-face {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cp-btn--discord.is-done > .cp-share-face:not(.cp-share-face--done) {
  visibility: hidden;
}
.cp-btn--discord:hover,
.cp-btn--discord:active {
  background: var(--cp-discord-press);
  border-color: color-mix(in srgb, white 45%, var(--cp-discord));
}
/* In a party the button sits under "Up to N more can join". */
.cp-invite {
  margin-top: 8px;
}
.cp-btn--quiet {
  background: transparent;
  border-color: var(--cp-line-soft);
  color: var(--cp-text-2);
}
.cp-btn-done {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cp-win);
  color: #08240f;
}

.cp-play:focus-visible,
.cp-btn:focus-visible,
.cp-pick-opt:focus-visible,
.cp-branch-opt:focus-visible,
.cp-float:focus-visible,
.cp-float-x:focus-visible,
.cp-ping-input:focus-visible + .cp-ping-switch,
.cp-help summary:focus-visible {
  outline: 3px solid var(--cp-gold);
  outline-offset: 2px;
}

/* ---- Ping toggle ---------------------------------------------------------------- */
.cp-ping {
  display: flex;
  align-items: center;
  gap: 12px;
  /* The whole row is the toggle's label, so it is the tap target. */
  min-height: 44px;
  margin: 0;
  /* Wide enough for the whole sentence on one line beside the toggle. */
  max-width: 660px;
  color: var(--cp-text-2);
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}
.cp-ping--off {
  cursor: default;
  align-items: flex-start;
}
.cp-ping--off svg {
  flex: none;
  margin-top: 2px;
}
.cp-ping-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.cp-ping-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--cp-line-soft);
  border: var(--cp-border) solid var(--cp-line);
  transition: background var(--cp-dur);
}
.cp-ping-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cp-text);
  transition: transform var(--cp-dur) var(--cp-ease);
}
.cp-ping-input:checked + .cp-ping-switch {
  background: var(--cp-win);
}
.cp-ping-input:checked + .cp-ping-switch::after {
  transform: translateX(18px);
}
/* Toggle, bell and words share one centre line, however many lines the words take. */
.cp-ping-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cp-ping-text svg {
  flex: none;
}

/* ---- With pings on: how long to keep looking, and where the pings go --------------
   The stay choice wears the game-version switch (.cp-branch, painted per look);
   the device list is a fold-out line like the party card's help. */
.cp-stay {
  flex-wrap: wrap;
}
.cp-devices {
  max-width: 660px;
}
.cp-devices-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0 14px 4px;
  list-style: none;
}
.cp-device {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
/* Name and "This browser" wrap as a pair: on a narrow card the chip drops
   under the name, so the name stays whole ("Chrome on Mac", never "Chrome
   on / Mac"). */
.cp-device-who {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
}
.cp-device-name {
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
  color: var(--cp-text);
  font-weight: 600;
}
.cp-device-here {
  flex: none;
  padding: 2px 9px;
  border: var(--cp-border) solid var(--cp-line-soft);
  border-radius: 999px;
  color: var(--cp-text-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}
.cp-device-remove {
  flex: none;
  margin-left: auto;
}
.cp-devices > p {
  padding-top: 8px;
  color: var(--cp-text-3);
}
/* "Mako is on the way": the party card's live line, under the seats count. */
.cp-coming {
  margin: 0;
}

/* ---- The room: your party standing in a real game room ---------------------------- */
.cp-scene {
  position: relative;
  /* The room is always as wide as its column; the ratio sets only its height.
     Without a set width WebKit carries min-height through aspect-ratio into a
     minimum width (220px x 16/8 = 440px), so in Safari the room ran past its
     card and off the page on phones. */
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 8;
  min-height: 220px;
  overflow: hidden;
  border: var(--cp-border) solid var(--cp-line);
  border-radius: var(--cp-radius);
  background: #120d1c;
  isolation: isolate;
  /* Names stand under the figures. The floor keeps a band of the room free
     below the feet for them: the gap under the feet, one row of tags (two
     when a crowded party stacks them, .is-stacked), and the gap to the
     frame. --cp-tag-h is the tallest a tag gets here (22px avatar + padding
     + border). The drop and the row gap are TAG_DROP_PX and TAG_ROW_GAP_PX
     in coop-play-view.js; change them together. */
  --cp-tag-h: 30px;
  --cp-tag-drop: 6px;
  --cp-tag-row-gap: 6px;
  --cp-tag-edge: 8px;
  --cp-tag-rows: 1;
  --cp-tag-band: calc(
    var(--cp-tag-drop) + var(--cp-tag-rows) * var(--cp-tag-h) + (var(--cp-tag-rows) - 1) * var(--cp-tag-row-gap) + var(--cp-tag-edge)
  );
}
.cp-scene.is-stacked {
  --cp-tag-rows: 2;
}
.cp-scene-room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% calc(var(--cp-foot, 0.75) * 100%);
  z-index: -2;
}
.cp-scene-front {
  z-index: -1;
}
.cp-scene-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(10, 6, 22, 0.15) 0%, rgba(10, 6, 22, 0) 40%, rgba(10, 6, 22, 0.55) 100%);
  pointer-events: none;
}
.cp-scene-floor {
  position: absolute;
  z-index: 1;
  left: 6%;
  right: 6%;
  top: 14%;
  /* Feet on the room's ground, or higher where a short room needs the space
     under them for the names. */
  bottom: max(calc((1 - var(--cp-foot, 0.75)) * 100% - 6%), var(--cp-tag-band));
  display: flex;
  align-items: flex-end;
  /* The group stands in the middle: as much bare ground on its left as on its right. */
  justify-content: center;
  gap: 3%;
  container-type: size;
}
/* Everyone stands at one height: the floor's height, or less when the party
   is too wide for the room (--cp-sum is set from the figures' proportions). */
.cp-scene-floor > * {
  --cp-h: min(100cqh, calc(100cqw / var(--cp-sum, 3)));
}

/* ---- Right now, in the sky ---------------------------------------------------------
   Before a match you stand alone in a tall room, low, beside three empty
   seats, and the sky above was bare. A sign hangs there instead: who is
   looking on your game version, who is in a party, and who Steam shows in
   STS2 right now, with their faces (coop-play-view.js skyHtml). The room
   grows by the sign's height (padding on a content-box room, so its own
   proportions still set the rest), and the floor starts under the sign, so
   the figures keep their size and never stand behind it. The sign's height
   is fixed and no label wraps: long labels give way to short ones, and four
   faces to two, as the sign narrows. */
.cp-scene.has-sky {
  /* The title tab stands 12px above the plate; the plate; the gap to the floor. */
  --cp-sky-top: 20px;
  --cp-sky-h: 80px;
  --cp-sky-gap: 10px;
  --cp-sky-room: calc(var(--cp-sky-top) + var(--cp-sky-h) + var(--cp-sky-gap));
  box-sizing: content-box;
  padding-top: var(--cp-sky-room);
}
.cp-scene.has-sky .cp-scene-floor {
  top: calc(var(--cp-sky-room) + 2%);
}
.cp-sky {
  position: absolute;
  z-index: 2;
  top: var(--cp-sky-top);
  left: 12px;
  right: 12px;
  max-width: 560px;
  height: var(--cp-sky-h);
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  /* The top padding clears the title tab, which reaches about 11px into the
     plate (more where the new look tilts it). */
  padding: 16px 16px 8px;
  border: 1px solid var(--cp-line);
  border-radius: var(--cp-radius-sm);
  background: color-mix(in srgb, var(--cp-card) 86%, transparent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  container: cp-sky / inline-size;
}
.cp-sky-title {
  position: absolute;
  top: -12px;
  left: 14px;
  margin: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--cp-gold);
  color: var(--cp-on-accent);
  /* 0.75rem keeps the sign's small text at 11px or more on the new look's 15px root. */
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}
.cp-sky-list {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Each count stands centred over its label, like a scoreboard: the spare
   width is shared out evenly, so the dividers fall midway between counts. */
.cp-sky-item {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 8px;
}
.cp-sky-item:first-child {
  padding-left: 0;
}
.cp-sky-item:last-child {
  padding-right: 0;
}
.cp-sky-item + .cp-sky-item {
  border-left: 1px solid var(--cp-line-soft);
}
.cp-sky-count {
  display: flex;
  align-items: center;
  min-height: 26px;
}
.cp-sky-n {
  font-family: var(--cp-font-display);
  font-size: 1.65rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--cp-text-2);
}
.cp-sky-item.is-on .cp-sky-n {
  color: var(--cp-gold);
}
/* Every label line is as tall as a face, so the line with faces is no
   taller than the others and the three numbers stand level. */
.cp-sky-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  color: var(--cp-text-2);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.cp-sky .cp-live-dot {
  width: 7px;
  height: 7px;
  transform: none;
}
.cp-sky-item.is-on .cp-live-dot {
  background: var(--cp-win);
}
/* Where the faces show, they stand in for the live dot. */
.cp-sky-item.has-faces .cp-live-dot {
  display: none;
}
.cp-sky-faces {
  display: inline-flex;
  align-items: center;
}
.cp-sky-face,
.cp-sky-more {
  flex: none;
}
.cp-sky-face + .cp-sky-face {
  margin-left: -6px;
}
/* Phones hide the avatars in the name tags; the faces on the sign stay. */
.cp-sky-faces .cp-avatar {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cp-card);
}
.cp-sky-more {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 5px;
  box-sizing: border-box;
  border: 1px solid var(--cp-line);
  border-radius: 999px;
  background: var(--cp-raised);
  color: var(--cp-text);
  font-size: 0.75rem;
  font-weight: 800;
}
/* What the sign shows grows with its width (measured inside its padding),
   so nothing on it ever wraps, squeezes or is cut:
     under 270px  the three counts and short labels ("looking", "in STS2");
     270px        + the live dots, and two faces then "+N" (they lead the STS2 label);
     320px        four faces;
     520px        the long labels ("looking on Stable", "in Slay the Spire 2"). */
.cp-sky-long,
.cp-sky .cp-live-dot,
.cp-sky-faces,
.cp-sky-wide,
.cp-sky-more.cp-sky-wide {
  display: none;
}
@container cp-sky (min-width: 270px) {
  .cp-sky .cp-live-dot {
    display: block;
  }
  .cp-sky-faces {
    display: inline-flex;
  }
}
@container cp-sky (min-width: 320px) {
  .cp-sky-wide {
    display: block;
  }
  .cp-sky-more.cp-sky-wide {
    display: inline-grid;
  }
  .cp-sky-more.cp-sky-tight {
    display: none;
  }
  .cp-sky-item {
    padding: 0 10px;
  }
}
@container cp-sky (min-width: 520px) {
  .cp-sky-long {
    display: inline;
  }
  .cp-sky-brief {
    display: none;
  }
  .cp-sky-item {
    padding: 0 14px;
  }
}
/* A wide room has sky to spare: a bigger sign, still clear of the seats. */
@container cp-side (min-width: 480px) {
  .cp-scene.has-sky {
    --cp-sky-h: 98px;
  }
  .cp-sky {
    max-width: 600px;
    padding: 16px 20px 10px;
  }
  .cp-sky-item {
    gap: 7px;
    padding: 0 18px;
  }
  .cp-sky-count {
    min-height: 32px;
  }
  .cp-sky-n {
    font-size: 2.15rem;
  }
  .cp-sky-label {
    min-height: 24px;
    font-size: 0.82rem;
  }
  .cp-sky-faces .cp-avatar {
    width: 24px;
    height: 24px;
  }
  .cp-sky-face + .cp-sky-face {
    margin-left: -7px;
  }
  .cp-sky-more {
    min-width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }
}
/* Phone rooms give the sign a little more of their width: enough for two
   faces on a 390px phone, in both looks. */
@container cp-side (max-width: 360px) {
  .cp-sky {
    left: 8px;
    right: 8px;
    padding-inline: 10px;
  }
}
.cp-climber {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: var(--cp-h, 100%);
  margin: 0;
}
.cp-climber::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -4%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  z-index: -1;
}
.cp-climber-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
}
.cp-climber-art .cp-figure-img {
  position: relative;
  z-index: 1;
}
/* Seated poses rest on a drum of fallen column, as in the header stage. */
.cp-stone {
  position: absolute;
  z-index: 0;
  border: 2px solid #0a0616;
  border-radius: 50% / 24%;
  background: #4a4160;
  box-shadow: 2px 3px 0 rgba(10, 6, 22, 0.6);
}
.cp-stone::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 46%;
  border-bottom: 2px solid #0a0616;
  border-radius: 50%;
  background: #6c6288;
}
.cp-climber-art .cp-figure-img {
  height: 100%;
  width: auto;
  max-width: 34vw;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
.cp-climber-art .cp-figure-blank {
  width: auto;
  height: 86%;
  aspect-ratio: 0.58;
  border-style: solid;
  border-color: var(--cp-gold);
  color: var(--cp-gold);
  background: rgba(10, 6, 22, 0.6);
  opacity: 1;
  font-size: 1.8rem;
}
.cp-climber.is-you .cp-climber-art .cp-figure-img {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 1px var(--cp-gold));
}

/* Name tag under each figure's feet. fitPartyTags() (coop-play-view.js) gives
   the whole party one width so the tags line up with even gaps between them
   and to the frame; the name and avatar sit centred in it, and a long name
   truncates. */
.cp-tag {
  position: absolute;
  top: calc(100% + var(--cp-tag-drop));
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: rgba(10, 6, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff1cf;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.cp-climber.is-you .cp-tag {
  border-color: var(--cp-gold);
}
.cp-tag-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The host's crown floats over the host's head (HEAD_X in coop-play-view.js
   says where the head is across the picture). A blank figure is shorter than
   its box, so its crown sits lower. */
.cp-crown {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 2px);
  display: inline-flex;
  color: var(--cp-gold);
  filter: drop-shadow(0 1px 0 #0a0616) drop-shadow(0 0 2px rgba(10, 6, 22, 0.8));
  transform: translateX(-50%);
}
.cp-crown--blank {
  bottom: calc(86% + 2px);
}
.cp-crown svg {
  width: 16px;
  height: 16px;
}
.cp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.cp-avatar {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.cp-avatar--initial {
  display: inline-grid;
  place-items: center;
  background: var(--cp-accent);
  color: var(--cp-on-accent);
  /* 0.75rem keeps the initial at 11px or more on the new look's 15px root. */
  font-size: 0.75rem;
}

/* Empty places in the party. */
.cp-seat {
  display: grid;
  place-items: center;
  flex: none;
  height: calc(var(--cp-h, 100%) * 0.72);
  aspect-ratio: 0.58;
  border: 2px dashed rgba(255, 241, 207, 0.4);
  border-radius: 42% 42% 12px 12px;
  /* Dark enough that a lantern or a crate behind the seat reads as background. */
  background: rgba(10, 6, 22, 0.6);
  color: rgba(255, 241, 207, 0.7);
}
.cp-seat-mark {
  font-size: 1.4rem;
  font-weight: 700;
}
.cp-scene.is-searching .cp-seat {
  animation: cp-seat 1.8s ease-in-out infinite;
}
.cp-scene.is-searching .cp-seat:nth-child(3) { animation-delay: 0.25s; }
.cp-scene.is-searching .cp-seat:nth-child(4) { animation-delay: 0.5s; }
@keyframes cp-seat {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.cp-howto {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cp-howto li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--cp-radius-sm);
  background: var(--cp-raised);
  border: var(--cp-border) solid var(--cp-line-soft);
  color: var(--cp-text-2);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}
.cp-howto-n,
.cp-step-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cp-text);
  color: var(--cp-card);
  font-family: var(--cp-font-heading);
  font-weight: 800;
  font-size: 0.85rem;
}

/* ---- Searching ---------------------------------------------------------------------- */
.cp-timer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--cp-font-heading);
  font-size: clamp(2.4rem, 1.8rem + 2vw, 3.4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cp-timer .cp-live-dot {
  width: 12px;
  height: 12px;
}

/* ---- Party steps ---------------------------------------------------------------------- */
.cp-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cp-step {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--cp-radius-sm);
  background: var(--cp-raised);
  border: var(--cp-border) solid var(--cp-line-soft);
}
.cp-step.is-done .cp-step-n {
  background: var(--cp-win);
  color: #08240f;
}
.cp-step-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cp-step-title {
  margin: 0;
  font-family: var(--cp-font-heading);
  font-size: 1.1rem;
}
.cp-step-text {
  margin: 0;
  color: var(--cp-text-2);
  font-size: 0.9rem;
  line-height: 1.5;
}
.cp-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-step-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--cp-text-3);
  font-size: 0.85rem;
}
.cp-step-status.is-ready {
  color: var(--cp-win);
}

/* A Steam name can be 32 characters: its button stays inside the step. */
.cp-step-actions .cp-btn {
  min-width: 0;
  max-width: 100%;
}
.cp-step-actions .cp-btn > span:not(.cp-btn-done) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-step-actions .cp-btn > svg {
  flex: none;
}

.cp-help {
  border-radius: var(--cp-radius-sm);
  border: var(--cp-border) dashed var(--cp-line-soft);
  color: var(--cp-text-2);
  font-size: 0.88rem;
}
/* The padding is on the line itself, so the whole 44px line opens it. */
.cp-help summary {
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cp-text);
}
.cp-help p {
  margin: 0;
  padding: 0 14px 12px;
  line-height: 1.5;
}
/* The end of the party card: help, then Leave party. */
.cp-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- A party, on a wide card ----------------------------------------------------------
   The heading and the room share the top row, the three steps stand side by
   side under them, and the help line and Leave party close the card: nothing
   is left empty under the room. .cp-main dissolves so its children can be
   placed on the card's own grid. Narrower cards stack them (see "Narrow
   screens" below). */
@container cp (min-width: 861px) {
  .cp-card--party {
    row-gap: 18px;
  }
  .cp-card--party > .cp-main {
    display: contents;
  }
  .cp-card--party > .cp-main > * {
    grid-column: 1 / -1;
    order: 3;
  }
  .cp-card--party > .cp-main > .cp-notice {
    order: 0;
  }
  /* The heading is the shorter of the two: it stands level with the middle of the room. */
  .cp-card--party > .cp-main > .cp-head {
    grid-column: 1;
    order: 1;
    align-self: center;
  }
  .cp-card--party > .cp-side {
    grid-column: 2;
    order: 2;
    position: static;
  }
  /* The foot: the help line takes the width, Leave party stands at its right
     end. The button's box is as tall as the closed help line, so it sits on
     that line's centre and stays put when the help opens. */
  .cp-card--party .cp-foot {
    flex-direction: row;
    align-items: flex-start;
    order: 4;
  }
  .cp-card--party .cp-foot > .cp-help {
    flex: 1 1 auto;
    min-width: 0;
  }
  .cp-card--party .cp-foot > .cp-actions {
    flex: none;
    min-height: calc(44px + 2 * var(--cp-border));
  }
  .cp-card--party .cp-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  /* In a column the number sits beside the title and the words and buttons
     get the step's whole width. Buttons stand on the step's floor, so the
     three steps' buttons share one line whatever the length of the words. */
  .cp-card--party .cp-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto;
    align-items: center;
    gap: 8px 12px;
  }
  .cp-card--party .cp-step-body {
    display: contents;
  }
  .cp-card--party .cp-step-text {
    grid-column: 1 / -1;
    align-self: start;
  }
  .cp-card--party .cp-step-status {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .cp-card--party .cp-step-actions {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

/* ---- Pill on other tabs ------------------------------------------------------------- */
.cp-float-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: stretch;
  gap: 2px;
  font-family: var(--cp-font, "Inter", system-ui, sans-serif);
}
.cp-float-wrap[hidden] {
  display: none;
}
.cp-float,
.cp-float-x {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong, #3a3450);
  background: var(--card-raised, #1a1626);
  color: var(--text, #f4eddc);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.cp-float {
  border-radius: 999px 0 0 999px;
}
.cp-float:only-child {
  border-radius: 999px;
}
.cp-float-x {
  padding: 0 14px;
  border-radius: 0 999px 999px 0;
  font-size: 1.2rem;
}
.cp-float .cp-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--win, #6dd97c);
}
.cp-float--found {
  background: var(--accent, #ff6b1a);
  color: #1a0d05;
  border-color: transparent;
}
.cp-float [data-cp-timer] {
  font-variant-numeric: tabular-nums;
}

/* ---- Under the card: right now, bring someone, your co-op climbs ------------------ */
.cp-more {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

/* Right now: one quiet line of counts, not a card. */
.cp-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
  color: var(--cp-text-2);
  font-size: 0.9rem;
}
.cp-now-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-text-2);
}
.cp-now-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.cp-now-item b {
  color: var(--cp-text);
  font-variant-numeric: tabular-nums;
}
.cp-now .cp-live-dot {
  transform: none;
}
.cp-now-item.is-on .cp-live-dot {
  background: var(--cp-win);
}

/* Two panels of unequal weight: the invite leads, the numbers sit beside it. */
.cp-more-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.cp-more--solo .cp-more-grid {
  grid-template-columns: minmax(0, 1fr);
}
.cp-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: clamp(16px, 2.4vw, 28px);
  border: var(--cp-border) solid var(--cp-line-soft);
  border-radius: var(--cp-radius);
  background: var(--cp-card);
}
.cp-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cp-panel-title {
  margin: 0;
  font-family: var(--cp-font-heading);
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--cp-text);
}

/* The post, drawn the way it will read in a channel, with the link's card. */
.cp-post {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 14px 16px;
  border: var(--cp-border) solid var(--cp-line-soft);
  border-left: 4px solid var(--cp-discord);
  border-radius: var(--cp-radius-sm);
  background: var(--cp-raised);
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cp-post-cap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cp-text-2);
}
.cp-post-cap svg {
  width: 15px;
  height: 15px;
  color: var(--cp-discord);
}
.cp-post-line {
  margin: 0;
  color: var(--cp-text);
}
.cp-post-link {
  color: var(--cp-steam-hi);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* The link's card as Discord draws it: its words, then the picture across
   the width. Beside "Your co-op climbs" the picture is the part that grows,
   so this panel is filled to its foot too. */
.cp-bring > .cp-post {
  flex: 1 1 auto;
}
.cp-post-embed {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--cp-radius-sm);
  background: color-mix(in srgb, var(--cp-card) 72%, black);
}
.cp-post-art {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border-radius: 6px;
  /* When it grows taller than its shape, keep the left (the words on it). */
  object-fit: cover;
  object-position: left center;
}
.cp-post-embed-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--cp-text-2);
}
.cp-post-embed-text b {
  font-size: 0.88rem;
  color: var(--cp-text);
}
/* Copy link flips to "Link copied" at the same width, like Share. */
.cp-btn--flip {
  display: inline-grid;
}
.cp-btn--flip.is-done > .cp-share-face:not(.cp-share-face--done),
.cp-btn--flip:not(.is-done) > .cp-share-face--done {
  visibility: hidden;
}

/* Your co-op climbs. The panel is as tall as its neighbour: the numbers on
   top, the latest runs at the foot, and between them the party standing in
   a room, which is the part that grows to fill the height. */
.cp-climbs-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.cp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.cp-stat {
  display: flex;
  flex-direction: column-reverse;
  /* Number first, label under it, packed to the top of the row, so the
     numbers line up even when one label takes two lines ("CO-OP / RUNS"). */
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.cp-stat dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cp-text-2);
}
.cp-stat dd {
  margin: 0;
  font-family: var(--cp-font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  line-height: 1;
  color: var(--cp-title-color);
  font-variant-numeric: tabular-nums;
}
.cp-best {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.cp-best-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0;
  font-size: 0.88rem;
}
.cp-best-label {
  font-weight: 700;
  color: var(--cp-text);
}
.cp-best-detail {
  color: var(--cp-text-2);
}
/* Here a tag names a climber, not a player, so it needs no avatar chip. */
.cp-best .cp-avatar {
  display: none;
}
.cp-best .cp-tag {
  padding: 3px 9px;
}
/* The room takes whatever height is left; its climbers scale with it. With
   no avatar in the tags, a row of them is shorter. */
.cp-best > .cp-scene {
  --cp-tag-h: 24px;
  flex: 1 1 150px;
  min-height: 150px;
  aspect-ratio: auto;
}
.cp-recent {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Two lines a run: who and how it ended, then when and how far. */
.cp-recent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "minis names result"
    "minis meta result";
  align-items: center;
  gap: 0 12px;
  padding: 8px 0;
  border-top: 1px solid var(--cp-line-soft);
  font-size: 0.86rem;
}
.cp-minis {
  grid-area: minis;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}
.cp-minis .cp-mini {
  display: block;
  width: auto;
  height: 36px;
}
.cp-minis .cp-figure-blank.cp-mini {
  width: 24px;
  height: 32px;
  font-size: 0.9rem;
}
/* A party's names are never cut: when the column is narrow (phones) they
   take a second line, breaking only after a " +" (each name and the "+"
   after it are one nowrap span, from coop-play-more.js), balanced.
   .cp-nowrap keeps "co-op" whole in the example note. */
.cp-party-name,
.cp-nowrap {
  white-space: nowrap;
}
.cp-recent-names {
  grid-area: names;
  align-self: end;
  font-weight: 600;
  color: var(--cp-text);
  overflow-wrap: break-word;
}
.cp-recent-meta {
  grid-area: meta;
  align-self: start;
  color: var(--cp-text-2);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.cp-result {
  grid-area: result;
  justify-self: end;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
/* One set of columns for the whole list, so every run starts its names on the
   same left edge whether two or four climbers stand in front of them. */
@supports (grid-template-columns: subgrid) {
  .cp-recent {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 12px;
  }
  .cp-recent-row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }
}
.cp-result--won {
  background: color-mix(in srgb, var(--cp-win) 22%, transparent);
  color: var(--cp-win);
}
.cp-result--lost {
  background: color-mix(in srgb, var(--cp-loss, #e5484d) 22%, transparent);
  color: var(--cp-loss-text, #ff9a9a);
}
.cp-result--abandoned {
  background: color-mix(in srgb, var(--cp-text-2) 18%, transparent);
  color: var(--cp-text-2);
}
/* No co-op runs to show yet: the same panel on sample numbers, marked as an
   example in words (the tag and the note) and dimmed so it cannot pass for
   the player's own. */
.cp-example-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--cp-gold);
  color: #1a1305;
  font-family: var(--cp-font);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.cp-climbs-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px dashed var(--cp-line);
  border-radius: var(--cp-radius-sm);
  color: var(--cp-text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.cp-climbs-note p {
  flex: 1 1 220px;
  margin: 0;
}
.cp-climbs.is-example .cp-climbs-body {
  opacity: 0.72;
  filter: saturate(0.75);
}
@container cp (max-width: 860px) {
  .cp-more-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Stacked, nothing needs to stretch: the room goes back to a fixed shape. */
  .cp-best > .cp-scene {
    flex: none;
    aspect-ratio: 16 / 7;
    min-height: 160px;
  }
}
@container cp (max-width: 520px) {
  .cp-panel {
    padding: 16px;
  }
  .cp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 8px;
  }
  .cp-minis .cp-mini {
    height: 32px;
  }
  .cp-climbs-note .cp-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---- The Play card's columns where the card is narrow --------------------------- */
/* From 861px of co-op width the room stands beside the controls (laptops and
   up). Below about 1044px the even split left the controls column too narrow
   for six climbers in a row (.cp-field--pick), so the picker took two rows,
   the card grew ~90px and the room, which grows to the card's foot, became a
   tall slice drawn at 1.6x. Giving the controls the larger share keeps the
   climbers in one row at most of these widths; the room keeps reaching the
   foot of the card. */
@container cp (min-width: 861px) and (max-width: 1043.9px) {
  .cp-card--idle,
  .cp-card--searching {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}

/* ---- Narrow screens --------------------------------------------------------------- */
@container cp (max-width: 860px) {
  .cp-card {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Controls first, so Play is on screen without scrolling; the room
     follows as the picture of the party you're forming. */
  .cp-side {
    position: static;
  }
  .cp-scene {
    aspect-ratio: 16 / 6;
    min-height: 180px;
  }
  .cp-pick-art {
    height: 50px;
  }
  /* A party is the payoff: show who's in it right under the heading, then
     the steps. .cp-main dissolves so its children can be ordered around
     the room. */
  .cp-card--party,
  .cp-card--ingame {
    row-gap: 16px;
  }
  .cp-card--party > .cp-main,
  .cp-card--ingame > .cp-main {
    display: contents;
  }
  .cp-card--party > .cp-main > *,
  .cp-card--ingame > .cp-main > * {
    order: 2;
  }
  .cp-card--party > .cp-main > .cp-notice,
  .cp-card--party > .cp-main > .cp-head,
  .cp-card--ingame > .cp-main > .cp-head {
    order: 0;
  }
  .cp-card--party > .cp-side,
  .cp-card--ingame > .cp-side {
    order: 1;
  }
}
@media (max-width: 560px) {
  .cp-page {
    padding: 12px 12px 96px;
  }
}
@container cp (max-width: 520px) {
  .cp-card {
    padding: 16px;
    gap: 16px;
  }
  /* Phones: two even rows (3 + 3), or 4 + 3 on the beta branch. */
  .cp-pick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cp-pick[data-cp-n="7"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cp-scene {
    aspect-ratio: 4 / 3;
    /* No avatar in the tags here, so a row of them is shorter. */
    --cp-tag-h: 24px;
  }
  .cp-scene-floor {
    left: 3%;
    right: 3%;
    gap: 2%;
  }
  /* No avatar here, so the padding is even on both sides. */
  .cp-tag {
    padding: 3px 8px;
  }
  .cp-avatar {
    display: none;
  }
  .cp-howto {
    grid-template-columns: minmax(0, 1fr);
  }
  .cp-play {
    max-width: none;
  }
  /* Share takes the whole row; the quieter buttons share the next one. */
  .cp-btn--discord {
    flex: 1 1 100%;
    justify-content: center;
  }
}
@media (max-width: 560px) {
  .cp-float-wrap {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cp *,
  .cp-float-wrap * {
    animation: none !important;
    transition: none !important;
  }
}

/* Classic: this tab's head holds nothing to see (its toolbar is hidden here
   and its heading is for assistive tech), so it takes no room. Without this
   it is an empty bar with a rule, pinned over the card while you scroll. */
html[data-ui="classic"] .tab-panel[data-tab="coop"] > .panel-head {
  position: static;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
}

/* Panel heading kept for assistive tech; the card shows its own title. */
.cp-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
