/* ==========================================================
   LEADERBOARD PAGE (loaded after style.css, only on /leaderboard)
   Big glowing pool, crowned top three, countdown, prize
   calculator and ranked table, in the KLEO navy / crystal / gold.
   ========================================================== */
body.lb {
  --lb-card: linear-gradient(180deg, rgba(20, 40, 70, 0.72), rgba(8, 17, 32, 0.86));
  --lb-line: rgba(76, 201, 255, 0.18);
  --lb-soft: rgba(234, 246, 255, 0.62);
  --lb-gold: #f5c542;
  --lb-prize: #8fe3ff;
  background:
    radial-gradient(900px 520px at 50% -80px, rgba(26, 111, 214, 0.55), transparent 70%),
    radial-gradient(700px 500px at 50% 820px, rgba(76, 201, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #071630 0%, #050c1a 45%, #040913 100%);
  background-attachment: fixed;
  font-family: "Outfit", "Inter", system-ui, sans-serif;
}
/* (the twinkling stars in the background are the .lb-stars field further down) */
body.lb main, body.lb .site-footer { position: relative; z-index: 1; }

/* Floating diamonds behind everything */
body.lb { position: relative; }
.lb-gems { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; animation: lb-gems-in 1.2s ease 0.3s both; }
@keyframes lb-gems-in { from { opacity: 0; } }
.lb-gem {
  position: absolute;
  width: var(--s);
  opacity: var(--o);
  translate: -50% calc(-50% - var(--sy, 0px) * var(--depth));
  filter: blur(var(--b)) drop-shadow(0 0 22px rgba(76, 201, 255, 0.35));
}
.lb-gem img {
  display: block;
  width: 100%;
  height: auto;
  animation: lb-gem-float var(--d) ease-in-out var(--dl) infinite alternate;
}
@keyframes lb-gem-float {
  0% { transform: translateY(10px) rotate(calc(var(--r) * -1)) scale(0.97); filter: brightness(0.95); }
  50% { filter: brightness(1.18); }
  100% { transform: translateY(-22px) rotate(var(--r)) scale(1.03); filter: brightness(0.95); }
}
/* Twinkling star field (starField() in app.js): fixed behind everything, each star on its own rhythm */
.lb-stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lb-star {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 calc(var(--s) * 3) var(--c);
  opacity: calc(var(--o) * 0.25);
  animation: lb-star-twinkle var(--d) ease-in-out var(--dl) infinite;
}
.lb-star.big {
  border-radius: 0;
  box-shadow: none;
  background: radial-gradient(circle, #fff 0 12%, var(--c) 30%, transparent 70%);
  clip-path: polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%);
  filter: drop-shadow(0 0 4px var(--c));
}
@keyframes lb-star-twinkle {
  0%, 100% { opacity: calc(var(--o) * 0.2); scale: 0.7; }
  50% { opacity: var(--o); scale: 1.15; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-star { animation: none; opacity: calc(var(--o) * 0.6); }
}
/* Shooting stars: a thin streak with a bright head, now and then (spawned by shootingStars() in app.js) */
.lb-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lb-shoot {
  position: absolute;
  height: 2px;
  border-radius: 2px;
  transform-origin: 100% 50%;
  background: linear-gradient(90deg, transparent, rgba(143, 227, 255, 0.35) 55%, rgba(234, 250, 255, 0.95));
  opacity: 0;
}
.lb-shoot::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  translate: 0 -50%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(143, 227, 255, 0.9), 0 0 18px 4px rgba(76, 201, 255, 0.45);
}
/* narrower screens: the sides overlap the content, so the diamonds shrink and fade back */
@media (max-width: 1180px) {
  .lb-gem { width: calc(var(--s) * 0.7); opacity: calc(var(--o) * 0.55); }
}
@media (max-width: 720px) {
  .lb-gem { width: calc(var(--s) * 0.5); opacity: calc(var(--o) * 0.45); }
}
body.lb .wrap { max-width: 980px; }

/* ---------- Hero ---------- */
.lb-hero { text-align: center; padding-top: 34px; padding-bottom: 8px; }
/* the logo sits in a wrapper so the floating crown can be placed over its K */
.lb-logo-wrap { position: relative; width: min(250px, 58vw); margin: 44px auto -6px; }
/* "KLEO × Stake": the small partner row over a page title (Leaderboard, Rewards) */
.brand-x { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0; color: rgba(234, 246, 255, 0.5); font-weight: 700; font-size: 20px; }
/* the KLEO carries the same tossed-on gold crown as the home logo (.logo-crown in style.css): same
   size, spot and bob in proportion to the logo */
.brand-kleo-wrap { position: relative; display: block; width: 122px; }
.brand-kleo { position: relative; z-index: 1; display: block; width: 100%; height: auto; filter: drop-shadow(0 0 10px rgba(76, 201, 255, 0.4)); }
.brand-stake-wrap { position: relative; display: block; }
.brand-stake { display: block; width: auto; height: 48px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
/* "Handshake": once the page has rendered (body.loaded), KLEO slides in from the left, Stake from the
   right and the × spins in between. Then a crystal glow breathes round the Stake wordmark and two
   small sparkles twinkle on it. Reduced motion: a still row. */
.brand-spark { position: absolute; width: 14px; height: 14px; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 1.5px, transparent 2.5px),
    linear-gradient(#fff, #fff) center / 1.6px 100% no-repeat, linear-gradient(90deg, #fff, #fff) center / 100% 1.6px no-repeat;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 72%); mask: radial-gradient(circle, #000 20%, transparent 72%);
  filter: drop-shadow(0 0 4px #8fe3ff); }
.brand-spark.s1 { right: -6px; top: -4px; }
.brand-spark.s2 { left: 18%; bottom: -2px; width: 10px; height: 10px; }
@media (prefers-reduced-motion: no-preference) {
  body:not(.loaded) .brand-x > * { opacity: 0; }
  body.loaded .brand-x .brand-kleo-wrap { animation: brand-from-left 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  body.loaded .brand-x .brand-stake-wrap { animation: brand-from-right 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  body.loaded .brand-x .brand-times { display: inline-block; animation: brand-x-in 0.5s ease-out 0.45s both; }
  .brand-stake { animation: brand-breathe 3.6s ease-in-out 1.2s infinite; }
  .brand-spark { animation: brand-twinkle 3.6s ease-in-out 1.2s infinite; }
  .brand-spark.s2 { animation-delay: 3s; }
}
@keyframes brand-from-left { from { translate: -60px 0; opacity: 0; filter: blur(4px); } }
@keyframes brand-from-right { from { translate: 60px 0; opacity: 0; filter: blur(4px); } }
@keyframes brand-x-in { from { rotate: -180deg; scale: 0.2; opacity: 0; } }
@keyframes brand-breathe {
  0%, 100% { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 0 rgba(76, 201, 255, 0)); }
  50% { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 12px rgba(76, 201, 255, 0.85)) brightness(1.08); }
}
@keyframes brand-twinkle {
  0%, 100% { opacity: 0; scale: 0.3; rotate: 0deg; }
  45% { opacity: 1; scale: 1; rotate: 45deg; }
  70% { opacity: 0; scale: 0.4; rotate: 90deg; }
}
/* Leaderboard hero as one column: "KLEO × Stake", the $5,000 and "Monthly Leaderboard" are all about
   the same width. Everything is sized off --pot (the amount's size) so the column keeps its shape. */
body[data-page="leaderboard"] .lb-hero { --pot: clamp(80px, 13vw, 132px); }
.lb-hero .brand-x { gap: calc(var(--pot) * 0.136); margin: 72px 0 calc(var(--pot) * 0.076); font-size: calc(var(--pot) * 0.167); }
.lb-hero .brand-kleo-wrap { width: calc(var(--pot) * 1.37); }
.lb-hero .brand-stake { height: calc(var(--pot) * 0.535); }
body[data-page="leaderboard"] .lb-name {
  max-width: none;
  margin-top: 12px;
  font-size: calc(var(--pot) * 0.17);
  letter-spacing: 0.2em;
  text-indent: 0.2em;   /* balances the space the letter-spacing leaves after the last letter */
  white-space: nowrap;
}
.lb-logo {
  position: relative;
  z-index: 1;   /* in front of the crown */
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(76, 201, 255, 0.35));
}
.lb-title { margin: 0; line-height: 1; }
/* Big page titles ($5,000 / Slot Deck / Rewards): tall upright Anton in a white-to-blue crystal fade */
.lb-pot {
  display: block;
  width: fit-content;
  margin: 0 auto;
  font-family: "Anton", "Teko", sans-serif;
  font-weight: 400;
  font-size: clamp(72px, 11.5vw, 116px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #d9f6ff 22%, #8fe3ff 48%, #4cc9ff 70%, #2a8ae8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #0c3a73) drop-shadow(0 0 26px rgba(76, 201, 255, 0.45));
}
/* The prize pool: a smaller raised "$", a light that sweeps across the digits every few seconds,
   glints popping on the facets, and four diamonds floating round it at different depths */
.lb-pot-wrap { position: relative; display: block; width: fit-content; margin: 0 auto; }
.lb-pot-wrap .lb-pot {
  font-size: var(--pot, clamp(86px, 15vw, 150px));   /* the Leaderboard's pool, set with the hero column above */
  background-image:
    linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%),
    linear-gradient(180deg, #ffffff 0%, #d9f6ff 22%, #8fe3ff 48%, #4cc9ff 70%, #2a8ae8 100%);
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0, 0 0;
  animation: pot-shine 5s ease-in-out 1.4s infinite;
}
@keyframes pot-shine {
  0% { background-position: 130% 0, 0 0; }
  32%, 100% { background-position: -30% 0, 0 0; }
}
.lb-cur { font-size: 0.58em; vertical-align: 0.6em; margin-right: 0.04em; }
/* holds the pot's space, unseen, until app.js fills in the real amount (no "Prizes TBA" flash) */
.lb-pot.is-pending { visibility: hidden; }
/* the pool once filled in: solid white digits on a stepped crystal-blue edge; each digit is a slot
   reel (a window with a strip of numbers inside) that app.js spins and lands */
.lb-pot.lb-pot-spin {
  display: inline-flex;
  align-items: flex-start;
  background: none;
  color: #fff;
  animation: none;
  filter: drop-shadow(0 2px 0 #8fe3ff) drop-shadow(0 3px 0 #1a6fd0) drop-shadow(0 0 26px rgba(76, 201, 255, 0.4));
}
.lb-pot-spin .ch { display: inline-block; }
.lb-pot-spin .reel { height: 1.02em; overflow: hidden; }
.lb-pot-spin .strip { display: flex; flex-direction: column; }
.lb-pot-spin .strip > span { display: block; height: 1.02em; }
/* while a reel spins, its numbers fade out at the top and bottom of the window */
.lb-pot-spin .reel.spinning { -webkit-mask: linear-gradient(transparent, #000 20%, #000 80%, transparent); mask: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
/* the flash when the last reel lands */
.lb-pot.lb-pot-spin.flash { animation: pot-flash 0.6s ease-out; }
@keyframes pot-flash {
  30% { filter: drop-shadow(0 2px 0 #8fe3ff) drop-shadow(0 3px 0 #1a6fd0) drop-shadow(0 0 40px rgba(143, 227, 255, 0.95)) brightness(1.35); }
}
/* a full-height "$", so "$5,000" is one even block that centres under the logo */
.lb-pot-spin .ch.lb-cur { font-size: 1em; vertical-align: 0; margin-right: 0.03em; }
.pot-gem {
  position: absolute;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 14px rgba(76, 201, 255, 0.35));
  animation: pot-gem 5s ease-in-out infinite;
}
/* mirrored left and right, so the stack doesn't lean */
.pot-gem.g1 { width: 70px; left: -100px; top: 38%; rotate: -16deg; }
.pot-gem.g2 { width: 32px; left: -44px; top: -2%; rotate: 12deg; animation-delay: -1.6s; animation-duration: 6s; }
.pot-gem.g3 { width: 70px; right: -100px; top: 38%; rotate: 16deg; animation-delay: -2.8s; }
.pot-gem.g4 { width: 32px; right: -44px; top: -2%; rotate: -12deg; animation-delay: -0.8s; animation-duration: 6.5s; }
@keyframes pot-gem { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.lb-pot-wrap .home-spark { z-index: 2; }
@media (max-width: 560px) {
  /* smaller and tucked in, so they stay clear of the screen edges */
  .pot-gem.g1 { width: 30px; left: -34px; top: 44%; }
  .pot-gem.g2 { width: 16px; left: -16px; top: -8%; }
  .pot-gem.g3 { width: 30px; right: -34px; top: 44%; }
  .pot-gem.g4 { width: 16px; right: -16px; top: -8%; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-pot-wrap .lb-pot, .pot-gem { animation: none; }
  .lb-pot-wrap .home-spark { display: none; }
}

.lb-name {
  display: block;
  max-width: 9em;
  margin: 4px auto 0;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
}
.lb-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.lb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 14px;
  border-radius: 10px;
  background: rgba(6, 13, 26, 0.7);
  box-shadow: inset 0 0 0 1px var(--lb-line);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lb-pill span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(76, 201, 255, 0.16);
  color: var(--brand);
  font-size: 0; /* hide the › glyph: it sits low in the font, so the arrow is drawn below instead */
}
.lb-pill span::before {
  content: "";
  width: 4.5px;
  height: 4.5px;
  translate: -1.6px 0; /* the rotated corner points right, so shift its ink back onto the centre */
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  rotate: 45deg;
}
.lb-pill:hover { box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.55); transform: translateY(-1px); }

.lb-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  padding: 12px 22px;
  border: 0;
  border-radius: 12px;
  background: rgba(6, 13, 26, 0.65);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  --c: 76, 201, 255;
  box-shadow: inset 0 0 0 1.5px rgba(var(--c), 0.7), 0 0 18px -6px rgba(var(--c), 0.8);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.lb-btn:hover { transform: translateY(-2px); background: rgba(var(--c), 0.12); box-shadow: inset 0 0 0 1.5px rgba(var(--c), 1), 0 0 26px -4px rgba(var(--c), 0.9); }
.lb-btn:active { transform: translateY(0) scale(0.97); }
.lb-btn:focus-visible { outline: 2px solid rgb(var(--c)); outline-offset: 3px; }
.lb-btn-join {
  background: linear-gradient(180deg, #7fdcff, var(--brand) 45%, var(--brand-deep));
  color: var(--brand-ink);
  box-shadow: 0 8px 26px -8px rgba(76, 201, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.lb-btn-join:hover { background: linear-gradient(180deg, #a6e8ff, #6dd4ff 45%, #2a7fe6); }
.lb-btn-gold { --c: 245, 197, 66; color: #ffe08a; }
.lb-btn-crystal { --c: 76, 201, 255; color: var(--brand); }
.lb-btn-crystal span { color: #fff; }
.lb-btn-facet { --c: 120, 150, 255; color: #c9d4ff; }

/* ---------- Podium ---------- */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  align-items: end;
  gap: 16px;
  padding-top: 56px;
}
.lb-pod {
  --rank: var(--silver);
  --rank-rgb: 201, 209, 223;
  position: relative;
  text-align: center;
  padding: 18px 16px 22px;
  border-radius: 18px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(var(--rank-rgb), 0.16), transparent 70%),
    var(--lb-card);
  box-shadow: inset 0 0 0 1px rgba(var(--rank-rgb), 0.35), 0 20px 40px -24px rgba(0, 0, 0, 0.9);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.lb-pod:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(var(--rank-rgb), 0.7), 0 24px 44px -22px rgba(var(--rank-rgb), 0.45); }
.lb-pod.r1 {
  --rank: var(--lb-gold);
  --rank-rgb: 245, 197, 66;
  padding-top: 26px;
  padding-bottom: 28px;
  margin-bottom: 24px;
  box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, 0.7), 0 0 50px -12px rgba(245, 197, 66, 0.45), 0 24px 50px -24px rgba(0, 0, 0, 0.9);
}
.lb-pod.r2 { order: 1; }
.lb-pod.r1 { order: 2; }
.lb-pod.r3 { order: 3; --rank: var(--bronze); --rank-rgb: 213, 138, 82; }

.lb-avatar-wrap { position: relative; width: 84px; margin: 22px auto 16px; }
.lb-pod.r1 .lb-avatar-wrap { width: 100px; }
.lb-crown {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 18px);
  width: 82%;
  overflow: visible;
  z-index: 2;
  transform: translateX(-50%) rotate(var(--tilt, 0deg));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px rgba(var(--rank-rgb), 0.45));
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.lb-pod.r2 .lb-crown { --tilt: -9deg; }
.lb-pod.r3 .lb-crown { --tilt: 9deg; }
.lb-pod.r1 .lb-crown { width: 86%; animation: lb-crown-bob 3.6s ease-in-out infinite; }
/* the crystal crown from the logo (crownImg in app.js): gold for 1st, tinted silver and bronze for 2nd and 3rd */
.lb-crown-png { height: auto; }
.lb-pod .lb-crown-png { width: 92%; bottom: calc(100% - 24px); }
.lb-pod.r1 .lb-crown-png { width: 100%; }
.lb-crown-png.r1 { filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 14px rgba(245, 197, 66, 0.55)); }
.lb-crown-png.r2 { filter: grayscale(1) brightness(1.35) contrast(1.05) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px rgba(201, 209, 223, 0.5)); }
.lb-crown-png.r3 { filter: sepia(1) saturate(1.6) hue-rotate(-18deg) brightness(0.92) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px rgba(213, 138, 82, 0.5)); }
.lb-pod:hover .lb-crown { transform: translateX(-50%) translateY(-5px) rotate(calc(var(--tilt, 0deg) * -0.4)); }
@keyframes lb-crown-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.lb-spark { transform-box: fill-box; transform-origin: center; animation: lb-spark 2.4s ease-in-out infinite; }
.lb-spark-2 { animation-delay: 1.2s; }
@keyframes lb-spark { 0%, 100% { opacity: 0; scale: 0.4; } 45%, 55% { opacity: 1; scale: 1; } }

/* Gold crown hover shine: spinning light rays, a glow halo, a glint across the metal, sparks popping */
.lb-rays {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  width: 210%;
  aspect-ratio: 1;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  translate: -50% 50%;
  scale: 0.45;
  opacity: 0;
  background:
    radial-gradient(circle, rgba(255, 236, 160, 0.75) 0 12%, rgba(245, 197, 66, 0.35) 26%, transparent 52%),
    repeating-conic-gradient(from 0deg, rgba(255, 220, 110, 0.55) 0deg 5deg, transparent 5deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 66%);
  mask: radial-gradient(circle, #000 20%, transparent 66%);
  transition: opacity 0.35s ease, scale 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35);
  animation: lb-rays-spin 9s linear infinite;
}
@keyframes lb-rays-spin { to { rotate: 360deg; } }
.lb-pod.r1:hover .lb-rays, .lb-pod.r1:focus-within .lb-rays { opacity: 1; scale: 1; }
.lb-pod.r1:hover .lb-crown, .lb-pod.r1:focus-within .lb-crown {
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(255, 220, 110, 0.95)) drop-shadow(0 0 26px rgba(245, 197, 66, 0.8));
}
.lb-pod.r1:hover .lb-avatar { box-shadow: 0 0 0 3px var(--rank), 0 0 30px 2px rgba(245, 197, 66, 0.75); }
.lb-glint { translate: -30px 0; opacity: 0; }
.lb-pod.r1:hover .lb-glint, .lb-pod.r1:focus-within .lb-glint { animation: lb-glint 1.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
@keyframes lb-glint {
  0% { translate: -30px 0; opacity: 0; }
  10% { opacity: 1; }
  55% { translate: 140px 0; opacity: 1; }
  56%, 100% { translate: 140px 0; opacity: 0; }
}
.lb-spark-h { transform-box: fill-box; transform-origin: center; opacity: 0; scale: 0.2; }
.lb-pod.r1:hover .lb-spark-h, .lb-pod.r1:focus-within .lb-spark-h { animation: lb-spark 1.3s ease-in-out infinite; }
.lb-pod.r1:hover .lb-sh2 { animation-delay: 0.35s; }
.lb-pod.r1:hover .lb-sh3 { animation-delay: 0.65s; }
.lb-pod.r1:hover .lb-sh4 { animation-delay: 0.95s; }
.lb-avatar-wrap > .lb-avatar, .lb-avatar-wrap > .lb-badge { position: relative; z-index: 1; }
.lb-avatar-wrap > .lb-badge { position: absolute; }
/* the miner from the KLEO artwork, cropped to his head and shoulders */
.lb-avatar {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fcfcf7 url("/assets/kleo-hero.webp") 63.4% 86% / 820% auto no-repeat;
  box-shadow: 0 0 0 3px var(--rank), 0 0 22px -2px rgba(var(--rank-rgb), 0.6);
}
.lb-badge {
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 22px;
  height: 22px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 5px;
  background: var(--rank);
  box-shadow: 0 0 0 2px #071226;
  display: grid;
  place-items: center;
}
.lb-badge b { transform: rotate(-45deg); color: #071226; font-size: 12px; font-weight: 800; }
.lb-pod-name { margin-top: 8px; font-size: 17px; font-weight: 800; letter-spacing: 0.02em; color: #fff; overflow-wrap: anywhere; }
.lb-pod-lbl { margin-top: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.16em; color: var(--lb-soft); }
.lb-pod.r1 .lb-pod-lbl { color: var(--lb-gold); }
.lb-pod-wager { margin-top: 2px; font-size: 19px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lb-pod.r1 .lb-pod-wager { font-size: 22px; }
.lb-prize {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(26, 111, 214, 0.28);
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.5), 0 0 18px -6px rgba(76, 201, 255, 0.7);
  color: var(--lb-prize);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lb-pod .lb-prize { font-size: 17px; padding: 8px 16px; }
.lb-pod-open .lb-pod-name { color: var(--lb-soft); }

/* ---------- Countdown ---------- */
.lb-timer { text-align: center; padding-top: 40px; padding-bottom: 28px; }
.lb-timer-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 201, 255, 0.28), transparent 70%);
  animation: lb-float 4s ease-in-out infinite;
}
.lb-timer-icon svg { width: 46px; height: 46px; filter: drop-shadow(0 0 12px rgba(76, 201, 255, 0.7)); }
@keyframes lb-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.lb-timer-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.lb-timer-title::before, .lb-timer-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 201, 255, 0.6));
}
.lb-timer-title::after { background: linear-gradient(90deg, rgba(76, 201, 255, 0.6), transparent); }
.lb-count { display: flex; justify-content: center; gap: clamp(18px, 5vw, 40px); margin-top: 6px; }
.lb-unit { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.lb-num {
  font-family: "Teko", "Outfit", sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(46px, 7vw, 60px);
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 20px rgba(200, 240, 255, 0.35);
  font-variant-numeric: tabular-nums;
}
.lb-lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--lb-soft); text-transform: uppercase; }
.lb-updated { margin: 16px 0 0; font-size: 13px; color: var(--lb-soft); }
.lb-ended { font-size: 22px; font-weight: 800; color: var(--lb-gold); padding: 12px 0; }

/* ---------- Calculator card (used by the Rewards page's Stake VIP calculator) ---------- */
.lb-calc {
  border-radius: 18px;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(76, 201, 255, 0.1), transparent 60%),
    var(--lb-card);
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.3);
  overflow: hidden;
}
.lb-calc-head { display: flex; align-items: center; gap: 14px; padding: 14px; }
.lb-calc-head > div { flex: 1; min-width: 0; }
.lb-calc-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: #fff; }
.lb-calc-head p { margin: 2px 0 0; font-size: 13px; color: var(--lb-soft); }
.lb-calc-body { padding: 4px 14px 16px; border-top: 1px solid rgba(76, 201, 255, 0.16); }
.lb-calc-body:not([hidden]) { animation: lb-open 0.3s ease; }
@keyframes lb-open { from { opacity: 0; translate: 0 -6px; } }
.lb-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(4, 9, 19, 0.85);
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.3);
  color: var(--brand);
  font-weight: 800;
  font-size: 18px;
}
.lb-field:focus-within { box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.7), 0 0 18px -8px rgba(76, 201, 255, 0.8); }
.lb-field input {
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}
.lb-field input::placeholder { color: rgba(234, 246, 255, 0.4); }
.lb-field input:focus { outline: none; }
.lb-calc-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 12px; color: var(--lb-soft); }
.lb-calc-note svg { flex: none; margin-top: 2px; color: var(--brand); }

