/* ============================================================
   GAME ROOM NETWORK — DESIGN SYSTEM (v2, brand-guide rebuild)
   Palette: Deep Black / Charcoal + Neon Amethyst accent.
   Type: Clash Display (chunky geometric) + General Sans (body).
   Energy: premium foundation, loud arcade hero/section moments.
   ============================================================ */

:root {
  /* --- Surfaces (brand: Deep Black #0A0D0E, Charcoal #1A1D20) --- */
  --black: #0a0d0e;
  --bg: #0d1013;
  --charcoal: #1a1d20;
  --surface: #16191d;
  --surface-2: #1e2228;
  --surface-3: #262b32;
  --line: #2a2f37;
  --line-soft: #202429;

  /* --- Brand accent: Neon Amethyst #7F4CFE --- */
  --am: #7f4cfe;
  --am-lo: #9a72ff; /* lighter */
  --am-hi: #5b2fd1; /* deeper (gradient end) */
  --am-ink: #ffffff;
  --am-glow: rgba(127, 76, 254, 0.45);
  --am-tint: rgba(127, 76, 254, 0.14);
  --am-line: rgba(127, 76, 254, 0.4);

  /* --- Text (cream headings from wordmark, cool grey body) --- */
  --cream: #f2ede1; /* display headings */
  --text: #e7e9ee;
  --grey: #d5d5d5; /* brand Cool Grey */
  --muted: #99a1ad;
  --faint: #626b78;

  --star: #f4c23b;

  /* --- Geometry --- */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --sidebar-w: 277px;
  --header-h: 64px;
  --rail-w: 300px;
  --maxw: 1560px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-am: 0 12px 34px rgba(127, 76, 254, 0.35);

  --font-display:
    "Clash Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font:
    "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
/* A focused game iframe receives its own keyboard events. Prevent those events
   from scroll-chaining into the host page while arrow keys control the game. */
html.game-input-active,
html.game-input-active body {
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: var(--am);
  color: #fff;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #2c323b;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a424e;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.am {
  color: var(--am);
}

/* ---------- Layout shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(10, 13, 14, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: calc(var(--sidebar-w) - 22px);
}
.brand__logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand__logo--footer {
  height: 46px;
}

.search {
  flex: 1;
  max-width: 580px;
  position: relative;
}
.search input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 44px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.search input:focus {
  border-color: var(--am);
  box-shadow: 0 0 0 3px var(--am-tint);
}
.search input::placeholder {
  color: var(--faint);
}
.search__icon {
  position: absolute;
  left: 7px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--faint);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.search__icon:hover {
  color: var(--text);
  background: var(--surface-2);
}
.search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--faint);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.search__clear:hover {
  color: var(--text);
  background: var(--surface-2);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ---------- Buttons ---------- */
.btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.08s,
    box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-3);
  border-color: #384049;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: linear-gradient(135deg, var(--am-lo), var(--am-hi));
  border-color: transparent;
  color: var(--am-ink);
  font-weight: 700;
  box-shadow: 0 6px 18px var(--am-glow);
}
.btn--primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 8px 24px var(--am-glow);
}
.btn--ghost {
  background: transparent;
}

.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 16px 12px 30px;
  background: var(--black);
}
.nav-group {
  margin-bottom: 18px;
}
.nav-group__label {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 4px 12px 10px;
  font-family: var(--font-display);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 550;
  font-size: 14.5px;
  transition:
    background 0.12s,
    color 0.12s;
}
.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-item.is-active {
  background: var(--am-tint);
  color: var(--cream);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--am);
}
.nav-item__icon {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
  font-size: 17px;
}
.nav-item__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item__icon .nav-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.nav-item__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  font-weight: 600;
}
.nav-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 12px 8px;
}

/* ---------- Main ---------- */
.main {
  min-width: 0;
  padding: 24px clamp(16px, 3vw, 34px) 60px;
}
.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 26px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.content-wrap--single {
  grid-template-columns: minmax(0, 1fr);
}
.content-main {
  min-width: 0;
}

