.backend-panel,
.backend-status-card {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .72));
  box-shadow: 0 18px 48px rgba(2, 6, 23, .22);
}

.backend-panel {
  margin-top: 24px;
  padding: 18px;
}

.backend-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.backend-panel-head span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #94a3b8;
}

.backend-panel-head strong {
  display: block;
  font-size: 20px;
  color: #f8fafc;
}

.backend-panel-head small {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .12);
  color: #86efac;
  font-size: 12px;
  font-weight: 700;
}

.backend-leaderboard p {
  margin: 0;
  color: #cbd5e1;
}

.backend-my-best {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(59, 130, 246, .12);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 700;
}

.backend-my-best strong {
  font-size: 20px;
  color: #fff;
}

.backend-leaderboard ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.backend-leaderboard li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  color: #cbd5e1;
  font-size: 13px;
}

.backend-leaderboard li strong {
  color: #f8fafc;
  font-size: 16px;
}

.backend-status-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.backend-status-card::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: rgba(59, 130, 246, .10);
  filter: blur(6px);
  pointer-events: none;
}

.backend-status-card h2 {
  margin: 4px 0 8px;
}

.backend-status-card p:last-child {
  margin-bottom: 0;
  color: #cbd5e1;
}

.backend-status-card[data-state="online"] {
  border-color: rgba(34, 197, 94, .35);
}

.backend-status-card[data-state="error"] {
  border-color: rgba(248, 113, 113, .40);
}

.backend-save-badge {
  position: fixed;
  z-index: 9999;
  right: 16px;
  bottom: 16px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 999px;
  background: rgba(15, 23, 42, .94);
  color: #e2e8f0;
  box-shadow: 0 14px 36px rgba(2, 6, 23, .34);
  font: 700 12px/1.35 system-ui, sans-serif;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.backend-save-badge.show {
  opacity: 1;
  transform: translateY(0);
}

.backend-save-badge[data-state="success"] {
  border-color: rgba(34, 197, 94, .45);
  color: #bbf7d0;
}

.backend-save-badge[data-state="error"] {
  border-color: rgba(248, 113, 113, .48);
  color: #fecaca;
}

@media (max-width: 640px) {
  .backend-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .backend-panel-head small {
    align-self: flex-start;
  }

  .backend-save-badge {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    text-align: center;
  }
}
