/* Block Runner rebuild (Marlon 02.12.): slim top bar (logo · wallet pill · cog), 5 tabs at the bottom, every tab a full view between
   them, sub-tabs as an equal-width segment, settings + guide as overlays. Loaded last. */
:root { --nb-bar: calc(60px + env(safe-area-inset-top)); --nb-tab: calc(66px + env(safe-area-inset-bottom)); }

/* ---- top bar ---- */
.nb-bar { height: var(--nb-bar); padding: env(safe-area-inset-top) calc(10px + env(safe-area-inset-right)) 0 calc(10px + env(safe-area-inset-left)); gap: 8px; z-index: 70; }
.nb-logo { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; }
.nb-logo > i[data-ic] { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; color: var(--cyan);
  background: radial-gradient(circle at 35% 30%, rgba(111,231,255,.3), rgba(5,7,10,.6) 72%); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 4px 14px rgba(0,0,0,.35); }
.nb-logo > i[data-ic] svg { width: 24px; height: 24px; }
.nb-logo .bar-title { margin: 0; position: static; width: auto; height: auto; clip-path: none; overflow: visible; font-size: clamp(14px, 4vw, 26px); }
@media (max-width: 519px) { .nb-logo .bar-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
.nb-wal { gap: 6px; padding: 0 12px 0 10px; min-height: 44px; }
.nb-wal i[data-ic] { color: var(--teal); } .nb-wal i[data-ic] svg { width: 20px; height: 20px; }
.nb-wal b { font: 800 14px var(--disp); color: var(--white); }
.nb-wal small { font: 700 10px var(--disp); letter-spacing: .06em; color: var(--muted); }
#cogBtn { width: 44px; } #cogBtn svg { width: 22px; height: 22px; }

/* ---- tab bar ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: var(--nb-tab); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
  padding: 6px calc(8px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14,19,26,.88), rgba(5,7,10,.96)); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
.tabs button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; border: 0; border-radius: 16px; background: none; color: var(--muted); padding: 0; transition: color .15s, background .15s, transform .12s; }
.tabs button i[data-ic] { width: 26px; height: 26px; } .tabs button svg { width: 26px; height: 26px; }
.tabs button b { font: 700 10.5px/1 var(--disp); letter-spacing: .06em; text-transform: uppercase; }
.tabs button[aria-current] { color: var(--white); background: linear-gradient(180deg, rgba(111,231,255,.2), rgba(111,231,255,.06)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 18px rgba(111,231,255,.18); }
.tabs button[aria-current] i[data-ic] { color: var(--cyan); filter: drop-shadow(0 0 8px rgba(111,231,255,.55)); }
.tabs button:active { transform: scale(.94); }
.tab-dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--void); }
@media (min-width: 900px) { .tabs { left: 50%; right: auto; width: min(640px, 100%); transform: translateX(-50%); bottom: 12px; height: auto; border: 1px solid var(--line-2); border-radius: 22px; padding: 6px; } }

/* ---- start screen (tab Race): between top bar and tab bar, RACE in the middle ---- */
.shell { grid-template-rows: var(--nb-bar) 1fr; }
.home { grid-template-rows: auto auto 1fr; align-content: start; padding: 6px 14px calc(var(--nb-tab) + 12px); overflow: hidden; }
.home .go { align-self: center; }
@media (min-width: 900px) { .home { padding-bottom: calc(var(--nb-tab) + 30px); } }
.go .chips { gap: 12px; }
.go .chip { min-width: 64px; min-height: 64px; }
.free-note { display: none; }
@media (max-height: 520px) and (orientation: landscape) {
  .home { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; padding: 4px 14px calc(var(--nb-tab) + 6px); }
  .me-card { grid-column: 1; grid-row: 1; } .goals { grid-column: 1; grid-row: 2; align-self: start; } .home .go { grid-column: 2; grid-row: 1 / span 2; }
  :root { --nb-bar: calc(52px + env(safe-area-inset-top)); --nb-tab: calc(56px + env(safe-area-inset-bottom)); }
  .tabs button { min-height: 44px; grid-auto-flow: column; gap: 8px; } .tabs button b { font-size: 11px; } .tab-dot { top: 4px; right: 4px; }
}

/* ---- tab views: full area between the bars ---- */
.win.nb-pane { position: fixed; top: var(--nb-bar); bottom: var(--nb-tab); left: 0; right: 0; z-index: 50; padding: 0; display: grid; place-items: stretch center;
  background: rgba(5,7,10,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: nbIn .16s ease-out; }
@keyframes nbIn { from { opacity: 0; } }
.win.nb-pane .win-box, .win.nb-pane .win-box.gbox, .win.nb-pane .win-box.rbox, .win.nb-pane .win-box.wbox { width: min(980px, 100%); height: 100%; max-height: none; border-radius: 0; border-width: 0 1px; animation: none; }
@media (min-width: 900px) { .win.nb-pane { bottom: calc(var(--nb-tab) + 26px); padding: 0 16px; } .win.nb-pane .win-box { border-radius: 20px; border-width: 1px; } }
.win.nb-pane .win-head { padding: 8px calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left)); }
.win.nb-pane .win-body { padding-bottom: 14px; }
.nb-head { gap: 8px; }
.nb-seg { flex: 1; min-width: 0; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(5,7,10,.5); border: 1px solid var(--line); }
.nb-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 0; border: 0; border-radius: 12px; background: none; color: var(--muted);
  font: 800 12px var(--disp); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.nb-seg button i[data-ic], .nb-seg button svg { width: 20px; height: 20px; }