.section {
  margin-bottom: 38px;
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.section__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Tiny brand aperture as the header bullet (masked so any ▸ glyph is hidden) */
.section__title .tick {
  display: inline-block;
  flex-shrink: 0;
  width: 0.82em;
  height: 0.82em;
  background: linear-gradient(135deg, var(--am-lo), var(--am));
  -webkit-mask: url("../img/grn-mark.svg") center / contain no-repeat;
  mask: url("../img/grn-mark.svg") center / contain no-repeat;
  text-indent: 200px;
  overflow: hidden;
  line-height: 0;
}
.section__link {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.section__link:hover {
  color: var(--am-lo);
}

/* ---------- HERO (loud, full-bleed featured) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  min-height: 420px;
  margin-bottom: 38px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.hero__art {
  position: absolute;
  inset: 0;
  z-index: -3;
}
.hero__art .cover {
  width: 100%;
  height: 100%;
}
.hero__art::after {
  /* amethyst wash to unify any art with the brand */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 100% at 80% 20%,
    var(--am-glow),
    transparent 60%
  );
  mix-blend-mode: screen;
  opacity: 0.55;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      90deg,
      var(--black) 8%,
      rgba(10, 13, 14, 0.75) 42%,
      transparent 72%
    ),
    linear-gradient(0deg, var(--black) 4%, transparent 44%);
}
/* Brand mark woven into the hero — a single quiet, background-matched
   watermark (the logo's aperture blades) bleeding off the right, recolored
   via CSS mask so it reads as an ambient brand detail, not a plonked logo. */
.hero__mark {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  /* Anchored LEFT with a fixed offset so it stays locked behind the
     (left-aligned) text at any viewport width, not drifting on resize. */
  top: 50%;
  left: -70px;
  width: 640px;
  height: 640px;
  transform: translateY(-50%) rotate(-6deg);
  /* Even tint behind the text, fading to transparent toward the right so it
     stays subtle and doesn't wash over the artwork. */
  background: linear-gradient(
    100deg,
    rgba(154, 114, 255, 0.17) 0%,
    rgba(140, 95, 240, 0.08) 45%,
    rgba(127, 76, 254, 0) 72%
  );
  -webkit-mask: url("../img/grn-mark.svg") center / contain no-repeat;
  mask: url("../img/grn-mark.svg") center / contain no-repeat;
}
.hero__body {
  position: relative;
  padding: clamp(24px, 4vw, 46px);
  max-width: 640px;
}
.hero__kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--am-lo);
  background: var(--am-tint);
  border: 1px solid var(--am-line);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 10px;
}
.hero__title .am {
  background: linear-gradient(120deg, var(--am-lo), var(--am));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tagline {
  color: var(--grey);
  font-size: 17px;
  margin-bottom: 18px;
  max-width: 46ch;
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}
.hero__meta b {
  color: var(--cream);
}
.hero__meta .sep {
  color: var(--faint);
}
.hero__meta .star {
  color: var(--star);
}
.hero__cta {
  height: 50px;
  padding: 0 28px;
  font-size: 15.5px;
  border-radius: 12px;
}

/* ---------- Game grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.grid--related {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.grid--related .card__title {
  font-size: 13px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--am-line);
  box-shadow: var(--shadow-am);
}
.card__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card__thumb .cover {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}
.card:hover .card__thumb .cover {
  transform: scale(1.06);
}
.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 13, 14, 0.5);
  opacity: 0;
  transition: opacity 0.16s;
}
.card:hover .card__play {
  opacity: 1;
}
.card__play span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--am-lo), var(--am-hi));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-am);
}
.card__rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 13, 14, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}
.card__rating .s {
  color: var(--star);
}
.card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
}
/* Rank badge for the Top Games row */
.card__badge--rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  background: linear-gradient(135deg, var(--am-lo), var(--am-hi));
  box-shadow: 0 4px 14px var(--am-glow);
}
.card--lg .card__badge--rank {
  width: 36px;
  height: 36px;
  font-size: 19px;
  border-radius: 11px;
}
.card__body {
  padding: 11px 13px 13px;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  color: var(--cream);
}
.card__cats {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.card--lg {
  grid-column: span 2;
  grid-row: span 2;
}
/* Let the image fill the tall card so the text strip stays compact (matching
   the stacked cards beside it) instead of leaving empty space below the text. */
.card--lg .card__thumb {
  aspect-ratio: auto;
  flex: 1 1 auto;
  min-height: 240px;
}
.card--lg .card__title {
  font-size: 18px;
}

.empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 50px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Cover art (branded placeholder: charcoal + amethyst) ---------- */
.cover {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--charcoal);
  overflow: hidden;
}
.cover--img > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover__label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cream);
  text-align: center;
  padding: 0 14px;
  line-height: 1.05;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  z-index: 2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- Right rail + ads ---------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rail__sticky {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ad {
  position: relative;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.012) 0 12px,
      transparent 12px 24px
    ),
    var(--surface);
  border: 1px dashed #333a44;
  border-radius: var(--radius-sm);
  color: var(--faint);
  overflow: hidden;
  margin: 0 auto;
}
.ad__tag {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--faint);
  font-family: var(--font-display);
}
.ad__body {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.ad__body small {
  display: block;
  color: #3f4653;
  margin-top: 2px;
}
.ad--leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin-bottom: 26px;
}
.ad--rect {
  width: 300px;
  height: 250px;
}
.ad--halfpage {
  width: 300px;
  height: 600px;
}
.ad--mobile {
  display: none;
  width: 320px;
  height: 50px;
}

