#game-topbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 1006px;
  height: 52px;
  z-index: 10000;
  box-sizing: border-box;
  transform-origin: 0 0;
  color: #fff6d2;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity .16s ease;
}

#game-topbar.is-visible {
  visibility: visible;
  opacity: 1;
}

.game-topbar__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 30px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% -80%, rgba(255, 213, 84, .42), transparent 48%),
    linear-gradient(180deg, #9b100f 0%, #6e0709 54%, #420305 100%);
  border-bottom: 2px solid #d89b25;
  box-shadow: inset 0 -1px 0 #4a0000, 0 2px 8px rgba(0, 0, 0, .72);
  pointer-events: auto;
}

.game-topbar__side {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}

.game-topbar__brand {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 500px;
  overflow: hidden;
  color: #ffe7a4;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 1px 0 #2b0000, 0 0 8px rgba(255, 196, 49, .45);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.game-topbar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid #f1c75d;
  border-radius: 18px;
  background: linear-gradient(180deg, #b8391d, #6c0808);
  color: #fff4c5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 3px rgba(0,0,0,.65);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.game-topbar__button:hover,
.game-topbar__button:focus-visible {
  background: linear-gradient(180deg, #d85727, #81100c);
  outline: 2px solid rgba(255, 223, 120, .55);
  outline-offset: 1px;
}

.game-topbar__back {
  display: block;
  width: 41px;
  height: 41px;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .72));
}

.game-topbar__back img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-topbar__back:hover,
.game-topbar__back:focus-visible {
  filter: brightness(1.12) drop-shadow(0 1px 3px rgba(0, 0, 0, .8));
  outline: 2px solid rgba(255, 223, 120, .55);
  outline-offset: 1px;
  border-radius: 50%;
}

.game-topbar__balance {
  display: flex;
  align-items: center;
  min-width: 230px;
  height: 36px;
  padding: 0 13px 0 5px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 207, 86, .5);
  border-radius: 18px;
  background: rgba(24, 0, 4, .56);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.7);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000;
}

.game-topbar__coin {
  width: 30px;
  height: 30px;
  margin-right: 7px;
  object-fit: contain;
}

.game-topbar__menu {
  position: absolute;
  right: 15px;
  top: 54px;
  width: 190px;
  overflow: hidden;
  border: 2px solid #e0b243;
  border-radius: 7px;
  background: #580609;
  box-shadow: 0 5px 16px rgba(0,0,0,.8);
  pointer-events: auto;
}

.game-topbar__menu[hidden],
.game-topbar__modal[hidden] {
  display: none;
}

.game-topbar__menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 210, 112, .3);
  background: linear-gradient(180deg, #a7191b, #72090c);
  color: #fff4d0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.game-topbar__menu-item:last-child { border-bottom: 0; }
.game-topbar__menu-item:hover { background: linear-gradient(180deg, #c52d25, #8c1011); }
.game-topbar__menu-item:disabled { cursor: wait; opacity: .55; }
.game-topbar__menu-icon { width: 34px; color: #ffd65c; font-size: 23px; }

.game-topbar__modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  width: auto;
  height: auto;
  background: rgba(14, 0, 2, .66);
  pointer-events: auto;
}

.game-topbar__settings {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  padding: 29px 36px 25px;
  box-sizing: border-box;
  border: 3px solid #d9a52f;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% -25%, rgba(255, 203, 77, .26), transparent 48%),
    linear-gradient(145deg, #8f1113, #4d0407 70%, #2b0103);
  box-shadow: inset 0 0 24px rgba(255, 158, 36, .18), 0 8px 28px rgba(0,0,0,.86);
}

.game-topbar__settings-title {
  margin: 0 0 18px;
  color: #ffe7a4;
  font-size: 24px;
  text-align: center;
}

.game-topbar__settings-close {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 31px;
  height: 31px;
  border: 2px solid #f0bf3e;
  border-radius: 5px;
  background: #9d1114;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

.game-topbar__setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
  padding: 0 16px;
  border: 1px solid rgba(255, 212, 104, .22);
  border-radius: 11px;
  background: rgba(31, 0, 3, .35);
}

.game-topbar__setting-label {
  display: flex;
  align-items: center;
  gap: 13px;
}

.game-topbar__setting-icon {
  width: 35px;
  color: #ffd45a;
  font-size: 30px;
  text-align: center;
}

.game-topbar__switch {
  position: relative;
  width: 128px;
  height: 42px;
  border: 2px solid #d8a43a;
  border-radius: 23px;
  background: #340205;
  box-shadow: inset 0 2px 7px rgba(0,0,0,.58);
  color: #c79e73;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  text-align: right;
  padding-right: 18px;
}

.game-topbar__switch::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #75ef27, #23a90e);
  border: 1px solid #d8ffac;
  box-shadow: 0 1px 5px rgba(0,0,0,.65);
  transition: transform .18s ease;
}

.game-topbar__switch[aria-pressed="true"] {
  color: #fff;
  text-align: left;
  padding-left: 17px;
  padding-right: 0;
  background: linear-gradient(180deg, #9e1c19, #6b080b);
}

.game-topbar__switch[aria-pressed="true"]::before {
  transform: translateX(84px);
}