/* ---------- Table ---------- */
#standings { padding-top: 24px; scroll-margin-top: 80px; }
.lb-table {
  border-radius: 16px;
  background: rgba(6, 13, 26, 0.72);
  box-shadow: inset 0 0 0 1px var(--lb-line);
  overflow: hidden;
}
.lb-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 110px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 46px;
  border-top: 1px solid rgba(76, 201, 255, 0.08);
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease;
}
.lb-row:nth-child(even) { background: rgba(20, 40, 70, 0.22); }
.lb-row:not(.lb-head):hover { background: rgba(76, 201, 255, 0.08); }
.lb-head { min-height: 36px; border-top: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--lb-soft); text-transform: uppercase; }
.lb-place {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 7px;
  background: rgba(20, 40, 70, 0.8);
  box-shadow: inset 0 0 0 1px var(--lb-line);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.lb-place.g1 { background: var(--lb-gold); color: #2a1a06; box-shadow: none; }
.lb-place.g2 { background: var(--silver); color: #0b1830; box-shadow: none; }
.lb-place.g3 { background: var(--bronze); color: #2a1206; box-shadow: none; }
.lb-user { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; font-weight: 700; color: #fff; }
.lb-user span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-mini { width: 26px; height: 26px; flex: none; box-shadow: 0 0 0 1.5px rgba(76, 201, 255, 0.5); }
.lb-wager { font-size: 14px; font-weight: 700; color: #fff; }
.lb-reward { justify-self: end; }
.lb-row .lb-prize { margin: 0; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.lb-row .lb-prize.none { background: none; box-shadow: none; color: var(--lb-soft); }
.lb-row-open .lb-user, .lb-row-open .lb-wager { color: var(--lb-soft); font-weight: 600; }
.lb-row-open .lb-mini { opacity: 0.35; filter: grayscale(1); }
.lb-empty { padding: 28px; text-align: center; color: var(--lb-soft); }

/* ---------- Rules + previous period ---------- */
.lb-section { padding-top: 56px; scroll-margin-top: 70px; }
.lb-h2 { margin: 0 0 16px; font-size: 22px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.lb-h2 small { margin-left: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--lb-soft); }
.lb-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lb-rule {
  position: relative;
  padding: 18px 18px 18px 64px;
  border-radius: 16px;
  background: var(--lb-card);
  box-shadow: inset 0 0 0 1px var(--lb-line);
}
.lb-rule-n {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 16px -4px rgba(76, 201, 255, 0.9);
}
.lb-rule h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: #fff; }
.lb-rule p { margin: 0; font-size: 14px; color: var(--lb-soft); }
.lb-rule p strong { color: var(--brand); }

/* ---------- Leaderboard Rules panel (#rules) ----------
   One panel: a header (badge, title, this race's dates, hide/show arrow), the rule tiles (the two
   that can cost you a payout are tinted red), then the RTP weighting tiers with a fill bar each. */
/* the two small buttons that open the panels */
.lr-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lr-show {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  background: rgba(76, 201, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.32);
  color: #8fe3ff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.lr-show:hover { background: rgba(76, 201, 255, 0.13); box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.6); color: #fff; }
.lr-show[aria-expanded="true"] { background: rgba(76, 201, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.75), 0 8px 22px -12px rgba(76, 201, 255, 0.8); color: #fff; }
.lr-show:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.lr-switch + .lr, .lr + .lr { margin-top: 16px; }
.lr:not([hidden]) { animation: lr-open 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes lr-open { from { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .lr:not([hidden]) { animation: none; } }
.lr {
  border-radius: 22px;
  background: radial-gradient(80% 50% at 50% 0%, rgba(76, 201, 255, 0.08), transparent 70%), var(--lb-card);
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.24), 0 24px 50px -28px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}
.lr-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 18px 20px; border-bottom: 1px solid var(--lb-line); }
.lr-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(76, 201, 255, 0.28), rgba(6, 13, 26, 0.9));
  box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.5);
  color: var(--brand);
}
.lr-titles { flex: 1; min-width: 0; }
.lr-title { margin: 0; font-size: 19px; font-weight: 800; color: #fff; }
.lr-sub { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--lb-soft); }
.lr-sub span { color: var(--brand); font-variant-numeric: tabular-nums; }
.lr-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 13, 26, 0.6);
  box-shadow: inset 0 0 0 1px var(--lb-line);
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}
.lr-toggle svg { transition: rotate 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.lr-toggle[aria-expanded="false"] svg { rotate: 180deg; }
.lr-toggle:hover { box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.7); }
.lr-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.lr-body { padding: 18px; }
.lr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lr-rule {
  --c: 76, 201, 255;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(6, 13, 26, 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--c), 0.2);
}
.lr-wide { grid-column: 1 / -1; }
.lr-warn { --c: 255, 92, 110; background: linear-gradient(180deg, rgba(255, 70, 90, 0.08), rgba(6, 13, 26, 0.55)); }
.lr-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(var(--c), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--c), 0.4);
  color: rgb(var(--c));
}
.lr-rule h3 { margin: 2px 0 4px; font-size: 15.5px; font-weight: 800; color: #fff; }
.lr-rule p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--lb-soft); }
.lr-rtp { margin-top: 14px; padding: 18px; border-radius: 16px; background: rgba(4, 9, 19, 0.6); box-shadow: inset 0 0 0 1px var(--lb-line); }
.lr-rtp h3 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.lr-rtp > p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--lb-soft); }
.lr-rtp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.lr-tier {
  --c: 76, 201, 255;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 14px;
  border-radius: 14px;
  background: radial-gradient(80% 60% at 50% 0%, rgba(var(--c), 0.12), transparent 70%), rgba(6, 13, 26, 0.7);
  box-shadow: inset 0 0 0 1px rgba(var(--c), 0.25);
  text-align: center;
}
.lr-tier.t2 { --c: 245, 197, 66; }
.lr-tier.t3 { --c: 160, 174, 200; }
.lr-tier-lbl { font-size: 12px; font-weight: 600; color: var(--lb-soft); }
.lr-pill { padding: 3px 10px; border-radius: 999px; background: rgba(var(--c), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--c), 0.45); font-size: 13px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.lr-tier b { margin-top: 4px; font-family: "Teko", sans-serif; font-weight: 700; font-size: 46px; line-height: 0.9; padding-top: 4px; color: rgb(var(--c)); font-variant-numeric: tabular-nums; }
.lr-bar { width: 80%; height: 5px; margin-top: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.lr-bar i { display: block; height: 100%; border-radius: inherit; background: rgb(var(--c)); }
@media (max-width: 720px) {
  .lr-grid { grid-template-columns: 1fr; }
  .lr-body { padding: 14px; }
  .lr-rtp { padding: 14px; }
  .lr-rtp-grid { gap: 8px; }
  .lr-tier { padding: 12px 6px; }
  .lr-tier b { font-size: 36px; }
  .lr-tier-lbl { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .lr-toggle svg { transition: none; } }
.lb-past + .lb-past { margin-top: 24px; }
.lb-past-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--lb-soft); }

