:root {
  --bg: #07031a;
  --bg2: #120632;
  --cyan: #2ef2ff;
  --pink: #ff3df2;
  --gold: #ffd24a;
  --red: #ff3c5a;
  --text: #eafcff;
  --muted: rgba(234, 252, 255, 0.55);
  --card: rgba(16, 8, 44, 0.86);
  --font-num: "Orbitron", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* The page scrolls: first screen = the game, below it = info section + footer.
   Touch on the game canvas never scrolls the page (touch-action: none on #game). */
html { scroll-behavior: smooth; }
html.modal-open { overflow: hidden; }
html, body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg2) 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overscroll-behavior-y: none;
}

/* ---------- Layout: [ad rail] [game column] [ad rail] on PC, game + fixed bottom banner on mobile ---------- */
:root {
  --ad-side-w: 160px;
  --ad-bottom-h: 50px;
  --ad-bottom-space: 0px; /* space reserved for the bottom banner (set in the mobile media query) */
}

#app {
  position: relative;
  height: 100vh;
  height: 100dvh; /* exactly one screen, so the game always fits */
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 24px;
  padding: max(8px, env(safe-area-inset-top)) 16px calc(max(8px, env(safe-area-inset-bottom)) + var(--ad-bottom-space));
}

#gameCol {
  flex: 0 1 520px;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Ad slots ---------- */
.ad-slot { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-side {
  flex: none;
  width: var(--ad-side-w);
  height: 600px;
  max-height: 100%;
  align-self: center;
}
.ad-bottom {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--ad-bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(4, 1, 14, 0.92);
  border-top: 1px solid rgba(46, 242, 255, 0.15);
  z-index: 20; /* stays above overlays: ads must never be covered */
}
/* Placeholder shown until a real ad tag is pasted in — delete the .ad-placeholder div when you do */
.ad-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.22);
  font: 600 11px/1.6 var(--font-num);
  letter-spacing: 0.15em;
}
.ad-bottom .ad-placeholder { width: 320px; height: var(--ad-bottom-h); border-radius: 6px; }

/* Narrow screens (mobile/tablet portrait): no side rails, fixed bottom banner instead */
@media (max-width: 899px) {
  :root { --ad-bottom-space: var(--ad-bottom-h); }
  .ad-side { display: none; }
  .ad-bottom { display: flex; }
}
/* Ads turned off (Monetize SHOW_AD_SLOTS = false) */
body.no-ads { --ad-bottom-space: 0px; }
body.no-ads .ad-slot { display: none; }

/* ---------- Buy Me a Coffee ---------- */
.bmc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: #ffdd00;
  color: #1a1206;
  font: 700 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 221, 0, 0.6), 0 0 18px rgba(255, 221, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.bmc:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #ffdd00, 0 0 28px rgba(255, 221, 0, 0.6); }
.bmc:active { transform: scale(0.96); }
.bmc-cup { font-size: 18px; }
.bmc-corner {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
}
.bmc-card { margin-top: 4px; height: 36px; font-size: 13px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.legal-link { color: var(--muted); font-size: 12px; text-decoration: none; opacity: 0.7; }
.legal-link:hover { opacity: 1; text-decoration: underline; }

/* Never show support buttons while a run is in progress */
body.playing .bmc { display: none; }

/* ---------- HUD ---------- */
#hud {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(46, 242, 255, 0.06);
  border: 1px solid rgba(46, 242, 255, 0.35);
  box-shadow: 0 0 14px rgba(46, 242, 255, 0.18) inset;
  min-width: 0;
}
.stat.best { border-color: rgba(255, 210, 74, 0.4); background: rgba(255, 210, 74, 0.05); box-shadow: 0 0 14px rgba(255, 210, 74, 0.14) inset; }
.stat.best .ico { fill: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); }
.stat.best.beaten { animation: bestGlow 0.9s ease-in-out infinite alternate; }

.ico { width: 22px; height: 22px; flex: none; fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }

.num {
  font-family: var(--font-num);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#score { font-size: 22px; text-shadow: 0 0 10px var(--cyan); }
#score.bump { animation: bump 0.25s ease-out; }
#best { font-size: 16px; color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 74, 0.7); }

.next {
  width: 56px;
  height: 52px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 61, 242, 0.6);
  background: rgba(255, 61, 242, 0.06);
  display: grid;
  place-items: center;
  position: relative;
}
.next::after {
  content: "›";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-55%);
  font-size: 20px;
  color: var(--pink);
  text-shadow: 0 0 6px var(--pink);
}
#nextCanvas { width: 46px; height: 46px; }

.icon-btn {
  width: 44px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn svg { width: 24px; height: 24px; fill: var(--text); }
.icon-btn .off { display: none; }
.icon-btn.muted .on { display: none; }
.icon-btn.muted .off { display: block; opacity: 0.6; }

svg .stroke { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { color: var(--text); }

/* ---------- Stage ---------- */
#stage {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  overflow: hidden;
}
#game {
  display: block;
  border-radius: 18px;
  touch-action: none;
  cursor: crosshair;
  transition: box-shadow 0.3s;
  box-shadow: 0 0 0 1px rgba(46, 242, 255, 0.25), 0 0 30px rgba(46, 242, 255, 0.12);
}
#stage.fever #game { animation: fever 0.6s linear infinite; }

