.page {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
  animation: rise-in 420ms var(--ease-out);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: center;
  min-height: 320px;
  padding: 40px 44px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(600px 380px at 85% 50%, rgb(255 197 61 / 0.14), transparent 65%),
    radial-gradient(500px 400px at 10% 0%, rgb(90 169 255 / 0.1), transparent 60%),
    linear-gradient(135deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}
.hero__copy { position: relative; z-index: 1; }
.hero__eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hero__title {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero__text { max-width: 520px; color: var(--text-2); font-size: 15.5px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero__actions .btn--xl { padding: 0 22px; }

.hero__stack { position: relative; height: 260px; }
.hero__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.07);
  transition: transform 600ms var(--ease-out);
}
.hero__card .art { width: 100%; height: 100%; }
.hero__card--0 { transform: translate(-100%, -48%) rotate(-10deg) scale(0.86); filter: brightness(0.55); }
.hero__card--1 { transform: translate(0%, -52%) rotate(10deg) scale(0.86); filter: brightness(0.55); }
.hero__card--2 { transform: translate(-50%, -50%); z-index: 2; width: 176px; }
.hero:hover .hero__card--0 { transform: translate(-110%, -50%) rotate(-14deg) scale(0.86); }
.hero:hover .hero__card--1 { transform: translate(10%, -54%) rotate(14deg) scale(0.86); }
.hero:hover .hero__card--2 { transform: translate(-50%, -54%) rotate(-2deg); }

/* ---------- Sections ---------- */

.section { margin-top: 40px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section__head h2 { font-size: 20px; font-weight: 800; }
.section__count { color: var(--text-3); font-weight: 600; font-size: 13px; }
.section__link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-2);
  font-weight: 650;
  font-size: 13px;
}
.section__link:hover { color: var(--text); }

/* ---------- Game tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-auto-flow: dense;
  gap: 16px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.tile--featured { grid-column: span 2; grid-row: span 2; }
.tile__art { position: absolute; inset: 0; transition: transform 700ms var(--ease-out); }
.tile__art .art { width: 100%; height: 100%; }
.tile__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgb(3 6 12 / 0.85));
}
.tile__meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  justify-items: start;
  gap: 4px;
}
.tile__name { font-size: 18px; font-weight: 800; text-shadow: 0 2px 10px rgb(0 0 0 / 0.5); }
.tile__fact { color: rgb(255 255 255 / 0.7); font-size: 12px; font-weight: 600; }
.tile__tagline { max-width: 340px; color: rgb(255 255 255 / 0.82); font-size: 14px; margin-bottom: 2px; }
.tile--featured .tile__meta { left: 24px; bottom: 24px; gap: 8px; }
.tile--featured .tile__name { font-size: clamp(28px, 3vw, 40px); font-weight: 900; }
.tile--featured .tile__fact { font-size: 13px; }
.tile__cta { position: absolute; right: 24px; bottom: 24px; }
.tile > .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  backdrop-filter: blur(6px);
  background: rgb(8 12 22 / 0.55);
}
.tile > .badge--live { background: rgb(4 30 18 / 0.7); }

.tile.is-soon .tile__art { filter: saturate(0.35) brightness(0.62); }

a.tile:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.1); }
a.tile:hover .tile__art { transform: scale(1.05); }
a.tile:active { transform: translateY(-2px) scale(0.99); }
.tile.is-soon:hover .tile__art { filter: saturate(0.6) brightness(0.75); }

/* Art micro-animations, triggered by hovering the tile. */
/* Only elements without a transform attribute are animated with `transform`; the rest use `translate`. */
.a-pop, .a-flame, .a-card-l, .a-card-r, .a-bob, .a-shake { transform-box: fill-box; transform-origin: center; }
.tile:hover .a-bob, .hero__card--2 .a-bob { animation: bob 2.4s var(--ease-in-out) infinite; }
.tile:hover .a-bob--late { animation-delay: -1.2s; }
.tile:hover .a-drift { animation: drift 4s var(--ease-in-out) infinite alternate; }
.a-spin { transform-box: fill-box; transform-origin: center; }
.tile:hover .a-spin, .hero__card--2 .a-spin { animation: art-spin 9s linear infinite; }
@keyframes art-spin { to { rotate: 360deg; } }
/* Groups that carry a transform attribute only get `translate`: touching transform-origin would move them. */
.tile:hover .a-rocket { animation: rocket 1.6s var(--ease-in-out) infinite; }
.tile:hover .a-flame { animation: flame 120ms linear infinite alternate; transform-origin: top; }
.tile:hover .a-pop { animation: gem-pop 1.4s var(--ease-spring) infinite; }
.tile:hover .a-shake { animation: fx-shake 600ms infinite; --shake: 1.5px; }
.tile:hover .a-bulb { animation: pulse 500ms steps(2) infinite; }
.tile:hover .a-bulb--alt { animation-delay: -250ms; }
.tile:hover .a-line { animation: pulse 700ms ease-in-out infinite; }
.tile:hover .a-card-l { animation: card-l 1.8s var(--ease-in-out) infinite; }
.tile:hover .a-card-r { animation: card-r 1.8s var(--ease-in-out) infinite; }
.tile:hover .a-glow { animation: pulse 1.6s ease-in-out infinite; }
.tile:hover .a-car { animation: car 1.4s linear infinite; }
.tile:hover .a-hop { animation: hop 700ms var(--ease-out) infinite; }