.nb-seg button[aria-selected="true"] { color: var(--void); background: linear-gradient(180deg, #8ff0ff, var(--cyan)); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 14px rgba(111,231,255,.3); }
.nb-lv { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(5,7,10,.5); }
.nb-lv .lgb { width: 24px; height: 24px; } .nb-lv b { font: 800 13px var(--disp); color: var(--white); }
.nb-head .spk, .nb-head .rk-live { flex: none; }
@media (max-width: 400px) { .nb-seg button i[data-ic] { display: none; } .nb-head .rk-live { display: none; } }

/* wallet tab: the shared wallet fills the view */
#win-wallet .win-box { grid-template-rows: minmax(0, 1fr); }
#win-wallet .win-body { padding: 12px calc(14px + env(safe-area-inset-right)) 12px calc(14px + env(safe-area-inset-left)); overflow: auto; }
#walletBox { --bzw-accent: var(--cyan); --bzw-accent-2: var(--teal); --bzw-on-accent: var(--void); display: flex; flex-direction: column; }
#walletBox > * { flex: 1; }
#walletBox .w-pane { display: grid; gap: 10px; align-content: start; width: min(560px, 100%); margin: 0 auto; }
.w-ok { display: grid; justify-items: start; gap: 10px; }
.w-ok .w-net { position: static; display: inline-flex; min-height: 48px; padding: 0 18px; font-size: 14px; }

/* ---- overlays: settings sheet + guide ---- */
.nb-ov { z-index: 90; }
.nb-cog { position: fixed; inset: 0; display: grid; place-items: end center; padding: 0; background: rgba(3,5,10,.6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: nbIn .16s ease-out; }
.nb-cog[hidden] { display: none; }
.nb-cogbox { width: min(520px, 100%); border-radius: 24px 24px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); animation: nbUp .22s cubic-bezier(.2,1.2,.4,1); }
@keyframes nbUp { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) and (min-height: 521px) { .nb-cog { place-items: center; } .nb-cogbox { border-radius: 24px; padding-bottom: 14px; } }
.nb-cogrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.nb-cb { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 96px; padding: 10px 6px; border-radius: 18px; text-decoration: none; color: var(--white);
  border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(111,231,255,.12), rgba(5,7,10,.4)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 20px rgba(0,0,0,.3); font: inherit; }
.nb-cb i[data-ic], .nb-cb svg { width: 30px; height: 30px; color: var(--cyan); }
.nb-cb b { font: 800 11px var(--disp); letter-spacing: .06em; text-transform: uppercase; }
.nb-cb small { font: 600 11px var(--body); color: var(--muted); margin-top: -3px; }
.nb-cb.off i[data-ic], #sndBtn.off i[data-ic] { color: var(--muted); }
.nb-cb:active { transform: scale(.96); }
@media (max-height: 520px) and (orientation: landscape) { .nb-cogrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .nb-cb { min-height: 80px; } }
.win.nb-ov#win-guide { z-index: 95; }
.nb-seg button[aria-selected="true"] i[data-ic] { color: var(--void); }
@media (max-height: 520px) and (orientation: landscape) {
  :root { --nb-bar: calc(48px + env(safe-area-inset-top)); --nb-tab: calc(50px + env(safe-area-inset-bottom)); }
  .tabs { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .tabs button { display: flex; align-items: center; justify-content: center; min-height: 42px; gap: 8px; }
  .tabs button i[data-ic], .tabs button svg { width: 22px; height: 22px; }
  .tabs .tab-dot { position: static; order: 3; margin-left: -4px; }
  .nb-logo > i[data-ic] { width: 36px; height: 36px; }
  .win.nb-pane .win-head { padding-top: 5px; padding-bottom: 5px; } .nb-seg { padding: 3px; } .nb-seg button { min-height: 38px; }
}
/* wallet home (Marlon 02.12.): Claim all big like the Race button, Top up below it, then the icon grid; one number format (BZWallet.fmt) */
#walletBox .bzw-hero .bzw-btn { justify-content: space-between; min-height: 56px; padding: 0 20px; border-radius: 18px; font: 800 15px var(--disp); letter-spacing: .06em; text-transform: uppercase; }
#walletBox .bzw-hero .bzw-btn b { font: 900 17px var(--disp); letter-spacing: .02em; text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
#walletBox .bzw-hero .bzw-btn small { flex-basis: 100%; margin-top: -6px; font: 700 11px var(--body, system-ui); letter-spacing: 0; text-transform: none; opacity: .75; text-align: left; }
#walletBox .w-claimall { flex-wrap: wrap; row-gap: 0; min-height: 64px; color: var(--void); background: linear-gradient(180deg, #9ff3ff, var(--cyan) 45%, var(--teal));
  box-shadow: 0 6px 0 #0f8a74, 0 14px 30px rgba(46,230,168,.3), inset 0 2px 0 rgba(255,255,255,.6); }
#walletBox .w-claimall:active { transform: translateY(4px); box-shadow: 0 2px 0 #0f8a74, inset 0 2px 0 rgba(255,255,255,.6); }
#walletBox .w-topup b { color: var(--cyan); }
@media (orientation: landscape) and (max-height: 520px) {
  #walletBox .bzw-hero .bzw-btn { flex-wrap: nowrap; gap: 10px; min-height: 52px; padding: 0 14px; font-size: 12.5px; white-space: nowrap; }
  #walletBox .bzw-hero .bzw-btn b { font-size: 14px; }
  #walletBox .bzw-hero .bzw-btn small { display: none; } /* the number of confirmations stays in the button title */
}
/* «Paid ✓ - Tap Start» after the payment (app.js renderReady): over the lobby, one big Start */
.st-ready { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgba(5,7,10,.55); }
.st-ready-card { display: grid; justify-items: center; gap: 10px; width: min(380px, 100%); padding: 22px 18px; border-radius: 22px; text-align: center; }
.st-ready-ok { font: 900 28px var(--disp); letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.st-ready-ok span { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 6px; border-radius: 50%; color: var(--void); background: var(--teal); font-size: 22px; vertical-align: 3px; }
.st-ready-t { color: var(--silver, #c9d3e3); font-size: 15px; }
.st-ready .play { min-width: min(260px, 80vw); margin-top: 6px; }
.st-ready .play:disabled { filter: grayscale(.6); }
/* gear on the Start card: 7 slots, the items of the picked slot below (tap = on/off) */
.rp { width: 100%; display: grid; gap: 8px; }
.rp-slots { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.rp-slot, .rp-item { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 5px 2px; border-radius: 12px; border: 1px solid var(--line); background: rgba(5,7,10,.5); color: var(--white, #eef3fb); cursor: pointer; }
.rp-slot img, .rp-item img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rc) 50%, transparent)); }
.rp-slot small, .rp-item small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; color: var(--muted, #8f9bb0); }
.rp-slot.on { border-color: var(--cyan); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 40%, transparent); }
.rp-pick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.rp-item { flex: 0 0 68px; }
.rp-item.on { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 18%, rgba(5,7,10,.6)); }
@media (orientation: landscape) and (max-height: 520px) {
  .st-ready { padding: 8px; } .st-ready-card { width: min(520px, 100%); gap: 6px; padding: 12px 14px; }
  .st-ready-ok { font-size: 20px; } .st-ready-ok span { width: 28px; height: 28px; font-size: 17px; } .st-ready-t { display: none; }
  .st-ready .play { min-height: 54px; font-size: 24px; margin-top: 2px; }
  .rp-slot img, .rp-item img { width: 30px; height: 30px; }
}
/* game over on short sideways phones (Marlon 02.12.: fits without scrolling, only the important things): the new item is one line */
@media (orientation: landscape) and (max-height: 430px) {
  .res-main .drop-card { flex: none; min-height: 0; padding: 4px 10px; gap: 8px; } .res-main .drop-card img { width: 34px; height: 34px; }
  .res-main .drop-card .muted, .res-main .drop-card br { display: none; }
  .res-xp { margin-top: 0; } .res-head .medal { width: 46px; height: 46px; }
}
/* wallet hero buttons (Marlon 03.12.): icon + short word + number, the unit small; never runs into its neighbour */
#walletBox .bzw-hero .bzw-btn > i { flex: none; width: 20px; height: 20px; display: block; }
#walletBox .bzw-hero .bzw-btn > i svg { width: 100%; height: 100%; display: block; }
#walletBox .bzw-hero .bzw-btn > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
#walletBox .bzw-hero .bzw-btn > b { flex: none; display: inline-flex; align-items: baseline; gap: 5px; }
#walletBox .bzw-hero .bzw-btn > b em { font: 700 10.5px var(--body); font-style: normal; letter-spacing: .02em; opacity: .75; }
#walletBox .bzw-hero .bzw-btn { gap: 10px; }
/* Credits page: status (races ready, move) and packs; the split only behind the (i) */
.w-split { display: none; }
.w-cr { display: grid; gap: 10px; }
.w-cr-a, .w-cr-b, .w-zap, .w-zap-a, .w-zap-b { display: grid; gap: 8px; align-content: start; min-width: 0; }
.w-cr-b:empty { display: none; }
.w-cr-b .lnk { justify-self: start; }
.w-move { min-height: 50px; font-size: 13px; }
.w-move > span { display: grid; justify-items: start; line-height: 1.15; text-align: left; }
.w-move small { font: 600 11px var(--body); letter-spacing: 0; text-transform: none; opacity: .8; }
.w-big small { line-height: 1.3; }
@media (max-height: 520px) and (orientation: landscape) {
  /* home: balance card + Claim all / Top up left, the eight tiles right; nothing empty, nothing cut */
  #walletBox .bzw:not(.bzw-sub) { grid-template-columns: minmax(210px, 38%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  #walletBox .bzw:not(.bzw-sub) .bzw-top { grid-row: 1; }
  #walletBox .bzw:not(.bzw-sub) .bzw-hero { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #walletBox .bzw:not(.bzw-sub) .bzw-hero[hidden] + .bzw-grid { grid-row: 1 / span 2; }
  #walletBox .bzw:not(.bzw-sub) .bzw-grid { grid-column: 2; grid-row: 1 / span 2; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  #walletBox .bzw-hero .bzw-btn { min-height: 44px; padding: 0 12px; gap: 8px; }
  #walletBox .w-claimall { min-height: 46px; }
  /* a page: no big empty balance card, the balance is a slim pill in the head row */
  #walletBox .bzw.bzw-sub { position: relative; display: flex; }
  #walletBox .bzw.bzw-sub .bzw-top { position: absolute; top: 0; right: 0; z-index: 2; flex-direction: row; align-items: center; gap: 10px; height: 44px; padding: 0 5px 0 14px; border-radius: 99px; }
  #walletBox .bzw.bzw-sub .bzw-deco { display: none; }
  #walletBox .bzw.bzw-sub .bzw-sum { display: flex; align-items: center; gap: 10px; container-type: normal; }
  #walletBox .bzw.bzw-sub .bzw-bal { font-size: 16px; }
  #walletBox .bzw.bzw-sub .bzw-unit { font-size: 10px; }
  #walletBox .bzw.bzw-sub .bzw-gas { min-height: 32px; }
  #walletBox .bzw.bzw-sub .bzw-page { gap: 8px; }
  #walletBox .bzw.bzw-sub .w-pane { width: 100%; }
  .w-cr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .w-zap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .w-zap .w-sub.w-cur { width: 100%; }
  .w-zap .w-pk4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-move { min-height: 44px; }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 720px) { #walletBox .bzw.bzw-sub .bzw-gas small { display: none; } }