/* ---------- Entrances ---------- */
.lb-hero > *, .lb-pod, .lb-timer, .lb-calc, .lb-table { animation: lb-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.lb-hero > :nth-child(2) { animation-delay: 0.08s; }
.lb-hero > :nth-child(3) { animation-delay: 0.16s; }
.lb-hero > :nth-child(4) { animation-delay: 0.22s; }
.lb-pod.r1 { animation-delay: 0.3s; }
.lb-pod.r2 { animation-delay: 0.38s; }
.lb-pod.r3 { animation-delay: 0.44s; }
.lb-timer { animation-delay: 0.5s; }
.lb-calc { animation-delay: 0.56s; }
.lb-table { animation-delay: 0.62s; }
@keyframes lb-rise { from { opacity: 0; translate: 0 22px; } }

@media (prefers-reduced-motion: reduce) {
  .lb-timer-icon, .lb-pod.r1 .lb-crown, .lb-spark, .lb-rays, .lb-gem img, .lb-gems,
  .lb-pod.r1:hover .lb-glint, .lb-pod.r1:hover .lb-spark-h { animation: none; }
  .lb-rays { transition: opacity 0.3s ease; scale: 1; }
  .lb-hero > *, .lb-pod, .lb-timer, .lb-calc, .lb-table, .lb-calc-body:not([hidden]) { animation: none; }
  .lb-pod:hover, .lb-btn:hover, .lb-pill:hover { transform: none; }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .lb-hero { padding-top: 20px; }
  .lb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .lb-btn { min-width: 0; padding: 12px 10px; font-size: 12.5px; }
  /* three buttons on two columns: "Use code" goes full width on top */
  .lb-actions .lb-btn-crystal { order: -1; grid-column: 1 / -1; }

  .lb-podium { grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 40px; }
  .lb-pod.r1 { order: 1; grid-column: 1 / 3; margin-bottom: 4px; }
  .lb-pod.r2 { order: 2; }
  .lb-pod.r3 { order: 3; }
  .lb-pod { padding: 14px 10px 18px; }
  .lb-avatar-wrap { width: 68px; }
  .lb-pod.r1 .lb-avatar-wrap { width: 88px; }
  .lb-pod-name { font-size: 15px; }
  .lb-pod-wager { font-size: 16px; }
  .lb-pod .lb-prize { font-size: 15px; padding: 6px 12px; }

  .lb-unit { min-width: 52px; }
  .lb-timer-title { font-size: 16px; gap: 12px; }

  .lb-calc-head { flex-wrap: wrap; }
  .lb-calc-head > div { flex-basis: 100%; }

  .lb-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; }
  .lb-head .lb-col-wager { display: none; }
  .lb-row .lb-wager { grid-column: 2; grid-row: 2; font-size: 13px; margin-top: -4px; }
  .lb-row .lb-reward { grid-column: 3; grid-row: 1 / 3; }
  .lb-mini { display: none; }

  .lb-rules { grid-template-columns: 1fr; }
}

