/* Shared base styles for the account and leaderboard pages. */

:root {
  --bg: #0b0c10; --panel: #13141a; --raise: #1b1c24; --grid: #1c1e26;
  --line: #262833; --line-hi: #3d4050; --ink: #f2f3f5; --prose: #c7cad3; --muted: #9a9eab; --dim: #4a4d58;
  --purple: #b561ff; --green: #22d764; --yellow: #ffd21f; --red: #ff5147;
  --label: "Geist", system-ui, sans-serif;
  --figure: "Geist", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: #3a3d4a var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.45 var(--figure); font-variant-numeric: tabular-nums; caret-color: var(--purple); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(181, 97, 255, .45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e3140; border-radius: 10px; border: 2px solid var(--bg); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-hi); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--raise); padding: 1px 5px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 1240px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) 72px max(24px, env(safe-area-inset-left)); }

.navbtn { font: 700 12px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 10px 14px; background: none; cursor: pointer; }
.navbtn:hover { color: var(--ink); border-color: var(--line-hi); }
.navbtn.go { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.navbtn.go:hover { background: #fff; }
.navbtn[aria-current="page"] { color: var(--ink); background: var(--raise); box-shadow: inset 0 -2px 0 var(--purple); }

/* ---- panels and controls ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { font: 700 13px/1.2 var(--label); letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.panel-head .sub { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 3px; padding: 2px; background: var(--bg); }
.seg button { font: 700 11px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 7px 11px; border-radius: 2px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--raise); color: var(--ink); box-shadow: inset 0 -2px 0 var(--purple); }
.btn { font: 700 12px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--ink); background: var(--raise); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; cursor: pointer; display: inline-block; }
.btn:hover { border-color: var(--line-hi); background: #22232d; }
.btn:disabled { background: none; cursor: default; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.slab { display: flex; align-items: baseline; justify-content: space-between; width: 100%; padding: 18px 20px; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--bg); cursor: pointer; text-align: left; text-decoration: none; }
.slab:hover { background: #fff; }
.slab:disabled { opacity: .6; cursor: default; }
.slab b { font: 700 40px/.9 var(--figure); text-transform: uppercase; }
.slab span { font: 700 11px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: #4a4d58; }
.msg { font-size: 14px; margin: 12px 0 0; min-height: 1.3em; color: var(--muted); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.aside { margin: 0; padding: 12px 16px; background: var(--raise); border-radius: 3px; font-size: 15px; color: var(--prose); }
.aside b { font: 700 11px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }

/* ---- timing-tower rows (the leaderboard and the account preview) ---- */
.tower { list-style: none; margin: 0; padding: 0; }
.tower li { display: grid; grid-template-columns: 34px 4px minmax(0, 1fr) auto 64px; align-items: center; gap: 0 14px; min-height: 48px; padding: 6px 12px 6px 6px; border-top: 1px solid var(--grid); }
.tower li:last-child { border-bottom: 1px solid var(--grid); }
.tower .pos { line-height: 1; font-variant-numeric: normal; text-align: right; }
.tower .stripe { width: 4px; height: 26px; border-radius: 1px; background: var(--team, var(--line-hi)); }
.tower .who { font: 600 18px/1.1 var(--figure); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tower .you { font: 700 10px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--bg); background: var(--ink); border-radius: 2px; padding: 3px 5px; margin-left: 10px; vertical-align: 2px; }
.tower .figure { font: 700 22px/1 var(--figure); text-align: right; }
.tower .figure small { font-size: 13px; color: var(--muted); margin-left: 3px; }
.tower .figure.p1 { color: var(--purple); }
.tower .gap { font: 600 14px/1 var(--figure); color: var(--muted); text-align: right; }
.tower li.me { background: var(--raise); }

@media (max-width: 600px) {
  main { padding: 0 max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }

  .navbtn { flex: 1; text-align: center; padding: 10px 4px; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
  .panel { padding: 16px; }
  .slab b { font-size: 34px; }
  .tower li { grid-template-columns: 26px 4px minmax(0, 1fr) auto 48px; gap: 0 10px; padding-right: 8px; }
}
@media (pointer: coarse) {
  .navbtn, .btn, .seg button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