@keyframes drift { to { transform: translateY(14px); } }
@keyframes rocket { 50% { translate: 5px -7px; } }
@keyframes flame { to { transform: scaleY(1.25); } }
@keyframes gem-pop { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.12) rotate(-4deg); } }
@keyframes card-l { 50% { transform: rotate(-4deg) translateX(-4px); } }
@keyframes card-r { 50% { transform: rotate(4deg) translateX(4px); } }
@keyframes car { from { translate: 0 -140px; } to { translate: 0 420px; } }
@keyframes hop { 40% { translate: 0 -12px; } }

/* ---------- Recent bets + explainer ---------- */

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.recent__skeleton { height: 44px; margin-bottom: 6px; }
.cell-game { display: inline-flex; align-items: center; gap: 8px; }
.cell-game span { display: grid; color: var(--text-3); }

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 16px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  color: var(--text-3);
  text-align: center;
  font-weight: 600;
}

.explainer {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, color-mix(in srgb, var(--win) 10%, var(--bg-1)), var(--bg-1) 55%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.explainer__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--win) 14%, transparent);
  color: var(--win);
}
.explainer h3 { font-size: 17px; }
.explainer p { color: var(--text-2); font-size: 13.5px; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr) 300px; }
  .hero__card--2 { width: 150px; }
  .hero__card { width: 130px; }
}
@media (max-width: 1000px) {
  .section--split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero__stack { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile__cta { display: none; }
}

/* ---------- A visitor's lobby ---------- */

.hero--guest .hero__title { max-width: 15ch; font-size: clamp(30px, 3.6vw, 48px); }
.hero--guest .hero__actions .btn span { display: grid; }

.perks { display: grid; gap: 14px; align-content: start; }
.perks__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.perk {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms, transform 200ms var(--ease-out);
}
.perk:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); }
.perk__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); color: var(--accent); }
.perk strong { display: block; font-weight: 750; }
.perk p { margin-top: 3px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.perks > .btn { width: auto; justify-self: start; }
@media (max-width: 600px) {
  .perks__list { grid-template-columns: 1fr; }
  .perks > .btn { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .perk:hover { transform: none; }
}

/* ---------- Discord invitation ---------- */

.discord-cta {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  padding: 22px 24px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background:
    radial-gradient(420px 220px at 0% 50%, rgb(88 101 242 / 0.35), transparent 70%),
    linear-gradient(120deg, #1b2050, #141a33 55%, var(--bg-1));
  box-shadow: inset 0 0 0 1px rgb(88 101 242 / 0.35);
}
.discord-cta__ghost {
  /* The mark again, large and faint, bleeding off the right edge. */
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  color: rgb(88 101 242 / 0.1);
  pointer-events: none;
}
.discord-cta__ghost .social-icon { width: 200px; height: 200px; }
.discord-cta__mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: #5865f2;
  color: #fff;
  box-shadow: 0 10px 30px rgb(88 101 242 / 0.45);
}
.discord-cta__mark .social-icon { width: 32px; height: 32px; }
.discord-cta__copy h2 { font: 800 20px/1.2 var(--font-display); }
.discord-cta__copy p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.discord-cta__join { position: relative; z-index: 1; background: #5865f2; color: #fff; box-shadow: 0 8px 24px rgb(88 101 242 / 0.35); }
.discord-cta__join:hover { background: #6d78f6; }

@media (max-width: 720px) {
  .discord-cta { grid-template-columns: auto minmax(0, 1fr); }
  .discord-cta__join { grid-column: 1 / -1; justify-content: center; }
}

/* The Discord button beside the hero's actions: square, in Discord's colour. */
.hero__actions .hero__discord {
  width: 52px;
  aspect-ratio: 1;
  padding: 0;
  background: rgb(88 101 242 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(88 101 242 / 0.45);
  color: #aab2ff;
}
.hero__actions .hero__discord:hover { background: #5865f2; color: #fff; }
.hero__discord .social-icon { width: 22px; height: 22px; }