/* ---------- 3D podium room (assets/podium-room.js) ---------- */
.lb-room-cta { display: flex; justify-content: center; margin-top: 26px; }
.lb-room-btn {
  min-height: 52px;
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4d8dff 0%, #2563eb 50%, #1a47c2 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 0 rgba(8, 25, 90, 0.6), 0 10px 22px -10px rgba(30, 80, 220, 0.55);
}
.lb-room-btn:hover { transform: none; background: linear-gradient(180deg, #6aa1ff 0%, #3474f2 50%, #1f52d1 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -2px 0 rgba(8, 25, 90, 0.6), 0 14px 28px -10px rgba(30, 80, 220, 0.55); }
.lb-room-btn:focus-visible { outline: 2px solid #fff; }
.lb-room-btn:disabled { opacity: 0.7; cursor: progress; }

html.room-open, html.room-open body { overflow: hidden; }
.room { position: fixed; inset: 0; z-index: 1000; background: #030812; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.6s ease; }
.room.ready .room-canvas { opacity: 1; }
.room-loading { position: absolute; inset: 0; display: grid; place-items: center; font: 600 15px Outfit, sans-serif; color: #9fdcff; letter-spacing: 0.04em; }
.room-toast { position: absolute; left: 50%; top: 76px; translate: -50% 0; z-index: 3; margin: 0; padding: 10px 18px; border-radius: 999px; background: rgba(6, 13, 26, 0.85); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.5); color: #fff; font: 700 13.5px Outfit, sans-serif; white-space: nowrap; }
.room-toast[hidden] { display: none; }
.room-stopped { z-index: 1; padding: 24px; background: rgba(2, 6, 14, 0.82); color: #eaf6ff; text-align: center; }
.room-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 8px rgba(76, 201, 255, 0.9); opacity: 0; pointer-events: none; }
.room.is-walking .room-dot { opacity: 1; }
.room-exit {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: rgba(6, 13, 26, 0.7); color: #eaf6ff;
  box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.55);
  font: 800 13px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.room-exit:hover { background: rgba(76, 201, 255, 0.14); }
.room-exit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.room-intro {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2;
  width: min(420px, calc(100vw - 32px)); padding: 30px 28px 28px; border-radius: 22px; text-align: center;
  background: rgba(6, 13, 26, 0.82);
  box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.5), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.4s ease;
}
.room.ready .room-intro { opacity: 1; }
.room-intro[hidden] { display: none; }
.room-title { margin: 0; font: 400 clamp(40px, 9vw, 56px)/1 Anton, sans-serif; color: #fff; text-shadow: 0 3px 0 #1a6fd6, 0 6px 0 #0c3a73; }
.room-sub { margin: 14px 0 18px; color: #b9cbe6; font: 500 15px Outfit, sans-serif; }
.room-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; margin: 0 0 22px; padding: 0; list-style: none; color: #b9cbe6; font: 500 13px Outfit, sans-serif; }
.room-keys li { display: inline-flex; align-items: center; gap: 4px; }
.room-keys b { color: #fff; font-weight: 700; margin-right: 2px; }
.kc { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 7px; background: rgba(76, 201, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.5); color: #fff; font: 700 12px Inter, sans-serif; }
.room-go {
  min-width: 220px; min-height: 52px; padding: 12px 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #4d8dff 0%, #2563eb 50%, #1a47c2 100%); color: #fff;
  font: 800 14px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 0 rgba(8, 25, 90, 0.6), 0 10px 22px -10px rgba(30, 80, 220, 0.55);
}
.room-go:hover { background: linear-gradient(180deg, #6aa1ff 0%, #3474f2 50%, #1f52d1 100%); }
.room-go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.room-stick { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(6, 13, 26, 0.4); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.room-stick.on { opacity: 1; }
.room-stick span { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: linear-gradient(180deg, #4d8dff, #1a47c2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
@media (prefers-reduced-motion: reduce) { .room-canvas, .room-intro { transition: none; } }
/* when the browser won't lock the mouse, the view follows the mouse anyway (a hint shows for a few seconds) */
.room.is-free .room-canvas { cursor: none; }
.room-tip { position: absolute; left: 50%; top: 22px; translate: -50% 0; z-index: 2; margin: 0; padding: 10px 18px; border-radius: 999px; background: rgba(6, 13, 26, 0.8); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.45); color: #eaf6ff; font: 600 13.5px Outfit, sans-serif; white-space: nowrap; opacity: 0; pointer-events: none; }
.room.is-free .room-tip { animation: room-tip 5s ease forwards; }
@keyframes room-tip { 0%, 100% { opacity: 0; } 8%, 80% { opacity: 1; } }
@media (max-width: 560px) { .room-tip { top: 124px; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); } }
/* sound on/off (next to Exit) and, on touch screens, a jump button */
.room-sound {
  position: absolute; top: 16px; right: 158px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(6, 13, 26, 0.7); color: #eaf6ff; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.room-sound:hover { background: rgba(76, 201, 255, 0.14); }
.room-sound:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.room-sound .room-sound-off { display: none; }
.room-sound[aria-pressed="false"] .room-sound-waves { display: none; }
.room-sound[aria-pressed="false"] .room-sound-off { display: inline; }
.room-jump {
  position: absolute; right: 22px; bottom: 26px; z-index: 2;
  display: none; place-items: center; width: 68px; height: 68px; border: 0; border-radius: 50%;
  background: linear-gradient(180deg, #4d8dff 0%, #2563eb 50%, #1a47c2 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 22px -10px rgba(30, 80, 220, 0.6);
  touch-action: none;
}
@media (pointer: coarse) { .room-jump { display: grid; } }
/* how many people are in the cave (only when multiplayer is connected) */
.room-people { position: absolute; top: 16px; left: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: rgba(6, 13, 26, 0.7); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.4); color: #eaf6ff; font: 600 13.5px Outfit, sans-serif; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.room-people::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4cc9ff; box-shadow: 0 0 10px #4cc9ff; }
.room-people[hidden] { display: none; }
@media (max-width: 560px) { .room-people { top: 70px; } }

/* Cave chat: bottom left. The log shows the latest lines and fades back when nothing new has been
   said for a while; it comes back while you're typing. */
.room-chat { position: absolute; left: 16px; bottom: 18px; z-index: 2; display: none; flex-direction: column; gap: 6px; width: min(340px, calc(100vw - 32px)); }
.room.is-walking .room-chat { display: flex; }
.room-chat-log { display: flex; flex-direction: column; gap: 4px; max-height: 190px; margin: 0; padding: 0; overflow-y: auto; list-style: none; opacity: 0.45; transition: opacity 0.4s; scrollbar-width: none; }
.room-chat.is-fresh .room-chat-log, .room-chat.is-typing .room-chat-log { opacity: 1; }
.room-chat-log li { align-self: flex-start; max-width: 100%; padding: 6px 12px; border-radius: 14px; background: rgba(6, 13, 26, 0.72); color: #eaf6ff; font: 500 13.5px/1.35 Outfit, sans-serif; overflow-wrap: anywhere; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.room-chat-log b { margin-right: 4px; color: #9fdcff; font-weight: 700; }
.room-chat-log li.me b { color: #f5c542; }
.room-chat-log li.kleo b { color: #f5c542; text-shadow: 0 0 8px rgba(245, 197, 66, 0.7); }   /* Kleo's verified name */
.room-chat-form { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(6, 13, 26, 0.72); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.room-chat.is-typing .room-chat-form { box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.8); }
.room-chat-form input { flex: 1; min-width: 0; min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: #fff; font: 500 14px Outfit, sans-serif; outline: none; }
.room-chat-form input::placeholder { color: #8ea5c6; }
.room-chat-form button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #4d8dff, #2563eb 50%, #1a47c2); color: #fff; font: 700 12px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.room-chat-form button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.room-chat-msg { margin: 0; min-height: 0; color: #ffb4b4; font: 600 12.5px Outfit, sans-serif; }
.room-chat-msg:empty { display: none; }
@media (max-width: 1240px) { .room-chat { bottom: 78px; } }   /* above the emote bar */
@media (pointer: coarse), (max-width: 560px) {
  .room-chat { top: 126px; bottom: auto; width: min(280px, calc(100vw - 32px)); }
  .room-chat-log { max-height: 110px; order: 2; }
}
/* name box on the room's intro (only when multiplayer is on) */
.room-name { display: grid; gap: 6px; margin: 0 auto 6px; max-width: 280px; text-align: left; }
.room-name span { color: #b9cbe6; font: 600 13px Outfit, sans-serif; }
.room-name input {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 0; border-radius: 12px; box-sizing: border-box;
  background: rgba(4, 10, 22, 0.8); color: #fff; font: 600 16px Outfit, sans-serif;
  box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.45);
}
.room-name input::placeholder { color: #6f86a8; }
.room-name input:focus { outline: none; box-shadow: inset 0 0 0 2px #4cc9ff, 0 0 0 4px rgba(76, 201, 255, 0.18); }
.room-name-msg { min-height: 20px; margin: 0 auto 12px; max-width: 280px; color: #ff9aa8; font: 600 13px Outfit, sans-serif; text-align: left; }
/* credit for the visitors' chimp model (its CC BY licence asks for it) */
.room-credit { margin: 16px 0 0; color: #7f93b3; font: 500 11.5px Outfit, sans-serif; }
.room-credit a { color: #9fdcff; text-decoration: none; }
.room-credit a:hover { text-decoration: underline; }
/* emote bar (1–4): only once you're walking and the chimp has loaded */
.room-emotes { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; z-index: 2; display: none; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(6, 13, 26, 0.72); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.room.has-emotes.is-walking .room-emotes { display: flex; }
.room-emotes button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 14px 7px 8px; border: 0; border-radius: 999px; background: transparent; color: #dbe8ff; font: 700 12.5px Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.room-emotes button:hover { background: rgba(76, 201, 255, 0.12); }
.room-emotes button[aria-pressed="true"] { background: linear-gradient(180deg, #4d8dff, #2563eb 50%, #1a47c2); color: #fff; }
.room-emotes button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.room-emotes kbd { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(76, 201, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.5); color: #fff; font: 700 11px Inter, sans-serif; }
.room.is-emote .room-dot { opacity: 0; }
@media (pointer: coarse) {
  .room-emotes { bottom: 108px; }
  .room-emotes kbd { display: none; }
  .room-emotes button { padding: 7px 11px; font-size: 11px; }
}
/* the Kick player sits behind the canvas, showing through the billboard's see-through screen */
.room-css { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.room-css[hidden] { display: none; }
/* the fade to black between the cave and the giveaway stage */
.room-fade { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.room-fade.on { opacity: 1; }
.room-canvas { z-index: 1; }
.room-tv { background: #000; overflow: hidden; }
.room-tv iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; filter: brightness(0.88) saturate(0.95); }
.room-watch { position: absolute; left: 50%; bottom: 76px; translate: -50% 0; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 18px 8px 10px; border-radius: 999px; background: rgba(6, 13, 26, 0.8); box-shadow: inset 0 0 0 1.5px rgba(76, 201, 255, 0.5); color: #fff; font: 700 13px Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.room-watch[hidden] { display: none; }
.room-watch kbd { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(76, 201, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(76, 201, 255, 0.5); font: 700 12px Inter, sans-serif; }
@media (pointer: coarse) { .room-watch { bottom: 160px; padding: 10px 18px; } }