/* Shared top bar for the Server and Atlas pages. Loaded after tokens.css and base.css.
   Markup: header.topbar > a.logo, nav.tabs > a.tab(.on), button.spin-cd#spinCd, div.who#who.
   Server page also has button.nav-btn (menu) and button.nav-btn.mem-btn (miners) for the phone. */
:root{--topbar-h:76px}
.topbar{position:relative;z-index:60;flex:none;height:56px;margin:10px 10px 0;padding:0 8px;display:flex;align-items:center;gap:10px;
  border-radius:var(--r-md);background:var(--surface-1);border:1px solid var(--line-strong)}
.topbar .logo{display:block;flex:none;padding:0 8px}
.topbar .logo img{display:block;height:36px;width:auto}
/* tighter desktops: no wider than the old mark, so a signed-in member's Account button stays on the bar */
@media (min-width:821px) and (max-width:1320px){.topbar .logo img{height:29px}}
.topbar .tabs{display:inline-flex;flex:none;gap:2px;padding:3px;margin:0;border:1px solid var(--line-strong);border-radius:var(--r-md);background:var(--surface-2);overflow:visible}
.topbar .tab{display:inline-flex;align-items:center;min-height:34px;padding:0 14px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--text-muted);
  font:600 13px var(--font-display);text-decoration:none;white-space:nowrap}
.topbar .tab:hover{color:var(--text);text-decoration:none}
.topbar .tab.on{background:var(--accent-fill);color:var(--on-accent)}
.topbar .tab:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
/* countdown chip */
.topbar .spin-cd{margin:0 auto 0 0;display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 12px;border-radius:var(--r-md);border:1px solid var(--line-strong);background:var(--surface-2);
  color:var(--text-muted);font:500 13px var(--font-body);white-space:nowrap;transition:border-color var(--motion-fast)}
.topbar .spin-cd::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--gold);flex:none}
.topbar .spin-cd b{font-family:var(--font-mono);font-weight:500;color:var(--text);font-variant-numeric:tabular-nums}
.topbar .spin-cd:hover{border-color:var(--accent-line)}
.topbar .spin-cd.ready{border-color:var(--gold-line);background:var(--gold-wash)}
.topbar .spin-cd.ready::before{background:var(--success)}
/* sign-in / account */
.topbar .who{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:13px;font-weight:500}
.topbar .who .av{width:28px;height:28px;font-size:10px}
.topbar .who .bolts{font-family:var(--font-mono);color:var(--text-muted)}
.topbar .who button{min-height:40px;padding:0 var(--sp-4);border-radius:var(--r-sm);border:1px solid var(--accent-line);background:transparent;color:var(--text);font-weight:500;transition:background var(--motion-fast),border-color var(--motion-fast)}
.topbar .who button:hover,.topbar .who button.on{border-color:var(--accent);background:var(--accent-wash)}
.topbar .who button.primary{background:var(--accent-fill);border-color:var(--accent-fill);color:var(--on-accent)}
.topbar .who button.primary:hover{background:var(--accent-fill-hover);border-color:var(--accent-fill-hover)}
/* phone buttons (hidden on desktop) */
.topbar .nav-btn{display:none}
@media (max-width:1100px){.topbar .who .bolts{display:none}}
/* phone: row 1 logo + tabs + sign-in; row 2 menu, countdown, miners */
@media (max-width:820px){
  :root{--topbar-h:112px}
  .topbar{height:auto;margin:0;border-radius:0;border-width:0 0 1px;flex-wrap:wrap;padding:8px 10px;gap:8px 8px}
  .topbar .logo{order:1;padding:0 2px}
  .topbar .logo img{height:24px}
  @media (min-width:601px) and (max-width:760px){.topbar .logo img{height:21px}}
  .topbar .tabs{order:2;margin-right:auto}
  .topbar .tab{padding:0 10px;min-height:40px}
  .topbar .who{order:3}
  .topbar .who>.av,.topbar .who>span:not(.bolts),.topbar .who .bolts{display:none}
  .topbar .who button.primary,.topbar .who button.acct{font-size:0;padding:0 12px}
  .topbar .who button.primary::after{content:"Sign in";font-size:13px}
  .topbar .who button.acct::after{content:"Account";font-size:13px}
  .topbar .nav-btn{order:4;display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:var(--r-sm);border:1px solid var(--line-strong);background:var(--surface-2);color:var(--text)}
  .topbar .nav-btn:hover,.topbar .nav-btn[aria-expanded="true"]{border-color:var(--accent);background:var(--accent-wash)}
  .topbar .spin-cd{order:5;flex:1 1 0;min-width:0;margin:0;justify-content:center}
  .topbar .mem-btn{order:6}
}

/* Wide phones fix (360 to 820 wide): force the row break after the sign-in button, so row 2 is always menu, countdown,
   miners. Without it, from 421 wide the menu button and the countdown fitted on row 1, the countdown was squeezed to
   30px and its text spilled past the screen edge, so the whole page scrolled sideways on large phones. The break is an
   empty line of its own, so the row gap is halved: two gaps of 4px make the same 8px. Under 360 the sign-in button
   already wraps to row 2 by itself and nothing changes. */
@media (min-width:360px) and (max-width:820px){
  .topbar{row-gap:4px}
  .topbar::before{content:"";order:4;flex:0 0 100%;height:0}
}

/* 320-wide phones fix: the free-spin chip is wider than its slot and spilled over the menu button. Hide its label
   (the title says "Free spin"), keep the dot and the countdown, and never let it overflow its box. */
@media (max-width:400px){.topbar .spin-cd{font-size:0;gap:5px;padding:0 6px;overflow:hidden;justify-content:center}.topbar .spin-cd b{font-size:11px;letter-spacing:-.03em;white-space:nowrap}}
