/* Leaderboards (src/ui/boards.js): the board screen, the rider-name entry and the strip on the results screen. Same
   glass panels and type as the rest of the menus. */

#boards {
  gap: 10px;
}
#boards h2 {
  margin: 0;
}
#lbSub,
#lbSrc {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}
#lbSrc b {
  color: var(--gd);
}

/* a row of tabs: one per career race, then CAREER and FREE RIDE; it scrolls sideways on narrow screens */
#lbTabs {
  display: flex;
  gap: 6px;
  max-width: min(1100px, 96vw);
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.lbTab {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 10px;
  text-align: left;
  color: var(--tx);
  cursor: pointer;
}
.lbTab small {
  font:
    400 10px 'Bungee',
    sans-serif;
  color: var(--dim);
}
.lbTab b {
  font:
    700 13px 'Chakra Petch',
    sans-serif;
  white-space: nowrap;
}
.lbTab.cur {
  border-color: var(--gd);
  box-shadow: inset 0 0 0 1px var(--gd);
}
.lbTab.cur small {
  color: var(--gd);
}

.lbBar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.lbBar .opt {
  min-width: 0;
  padding: 8px 14px;
}

/* the table: rank, rider, time or points, bike, difficulty (or races and stars on the career board) */
.lbTable {
  width: min(860px, 96vw);
  border-radius: 14px;
  padding: 6px 10px;
  overflow-x: auto;
}
.lbTable table {
  width: 100%;
  border-collapse: collapse;
  font:
    600 15px 'Chakra Petch',
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.lbTable th {
  padding: 8px 10px;
  font:
    400 11px 'Bungee',
    sans-serif;
  letter-spacing: 0.04em;
  color: var(--dim);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.lbTable td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(190, 180, 255, 0.08);
  white-space: nowrap;
}
.lbTable td.rk {
  width: 3em;
  font:
    400 16px 'Bungee',
    sans-serif;
  color: var(--dim);
}
.lbTable td.sc {
  font-weight: 800;
  color: var(--tx);
}
.lbTable td.bk,
.lbTable td.df {
  color: var(--dim);
  font-weight: 500;
}
.lbTable tr.p1 td.rk {
  color: #ffd76a;
}
.lbTable tr.p2 td.rk {
  color: #d6dbe6;
}
.lbTable tr.p3 td.rk {
  color: #e0a070;
}
.lbTable tr.me td {
  background: rgba(46, 230, 197, 0.12);
}
.lbTable tr.me td.nm {
  color: var(--tl);
}
.lbTable td.nm i {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font:
    400 10px 'Bungee',
    sans-serif;
  font-style: normal;
  color: #05030f;
  background: var(--tl);
}
.lbTable tr.gap td,
.lbTable tr.none td {
  text-align: center;
  color: var(--dim);
  font-weight: 500;
}
.lbTable .d-hard {
  color: #ff9a4a;
}
.lbTable .d-legend {
  color: var(--pk);
}
.lbTable .d-easy {
  color: #9fe8ff;
}

/* the rider-name entry: the name in a box, a keyboard for gamepad and mouse */
#lbNameBox {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: min(420px, 90vw);
  padding: 14px 18px;
  border-radius: 14px;
  justify-content: space-between;
}
#lbNameTx {
  font:
    400 clamp(24px, 4vmin, 34px) 'Bungee',
    sans-serif;
  color: var(--gd);
  min-height: 1.2em;
}
#lbNameTx::after {
  content: '_';
  color: var(--tl);
  animation: lbBlink 1s steps(1) infinite;
}
@keyframes lbBlink {
  50% {
    opacity: 0;
  }
}
#lbNameN {
  color: var(--dim);
}
#lbKeys {
  display: grid;
  gap: 6px;
}
#lbKeys > div {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.lbKey {
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--tx);
  font:
    700 16px 'Chakra Petch',
    sans-serif;
  cursor: pointer;
}
.lbKey.wide {
  min-width: 90px;
}
.menu.row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

/* results: where the ride just landed on the boards */
#endBoard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
#endBoard.hide {
  display: none;
}
#endBoard .wait {
  color: var(--dim);
}
#endBoard .nr {
  width: 100%;
  font:
    400 clamp(20px, 3.4vmin, 28px) 'Bungee',
    sans-serif;
  color: var(--gd);
  text-shadow: 0 0 14px rgba(255, 194, 61, 0.5);
}
#endBoard .pill {
  display: grid;
  gap: 1px;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}
#endBoard .pill small {
  font:
    400 10px 'Bungee',
    sans-serif;
  color: var(--dim);
}
#endBoard .pill b {
  font:
    800 18px 'Chakra Petch',
    sans-serif;
  font-variant-numeric: tabular-nums;
}
#endBoard .pill em {
  font-style: normal;
  font-weight: 700;
  color: var(--tl);
}
#endBoard .pill em u {
  text-decoration: none;
  color: var(--dim);
  font-weight: 500;
}
#endBoard .pill i {
  font:
    400 10px 'Bungee',
    sans-serif;
  font-style: normal;
  color: var(--dim);
}
#endBoard .pill i.nb {
  color: var(--tl);
}
#endBoard .pill.rec,
#endBoard .pill i.rc {
  border-color: var(--gd);
  color: var(--gd);
}

/* phones: the tab row and the table take the screen's width inside the menu padding, so the board scrolls inside
   itself and the page never scrolls sideways */
@media (max-width: 600px) {
  #lbTabs {
    max-width: 100%;
  }
  .lbTable {
    width: 100%;
  }
}
