/* =============================================================================
   CueArrena — cuearrena.com
   Loaded AFTER codex.css, which supplies the shared chrome: topbar, hero
   scaffolding, .section / .chapter-* headers, .fleet-card, .arena-card,
   .btn / .btn-pill, .torn-edge, footer, .reveal and the language picker.

   Only what this property needs lives here:
     - the worked-example panel (the printed board story)
     - the platform grid for the six workshop cards
     - the app section, including its pre-launch state
     - section backgrounds

   Assets are a local copy rather than links to cuearr.com. Webfonts are
   CORS-restricted cross-origin, and this is a different registrable domain
   entirely — nothing at all can be shared with cuearr.com by reference.
   ============================================================================= */

/* ============ GRIDS ============ */
/* Six workshop cards. auto-fit lands on four columns above ~1300px, which
   leaves two cards stranded on a second row. Six divides cleanly by three and
   by two, so pin it: 3 across on desktop, 2 on tablet, 1 on mobile — balanced
   at every step. */
.plat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1.1rem, 2vw, 1.6rem);
}
@media (min-width: 1100px) {
  .plat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* codex's .arena-grid is auto-fit minmax(280px), which lands 3-across at this
   width and orphans a fourth card. Four cards read better as a 2x2 anyway. */
.arena-grid--2x2 {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 2vw, 1.6rem);
}
@media (max-width: 720px) {
  .arena-grid--2x2 { grid-template-columns: 1fr; }
}

/* ============ HERO TYPE ============ */
/* codex sizes .hero-title for cuearr.com's headline, which is three very short
   lines ("The / Codex / of CueArr") and tops out at 6.5rem. .hero-grid is a
   fixed 1fr 1fr, so the text column is only ~557px at 1440px — and this page's
   headline is two full phrases, which broke onto four lines at that size.
   Size it for the longest language instead: French runs "Mettez le jeu" at 13
   characters, and a two-line headline is the point of the <br />. */
.hero-title { font-size: clamp(2.2rem, 3.6vw + 0.8rem, 3.7rem); }

/* ============ THE GAME PHONE ============ */
/* Recreated from a real in-app screenshot rather than invented: light lavender
   app surface, white art card, red role, green/red team counts, and a bottom
   bar with Leave, a raised blue Scan button and a connection indicator. The
   in-app "Scan a human" action button is deliberately omitted — the bottom-bar
   Scan is the one that matters in a still image. */
.gamephone { position: relative; width: min(300px, 82%); margin: 0 auto; }
.gamephone__glow {
  position: absolute; inset: -18% -12%;
  background: radial-gradient(ellipse at 50% 45%, rgba(79,183,255,0.28), transparent 68%);
  filter: blur(26px); pointer-events: none;
}
.gamephone__frame {
  position: relative;
  border-radius: 30px;
  padding: 9px;
  background: linear-gradient(160deg, #2b3444, #10161f);
  box-shadow: 0 26px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,143,61,0.28);
  transform: rotate(-2deg);
}
.gamephone__notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 17px;
  background: #10161f;
  border-radius: 0 0 12px 12px;
  z-index: 3;
}
.gamephone__screen {
  position: relative;
  border-radius: 23px;
  background: #fbf3fa;          /* the app's very light lavender surface */
  overflow: hidden;
  color: #1c1b1f;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: 4px;
}

