/* Leaderboard pages — same arcade look as the landing page. */
:root {
  --bg: #170b24;
  --panel: #241238;
  --panel-deep: #1b0e2d;
  --panel-edge: #3b2159;
  --gold: #ffc530;
  --silver: #d6d0e4;
  --bronze: #e0975a;
  --pink: #ff4d9d;
  --cyan: #3ee8dc;
  --twitch: #9146ff;
  --cream: #f5edff;
  --dim: #b39ecf;
  --pixel: 'Press Start 2P', monospace;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(145, 70, 255, .25), transparent),
    radial-gradient(ellipse 40% 30% at 85% 60%, rgba(255, 77, 157, .07), transparent),
    radial-gradient(ellipse 40% 30% at 10% 80%, rgba(62, 232, 220, .06), transparent);
}
/* subtle CRT scanlines over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.09) 2px 4px);
  z-index: 5;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background-color .15s;
}
.btn:hover { transform: translateY(2px); }
.btn-twitch { background: var(--twitch); color: #fff; box-shadow: 0 4px 0 #5c2aa8; }
.btn-twitch:hover { box-shadow: 0 2px 0 #5c2aa8; }
.btn-gold {
  background: var(--gold);
  color: #2a1500;
  box-shadow: 0 4px 0 #9a6d00;
  font-family: var(--pixel);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: 1px;
}
.btn-gold:hover { background: #ffd45e; box-shadow: 0 2px 0 #9a6d00; }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: .9rem; background: var(--panel-edge); color: var(--cream); }
.btn-small:hover { background: #4d2c73; }

/* ---------- Header ---------- */
header { text-align: center; padding: 40px 0 6px; }
.crumbs { font-size: .95rem; color: var(--dim); margin-bottom: 18px; }
.crumbs a { color: var(--dim); text-decoration: none; padding: 4px 2px; }
.crumbs a:hover { color: var(--cream); text-decoration: underline; }
h1 {
  font-family: var(--pixel);
  font-size: clamp(1.1rem, 4.5vw, 2rem);
  letter-spacing: 2px;
  line-height: 1.5;
  color: var(--gold);
  text-shadow: 3px 3px 0 #8a1e5c, 6px 6px 0 rgba(0,0,0,.4), 0 0 24px rgba(255,197,48,.5);
  text-wrap: balance;
}
.sub { margin-top: 10px; color: var(--dim); text-wrap: balance; }
.actions {
  margin-top: 20px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.account { display: contents; color: var(--dim); }
.account-user { display: inline-flex; align-items: center; gap: 10px; }
.account-user .avatar { width: 28px; height: 28px; }
.account strong { color: var(--cream); }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-deep));
  border: 2px solid var(--panel-edge);
  border-radius: var(--radius);
}
.panel h2 {
  font-family: var(--pixel);
  font-size: .85rem;
  line-height: 1.6;
  color: var(--cream);
}
.meta { color: var(--dim); font-size: .9rem; min-height: 1.35em; }
.kicker {
  font-family: var(--pixel);
  font-size: .55rem;
  letter-spacing: 1px;
  color: var(--pink);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- Overview cards ---------- */
.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin-top: 32px;
}
.card { display: flex; flex-direction: column; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--edge, var(--gold)); box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 28px var(--glow, rgba(255,197,48,.2)); }
.card-screen {
  display: grid;
  place-items: center;
  height: 112px;
  font-size: 2.6rem;
  border-bottom: 2px solid var(--panel-edge);
  text-decoration: none;
  position: relative;
  text-shadow: 0 6px 24px rgba(0,0,0,.55);
}
.card-screen::before { content: var(--screen-art, ""); }
.card-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.12) 3px 6px);
}
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h2 a { text-decoration: none; }
.card-body h2 a:hover { color: var(--gold); }
.card-board { flex: 1; }
.card-more { align-self: flex-start; margin-top: 6px; }

