/* ===========================================================================
   Home page — short, calm, bloxswaps-like:
   hero (copy + static mascot) · the live line + one showcase row (most
   valuable / new on the market, per game; it drifts slowly on its own, see
   home.js "autoplay") · 3 compact steps · CTA.
   Rules for this page: no other looping animation (only the live dot and the
   two .btn-shine CTAs), NO outlines — depth comes from surface contrast only.
   Layered on app.css + shell.css.
   =========================================================================== */

.home { position: relative; }

/* reveal-on-scroll: hide [data-io] only while JS runs (content stays visible
   without JS); observeReveals() adds .reveal which fades it in once */
.home.js-io [data-io]:not(.reveal) { opacity: 0; }

.hm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@keyframes hm-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes hm-fade { from { opacity: 0; transform: translateY(10px); } }

.hm-in { animation: hm-rise 620ms var(--ease-out-quart) var(--d, 0ms) backwards; }

/* ---------------------------------------------------------------- hero */
.hm-hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--header-h) + 60px) 0 0;
  overflow: clip;
}
.hm-hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 520px at 8% -6%, rgba(109, 40, 217, .22), transparent 70%),
    radial-gradient(720px 600px at 80% 26%, rgba(139, 92, 246, .13), transparent 70%);
}
.hm-hero-bg::before { /* faint static dot grid */
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.3px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(60% 55% at 38% 34%, #000 10%, transparent 75%);
  mask-image: radial-gradient(60% 55% at 38% 34%, #000 10%, transparent 75%);
  opacity: .5;
}

.hm-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: 28px;
  min-height: 450px;
}
.hm-hero-copy { position: relative; z-index: 2; min-width: 0; }

.hm-h1 {
  margin: 20px 0 16px;
  font-size: clamp(40px, 4.5vw, 62px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.025em;
}
.hm-h1-line { display: block; }
.hm-h1-grad {
  padding-bottom: .06em;
  background: linear-gradient(90deg, #c4b5fd 0%, #a78bfa 35%, #8b5cf6 70%, #7c3aed 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hm-lede {
  max-width: 540px;
  margin: 0 0 28px;
  font-size: 16.5px; font-weight: 400; line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty; /* no one-word last line ("seconds.") */
}
.hm-lede b { color: rgba(255, 255, 255, .9); font-weight: 600; }

.hm-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hm-cta .btn-lg, .hm-banner-cta .btn-lg { height: 52px; padding: 0 26px; border-radius: 14px; font-weight: 700; }
.hm-btn-main {
  border: 0;
  box-shadow: 0 10px 28px rgba(124, 58, 237, .38); /* drop shadow only: same flat primary as every other button */
  transition: transform 250ms var(--ease-out-quart), box-shadow 250ms var(--ease-out), filter 150ms;
}
.hm-btn-main:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 36px rgba(124, 58, 237, .5); }
.hm-btn-main:active { transform: scale(.97); }
.hm-btn-main .hm-btn-arrow { transition: transform 250ms var(--ease-out-quart); }
.hm-btn-main:hover .hm-btn-arrow { transform: translateX(3px); }
.hm-btn-alt {
  background: #161a22;
  transition: transform 250ms var(--ease-out-quart), background-color 150ms;
}
.hm-btn-alt:hover { background: #1d222c; transform: translateY(-2px); }
.hm-btn-alt:active { transform: scale(.97); }

.hm-coins { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: 13px; color: var(--muted); }
.hm-coin-stack { display: inline-flex; flex: none; gap: 5px; }
.hm-coin-stack img { width: 22px; height: 22px; border-radius: 50%; transition: transform 250ms var(--ease-out-quart); }
.hm-coin-stack img:hover { transform: translateY(-3px); }
.hm-coins-text { white-space: nowrap; }

/* mascot stage — static: no float, no parallax, no spinning ring */
.hm-stage {
  position: relative;
  height: 450px;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.hm-stage-glow {
  position: absolute; left: 50%; top: 48%;
  width: 400px; height: 440px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .36), rgba(109, 40, 217, .12) 58%, transparent 100%);
}
.hm-stage-floor {
  position: absolute; left: 50%; bottom: 8px;
  width: 210px; height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(76, 29, 149, .3) 60%, transparent);
}
.hm-mascot {
  position: relative;
  height: 410px; width: auto; max-width: none;
  margin-bottom: 14px;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .5));
  user-select: none; -webkit-user-drag: none;
  animation: hm-fade 700ms var(--ease-out-quart) 140ms backwards; /* one-time entrance */
}