/* ---------- Play page ---------- */
.play-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}
.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a:hover {
  color: var(--am-lo);
}
.breadcrumb .sep {
  color: var(--faint);
}

.stage {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow);
}
.stage__frame {
  position: relative;
  width: 100%;
  background: #05070a;
}
.stage__frame.is-landscape {
  aspect-ratio: 16 / 9;
}
.stage__frame.is-portrait {
  aspect-ratio: 3 / 4;
  max-width: 560px;
  margin: 0 auto;
}
.stage__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.stage__poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
}
.stage__poster .cover {
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: brightness(0.55);
}
.stage__poster .play-big {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--am-lo), var(--am-hi));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-am);
  transition: transform 0.15s;
}
.stage__poster:hover .play-big {
  transform: scale(1.08);
}
.stage__poster .play-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stage__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--charcoal);
  border-top: 1px solid var(--line);
}
.stage__bar .g-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.stage__bar .g-icon .cover {
  width: 100%;
  height: 100%;
}
.stage__bar .g-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--cream);
}
.stage__bar .g-dev {
  color: var(--muted);
  font-size: 12px;
}
.stage__bar .g-stats {
  margin-left: auto;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  align-items: center;
}
.stage__bar .g-stats b {
  color: var(--cream);
}
.stage__bar .s {
  color: var(--star);
}
.iconbtn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
}
.iconbtn:hover {
  background: var(--surface-3);
  border-color: var(--am-line);
}

.gameinfo {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
}
.gameinfo__head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.gameinfo__logo {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.gameinfo__logo .cover {
  width: 100%;
  height: 100%;
}
.gameinfo__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.gameinfo__tagline {
  color: var(--muted);
}
.gameinfo__desc {
  color: var(--grey);
  margin-bottom: 16px;
}
.gameinfo__desc p {
  margin-bottom: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
}
.chip:hover {
  color: var(--cream);
  border-color: var(--am-line);
}

/* ---------- Static content pages ---------- */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 4px 40px;
}
.page .policy-brand {
  color: var(--am-lo);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.page h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.page .lede {
  color: var(--grey);
  font-size: 17px;
  margin-bottom: 26px;
}
.page h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--cream);
}
.page p,
.page li {
  color: var(--grey);
  margin-bottom: 12px;
}
.page ul,
.page ol {
  padding-left: 22px;
  margin-bottom: 12px;
}
.page a.link {
  color: var(--am-lo);
  font-weight: 600;
}
.page a.link:hover {
  text-decoration: underline;
}
.page .updated {
  color: var(--faint);
  font-size: 13px;
  margin-bottom: 24px;
}
.card-panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
}
.page .legal-notice {
  border-left: 4px solid var(--am);
  color: var(--cream);
  font-weight: 700;
}
.terms-page h2 {
  scroll-margin-top: calc(var(--header-h) + 18px);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--black);
  padding: 38px clamp(16px, 3vw, 34px) 30px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
}
.footer__brand .brand {
  min-width: 0;
  margin-bottom: 14px;
}
.footer__brand p {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 330px;
}
.footer__col h4 {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faint);
  margin-bottom: 12px;
}
.footer__col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 5px 0;
}
.footer__col a:hover {
  color: var(--am-lo);
}
.footer__col .footer__privacy-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.footer__privacy-icon {
  display: block;
  flex: 0 0 auto;
}
.footer__bar {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13px;
}

/* ============================================================
   ANIMATIONS & POLISH
   ============================================================ */
@keyframes grn-holespin {
  /* rotate + pulse = "black hole" */
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(0.84);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}
@keyframes grn-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(127, 76, 254, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(127, 76, 254, 0.9));
  }
}
@keyframes grn-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes grn-shimmer {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -180% 0;
  }
}
@keyframes grn-btnglow {
  0%,
  100% {
    box-shadow: 0 6px 18px var(--am-glow);
  }
  50% {
    box-shadow: 0 6px 26px var(--am-glow);
  }
}

