/* =========================================================================
   REBEL CARS // pages/the-game.css
   The Game page only. Everything here is prefixed .game-
   01  Hero (rear-view car from darkness, callouts, facts strip)
   02  01 // Game modes (designed card grid, lead card)
   03  02 // True Traction (chips, ecosystem note, sticky media frame)
   04  03 // Under the hood (spec-sheet panels, SYS.02 in Ethereum blue)
   05  Garage // Studio renders (showcase band)
   06  Closing band
   ========================================================================= */


/* =========================================================================
   01  HERO
   ========================================================================= */
.game-hero {
  padding-bottom: 0;
  background:
    radial-gradient(42% 52% at 78% 44%, rgba(232,34,47,.15), transparent 70%),
    radial-gradient(30% 40% at 0% 100%, rgba(232,34,47,.06), transparent 70%);
}
/* Never higher than 20px below the fixed header (half height = .2752 x width). */
.rc-pagehero > .game-hero__outline { top: max(44%, calc(var(--header-h) + 20px + max(270px, 22.57vw))); right: -20%; width: max(980px, 82vw); }

.game-hero__copy { position: relative; z-index: 1; gap: 26px; }
.game-hero__title { max-width: 12ch; font-size: clamp(3.2rem, 6.6vw, 6.4rem); }
.game-hero__lead { max-width: 36rem; font-size: clamp(1.08rem, 1.35vw, 1.22rem); line-height: 1.6; color: var(--text-2); }

/* Car: wider than its column and pulled left under the copy edge; an oval
   mask lets it emerge from darkness. The floor fade also hides the studio
   credit at the bottom-left of the render completely. */
.game-hero__visual { align-self: center; }
.game-hero__car {
  position: relative;
  isolation: isolate;
  width: 142%;
  margin-left: -34%;
}
.js .game-hero__car { animation: game-car-in 1.4s var(--ease) .15s both; }
.game-hero .game-hero__car img {
  width: 100%;
  -webkit-mask-image:
    radial-gradient(60% 68% at 50% 46%, #000 56%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 17%, #000 68%, transparent 86%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(60% 68% at 50% 46%, #000 56%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 17%, #000 68%, transparent 86%);
  mask-composite: intersect;
}
/* Faint red bloom at tail-light height, screened over the render. */
.game-hero__car::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 40%;
  height: 28%;
  background: radial-gradient(closest-side, rgba(232,34,47,.45), rgba(232,34,47,0));
  filter: blur(24px);
  mix-blend-mode: screen;
  opacity: .5;
  pointer-events: none;
}