/* ---------------------------------------------------------------- sections */
.home .section { margin-top: 80px; }
.hm-section { position: relative; }
.hm-title { margin-bottom: 16px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; letter-spacing: -.01em; }
.hm-title span { color: var(--accent-hover); }
.hm-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  font-size: 14px; font-weight: 600; color: var(--accent-hover); white-space: nowrap;
  transition: color 150ms, gap 200ms var(--ease-out-quart);
}
.hm-link:hover { color: #c4b5fd; gap: 10px; }

/* ---------------------------------------------------------------- showcase row */

.hm-show-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 10px; }
.hm-modes { display: flex; align-items: center; gap: 24px; min-width: 0; }
.hm-mode {
  position: relative;
  height: 44px; padding: 0;
  font-size: clamp(20px, 2vw, 26px); font-weight: 800; letter-spacing: -.01em; white-space: nowrap;
  color: rgba(255, 255, 255, .5); /* ~5:1 on the canvas: readable and clearly a tab, still well below the white active one */
  transition: color 200ms var(--ease-out);
}
.hm-mode:hover { color: rgba(255, 255, 255, .78); }
.hm-mode.on { color: #fff; }
.hm-mode::after {
  content: ''; position: absolute; left: 0; bottom: 1px; width: 28px; height: 3px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 10px rgba(139, 92, 246, .7);
  transform: scaleX(0); transform-origin: left;
  transition: transform 260ms var(--ease-out-fluid);
}
.hm-mode.on::after { transform: scaleX(1); }
.hm-mode:focus-visible { box-shadow: none; outline: none; color: #fff; text-decoration: underline; text-underline-offset: 6px; }

.hm-show-tools { display: flex; align-items: center; gap: 10px; }
.hm-gtabs .gt { height: 40px; cursor: pointer; }
.hm-arrows { display: flex; gap: 6px; }
.hm-arrow {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; background: #14181e;
  transition: background-color 150ms, transform 200ms var(--ease-out-quart), opacity 200ms;
}
.hm-arrow:hover:not(:disabled) { background: #1d222b; }
.hm-arrow:active:not(:disabled) { transform: scale(.92); }
.hm-arrow:disabled { opacity: .3; cursor: default; }

.hm-row-wrap { position: relative; transition: opacity 220ms var(--ease-out); }
.hm-row-wrap.is-switching { opacity: .4; }
/* autoplay: the row fades out, swaps to the next game (or back to its start) and fades in; the rail thumb glides */
.hm-show.is-cycle .hm-row-wrap { transition: opacity 380ms var(--ease-in-out); }
.hm-show.is-out .hm-row-wrap { opacity: 0; }
.hm-show.is-cycle .hm-thumb { transition: transform 600ms var(--ease-in-out), width 600ms var(--ease-in-out), background-color 150ms, height 150ms, margin-top 150ms; }
.hm-row {
  list-style: none; margin: 0 -4px; padding: 8px 4px 10px;
  display: flex; gap: 10px;
  min-height: 234px; /* = a row of tiles: skeletons, messages and tiles never change its height */
  overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 4px;
  scrollbar-width: none; /* the custom rail below replaces the native bar */
  -webkit-overflow-scrolling: touch;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.hm-row::-webkit-scrollbar { display: none; }
.hm-row.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.hm-row.is-auto { scroll-snap-type: none; } /* the drift writes scrollLeft every frame: snapping would pull it back */
.hm-row.is-calm .icard, .hm-row.is-calm .hm-row-msg { animation: none; } /* an autoplay swap only fades */
.hm-row.is-dragging .hm-tile { pointer-events: none; }
/* edge fades: home.js sizes each one by how far the row is from that end (0–56px), so they grow in, never snap */
.hm-row-wrap { --fl: 0px; --fr: 0px; }
.hm-row-wrap.has-fade .hm-row {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
}

.hm-cell { flex: none; width: 158px; scroll-snap-align: start; }
.hm-tile { display: block; height: 100%; border-radius: 12px; -webkit-user-drag: none; }
.hm-tile:focus-visible { box-shadow: none; }
.hm-tile:focus-visible .icard { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--accent), inset 0 -2px 0 rgb(var(--rc)); }
.hm-tile .icard { height: 100%; box-shadow: inset 0 -2px 0 rgb(var(--rc)); }
.hm-tile .icard.clickable:hover { box-shadow: inset 0 -2px 0 rgb(var(--rc)), 0 16px 30px rgba(0, 0, 0, .45); }
.hm-tile .ic-art img { -webkit-user-drag: none; }
.hm-tile .ic-meta { align-items: center; }
/* static variant looks: badges and art effects stand still on the home page */
.hm-row .icard *, .hm-row .icard *::before, .hm-row .icard *::after { animation: none !important; }
.hm-row .fx-mega img { filter: drop-shadow(0 0 8px rgba(217, 70, 239, .7)); }

.hm-val { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 13px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-val .vicon { width: 13px; height: 13px; }
.hm-age { flex: none; font-size: 11px; font-weight: 500; color: var(--muted); }

.hm-skel { flex: none; width: 158px; height: 216px; border-radius: 12px; background: #0e1118; }
.hm-skel:nth-child(2n) { background: #0d1016; }

.hm-row-msg {
  flex: 1 0 100%;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px 18px;
  min-height: 216px; padding: 24px;
  border-radius: 16px;
  background: #0e1118;
  cursor: default;
  animation: hm-fade 360ms var(--ease-out) backwards;
}
.hm-msg-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(139, 92, 246, .12); }
.hm-msg-ico img { opacity: .9; }
.hm-msg-ico.is-clock { color: var(--accent-hover); } /* a coming-soon game (staff console → Controls): a clock tile, not the game's art */
.hm-msg-txt { display: flex; flex-direction: column; gap: 3px; max-width: 420px; min-width: 0; }
.hm-msg-txt b { font-size: 15px; font-weight: 700; color: #fff; }
.hm-msg-txt span { font-size: 13.5px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.hm-row-msg .btn { height: 40px; }

.hm-show-foot { display: flex; align-items: center; gap: 20px; margin-top: 4px; }
.hm-rail { position: relative; flex: 1; min-width: 0; height: 18px; cursor: pointer; }
.hm-rail[hidden] { display: block !important; visibility: hidden; }
.hm-rail.is-off { visibility: hidden; }
.hm-rail::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, .06); }
.hm-thumb {
  position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; width: 40px;
  border-radius: 4px;
  background: rgba(167, 139, 250, .55);
  cursor: grab; touch-action: none;
  transition: background-color 150ms, height 150ms, margin-top 150ms;
}
.hm-thumb::before { content: ''; position: absolute; inset: -7px 0; } /* bigger grab area */
.hm-rail:hover .hm-thumb, .hm-rail.is-active .hm-thumb { height: 6px; margin-top: -3px; background: var(--accent-hover); }
.hm-rail.is-active .hm-thumb { cursor: grabbing; }
.hm-show-foot .hm-link { margin-left: auto; }

/* ---------------------------------------------------------------- how it works */
.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hm-step {
  display: flex; align-items: flex-start; gap: 14px;
  min-width: 0; padding: 20px;
  border-radius: 16px;
  background: #0e1118;
  transition: background-color 200ms var(--ease-out), transform 300ms var(--ease-out-quart);
}
.hm-step:hover { background: #12161f; transform: translateY(-2px); }
.hm-step-ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--accent-hover); background: rgba(139, 92, 246, .12);
  transition: transform 300ms var(--ease-out-quart);
}
.hm-step:hover .hm-step-ico { transform: rotate(-6deg) scale(1.05); }
.hm-step-txt { min-width: 0; }
.hm-step h3 { display: flex; align-items: center; gap: 8px; margin: 1px 0 5px; font-size: 16px; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.hm-step-n {
  flex: none; display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  font-size: 11.5px; font-weight: 800; color: #fff;
  background-image: var(--background-image-btn-grad);
}
.hm-step p { margin: 0; font-size: 13.5px; font-weight: 400; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

/* ---------------------------------------------------------------- CTA banner */
.hm-banner {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: 290px;
  padding: 44px clamp(24px, 4.5vw, 56px);
  border-radius: 22px;
  background:
    radial-gradient(60% 130% at 88% 110%, rgba(139, 92, 246, .42), transparent 62%),
    radial-gradient(45% 90% at 0% 0%, rgba(109, 40, 217, .2), transparent 70%),
    linear-gradient(115deg, #181230 0%, #110e20 50%, #0d0f1c 100%);
}
.hm-banner-copy { position: relative; z-index: 2; max-width: min(560px, 62%); }
.hm-banner-title {
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 800; line-height: 1.05; letter-spacing: -.01em;
  text-transform: uppercase;
}
.hm-banner-title span { color: #c4b5fd; }
.hm-banner-sub { max-width: 420px; margin: 12px 0 22px; font-size: 15px; font-weight: 400; line-height: 1.6; color: rgba(255, 255, 255, .7); }
.hm-banner-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hm-banner-cta .btn-lg { min-width: 220px; }
.hm-banner-mascot {
  position: absolute; right: 7%; bottom: 0; z-index: 1;
  height: 262px; width: auto; max-width: none;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .45));
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.hm-banner.reveal .hm-banner-mascot { animation: hm-fade 700ms var(--ease-out-quart) 120ms backwards; } /* one-time */

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .hm-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
  .hm-stage { height: 400px; }
  .hm-mascot { height: 380px; }
  .hm-stage-glow { width: 360px; height: 400px; }
}
@media (min-width: 961px) and (max-width: 1180px) {
  /* three narrow step cards: every title stays on one line, so the three descriptions start level */
  .hm-step h3 { font-size: 15px; }
}
@media (max-width: 960px) {
  .hm-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); min-height: 380px; }
  .hm-stage { height: 380px; }
  .hm-mascot { height: 350px; }
  .hm-stage-glow { width: 320px; height: 370px; }
  .hm-steps { grid-template-columns: 1fr; gap: 10px; }
  .hm-step { align-items: center; }
  .hm-banner-mascot { right: 3%; height: 230px; }
}
@media (max-width: 760px) {
  .hm-hero { padding-top: calc(var(--header-h) + 20px); padding-bottom: 28px; }
  .hm-hero-bg { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
  .hm-hero-inner { display: block; position: relative; min-height: 0; }
  /* mascot sits behind the copy on the right, faded so the text stays readable; the stage ends where the hero does,
     so the fade at its foot ends there too (the hero clips anything below it: a straight cut through the mascot).
     The face and the waving hand clear the lede ("— or buy and sell on the market"): the stage a little further
     right, its left fade a little longer */
  .hm-stage {
    position: absolute; z-index: 0;
    top: 6px; right: -84px; bottom: 0; /* beside the headline, as when the live chip sat above it */
    width: 220px; height: auto;
    align-items: flex-start; padding-top: 20px;
    opacity: .42;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%), linear-gradient(to bottom, #000 72%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent 0%, #000 55%), linear-gradient(to bottom, #000 72%, transparent);
    mask-composite: intersect;
  }
  .hm-mascot { height: 340px; margin-bottom: 0; }
  .hm-stage-floor { display: none; }
  .hm-stage-glow { top: 182px; width: 260px; height: 320px; }
  .hm-h1 { font-size: clamp(34px, 9.4vw, 50px); margin: 16px 0 12px; }
  .hm-lede { font-size: 15px; margin-bottom: 22px; }
  .hm-lede, .hm-h1-line:not(.hm-h1-grad) { text-shadow: 0 2px 18px rgba(6, 8, 13, .9); }
  .hm-coins { margin-top: 18px; }
  .home .section { margin-top: 44px; }

  .hm-show-head { margin-bottom: 6px; }
  .hm-show-tools { width: 100%; }
  .hm-gtabs { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-gtabs .gt { justify-content: center; padding: 0 8px; }
  .hm-cell, .hm-skel { width: 140px; }
  .hm-row { min-height: 216px; }
  .hm-skel { height: 198px; }
  /* icon, two lines of text and the button fit the 198px tile height at 360px: the row never grows */
  .hm-row-msg { min-height: 198px; padding: 12px 16px; gap: 10px; text-align: center; flex-direction: column; flex-wrap: nowrap; }
  .hm-msg-ico { width: 40px; height: 40px; border-radius: 12px; }
  .hm-msg-ico img { width: 24px; height: 24px; }
  .hm-msg-txt { align-items: center; }
  .hm-msg-txt span { font-size: 13px; line-height: 1.45; }

  .hm-step { padding: 16px; }
  .hm-step-ico { width: 40px; height: 40px; }
  .hm-banner { flex-direction: column; align-items: stretch; min-height: 0; padding: 0 20px 24px; text-align: center; }
  .hm-banner-mascot { position: relative; right: auto; bottom: auto; order: -1; height: 170px; margin: 12px auto 4px; }
  .hm-banner-copy { max-width: none; }
  .hm-banner-sub { margin: 10px auto 18px; font-size: 14px; }
  .hm-banner-cta { justify-content: center; }
}
@media (max-width: 560px) {
  .hm-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hm-cta .btn-lg { padding: 0 10px; font-size: 15px; }
  .hm-btn-main .hm-btn-arrow { display: none; }
  .hm-coins { gap: 10px; }
  .hm-coin-stack { gap: 4px; }
  .hm-coin-stack img { width: 20px; height: 20px; }
  .hm-coins-text { min-width: 0; font-size: 12.5px; white-space: normal; } /* one line wherever it fits (a 280px fold: two) */
  .hm-modes { gap: 18px; }
  .hm-mode { font-size: 18px; }
  .hm-xl { display: none; }
  .hm-arrows { display: none; }
  .hm-banner-title { font-size: clamp(24px, 7.4vw, 32px); }
  .hm-banner-cta .btn { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 370px) {
  .hm-cta { grid-template-columns: 1fr; }
  .hm-mode { font-size: 16.5px; }
  .hm-gtabs .gt img { display: none; }
}

/* ---------------------------------------------------------------- five games (Oct 13: + BGSI, BGS)
   The showcase's game tabs stay one calm row: phones and tablets (<= 760px) share the row by content (beside the
   arrows up to 560px), labels only from 440px down; the narrowest phones tighten the padding. Every tab keeps
   >= 40px of width and height. */
@media (max-width: 760px) {
  .hm-gtabs { display: flex; min-width: 0; }
  .hm-gtabs .gt { flex: 1 1 auto; min-width: 40px; padding: 0 8px; gap: 6px; }
  /* a game that isn't live (app.css game states): its "Soon" / "Paused" capsule is a 6px dot where the row is shared */
  .hm-gtabs { --gs-dot-w: 6px; --gs-dot-h: 6px; --gs-dot-pad: 0; --gs-dot-fs: 0; --gs-dot-bg: rgba(255, 255, 255, .42); --gs-dot-bg-on: #fff; --gs-dot-pos: absolute; --gs-dot-top: 6px; --gs-dot-right: 5px; }
}
@media (max-width: 440px) {
  .hm-gtabs .gt img { display: none; }
}
/* small phones: the waving hand still sits behind the lede's end ("buy and sell"), the art a step quieter there */
@media (max-width: 420px) {
  .hm-stage { opacity: .32; }
}
@media (max-width: 359px) {
  .hm-gtabs .gt { padding: 0 6px; font-size: 13px; }
}
