/*
 * The top bar, in two rows.
 *
 * The thin row is for the things you set once and forget: the pages, the
 * language, the sound, and the level with its bar. The main row is for the
 * things you reach for while playing: the games menu, the money, the account.
 * Splitting them is what keeps the main row from becoming a shelf of eleven
 * buttons at eleven different weights.
 *
 * This file is loaded last and deliberately overrides the older single row
 * rules rather than editing them, so that nothing else that borrows those
 * classes changes underneath.
 */

/*
 * The header does not scroll away.
 *
 * The rail and the chat room are both fixed, so a header that slid off the top
 * left them hanging in the air with a gap above them. Everything that frames
 * the board now stays where it is and only the board moves.
 */
.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 45;
  display: block;
  height: auto;
  padding: 0;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}

/* The page starts under it rather than behind it. */
body {
  padding-top: 62px;
}

/* ------------------------------------------------------------ thin row */

.topbar-thin {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 34px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #060a11;
}

.thin-links {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.thin-links a {
  color: var(--text-faint);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.thin-links a:hover {
  color: var(--text);
}

.thin-button {
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.thin-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.thin-button.danger:hover {
  color: #f7a2a2;
}

.topbar-thin .lang {
  margin-left: auto;
}

.topbar-thin .lang-chip {
  height: 24px;
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  font-size: 11px;
}

.topbar-thin .lang-chip:hover {
  border-color: var(--line);
}

/* --------------------------------------------------------- the level */

/*
 * A word, a number and a long thin line, the way the board this borrows its
 * shape from wears it. The bar is the only thing that moves and it moves once
 * per bet, so it belongs up here rather than among the controls.
 */
.topbar-thin .level-chip {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.topbar-thin .level-chip-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.topbar-thin .level-chip-bar {
  width: 150px;
  height: 6px;
  border-radius: 3px;
  background: #121d31;
  border: 1px solid #1d2a44;
}

.topbar-thin .level-chip-bar span {
  border-radius: 3px;
}

/* ------------------------------------------------------------ main row */

.topbar-main {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 0 16px;
}

.topbar-main .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* --------------------------------------------------------- the games */

.games {
  position: relative;
}

.games-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.games-chip:hover,
.games-chip[aria-expanded='true'] {
  background: #16243c;
  border-color: var(--line-2);
}

.games-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.games-mark svg {
  width: 100%;
  height: 100%;
}

.games-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.games-menu[hidden] {
  display: none;
}

.games-menu button {
  padding: 10px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.games-menu button:hover {
  background: #16233a;
  color: var(--text);
}

.games-menu button.is-on {
  color: var(--gold);
}

/* --------------------------------------------------------- the money */

.link-button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.link-button:hover {
  color: var(--text);
}

.link-button[hidden],
#deposit-top[hidden] {
  display: none;
}

.balance {
  gap: 8px;
  align-items: center;
  border-radius: 6px;
}

.balance-coin {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #a9bdf5;
}

.balance-coin svg {
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------- the account */

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 6px;
}

.account-face {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
}

.account-face .face {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  font-size: 11px;
}

.account-address {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

/* ------------------------------------------------------- narrow glass */

@media (max-width: 1100px) {
  .views {
    display: none;
  }
}

@media (max-width: 860px) {
  .thin-links {
    display: none;
  }

  .topbar-thin .level-chip-bar {
    width: 90px;
  }

  .topbar-main {
    gap: 10px;
  }

  .account-address {
    max-width: 90px;
  }
}

/* The switch and the level, now that they sit on the main row. */
.topbar-main .thin-button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.topbar-main .thin-button:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.topbar-main .level-chip {
  margin-right: 4px;
}

/* The present on the register button hangs past the bar, so nothing clips it. */
.topbar,
.topbar-main,
.topbar-right {
  overflow: visible;
}