/* HUD call-outs, positioned in % of the image (same language as the home hero). */
.game-hero__callout {
  position: absolute;
  z-index: 1;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
  font: 500 .64rem/1 var(--font-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-3);
}
.game-hero__callout::before {
  content: "";
  position: absolute;
  right: -1px;
  top: 100%;
  width: 1px;
  height: var(--drop, 3vw);
  background: linear-gradient(180deg, var(--line-2), rgba(255,255,255,.35));
}
.game-hero__callout::after {
  content: "";
  position: absolute;
  right: -3px;
  top: calc(100% + var(--drop, 3vw));
  width: 5px;
  height: 5px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.game-hero__callout--wing { right: 15.5%; top: 9%; --drop: 2.6vw; }
/* Tail-light call-out sits below the car, its leader line rises to the lamp. */
.game-hero__callout--light { right: 66%; top: 74%; padding: 6px 0 0; border-bottom: 0; border-top: 1px solid var(--line-2); --drop: 7vw; }
.game-hero__callout--light::before { top: auto; bottom: 100%; background: linear-gradient(0deg, var(--line-2), rgba(255,255,255,.35)); }
.game-hero__callout--light::after { top: auto; bottom: calc(100% + var(--drop)); }

/* Facts strip: the hero's bottom status bar. */
.game-hero__facts { position: relative; z-index: 1; margin-top: clamp(40px, 5vw, 72px); }
.game-hero__facts .rc-facts { border-bottom: 0; }

@media (max-width: 1179px) {
  .game-hero__callouts { display: none; }
}
@media (max-width: 960px) {
  .game-hero__car { width: 128%; margin-left: -14%; }
  .rc-pagehero > .game-hero__outline { top: auto; bottom: 4%; right: -40%; width: 160vw; transform: none; }
  .game-hero__facts { margin-top: 8px; }
}


/* =========================================================================
   02  01 // GAME MODES
   3 x 3 cells on desktop: the lead card (M/01) takes a 2 x 2 block, M/02
   and M/03 stack beside it, M/04 to M/06 run along the bottom row.
   ========================================================================= */
.game-modes__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.game-mode p { font-size: 1rem; }
.game-mode .rc-link { margin-top: auto; align-self: flex-start; }

.game-mode--lead {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: flex-end;
  min-height: 460px;
  padding: clamp(28px, 3.4vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(232,34,47,.12), transparent 70%),
    var(--panel);
}
.game-mode--lead::before { width: 22px; height: 22px; }
.game-mode--lead:hover::before,
.game-mode--lead:focus-within::before { width: 36px; height: 36px; }
.game-mode--lead .rc-card__index { top: clamp(28px, 3.4vw, 48px); right: clamp(28px, 3.4vw, 48px); color: var(--red-bright); }

/* Giant outlined numeral: the "one memorable move" of this section. */
.game-mode__num {
  position: absolute;
  top: clamp(12px, 2vw, 28px);
  left: clamp(22px, 3vw, 44px);
  padding-top: .08em;
  font: 500 clamp(9rem, 17vw, 16rem)/.8 var(--font-display);
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  pointer-events: none;
  user-select: none;
}
.game-mode__foot { position: relative; display: grid; gap: 20px; }
.game-mode--lead .rc-card__title {
  max-width: 16ch;
  padding: .08em 0 0;
  font: 500 clamp(2.4rem, 4.2vw, 3.8rem)/.92 var(--font-display);
  letter-spacing: .01em;
  color: var(--text);
}
.game-mode--lead p { max-width: 46ch; font-size: clamp(1.08rem, 1.3vw, 1.2rem); line-height: 1.6; color: var(--text-2); }
.game-mode__ruler { width: min(100%, 420px); margin-top: 8px; }

/* Studio render inside the lead card: anchored top-right, masked so it fades
   into the panel to the left and towards the text block at the bottom. The
   numeral, index and text are positioned later in the DOM and paint above it. */
.game-mode__art {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  aspect-ratio: 16 / 10;
  pointer-events: none;
}
.game-mode__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  mix-blend-mode: lighten; /* the black studio backdrop drops out, the panel wash stays */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 34%, #000 86%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 46%, transparent 78%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 34%, #000 86%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 14%, #000 46%, transparent 78%);
  mask-composite: intersect;
  transition: opacity .24s var(--ease);
}
.game-mode--lead:hover .game-mode__art img { opacity: 1; }