/* --- app bar --- */
.gp-appbar {
  display: flex; align-items: center; gap: 7px;
  padding: 26px 10px 8px;
}
.gp-appbar svg { width: 15px; height: 15px; color: #1c1b1f; flex: 0 0 auto; }
.gp-appbar__back svg { width: 17px; height: 17px; }
.gp-appbar__titles { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.gp-appbar__title {
  font-size: 0.82rem; font-weight: 700; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-appbar__sub { font-size: 0.6rem; color: #4a4550; line-height: 1.2; }
.gp-appbar__icons { display: flex; align-items: center; gap: 7px; }

/* --- character card --- */
.gp-art {
  margin: 2px 12px 0;
  background: #fff;
  border-radius: 4px;
  padding: 8px 0;
  display: grid; place-items: center;
}
.gp-art svg { width: 74%; height: auto; max-height: 132px; }

/* --- role / task --- */
.gp-role {
  margin-top: 9px; text-align: center;
  font-size: 0.98rem; font-weight: 800; letter-spacing: 0.01em;
  color: #cf2020;
}
.gp-task {
  margin: 5px 12px 0; text-align: center;
  font-size: 0.63rem; line-height: 1.35; color: #24222a;
}

/* --- team counts --- */
.gp-scores {
  display: flex; justify-content: space-around; align-items: center;
  margin-top: 11px; padding: 0 10px;
}
.gp-score { font-size: 0.72rem; font-weight: 700; }
.gp-score--human  { color: #2e7d32; }
.gp-score--zombie { color: #c62828; }
.gp-time { margin-top: 9px; text-align: center; font-size: 0.72rem; color: #24222a; }

/* --- bottom bar --- */
.gp-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 13px; padding: 7px 16px 9px;
  border-top: 1px solid #e6dfe8;
  background: #fdf9fd;
}
.gp-bottom svg { width: 15px; height: 15px; }
.gp-bottom__item, .gp-bottom__scan {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.gp-bottom__item { color: #1c1b1f; }
.gp-bottom__item em { font-style: normal; font-size: 0.55rem; font-weight: 700; }
/* The raised centre action, exactly as the app draws it. */
.gp-bottom__scan {
  position: relative; top: -12px;
  width: 46px; height: 46px; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #4fc3f7, #29a4ef);
  color: #fff;
  box-shadow: 0 5px 12px rgba(41,164,239,0.45);
}
.gp-bottom__scan em { font-style: normal; font-size: 0.5rem; font-weight: 700; }
.gp-bottom__wifi { color: #43a047; display: flex; }

/* ============ THE APP ============ */
.app-wrap {
  max-width: 46rem; margin: 0 auto;
  text-align: center;
}
.app-badges {
  display: flex; flex-wrap: wrap; gap: 0.9rem;
  justify-content: center;
  margin-top: 1.6rem;
}
.app-badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(201,143,61,0.45);
  background: rgba(10,23,40,0.72);
  color: var(--parchment);
  font-family: "IM Fell English SC", serif;
  font-size: 0.85rem; letter-spacing: 0.1em;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.app-badge svg { width: 20px; height: 20px; flex: 0 0 auto; }
.app-badge:hover { border-color: var(--brass); color: var(--brass-hot); transform: translateY(-2px); }

/* Pre-launch state. Rendered instead of links while ARENA_ANDROID_URL and
   ARENA_IOS_URL are empty — a badge that goes nowhere is worse than an honest
   "not yet", and this reverts to real links with no markup change. */
.app-badge--soon {
  opacity: 0.55;
  cursor: default;
  border-style: dashed;
}
.app-badge--soon:hover { transform: none; border-color: rgba(201,143,61,0.45); color: var(--parchment); }
.app-soon-tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--cyan);
  background: rgba(79,183,255,0.12);
  color: var(--cyan-hot);
  font-family: "IM Fell English SC", serif;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.app-note {
  margin-top: 1.4rem;
  font-family: "IM Fell English", serif; font-style: italic;
  font-size: 0.98rem; color: var(--parchment-dim);
}

/* ============ THE SCALE LADDER ============ */
/* Four rungs, smallest to largest. A ladder rather than a grid because the
   point of the section is that each step is bigger than the last, and a grid
   flattens that into four equal boxes. */
.scale-list {
  position: relative; z-index: 2;
  display: grid; gap: clamp(0.9rem, 1.6vw, 1.2rem);
  max-width: 54rem; margin: 0 auto;
}
.scale-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: 10px;
  border: 1px solid rgba(201,143,61,0.3);
  background: linear-gradient(160deg, rgba(23,41,62,0.9), rgba(10,23,40,0.9));
}
/* Each rung sits a little wider and brighter than the one above it. */
.scale-step:nth-child(2) { margin-inline: -0.6rem; border-color: rgba(201,143,61,0.4); }
.scale-step:nth-child(3) { margin-inline: -1.2rem; border-color: rgba(201,143,61,0.5); }
.scale-step:nth-child(4) {
  margin-inline: -1.8rem;
  border-color: var(--brass);
  box-shadow: 0 0 34px rgba(255,205,107,0.14), 0 16px 38px rgba(0,0,0,0.5);
}
@media (max-width: 560px) {
  .scale-step, .scale-step:nth-child(n) { margin-inline: 0; }
  .scale-step { grid-template-columns: 1fr; gap: 0.7rem; }
}
.scale-step__rung {
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: rgba(255,205,107,0.12);
  color: var(--brass-hot);
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  font-size: 1.1rem; line-height: 1;
}
.scale-step__body .tag { margin-bottom: 0.4rem; }
.scale-step__body h3 {
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  font-size: clamp(1.05rem, 0.8vw + 0.9rem, 1.3rem);
  color: var(--parchment); margin-bottom: 0.45rem;
}
.scale-step__body p { font-size: 0.98rem; line-height: 1.6; color: var(--parchment-dim); }

/* ============ WHAT'S COMING ============ */
.soon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
/* Exactly two cards, so pin the pair rather than letting auto-fit decide —
   auto-fit was laying them into two of three tracks and leaving them narrower
   than they should be. */
@media (min-width: 860px) {
  .soon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.soon-card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  border-radius: 10px;
  /* Dashed, and cyan rather than brass: these are not finished things, and the
     page should look like it knows that. */
  border: 1px dashed rgba(79,183,255,0.45);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(79,183,255,0.10), transparent 60%),
    linear-gradient(160deg, rgba(15,42,68,0.85), rgba(10,23,40,0.9));
}
.soon-card__tag {
  display: inline-block; margin-bottom: 0.8rem;
  padding: 0.24rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--cyan);
  background: rgba(79,183,255,0.12);
  color: var(--cyan-hot);
  font-family: "IM Fell English SC", serif;
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.soon-card h3 {
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  font-size: clamp(1.2rem, 1.2vw + 0.9rem, 1.5rem);
  color: var(--parchment); margin-bottom: 0.7rem;
}
.soon-card p { font-size: 0.98rem; line-height: 1.65; color: var(--parchment-dim); }
.soon-card__link {
  display: inline-block; margin-top: 1rem;
  font-family: "IM Fell English SC", serif;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-hot); text-decoration: none;
  border-bottom: 1px solid rgba(79,183,255,0.4);
  padding-bottom: 2px;
}
.soon-card__link:hover { color: #fff; border-bottom-color: var(--cyan-hot); }

/* ============ THE GAME CATALOGUE ============ */
/* A list, not a card grid. These are real rows of live data with wildly
   varying description lengths, and a grid of cards would leave ragged
   whitespace wherever a game had a one-line blurb. */
.game-list {
  display: grid; gap: 0.55rem;
  max-width: 56rem; margin: 0 auto;
}
.game-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(0.9rem, 2vw, 1.4rem);
  align-items: center;
  padding: clamp(0.9rem, 1.6vw, 1.15rem) clamp(1rem, 2vw, 1.4rem);
  border-radius: 8px;
  border: 1px solid rgba(201,143,61,0.26);
  background: linear-gradient(160deg, rgba(23,41,62,0.86), rgba(10,23,40,0.9));
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.game-row:hover { border-color: var(--brass); transform: translateX(3px); }
.game-row[hidden] { display: none; }

.game-row__rank {
  display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255,205,107,0.1);
  border: 1px solid rgba(201,143,61,0.4);
  color: var(--brass-hot);
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  font-size: 0.82rem; line-height: 1;
}
.game-row__body { min-width: 0; }
.game-row__name {
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.15rem);
  color: var(--parchment);
  margin-bottom: 0.2rem;
}
.game-row__desc {
  font-size: 0.9rem; line-height: 1.5;
  color: var(--parchment-dim);
  margin: 0;
}
.game-row__meta {
  display: flex; align-items: center; gap: 0.45rem;
  flex: 0 0 auto; white-space: nowrap;
}
.game-row__cat {
  font-family: "IM Fell English SC", serif;
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cyan-hot);
  border: 1px solid rgba(79,183,255,0.35);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.game-row__stars { color: var(--brass-hot); font-size: 0.95rem; }
.game-row__score {
  font-family: "Cinzel Decorative", serif; font-weight: 900;
  color: var(--brass-hot); font-size: 0.95rem;
}
.game-row__count { font-size: 0.72rem; color: var(--parchment-deep); }

@media (max-width: 640px) {
  /* Stack the meta under the name rather than squeezing three columns into a
     phone — the rating is worth reading, and it stops the name truncating. */
  .game-row { grid-template-columns: auto 1fr; }
  .game-row__meta {
    grid-column: 2; margin-top: 0.5rem;
    flex-wrap: wrap; white-space: normal;
  }
}

/* --- pager --- */
.game-pager {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  margin-top: 1.6rem;
}
.game-pager[hidden] { display: none; }
.game-pager__btn {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(201,143,61,0.45);
  background: rgba(10,23,40,0.7);
  color: var(--parchment);
  font-family: "IM Fell English SC", serif;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}
.game-pager__btn:hover:not(:disabled) { border-color: var(--brass); color: var(--brass-hot); }
.game-pager__btn:disabled { opacity: 0.35; cursor: default; }
.game-pager__at {
  font-family: "IM Fell English", serif; font-style: italic;
  font-size: 0.9rem; color: var(--parchment-dim);
}

/* ============ SECTION BACKGROUNDS ============ */
.chapter-play {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(15,32,56,0.5), transparent 55%),
    linear-gradient(180deg, var(--midnight) 0%, #08131f 100%);
}
.chapter-board {
  background:
    radial-gradient(ellipse at 75% 10%, rgba(23,41,62,0.7), transparent 60%),
    linear-gradient(180deg, #08131f 0%, var(--midnight) 100%);
}
.chapter-build {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(15,32,56,0.6), transparent 60%),
    linear-gradient(180deg, var(--midnight) 0%, #08131f 100%);
}
.chapter-app {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(79,183,255,0.10), transparent 60%),
    linear-gradient(180deg, #08131f 0%, var(--midnight) 100%);
}

/* codex's .chapter-badge hangs its ❦ ornaments outside its own box at
   left/right: -1.4rem. Once the badge fills its line those ornaments push past
   the viewport and the page gains horizontal scroll — caught on French at
   390px on marketing.cuearr.com. Reserve the gutters so no label can do it. */
.chapter-badge { max-width: calc(100% - 3.2rem); }
