/* Shared master frame/header for app, guide, leaderboard */

body .shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-wrap {
  max-width: 760px;
}

body .topbar .top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.topbar .btn {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f8ff;
  border-radius: 18px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  white-space: nowrap;
}

.topbar .btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.topbar .btn.ghost {
  background: rgba(255, 255, 255, 0.05);
}

.topbar .btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

.topbar .btn-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  filter:
    brightness(0)
    invert(1)
    drop-shadow(0 0 8px rgba(255, 255, 0, 0.55));
}

.topbar .back-btn {
  min-width: 132px;
  background: linear-gradient(135deg, #3146d9, #6f5bff);
  border: none;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.38);
}

.topbar .back-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 34px rgba(99, 102, 241, 0.5);
}

.topbar .nav-icon-btn {
  min-width: 132px;
}

/* Keep this after .btn.ghost so active never gets overridden */
.topbar .nav-icon-btn.active {
  border-color: rgba(123, 140, 255, 0.45);
  background: linear-gradient(135deg, rgba(123, 140, 255, 0.2), rgba(157, 107, 255, 0.14));
  box-shadow: 0 8px 22px rgba(123, 140, 255, 0.2);
  color: #ffffff;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  body .topbar .top-actions {
    width: 100%;
  }

  body .topbar .top-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  body .shell {
    padding: 12px;
  }
}
