/* The leaderboards page (docs/FRONTEND_SPEC.md §5), from design/mockups/leaderboards.html — unchanged. */
:root{
  --page:#cfe8f6; --card:#fffaf0; --ink:#2e2748; --muted:#5f5879; --edge:#2e2748;
  --gold:#f5b72f; --gold-ink:#3a2a05; --silver:#dfe2ee; --bronze:#e7a46e; --mint:#23845a; --grass:#7cc25a; --soil:#c9956a;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){--page:#1c2244;--card:#241f3b;--ink:#f7f2ff;--muted:#bdb5da;--edge:#0f0c1c;--mint:#6ee0a6;--silver:#b9bdd3}
}
:root[data-theme="dark"]{--page:#1c2244;--card:#241f3b;--ink:#f7f2ff;--muted:#bdb5da;--edge:#0f0c1c;--mint:#6ee0a6;--silver:#b9bdd3}
*,*::before,*::after{box-sizing:inherit}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;background:var(--page);color:var(--ink);font-family:Fredoka,"Trebuchet MS","Segoe UI",system-ui,sans-serif}
a{color:inherit}
.card{background:var(--card);border:2px solid var(--edge);border-radius:20px;box-shadow:0 5px 0 var(--edge)}
.wrap{max-width:980px;margin:0 auto;padding:0 20px}

header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0}
.logo{display:flex;align-items:center;gap:10px;font-size:24px;font-weight:700;text-decoration:none}
.logo svg{display:block}
nav{display:flex;gap:4px;padding:4px}
nav a{display:flex;align-items:center;min-height:44px;padding:0 16px;border-radius:14px;text-decoration:none;font-weight:500;font-size:16px}
nav a[aria-current="page"]{background:var(--gold);color:var(--gold-ink);font-weight:600}
nav span{display:flex;align-items:center;min-height:44px;padding:0 16px;color:var(--muted);font-size:16px}

.hero{text-align:center;padding:28px 0 8px}
.hero h1{margin:0;font-size:clamp(40px,7vw,64px);font-weight:700;line-height:1;letter-spacing:-0.5px}
.hero p{margin:12px 0 0;font-size:18px;color:var(--muted)}
.hero b{color:var(--ink);font-weight:600}

.tabs{display:inline-flex;gap:4px;padding:5px;margin:26px auto 0}
.tabs button{font:inherit;font-size:16px;font-weight:500;color:var(--ink);background:transparent;border:0;border-radius:14px;min-height:46px;padding:0 20px;cursor:pointer}
.tabs button[aria-selected="true"]{background:var(--gold);color:var(--gold-ink);font-weight:600}
.tabs button:focus-visible,nav a:focus-visible{outline:3px solid #ff7a6b;outline-offset:2px}
.tabrow{text-align:center}

.podium{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;gap:14px;max-width:720px;margin:44px auto 0}
.spot{display:flex;flex-direction:column;align-items:center;text-align:center}
.who{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:14px}
.who .addr{font-size:18px;font-weight:600}
.who .val{font-size:16px;color:var(--mint);font-weight:600}
.avatar{width:64px;height:64px;border-radius:18px;border:2px solid var(--edge);box-shadow:0 4px 0 var(--edge);overflow:hidden;background:var(--card)}
.first .avatar{width:84px;height:84px;border-radius:22px}
.crown{height:26px;margin-bottom:-4px}
.block{width:100%;border:2px solid var(--edge);border-radius:18px 18px 0 0;border-bottom:0;display:flex;justify-content:center;padding-top:14px;font-size:44px;font-weight:700;color:var(--gold-ink);position:relative;overflow:hidden;transform-origin:bottom}
.block::after{content:"";position:absolute;left:0;right:0;bottom:0;height:22px;background:var(--grass);border-top:2px solid var(--edge)}
.b1{height:190px;background:var(--gold)}
.b2{height:140px;background:var(--silver);color:var(--ink)}
.b3{height:110px;background:var(--bronze);color:var(--ink)}
.ground{max-width:760px;height:26px;margin:0 auto;background:var(--soil);border:2px solid var(--edge);border-radius:0 0 18px 18px;box-shadow:0 5px 0 var(--edge)}
@media (prefers-reduced-motion:no-preference){
  .block{animation:rise .7s cubic-bezier(.2,.9,.3,1.2) both}
  .b2{animation-delay:.12s}.b3{animation-delay:.24s}
  @keyframes rise{from{transform:scaleY(.05)}to{transform:scaleY(1)}}
}

.you{display:flex;align-items:center;gap:16px;margin:40px auto 0;max-width:720px;padding:16px 20px;background:var(--gold);color:var(--gold-ink)}
.you .rank{font-size:34px;font-weight:700;min-width:84px}
.you .txt{flex:1;display:flex;flex-direction:column;gap:2px}
.you .txt b{font-size:18px}
.you .txt span{font-size:15px}
.you .avatar{width:52px;height:52px;border-radius:14px;box-shadow:none}

.list{max-width:720px;margin:24px auto 0;padding:8px 20px}
.row{display:grid;grid-template-columns:40px 44px minmax(0,1fr) auto;align-items:center;gap:14px;padding:12px 0;border-bottom:1px dashed var(--muted)}
.row:last-child{border-bottom:0}
.row .n{font-size:18px;font-weight:600;color:var(--muted);text-align:center}
.row .avatar{width:44px;height:44px;border-radius:12px;box-shadow:none}
.row .mid{display:flex;flex-direction:column;gap:6px;min-width:0}
.row .addr{font-size:17px;font-weight:500}
.bar{height:8px;border-radius:99px;background:color-mix(in srgb,var(--muted) 22%,transparent);overflow:hidden}
.bar i{display:block;height:100%;border-radius:99px;background:var(--grass)}
.row .v{font-size:17px;font-weight:600;color:var(--mint);text-align:right;white-space:nowrap}

.bdg{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;border:2px solid var(--edge);vertical-align:middle;margin-left:4px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.row.glow{background:linear-gradient(90deg,rgba(155,232,255,.25),rgba(185,156,255,.25),rgba(255,143,209,.2));border-radius:12px;padding-left:8px;padding-right:8px}
.myth .avatar{box-shadow:0 0 0 3px #b99cff,0 0 18px 4px rgba(155,120,255,.55)}
.legend{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin:18px 0 0;font-size:14px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.foot{text-align:center;color:var(--muted);font-size:14px;padding:32px 0 56px;line-height:1.5}

@media (max-width:640px){
  header{flex-direction:column;align-items:stretch}
  nav{justify-content:space-between}
  nav a,nav span{padding:0 12px;font-size:15px}
  .tabs{display:flex;width:100%}
  .tabs button{flex:1;padding:0 8px;font-size:14px}
  .podium{gap:8px}
  .who .addr{font-size:15px}.who .val{font-size:14px}
  .avatar{width:48px;height:48px}.first .avatar{width:62px;height:62px}
  .b1{height:150px}.b2{height:112px}.b3{height:88px}
  .block{font-size:34px}
  .you .rank{font-size:26px;min-width:60px}
  .row{grid-template-columns:30px 40px minmax(0,1fr) auto;gap:10px}
}

/* ---- additions for the real page (not visual changes) ---- */
/* .you sets display:flex, which would override [hidden]: without a session there is no "you". */
#you[hidden]{display:none}
.empty{text-align:center;color:var(--muted);padding:18px 0}