.combo {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-family: var(--font-num);
  font-weight: 900;
  font-size: clamp(40px, 12vw, 72px);
  color: #fff;
  text-shadow: 0 0 12px var(--cyan), 0 0 28px var(--cyan);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
.combo.pop { animation: comboPop 0.9s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.combo.hot { color: #fff6d0; text-shadow: 0 0 10px var(--pink), 0 0 26px var(--pink), 0 0 50px var(--gold); }

/* ---------- Overlays ---------- */
.overlay {
  /* Covers only the first screen (the game), so the info section below can still be scrolled to.
     Never covers the bottom banner. */
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(100vh - var(--ad-bottom-space));
  height: calc(100dvh - var(--ad-bottom-space));
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 1, 14, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  animation: fadeIn 0.35s ease-out;
}
.overlay.hidden { display: none; }

.card {
  width: min(360px, 100%);
  padding: 24px 20px 22px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid rgba(46, 242, 255, 0.35);
  box-shadow: 0 0 40px rgba(46, 242, 255, 0.2), 0 0 80px rgba(255, 61, 242, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: cardIn 0.45s cubic-bezier(.2, 1.4, .4, 1);
}

.logo { display: flex; flex-direction: column; line-height: 1; gap: 6px; }
.logo .l1 {
  font-family: var(--font-num); font-weight: 900; font-size: 48px; letter-spacing: 0.12em;
  color: #fff; text-shadow: 0 0 10px var(--pink), 0 0 30px var(--pink);
}
.logo .l2 {
  font-family: var(--font-num); font-weight: 600; font-size: 14px; letter-spacing: 0.32em;
  color: var(--cyan); text-shadow: 0 0 8px var(--cyan);
}

#chainCanvas { width: 100%; max-width: 320px; height: auto; aspect-ratio: 640 / 300; }
#overPlanet { width: 120px; height: 120px; }

.row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.hint { color: var(--muted); font-size: 22px; }
.hint .ico { width: 28px; height: 28px; fill: var(--text); filter: none; opacity: 0.8; }
.stat-sm { font-size: 20px; }
.stat-sm .ico { fill: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); }
.stat-sm .num { color: var(--gold); }
.emoji { font-size: 20px; }
.huge { font-size: 46px; text-shadow: 0 0 14px var(--cyan), 0 0 30px var(--cyan); }
.badge { font-size: 22px; animation: bump 0.6s ease-in-out infinite alternate; }
.badge.hidden { display: none; }

.btns { display: flex; gap: 14px; margin-top: 6px; }
.btn {
  width: 72px; height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(46, 242, 255, 0.5);
  background: rgba(46, 242, 255, 0.08);
  color: var(--cyan);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
  padding: 0;
}
.btn svg { width: 30px; height: 30px; fill: currentColor; }
.btn:hover { box-shadow: 0 0 20px rgba(46, 242, 255, 0.45); }
.btn:active { transform: scale(0.92); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), #7a3dff 55%, var(--cyan));
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 61, 242, 0.5);
}
.btn.primary svg { fill: #fff; }
.btn.primary .stroke { stroke: #fff; }
.btn.big { width: 110px; height: 76px; border-radius: 22px; }
.btn.big svg { width: 40px; height: 40px; }
.btn .done { display: none; color: #5dff9e; }
.btn.copied { border-color: #5dff9e; box-shadow: 0 0 20px rgba(93, 255, 158, 0.5); }
.btn.copied .copy { display: none; }
.btn.copied .done { display: block; }

/* ---------- Animations ---------- */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
}
@keyframes fever {
  0%   { box-shadow: 0 0 0 3px #ff3df2, 0 0 40px #ff3df2, 0 0 80px rgba(255, 61, 242, 0.5); }
  33%  { box-shadow: 0 0 0 3px #2ef2ff, 0 0 40px #2ef2ff, 0 0 80px rgba(46, 242, 255, 0.5); }
  66%  { box-shadow: 0 0 0 3px #ffd24a, 0 0 40px #ffd24a, 0 0 80px rgba(255, 210, 74, 0.5); }
  100% { box-shadow: 0 0 0 3px #ff3df2, 0 0 40px #ff3df2, 0 0 80px rgba(255, 61, 242, 0.5); }
}
@keyframes bestGlow { from { box-shadow: 0 0 10px rgba(255, 210, 74, 0.3); } to { box-shadow: 0 0 26px rgba(255, 210, 74, 0.8); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: scale(0.85) translateY(20px); } to { opacity: 1; transform: none; } }

@media (max-width: 380px) {
  #score { font-size: 18px; }
  #best { font-size: 14px; }
  .stat { padding: 0 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #stage.fever #game { animation-duration: 2s; }
}

/* =========================================================
 * Below-the-game content: scroll hint, info section, footer, modals
 * ========================================================= */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--ad-bottom-space) + 2px);
  transform: translateX(-50%);
  width: 36px; height: 24px;
  display: grid; place-items: center;
  color: var(--muted);
  z-index: 11; /* above the start overlay, so it's visible on the title screen */
  animation: hintBob 1.6s ease-in-out infinite;
}
.scroll-hint svg { width: 26px; height: 26px; }
.scroll-hint:hover { color: #fff; }
body.playing .scroll-hint { display: none; }
@keyframes hintBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 5px); } }

.info {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 16px 24px;
  line-height: 1.7;
  font-size: 16px;
}
.info a { color: var(--cyan); }
.info-head { text-align: center; margin-bottom: 28px; }
.info-head h1 {
  font-family: var(--font-num); font-weight: 900;
  font-size: clamp(26px, 6vw, 40px); letter-spacing: 0.06em; margin: 0 0 10px;
  text-shadow: 0 0 12px var(--pink);
}
.info-lead { font-size: 18px; max-width: 640px; margin: 0 auto 8px; }
.info-langs { color: var(--muted); font-size: 14px; margin: 0; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }
.info-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(46, 242, 255, 0.16);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
  min-width: 0;
}
.info-card h2 { font-size: 20px; margin: 0 0 8px; color: var(--cyan); }
.info-card ol, .info-card ul { padding-left: 20px; margin: 8px 0; }
.info-card li { margin: 4px 0; }
.info-card p { margin: 8px 0; }
.ctrl { width: 100%; border-collapse: collapse; }
.ctrl th, .ctrl td { text-align: left; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
.ctrl th { white-space: nowrap; font-weight: 600; padding-right: 12px; }
.info kbd {
  display: inline-block; padding: 0 6px; border: 1px solid rgba(255,255,255,0.25);
  border-bottom-width: 2px; border-radius: 5px; font: 600 13px/1.5 ui-monospace, monospace;
}
.chain {
  list-style: none; padding: 0 !important; margin: 12px 0 !important;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
@media (max-width: 560px) { .chain { grid-template-columns: repeat(3, 1fr); } }
.chain li {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,0.03); margin: 0 !important;
}
.chain canvas { width: 56px; height: 56px; }
.chain .name { font-size: 13px; font-weight: 600; text-align: center; }
.chain .pts { font: 700 12px/1 var(--font-num); color: var(--gold); }
.info details { border-top: 1px solid rgba(255,255,255,0.08); padding: 4px 0; }
.info summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.info details p { margin: 0 0 10px; color: rgba(234, 252, 255, 0.85); }
.info .more { color: var(--muted); font-size: 14px; margin-top: 12px; }
.info-play {
  display: block; width: fit-content; margin: 24px auto 0;
  padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 700;
  color: #fff !important;
  background: linear-gradient(135deg, var(--pink), #7a3dff 55%, var(--cyan));
}

.game-footer {
  max-width: 880px; margin: 0 auto;
  padding: 20px 16px calc(28px + var(--ad-bottom-space));
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center; color: var(--muted); font-size: 14px;
}
.game-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 8px; }
.game-footer a { color: var(--text); text-decoration: none; opacity: 0.8; }
.game-footer a:hover { opacity: 1; text-decoration: underline; }
.game-footer p { margin: 0; }

.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: 1px solid rgba(46, 242, 255, 0.35);
  border-radius: 20px;
  background: #10082c;
  color: var(--text);
  box-shadow: 0 0 40px rgba(46, 242, 255, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.modal[open] { display: flex; animation: cardIn 0.3s ease-out; }
.modal::backdrop { background: rgba(4, 1, 14, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-body { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 22px 22px; line-height: 1.65; font-size: 15px; }
.modal-body h2 { margin: 0 0 4px; font-size: 22px; padding-right: 32px; }
.modal-body h3 { margin: 18px 0 4px; font-size: 16px; color: var(--cyan); }
.modal-body p { margin: 6px 0; }
.modal-body a { color: var(--cyan); }
.modal-body .muted { color: var(--muted); font-size: 13px; }
.modal-body .more { margin-top: 16px; font-size: 14px; }
.modal > form { position: absolute; top: 10px; right: 10px; margin: 0; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06);
  color: var(--text); font-size: 16px; cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,0.14); }
.contact-btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  background: #ffdd00; color: #1a1206 !important; font-weight: 700; text-decoration: none;
}

/* =========================================================
 * Embedded builds (itch.io / Poki / CrazyGames iframes) — html.embed is set by js/platform.js
 * One fixed screen: no page scroll (avoids scroll fights with the host page), no ad space.
 * ========================================================= */
html.embed { --ad-bottom-space: 0px; scroll-behavior: auto; }
html.embed, html.embed body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.embed #app { height: 100%; }
html.embed .overlay { height: 100%; }

/* Narrow screens and embeds: the corner coffee button would overlap the HUD,
   so it sits below the title card instead. */
@media (max-width: 600px) {
  .overlay { align-content: center; gap: 12px; }
  .bmc-corner { position: static; order: 2; justify-self: center; }
}
html.embed .overlay { align-content: center; gap: 12px; }
html.embed .bmc-corner { position: static; order: 2; justify-self: center; }

/* =========================================================
 * Online leaderboard (js/leaderboard.js)
 * ========================================================= */
.lb-open-start {
  margin-left: 6px; height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(255, 210, 74, 0.5); background: rgba(255, 210, 74, 0.1);
  color: var(--gold); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.lb-open-start:hover { box-shadow: 0 0 14px rgba(255, 210, 74, 0.45); }

.rank-box { width: 100%; min-height: 0; display: flex; justify-content: center; }
.rank-box[data-state="hidden"] { display: none; }
.rank-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.rank-chip {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border-radius: 12px;
  background: rgba(46, 242, 255, 0.08); border: 1px solid rgba(46, 242, 255, 0.3); font-size: 14px;
}
.rank-chip b { font-family: var(--font-num); font-size: 16px; color: #fff; }
.rank-chip small { color: var(--muted); font-size: 11px; }
.rank-open, .rank-retry {
  height: 34px; min-width: 40px; border-radius: 12px; cursor: pointer; font-size: 17px;
  border: 1px solid rgba(255, 210, 74, 0.5); background: rgba(255, 210, 74, 0.1); color: var(--gold);
}
.rank-loading { color: var(--muted); letter-spacing: 4px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.nick-form {
  display: flex; align-items: center; gap: 6px; width: 100%; max-width: 280px;
  padding: 4px 4px 4px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(46, 242, 255, 0.35);
}
.nick-form.invalid { border-color: var(--red); animation: shake 0.3s; }
.nick-form.saved { border-color: #5dff9e; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.nick-ico { font-size: 16px; }
.nick-form input {
  flex: 1; min-width: 0; height: 32px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 600 15px system-ui, sans-serif; user-select: text; -webkit-user-select: text;
}
.nick-form input::placeholder { color: var(--muted); }
.nick-go {
  width: 36px; height: 32px; border-radius: 10px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--cyan)); color: #fff; display: grid; place-items: center;
}
.nick-go svg { width: 20px; height: 20px; }

.lb-modal { width: min(420px, calc(100vw - 24px)); }
.lb-title { text-align: center; font-size: 30px !important; padding: 0 !important; margin: 0 0 8px !important; }
.lb-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.lb-tab {
  flex: 1; height: 36px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.04); color: var(--muted);
}
.lb-tab[aria-selected="true"] { color: #fff; border-color: var(--cyan); background: rgba(46, 242, 255, 0.12); }
.lb-list { list-style: none; padding: 0; margin: 0; }
.lb-row {
  display: grid; grid-template-columns: 40px 28px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px;
}
.lb-row:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.lb-row.me { background: rgba(255, 61, 242, 0.14); outline: 1px solid rgba(255, 61, 242, 0.5); }
.lb-rank { font: 700 14px/1 var(--font-num); color: var(--muted); text-align: center; }
.lb-planet { width: 28px; height: 28px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-score { font: 900 15px/1 var(--font-num); color: var(--gold); font-variant-numeric: tabular-nums; }
.lb-me:not(:empty) { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.2); }
.lb-empty { text-align: center; color: var(--muted); padding: 18px 0; font-size: 20px; }
.lb-nick { margin: 14px auto 0; }
.lb-note { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0 !important; }

/* =========================================================
 * Daily challenge
 * ========================================================= */
.mode-btns { display: flex; gap: 12px; justify-content: center; }
.btn.daily {
  width: 110px; height: 76px; border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border: 1px solid rgba(255, 210, 74, 0.7);
  background: linear-gradient(135deg, rgba(255, 210, 74, 0.22), rgba(255, 120, 40, 0.18));
  color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 210, 74, 0.3);
}
.btn.daily:hover { box-shadow: 0 0 28px rgba(255, 210, 74, 0.55); }
.daily-ico { font-size: 22px; line-height: 1.1; }
#dailyNo { font-size: 18px; color: #fff; text-shadow: 0 0 8px var(--gold); line-height: 1.2; }
.daily-best { font-size: 11px; color: var(--gold); opacity: 0.9; line-height: 1.2; }
.daily-best:empty { display: none; }
.mode-badge {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px; pointer-events: none;
  font: 900 13px/1.4 var(--font-num); color: #fff;
  background: rgba(255, 210, 74, 0.18); border: 1px solid rgba(255, 210, 74, 0.6);
  text-shadow: 0 0 6px var(--gold);
}
.mode-badge.hidden { display: none; }
@media (max-width: 380px) {
  .btn.big, .btn.daily { width: 96px; height: 70px; }
}

.rank-chip.daily { background: rgba(255, 210, 74, 0.12); border-color: rgba(255, 210, 74, 0.55); }
