/* ==========================================================================
   Header Navigation (Weightless Floating Controls)
   ========================================================================== */

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 24px 0 24px;
  background: transparent;
  z-index: 150;
  flex-shrink: 0;
  transition: opacity 0.28s var(--ease-apple);
  position: relative;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The session pill sits midway between the left and right groups, with equal
   space on both sides at every desktop width (a screen-centred grid crowded
   the right group, and the timer is not screen-centred anyway when the
   analytics panel is open). */
@media (min-width: 921px) and (min-height: 521px), (min-width: 1101px) {
  #header {
    display: flex;
    gap: 12px;
  }
  .header-left {
    min-width: 0;
  }
  .header-center {
    margin: 0 auto;
  }
}

@media (min-width: 921px) and (max-width: 1180px) and (min-height: 521px), (min-width: 1101px) and (max-width: 1180px) {
  #header {
    padding: env(safe-area-inset-top, 0px) 16px 0 16px;
  }
  .logo-title {
    display: none;
  }
  .event-pill {
    padding: 0 11px;
  }
}

/* Smallest desktops: the profile pill keeps avatar + PB (the name is one tap
   away in the profile) and the group dividers go, so nothing overlaps */
@media (min-width: 921px) and (max-width: 1100px) and (min-height: 521px) {
  .account-name-mini {
    display: none;
  }
  .header-divider {
    display: none;
  }
  .header-right {
    gap: 6px;
  }
}

/* Narrow desktops: collapse the Academy label to an icon */
@media (min-width: 921px) and (max-width: 1240px) and (min-height: 521px), (min-width: 1101px) and (max-width: 1240px) {
  .icon-btn.icon-btn-labeled {
    width: 36px;
    padding: 0;
  }
  .icon-btn-labeled .icon-btn-label {
    display: none;
  }
}

.header-quick-pair {
  display: contents;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.025em;
  padding-right: 4px;
  cursor: default;
}

.logo-icon {
  color: #F5F5F7;
  filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.24));
}

.logo-title {
  color: #F5F5F7;
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* Event Segmented Control */
.event-segmented-control {
  display: flex;
  align-items: center;
  height: 36px;
  background: rgba(255, 255, 255, 0.048);
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow:
    0 6px 18px -4px rgba(0, 0, 0, 0.55),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.16);
  padding: 3px;
  border-radius: var(--r-pill);
  gap: 2px;
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.event-pill {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 600;
  height: 28px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease-apple), color 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}

.event-pill:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.event-pill:active {
  transform: scale(0.96);
}

.event-pill.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.09) 100%);
  color: #FFFFFF;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.48),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.16);
}

/* Session Switcher Capsule */
.session-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--liquid-shadow-sm);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 15px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.18s var(--ease-apple), background 0.18s var(--ease-apple), border-color 0.18s var(--ease-apple), color 0.18s var(--ease-apple);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.session-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.session-pill:active {
  transform: scale(0.96);
}

/* Puzzle and scramble type inside the session pill: portrait phones only (mobile.css) */
.session-context {
  display: none;
}

.session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

/* Quick Action Liquid Glass Round Buttons (36x36px) */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.048);
  box-shadow:
    0 6px 16px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.20);
  color: var(--text-tertiary);
  cursor: pointer;
  position: relative;
  transition: transform 0.18s var(--ease-apple), background 0.2s var(--ease-apple), color 0.2s var(--ease-apple), border-color 0.2s var(--ease-apple);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.48);
}

/* Labeled primary navigation button (Academy) */
.icon-btn.icon-btn-labeled {
  width: auto;
  gap: 7px;
  padding: 0 14px 0 12px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
}

.icon-btn-label {
  white-space: nowrap;
}

/* Thin separators between header control groups */
.header-divider {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}

.inspection-tag {
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