/* Each game's colours, matching its cabinet on the landing page */
.game-floss-simulator { --edge: var(--cyan); --glow: rgba(62,232,220,.3); }
.game-floss-simulator .card-screen {
  --screen-art: "🪵🏝️🌊";
  background: radial-gradient(ellipse at 50% 20%, #2fd8ff33, transparent), linear-gradient(160deg, #0e5e63, #0a2c44);
}
.game-jump-and-run { --edge: #ff6b5b; --glow: rgba(224,54,44,.35); }
.game-jump-and-run .card-screen {
  --screen-art: "🦲🩳🪙";
  background: radial-gradient(ellipse at 78% 12%, #ffd16640, transparent 55%), linear-gradient(180deg, #1d5e9e, #0b1f3a);
}
.game-sonnenrun { --edge: #ffb02e; --glow: rgba(255,176,46,.35); }
.game-sonnenrun .card-screen { background: #f7b733 url("/sonnenrun-cover.jpg") center 30% / cover; }

/* ---------- Game page: board picker ---------- */
.tabs { margin: 30px 0 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.tab-group { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tab-group-label { font-family: var(--pixel); font-size: .55rem; letter-spacing: 1px; color: var(--pink); }
.tab-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tab {
  font: inherit;
  color: var(--dim);
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  cursor: pointer;
  transition: color .15s, border-color .15s, background-color .15s;
}
.tab:hover { color: var(--cream); border-color: var(--dim); }
.tab[aria-selected="true"] { color: #2a1500; background: var(--gold); border-color: var(--gold); box-shadow: 0 3px 0 #9a6d00; }
.pill { min-height: 44px; padding: 8px 18px; border-radius: 999px; font-weight: 600; }
.chip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-family: var(--pixel);
  font-size: .7rem;
  display: grid;
  place-items: center;
}

.chip-symbol { font-family: 'Outfit', system-ui, sans-serif; font-size: 1.15rem; }
.chip-symbol[aria-selected="true"] { color: #2a1500; }

/* ---------- Game page: board panel ---------- */
.board-panel { padding: 18px 20px 22px; max-width: 760px; margin: 0 auto; }
.board-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; margin-bottom: 14px; text-align: center; }
.board-title h2 { font-size: clamp(.8rem, 2.6vw, 1rem); text-wrap: balance; }
.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--panel-edge);
  background: var(--panel-deep);
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.nav-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Board rows ---------- */
.board { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: 34px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  border-left: 3px solid transparent;
}
.rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--pixel);
  font-size: .62rem;
  color: var(--dim);
}
/* Podium: the first three get a medal and a coloured edge */
.row.gold { border-left-color: var(--gold); background: linear-gradient(90deg, rgba(255,197,48,.12), rgba(0,0,0,.2) 60%); }
.row.silver { border-left-color: var(--silver); background: linear-gradient(90deg, rgba(214,208,228,.09), rgba(0,0,0,.2) 60%); }
.row.bronze { border-left-color: var(--bronze); background: linear-gradient(90deg, rgba(224,151,90,.1), rgba(0,0,0,.2) 60%); }
.gold .rank { background: var(--gold); color: #2a1500; box-shadow: 0 0 14px rgba(255,197,48,.45); }
.silver .rank { background: var(--silver); color: #241238; }
.bronze .rank { background: var(--bronze); color: #2a1500; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-edge); }
.avatar-initial { display: grid; place-items: center; font-weight: 800; color: var(--dim); text-transform: uppercase; }
.gold .avatar { box-shadow: 0 0 0 2px var(--gold); }
.who { min-width: 0; display: flex; flex-direction: column; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 1.02rem; }
.who small, .value small { color: var(--dim); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.value b { font-weight: 800; font-size: 1.08rem; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gold .value b { color: var(--gold); }
/* The logged-in player's own rows */
.row.self { outline: 2px solid rgba(62,232,220,.55); outline-offset: -2px; }
.you {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--cyan);
  color: #082a28;
  font-family: var(--pixel);
  font-size: .45rem;
  vertical-align: 3px;
}

/* Loading placeholders */
.skeleton .row { background: rgba(0,0,0,.2); }
.skeleton .bar {
  grid-column: 1 / -1;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 2px; color: var(--dim); }
.board-panel .empty { align-items: center; text-align: center; padding: 18px 0 8px; }
.error { color: #ff9b9b; padding: 10px 2px; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .wrap { padding: 0 14px 64px; }
  .row { grid-template-columns: 30px 32px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px 8px 8px; }
  .rank { width: 30px; height: 30px; }
  .avatar { width: 32px; height: 32px; }
  .board-panel { padding: 14px 12px 18px; }
  .tab-row { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .card, .tab, .nav-btn { transition: none; }
  .btn:hover, .card:hover { transform: none; }
  .skeleton .bar { animation: none; }
}