/* ---- Aperture "black hole" loader ---- */
.grn-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.grn-loader {
  position: relative;
  width: var(--s, 64px);
  height: var(--s, 64px);
}
.grn-loader__ring {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  background: radial-gradient(
    circle at 50% 50%,
    var(--am-lo),
    var(--am-hi) 72%
  );
  -webkit-mask: url("../img/grn-mark.svg") center / contain no-repeat;
  mask: url("../img/grn-mark.svg") center / contain no-repeat;
  animation:
    grn-holespin 2.2s cubic-bezier(0.6, 0, 0.4, 1) infinite,
    grn-glow 1.8s ease-in-out infinite;
}
.grn-loader__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Skeleton loading cards ---- */
.skeleton {
  background: linear-gradient(
    100deg,
    var(--surface) 28%,
    var(--surface-3) 46%,
    var(--surface) 64%
  );
  background-size: 220% 100%;
  animation: grn-shimmer 1.5s ease-in-out infinite;
}
.skel-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.skel-card__thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
}
.skel-card__body {
  padding: 11px 13px 15px;
}
.skel-line {
  height: 12px;
  border-radius: 6px;
}
.skel-line.sm {
  height: 9px;
  width: 55%;
  margin-top: 9px;
}

/* ---- Staggered card entrance (initial load only) ---- */
.grid--enter > .card {
  animation: grn-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---- Micro-interactions ---- */
.nav-item {
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.12s;
}
.nav-item:hover {
  transform: translateX(2px);
}
.app.rail-collapsed .nav-item:hover {
  transform: none;
}
.btn--primary:hover {
  animation: grn-btnglow 1.6s ease-in-out infinite;
}
.card__thumb::after {
  /* shine sweep on hover */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}
.card:hover .card__thumb::after {
  transform: translateX(120%);
}

/* ---- Game-stage loading overlay ---- */
.stage__loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #14101f, var(--black));
}

/* ============================================================
   COLLAPSIBLE LEFT RAIL
   ============================================================ */
.layout {
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar {
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item__label,
.nav-item__count {
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.app.rail-collapsed {
  --sidebar-w: 78px;
}
.app.rail-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}
.app.rail-collapsed .nav-group__label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.app.rail-collapsed .nav-item {
  justify-content: center;
  gap: 0;
}
.app.rail-collapsed .nav-item__label,
.app.rail-collapsed .nav-item__count {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.app.rail-collapsed .nav-item__icon {
  width: auto;
}

/* The toggle "tab" straddling the sidebar's right edge */
.rail-toggle {
  position: fixed;
  z-index: 46;
  top: calc(var(--header-h) + 16px);
  left: calc(var(--sidebar-w) - 14px);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition:
    left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.15s,
    color 0.15s,
    transform 0.1s;
}
.rail-toggle:hover {
  background: var(--am);
  color: #fff;
  border-color: var(--am);
}
.rail-toggle:active {
  transform: scale(0.92);
}
.rail-toggle svg {
  transition: transform 0.3s ease;
}
.app.rail-collapsed .rail-toggle svg {
  transform: rotate(180deg);
}

/* ---- Respect reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grn-loader__ring {
    animation: grn-glow 2s ease-in-out infinite !important;
  }
}

/* ---------- Responsive ---------- */
.scrim {
  display: none;
}
@media (max-width: 1200px) {
  .content-wrap {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
  .ad--mobile {
    display: grid;
  }
  /* When the mobile ad shows under the leaderboard, balance the gaps so it
     sits centered between the leaderboard and the hero (not glued to the hero). */
  .ad--leaderboard {
    margin-bottom: 14px;
  }
  .ad--mobile {
    margin-bottom: 14px;
  }
  .grid--related {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  :root {
    --header-h: 56px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .rail-toggle {
    display: none;
  } /* mobile uses the hamburger drawer */
  .app.rail-collapsed {
    --sidebar-w: 264px;
  } /* ignore collapse on mobile */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    z-index: 45;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .app.rail-collapsed .nav-item__label,
  .app.rail-collapsed .nav-item__count {
    opacity: 1;
    width: auto;
  }
  .app.rail-collapsed .nav-item {
    justify-content: flex-start;
    gap: 12px;
  }
  .app.nav-open .sidebar {
    transform: translateX(0);
  }
  .app.nav-open .scrim {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 44;
    background: rgba(0, 0, 0, 0.55);
  }
  .hamburger {
    display: inline-flex;
  }
  .header {
    gap: 10px;
    padding: 0 12px;
  }
  .brand {
    min-width: 0;
  }
  .brand__logo {
    height: 32px;
  }
  .header__actions .btn:not(.btn--primary) {
    display: none;
  }
  .header__actions .btn span {
    display: none;
  }
  .hero {
    min-height: 380px;
  }
  .card--lg {
    grid-column: span 2;
    grid-row: auto;
  }
  .card--lg .card__thumb {
    aspect-ratio: 4/3;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
  .stage__bar {
    flex-wrap: wrap;
  }
  .stage__bar .g-stats {
    width: 100%;
    margin-left: 0;
  }
}