@media (max-width: 1099px) {
  .game-modes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-mode--lead { grid-row: auto; min-height: 0; padding-top: clamp(150px, 19vw, 200px); }
  .game-mode--last { grid-column: 1 / -1; }
  /* Narrower art; the text block starts in the faded lower part of the image. */
  .game-mode__art { width: 66%; }
  .game-mode--lead { padding-top: 27%; }
}
@media (max-width: 720px) {
  .game-modes__grid { grid-template-columns: minmax(0, 1fr); }
  .game-mode--lead,
  .game-mode--last { grid-column: auto; }
  /* Text starts below the car (car ends at about 75% of the image height). */
  .game-mode--lead { min-height: 0; padding-top: 54%; }
  /* The render takes the numeral's place on phones. */
  .game-mode__num { display: none; }
  .game-mode__art { width: 100%; }
  .game-mode__art img {
    -webkit-mask-image:
      linear-gradient(90deg, transparent 0%, #000 22%, #000 94%, transparent 100%),
      linear-gradient(180deg, transparent 0%, #000 10%, #000 56%, transparent 86%);
    mask-image:
      linear-gradient(90deg, transparent 0%, #000 22%, #000 94%, transparent 100%),
      linear-gradient(180deg, transparent 0%, #000 10%, #000 56%, transparent 86%);
  }
}


/* =========================================================================
   03  02 // TRUE TRACTION
   ========================================================================= */
.game-traction { --glow-x: 6%; --glow-y: 420px; }
.game-traction__head { margin-bottom: 40px; }

.game-traction__label {
  margin-bottom: 16px;
  font: 500 .72rem/1.2 var(--font-mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.game-traction__copy { display: grid; gap: 1.1em; margin-top: 40px; }
.game-traction__note { margin-top: 44px; }
.game-traction__notebody p { font-size: 1rem; }
.game-traction__notebody > * + * { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.game-traction__visual {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}
/* 3:2 wheel close-up: the tall crop keeps the whole wheel (file x 10-45%) centred,
   the 4:3 crop adds the side panel and sill to the right. */
.game-traction__media img { aspect-ratio: 4 / 5; object-position: 4% 50%; }

@media (max-width: 960px) {
  .game-traction__visual { position: relative; top: auto; max-width: 560px; }
  .game-traction__media img { aspect-ratio: 4 / 3; object-position: 0% 50%; }
}
.game-traction__media .rc-media__cap span { white-space: nowrap; }
@media (max-width: 480px) {
  .game-traction__media .rc-media__cap > span:last-child { display: none; }
}


/* =========================================================================
   04  03 // UNDER THE HOOD (spec sheet)
   ========================================================================= */
.game-sys { --glow-x: 92%; --glow-y: 300px; }

/* Thin header bar above the sheet. */
.game-sys__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  font: 500 .68rem/1 var(--font-mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.game-sys__bar::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.game-sys__bar span { white-space: nowrap; }
.game-sys__bar span:first-child { flex: 1; display: flex; align-items: center; gap: 16px; }
.game-sys__bar span:first-child::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--line)); }

.game-sys__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
.game-sys__panel { display: flex; flex-direction: column; }
.game-sys__panel .rc-panel__title { max-width: none; }
.game-sys__body { flex: 1; }
.game-sys__body > * + * { margin-top: 16px; }
.game-sys__name { font-size: clamp(1.75rem, 2.5vw, 2.3rem); line-height: .95; }
.game-sys__text { display: grid; gap: 1em; }
.game-sys__text p { font-size: 1rem; }
.game-sys__em { padding-left: 16px; border-left: 2px solid var(--red); color: var(--text); }

/* SYS.02 (inside .rc-eth, so bracket, title square and rule are blue): the
   faceted Ethereum mark sits beside the name, the text keeps the full width. */
.game-sys__ethhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.game-sys__ethmark {
  height: clamp(92px, 8.4vw, 124px);
  margin: 4px clamp(4px, 1.2vw, 16px) 0 0;
}
.game-sys__chain { display: grid; gap: 14px; }
.game-sys__ethtags { padding-left: 18px; }

/* SYS.01 spans the full width: big name on the left, text column on the right. */
.game-sys__panel--lead { grid-column: 1 / -1; }
.game-sys__panel--lead .game-sys__body {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 24px clamp(32px, 5vw, 80px);
  padding-block: clamp(28px, 3.4vw, 48px);
}
.game-sys__panel--lead .game-sys__body > * + * { margin-top: 0; }
.game-sys__panel--lead .game-sys__name { font-size: clamp(3.2rem, 7vw, 6.4rem); line-height: .85; }
.game-sys__panel--lead .game-sys__text p { font-size: 1.0625rem; }
.game-sys__panel--lead .game-sys__text p:first-child { color: var(--text); }

@media (max-width: 960px) {
  .game-sys__panel--lead .game-sys__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .game-sys__grid { grid-template-columns: minmax(0, 1fr); }
}
/* Narrow phones: the decorative counters would wrap under the titles. */
@media (max-width: 480px) {
  .game-sys__panel .rc-panel__meta,
  .game-traction__note .rc-panel__meta { display: none; }
}
/* Smallest phones: tighter tracking keeps "SYS.03 // ANTI-CHEAT" on one line. */
@media (max-width: 400px) {
  .game-sys__panel .rc-panel__title { gap: 12px; letter-spacing: .14em; }
}


/* =========================================================================
   05  GARAGE // STUDIO RENDERS (unnumbered showcase band)
   One large lead frame with two 3:2 detail frames stacked beside it. Column
   ratio 2.24 : 1 makes the lead frame come out at about 16:10. Tablet: lead
   on top, details side by side. Phones: one snapping strip of 3:2 frames.
   ========================================================================= */
.game-garage__bar { display: flex; align-items: center; gap: 28px; margin-bottom: clamp(28px, 3.4vw, 44px); }
.game-garage__ruler { flex: 1; min-width: 0; opacity: .7; }

.game-garage__grid {
  display: grid;
  grid-template-columns: minmax(0, 2.24fr) minmax(0, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.game-garage__item--lead { grid-row: 1 / span 2; }
.game-garage__media { height: 100%; margin: 0; overflow: hidden; background: #000; }
/* Whole-car renders (16:10 files): shown uncropped. */
.game-garage__media img { aspect-ratio: 16 / 10; transition: transform .6s var(--ease); }
.game-garage__item--lead .game-garage__media img { object-position: 50% 42%; }
/* Companion captions sit at the top edge, clear of the cars and of the credit
   baked into the bottom-left corner of REF // 03. */
.game-garage__item:not(.game-garage__item--lead) .rc-media__cap {
  top: 0;
  bottom: auto;
  padding: 12px 16px 26px;
  background: linear-gradient(180deg, rgba(5,6,8,.92) 35%, rgba(5,6,8,0));
}
/* Hover zoom grows up and right, so the bottom-left credit never gets clipped. */
.game-garage__item--credit .game-garage__media img { transform-origin: 0 100%; }
/* Desktop: the two detail frames set the row height; the lead image fills it. */
@media (min-width: 961px) {
  .game-garage__item--lead .game-garage__media img { position: absolute; inset: 0; aspect-ratio: auto; }
}
.game-garage__item:hover .game-garage__media img { transform: scale(1.03); }
.game-garage__media .rc-media__cap span { white-space: nowrap; }

@media (max-width: 960px) {
  .game-garage__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-garage__item--lead { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 720px) {
  .game-garage__ruler { display: none; }
  /* Horizontal, snapping strip (keyboard-focusable via data-scroll-region). */
  .game-garage__strip {
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .game-garage__strip:focus-visible { outline-offset: -2px; }
  .game-garage__grid { display: flex; gap: 16px; width: max-content; }
  .game-garage__item { flex: none; width: min(84vw, 340px); scroll-snap-align: start; }
  .game-garage__item--lead .rc-media__cap > :last-child { display: none; }
  .game-garage__item:hover .game-garage__media img { transform: none; }
}


/* =========================================================================
   06  CLOSING BAND
   ========================================================================= */
.game-cta__title { font-size: clamp(3rem, 8vw, 6.4rem); line-height: .86; }
@media (max-width: 480px) {
  .game-cta__actions { width: 100%; }
  .game-cta__actions .rc-btn { width: 100%; }
}


@media (prefers-reduced-motion: reduce) {
  .js .game-hero__car { animation: none; }
  .game-garage__media img,
  .game-mode__art img { transition: none; }
  .game-garage__item:hover .game-garage__media img { transform: none; }
}

/* Keyframes (this page only) */
@keyframes game-car-in {
  from { opacity: 0; transform: translateX(3%) scale(1.02); }
  to { opacity: 1; transform: none; }
}
