.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.topbar .stats {
  flex: 1;
  min-width: 240px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.brandLogo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brandLogoBlock {
  border-radius: 4px;
}

.brandLogoBlock.b1 { background: #4f86ff; }
.brandLogoBlock.b2 { background: #ff6b6b; }
.brandLogoBlock.b3 { background: #ffe169; }
.brandLogoBlock.b4 { background: #6bbf59; }

.brandText {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brandTitle {
  font-weight: 900;
  font-size: clamp(16px, 4vw, 22px);
  letter-spacing: 0.5px;
  color: #fff;
}

.brandSubtitle {
  font-size: clamp(11px, 2.5vw, 14px);
  color: var(--muted);
}

.stats {
  display: grid;
  direction: ltr;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "best btn"
    "score score";
  gap: 4px 8px;
  align-items: center;
}

.stat {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  min-width: 0;
}

.stats .stat:nth-child(1) {
  grid-area: best;
  text-align: left;
  padding: 0px 0px;
  justify-self: start;
}

.stats .stat:nth-child(2) {
  grid-area: score;
  text-align: center;
  padding: 0px 0px;
}

.stats .stat:nth-child(2) .statLabel {
  display: none;
}

.stats .stat:nth-child(2) .statValue {
  font-size: var(--scoreSize);
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.20);
}

.bestStat {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}

.bestStat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.bestStatIcon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #ffe169;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  transform: translateY(1px);
}

.bestStat .statValue {
  font-size: 30px;
}

.stats .stat:nth-child(2) .statLabel::before {
  content: "★ ";
}

.statLabel {
  font-size: 12px;
  color: var(--muted);
}

.statValue {
  color: #ffe169;
  font-size: 30px;
  font-weight: 800;
}

#score {
  color: #ffffff;
}

.scorePop {
  animation: scorePop 220ms ease-out 1;
}

@keyframes scorePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
