/* ZenStudy Design System & Visuals */

:root {
  /* Common System Font */
  --font-primary: 'Inter', sans-serif;
  --font-accent: 'Outfit', sans-serif;

  /* Theme: Studying (Default Sage Zen) */
  --color-bg-base: #eaf2ed;
  --color-bg-gradient: linear-gradient(135deg, #e3ede7 0%, #dbede2 100%);
  --color-glass-fill: rgba(255, 255, 255, 0.45);
  --color-glass-border: rgba(255, 255, 255, 0.35);
  --color-primary: #2d5a27;
  --color-primary-rgb: 45, 90, 39;
  --color-accent: #6b8e23;
  --color-accent-light: rgba(107, 142, 35, 0.15);
  --color-text-main: #2b3a2a;
  --color-text-muted: #5e6b5d;
  --color-shadow: rgba(45, 90, 39, 0.08);

  /* Visual Tiers (for high active user counts on map) */
  --color-tier-mid: #3a86c8;
  --color-tier-mid-rgb: 58, 134, 200;
  --color-tier-high: #de3e3e;
  --color-tier-high-rgb: 222, 62, 62;

  /* Transition timings */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.2s ease;
}

/* Theme Shift: Pomodoro Break State (Warm Ambient Terracotta) */
body.theme-break {
  --color-bg-base: #f5eae4;
  --color-bg-gradient: linear-gradient(135deg, #f7e6dc 0%, #ecdcd2 100%);
  --color-glass-fill: rgba(255, 255, 255, 0.5);
  --color-glass-border: rgba(255, 255, 255, 0.4);
  --color-primary: #bf5d38;
  --color-primary-rgb: 191, 93, 56;
  --color-accent: #d27d53;
  --color-accent-light: rgba(210, 125, 83, 0.15);
  --color-text-main: #4a342c;
  --color-text-muted: #7d655c;
  --color-shadow: rgba(191, 93, 56, 0.08);
}

/* Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-base);
  background-image: var(--color-bg-gradient);
  color: var(--color-text-main);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  transition: var(--transition-smooth);
}

/* Dynamic Map Background Container */
.map-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

/* Scroll wrapper for infinite horizontal globe rotation */
.map-scroll-wrapper {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: max-content;
  will-change: transform;
  animation: rotateMap 180s linear infinite;
  pointer-events: none;
}

@keyframes rotateMap {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* SVG Map internal styles */
.map-bg-container svg {
  height: 100% !important;
  width: auto !important;
  flex-shrink: 0;
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.map-bg-container svg #background {
  fill: none !important;
  display: none !important;
}

.map-bg-container svg text {
  display: none !important;
}

.map-bg-container svg path {
  fill: var(--color-text-muted);
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 0.8;
  opacity: 0.12;
  transition: fill 0.8s ease, opacity 0.8s ease;
  pointer-events: auto; /* Enable hit-testing for map tooltips */
}

/* Glow highlight for countries with active users (handles path directly, or g group container) */
.map-bg-container svg g.active-country path {
  opacity: 1 !important;
  /* Child paths are solid relative to their parent group, allowing JS opacity on the <g> group to work */
}

.map-bg-container svg path.active-country,
.map-bg-container svg g.active-country path {
  stroke-width: 1.2px;
}

/* Tier: Low (1-30 users) - Sage Green (default theme color) */
.map-bg-container svg path.active-tier-low,
.map-bg-container svg g.active-tier-low path {
  fill: var(--color-primary) !important;
  stroke: var(--color-primary) !important;
}

.map-bg-container svg path.active-tier-low,
.map-bg-container svg g.active-tier-low {
  filter: drop-shadow(0 0 15px rgba(var(--color-primary-rgb), 0.7));
}

/* Tier: Mid (31-80 users) - Ocean Blue */
.map-bg-container svg path.active-tier-mid,
.map-bg-container svg g.active-tier-mid path {
  fill: var(--color-tier-mid) !important;
  stroke: var(--color-tier-mid) !important;
}

.map-bg-container svg path.active-tier-mid,
.map-bg-container svg g.active-tier-mid {
  filter: drop-shadow(0 0 15px rgba(var(--color-tier-mid-rgb), 0.7));
}

/* Tier: High (81+ users) - Coral Red */
.map-bg-container svg path.active-tier-high,
.map-bg-container svg g.active-tier-high path {
  fill: var(--color-tier-high) !important;
  stroke: var(--color-tier-high) !important;
}

.map-bg-container svg path.active-tier-high,
.map-bg-container svg g.active-tier-high {
  filter: drop-shadow(0 0 18px rgba(var(--color-tier-high-rgb), 0.8));
}

/* App Container — full screen, transparent to pointer events so map tooltips can fire */
.app-container {
  display: block;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  z-index: 10;
  position: relative;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
  /* children re-enable individually */
}

.app-container.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════
   HUD Panel — floating right on desktop, left on mobile
   Contains profile+nav widget and timer widget
══════════════════════════════════════════════════ */
.hud-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: visible;
  /* Hide scrollbar visually */
  scrollbar-width: none;
}

.hud-panel::-webkit-scrollbar {
  display: none;
}

/* ── Profile + Nav Dropdown Widget ── */
.profile-nav-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 260px;
}

.profile-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--color-glass-border);
  border-radius: 16px;
  padding: 10px 14px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 20px var(--color-shadow);
  transition: var(--transition-fast);
  text-align: left;
}

.profile-nav-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 24px var(--color-shadow);
}

.profile-nav-avatar {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.profile-nav-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.profile-nav-name {
  font-family: var(--font-accent);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-nav-sub {
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.profile-nav-chevron {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.profile-nav-widget.open .profile-nav-chevron {
  transform: rotate(180deg);
}

/* Nav dropdown */
.profile-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease;
  pointer-events: none;
}

.profile-nav-widget.open .profile-nav-menu {
  max-height: 200px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 6px;
}

/* ── Timer HUD Widget ── */
.timer-hud-widget {
  width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timer-hud-widget .online-indicator {
  background: var(--color-accent-light);
  padding: 7px 14px;
  border-radius: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nav items shared style */
.nav-item {
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--color-text-muted);
  border-radius: 12px;
  border: 1px solid var(--color-glass-border);
  text-align: left;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-fast);
  box-shadow: 0 2px 10px var(--color-shadow);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text-main);
}

.nav-item.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 15px var(--color-shadow);
}

.online-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(var(--color-primary-rgb), 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0);
  }
}

.online-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

/* ══════════════════════════════════════════════════
   Main Workspace — full screen, content panes live here
══════════════════════════════════════════════════ */
.main-workspace {
  position: absolute;
  inset: 0;
  padding: 0;
  overflow: hidden;
  z-index: 12;
  pointer-events: none; /* Let events pass through empty space to the map */
}

.tab-pane {
  display: none;
  height: 100%;
  position: relative;
  pointer-events: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

#pane-leaderboard.active,
#pane-stats.active {
  pointer-events: auto; /* Active overlay panels should capture pointer events */
}

/* Leaderboard and Stats panes get comfortable padding — narrow to avoid underlapping HUD */
#pane-leaderboard,
#pane-stats {
  padding: 40px;
  overflow-y: auto;
  margin-right: 280px;
}

/* Floating Space Layer (session messages) */
.floating-space {
  flex-grow: 1;
  position: relative;
  /*
   * Do NOT set width: 100% — that makes the box viewport-wide regardless of padding.
   * Instead, use margin-right to physically narrow the element so children's
   * max-width: 100% resolves against a truly smaller containing block.
   * margin = HUD widget (260px) + HUD right gap (20px) = 280px
   */
  margin-right: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
  /* hard-clip any remaining overflow */
  padding: 20px 20px 120px 20px;
  pointer-events: none; /* Let events pass through empty space to the map */
}

/* Radial Menu (Vibe Broadcaster) */
.vibe-control-center {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
  pointer-events: auto; /* Re-enable pointer events for the broadcast button */
}

.radial-menu-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-radial-trigger {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 1px solid var(--color-glass-border);
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 6px 20px var(--color-shadow);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-radial-trigger:hover {
  transform: scale(1.08);
}

.btn-radial-trigger.open {
  transform: rotate(45deg) scale(1.05);
  background: var(--color-text-muted);
}

.icon-plus {
  display: inline-block;
  line-height: 1;
}

/* Radial ring items */
.radial-ring,
.radial-subring {
  position: absolute;
  width: 250px;
  height: 250px;
  pointer-events: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.1);
  transform: scale(0);
  opacity: 0;
  z-index: 80;
}

.radial-ring.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Sentiment bubble items */
.sentiment-node {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 90;
}

.sentiment-node:hover {
  transform: scale(1.15);
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.sentiment-emoji {
  font-size: 20px;
}

.sentiment-text {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Radial Subring for message options (arcs) */
.radial-subring.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
  z-index: 95;
}

.message-node {
  position: absolute;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-primary);
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  max-width: 180px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition-fast);
  color: var(--color-text-main);
  z-index: 98;
}

.message-node:hover {
  background: var(--color-primary);
  color: white;
  transform: scale(1.05);
}

.vibe-label {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1.5px;
}

/* Floating Alerts / Stacked bubbles */
.msg-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-glass-fill);
  border: 1px solid var(--color-glass-border);
  padding: 10px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  max-width: 100%;
  width: fit-content;
  align-self: flex-start;
  backdrop-filter: blur(10px);
  animation: message-slide-down 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: opacity 0.5s ease;
  overflow: hidden;
  /* safety: clip any overflow at bubble boundary */
  flex-shrink: 0; /* prevent vertical squashing in flex containers */
  pointer-events: auto; /* Re-enable pointer events on the bubble itself */
}

.msg-bubble.fade-out {
  opacity: 0;
}

.msg-bubble.sentiment-positive {
  border-left: 4px solid var(--color-primary);
}

.msg-bubble.sentiment-negative {
  border-left: 4px solid var(--color-accent);
}

/* Close / dismiss button on message bubbles */
.msg-close-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1;
  padding: 4px 6px;
  margin-left: auto;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
  opacity: 0.5;
  align-self: center;
}

.msg-close-btn:hover {
  color: var(--color-text-main);
  background: rgba(0, 0, 0, 0.06);
  opacity: 1;
}

/* "you" tag on own messages */
.msg-you-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: var(--color-primary);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.7;
}

/* ── Reaction Strip ── */
.msg-bubble {
  /* override to allow flex-wrap so reaction strip sits below */
  flex-wrap: wrap;
  align-items: flex-start;
}

.msg-bubble>.msg-avatar,
.msg-bubble>.msg-close-btn {
  /* Keep avatar and close button fixed — but NOT msg-content (it must be able to shrink) */
  flex-shrink: 0;
}

.msg-bubble>.msg-content {
  flex-grow: 1;
  flex-shrink: 1;
  /* MUST be shrinkable so the bubble can contract around the text */
  min-width: 0;
  /* allow shrinking below intrinsic content width */
}

.reaction-strip {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.reaction-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  line-height: 1.4;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.08);
}

.reaction-btn.reacted {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.reaction-count {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-accent);
  min-width: 14px;
  text-align: center;
}


.reaction-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(45, 90, 39, 0.08);
  border: 1px solid rgba(45, 90, 39, 0.15);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 14px;
  line-height: 1.4;
  cursor: default;
  user-select: none;
}

/* ── Affirmation Word Cloud ── */
.affirmation-cloud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*
   * Flex column so words stack vertically — always on-screen,
   * never overlapping, no orbit-radius math needed.
   */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: min(560px, 80vw);
  pointer-events: none;
  z-index: 20;
}

.affirmation-word {
  white-space: nowrap;
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 2px 12px rgba(45, 90, 39, 0.18);
  opacity: 0;
  /* Simple slide-up per item; no --x/--y orbit needed */
  animation: affirmation-rise 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) var(--delay, 0s) forwards;
}

@keyframes affirmation-rise {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.85);
  }

  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.04);
  }

  100% {
    opacity: 0.9;
    transform: translateY(0) scale(1);
  }
}

/* Fade the whole cloud out when no longer visible */
.affirmation-cloud:not(.visible) .affirmation-word {
  opacity: 0;
  transition: opacity 0.8s ease;
}


.msg-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msg-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* allow the flex child to shrink below its intrinsic width */
  overflow: hidden;
  width: fit-content;
}

.msg-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
}

.msg-text {
  font-size: 13px;
  font-weight: 500;
  margin-top: 1px;
  color: var(--color-text-main);
  /*
   * overflow-wrap: anywhere (not break-word) is critical:
   * it changes the CSS min-content size of the text to ~1 character.
   * This in turn changes how width:fit-content on .msg-bubble is calculated:
   * fit-content = min(max-content, max(min-content, fill-available))
   * With min-content ≈ 0, fit-content correctly resolves to fill-available
   * when text is longer than the available space, giving flex children a
   * definite width that text can wrap inside.
   */
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

@keyframes message-slide-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Floating bubble animation (when sent) */
.temp-float-bubble {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary);
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: bubble-float-up 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bubble-float-up {
  0% {
    transform: translateX(-50%) translateY(0) scale(0.8);
    opacity: 0;
  }

  15% {
    transform: translateX(-50%) translateY(-30px) scale(1);
    opacity: 1;
  }

  85% {
    transform: translateX(-50%) translateY(-250px) scale(1);
    opacity: 0.8;
  }

  100% {
    transform: translateX(-50%) translateY(-300px) scale(0.9);
    opacity: 0;
  }
}

/* Leaderboards Pane */
.pane-header {
  margin-bottom: 25px;
}

.pane-header h2 {
  font-family: var(--font-accent);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 5px;
}

.pane-header p {
  color: var(--color-text-muted);
  font-size: 14px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  flex-grow: 1;
  min-height: 0;
}

.leaderboard-card {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.leaderboard-card h3 {
  font-family: var(--font-accent);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--color-glass-border);
  padding-bottom: 10px;
}

.leaderboard-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leader-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.leader-item.is-self {
  border: 1.5px solid var(--color-primary);
  background: rgba(255, 255, 255, 0.7);
}

.leader-rank {
  font-family: var(--font-accent);
  font-size: 15px;
  font-weight: 700;
  width: 24px;
  color: var(--color-text-muted);
}

.leader-rank-1 {
  color: #d4af37;
}

.leader-rank-2 {
  color: #aaa9ad;
}

.leader-rank-3 {
  color: #cd7f32;
}

.leader-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.leader-avatar {
  font-size: 20px;
}

.leader-name-container {
  display: flex;
  flex-direction: column;
}

.leader-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.leader-country {
  font-size: 11px;
  color: var(--color-text-muted);
}

.leader-time {
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

/* Stats Tab */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-bubble {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--color-glass-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.stat-number {
  font-family: var(--font-accent);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.profile-settings-card {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  padding: 25px;
}

.profile-settings-card h3 {
  font-family: var(--font-accent);
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-text-main);
  outline: none;
  transition: var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.nickname-input-wrapper {
  display: flex;
  gap: 10px;
}

.btn-refresh-name {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-refresh-name:hover {
  background: white;
  transform: rotate(45deg);
}

.avatar-row-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 0;
}

.avatar-option {
  font-size: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px solid var(--color-glass-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.avatar-option:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.avatar-option.selected {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 4px 10px var(--color-shadow);
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════
   Circular Pomodoro Timer (used inside timer-hud-widget)
══════════════════════════════════════════════════ */
.pomodoro-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 20px var(--color-shadow);
}

.timer-circle-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 14px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-trail {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 4;
}

.timer-progress {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.timer-status-text {
  font-family: var(--font-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.timer-countdown {
  font-family: var(--font-accent);
  font-size: 34px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1;
}

.timer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Button Classes */
.btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 15px var(--color-shadow);
}

.btn-primary:hover {
  background: rgba(var(--color-primary-rgb), 0.9);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-text-main);
  border: 1px solid var(--color-glass-border);
}

.btn-secondary:hover {
  background: white;
}

.btn-save {
  background: var(--color-primary);
  color: white;
  max-width: 150px;
  margin-top: 5px;
}

.btn-save:hover {
  transform: translateY(-1px);
}

.session-tip-card {
  background: rgba(255, 255, 255, 0.25);
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
}

.session-tip-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 5px;
}

.session-tip-card p {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Fullscreen Landing Glass Overlay */
.landing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(234, 242, 237, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.landing-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-glass-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  width: 480px;
  max-width: 90vw;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(45, 90, 39, 0.1);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.landing-header {
  text-align: center;
}

.landing-icon {
  font-size: 42px;
  display: block;
  margin-bottom: 10px;
}

.landing-header h1 {
  font-family: var(--font-accent);
  font-size: 32px;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.landing-header p {
  color: var(--color-text-muted);
  font-size: 14px;
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.btn-start-focus {
  background: var(--color-primary);
  color: white;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 6px 20px var(--color-shadow);
  margin-top: 10px;
}

.btn-start-focus:hover {
  background: rgba(var(--color-primary-rgb), 0.9);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════
   Responsive Design
══════════════════════════════════════════════════ */

/* Medium screens: shrink HUD slightly */
@media (max-width: 900px) {
  .hud-panel {
    right: 14px;
    top: 14px;
  }

  .profile-nav-widget,
  .timer-hud-widget {
    width: 230px;
  }

  /* HUD narrows to 230px + 14px right gap = 244px margin */
  .floating-space {
    margin-right: 244px;
  }

  .timer-circle-container {
    width: 130px;
    height: 130px;
  }

  .timer-countdown {
    font-size: 28px;
  }

  .session-tip-card {
    display: none;
  }

  #pane-leaderboard,
  #pane-stats {
    padding: 24px;
    margin-right: 244px;
  }
}

/* Narrow screens: HUD is full width at the top, stacked, and content sits below without overlap */
@media (max-width: 600px) {
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .hud-panel {
    position: static;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding: 12px 12px 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    z-index: 200;
  }

  .profile-nav-widget,
  .timer-hud-widget {
    width: 100%;
    max-width: none;
  }

  .profile-nav-widget {
    align-items: stretch;
  }

  .profile-nav-menu {
    align-items: stretch;
  }

  /* Timer goes more compact on mobile */
  .pomodoro-widget {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }

  .timer-circle-container {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .timer-countdown {
    font-size: 22px;
  }

  .timer-status-text {
    font-size: 7px;
  }

  .timer-actions {
    flex: 1;
    min-width: 120px;
  }

  .session-tip-card {
    display: none;
  }

  .timer-hud-widget .online-indicator {
    font-size: 11px;
  }

  .main-workspace {
    position: relative;
    flex-grow: 1;
    height: 0;
    overflow: hidden;
  }

  /* Content panes: minimal padding, full width */
  #pane-leaderboard,
  #pane-stats {
    padding: 16px;
    margin-right: 0;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .stats-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .floating-space {
    margin-right: 0;
    padding: 12px 12px 90px 12px;
  }
}

/* Fullscreen Vibe Overlay */
.vibe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(234, 242, 237, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.vibe-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.vibe-overlay-container {
  position: relative;
  width: 90%;
  max-width: 680px;
  height: 460px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* When messages are visible, dim the radial ring behind them */
.vibe-overlay-container.message-active .radial-menu-wrapper {
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.vibe-overlay-container .radial-menu-wrapper {
  opacity: 1;
  transition: opacity 0.35s ease;
}

/* Expanded Center Radial Menu Wrapper */
.vibe-overlay .radial-menu-wrapper {
  width: 120px;
  height: 120px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vibe-overlay .radial-ring {
  position: absolute;
  width: 360px;
  /* Much larger than original 250px! */
  height: 360px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.vibe-overlay .radial-ring.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Spaced out Sentiment Node */
.vibe-overlay .sentiment-node {
  position: absolute;
  width: 82px;
  /* Larger nodes! */
  height: 82px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 1010;
  color: var(--color-text-main);
}

.vibe-overlay .sentiment-node:hover {
  transform: scale(1.18);
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 12px 30px rgba(var(--color-primary-rgb), 0.3);
}

.vibe-overlay .sentiment-node.active-sentiment {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(var(--color-primary-rgb), 0.25);
}

.vibe-overlay .sentiment-emoji {
  font-size: 24px;
  /* Larger emojis */
}

.vibe-overlay .sentiment-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 4px;
  text-align: center;
}

.vibe-overlay .btn-radial-trigger {
  width: 70px;
  height: 70px;
  font-size: 32px;
  background: var(--color-primary);
  z-index: 1020;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  border: 1px solid var(--color-glass-border);
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.vibe-overlay .btn-radial-trigger:hover {
  transform: scale(1.05);
}

/* Message selection column — absolutely layered ON TOP of the radial ring */
.message-selection-column {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: min(500px, 85vw);
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 1050;
  /* above sentiment nodes (z-index: 1010) */
  animation: msg-col-appear 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  /* Frosted glass backing so text stays legible over the faded ring */
  background: rgba(234, 242, 237, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 16px 48px rgba(45, 90, 39, 0.08);
}

.message-selection-column::-webkit-scrollbar {
  display: none;
}

.message-selection-column.hidden {
  display: none !important;
}

.message-selection-column h3 {
  font-family: var(--font-accent);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-accent-light);
  padding-bottom: 8px;
  margin-bottom: 5px;
}

.message-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Speech Bubble Message Options */
.btn-message-option {
  width: 100%;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-glass-border);
  border-radius: 18px;
  border-top-left-radius: 4px;
  /* Cute speech bubble corner */
  font-family: var(--font-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  color: var(--color-text-main);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: var(--transition-fast);
}

.btn-message-option:hover {
  background: var(--color-primary);
  color: white;
  transform: translateX(6px);
  box-shadow: 0 6px 20px var(--color-shadow);
  border-color: var(--color-primary);
}

@keyframes msg-col-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Adjustments for Vibe Broadcaster Trigger in main UI */
.vibe-control-center {
  z-index: 30 !important;
}

.vibe-control-center .btn-radial-trigger {
  width: 60px;
  height: 60px;
  font-size: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-glass-border);
  color: white;
  background: var(--color-primary);
  box-shadow: 0 4px 15px var(--color-shadow);
  cursor: pointer;
}

/* Mobile: make container fill viewport height so there's room for the message column */
@media (max-width: 768px) {
  .vibe-overlay-container {
    width: 95%;
    height: 90vh;
  }

  .vibe-overlay .radial-ring {
    width: 290px;
    height: 290px;
  }

  .vibe-overlay .sentiment-node {
    width: 68px;
    height: 68px;
  }

  .vibe-overlay .sentiment-emoji {
    font-size: 20px;
  }

  .message-selection-column {
    width: min(420px, 90vw);
  }

  .btn-message-option {
    padding: 12px 16px;
    font-size: 12px;
  }
}

/* Back Button in Message Column */
.message-column-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 5px;
}

.btn-message-back {
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: var(--font-primary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  transition: var(--transition-fast);
}

.btn-message-back:hover {
  color: var(--color-primary-dark, #5d826a);
  transform: translateX(-3px);
}

/* Zen Toast Notifications styling */
.zen-toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2100;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.zen-toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(135, 169, 149, 0.25);
  border-left: 5px solid var(--color-primary);
  color: var(--color-text-main);
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  font-family: var(--font-primary);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: auto;
  line-height: 1.4;
}

.zen-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.zen-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.zen-toast-message {
  flex-grow: 1;
}


@media (max-height: 640px) {
  .vibe-overlay-container {
    height: 95vh;
  }

  .vibe-overlay .radial-ring {
    width: 280px;
    height: 280px;
  }

  .vibe-overlay .sentiment-node {
    width: 64px;
    height: 64px;
  }

  .vibe-overlay .sentiment-emoji {
    font-size: 18px;
  }

  .vibe-overlay .sentiment-text {
    font-size: 8px;
  }
}

/* Custom Zen Confirmation Modal */
.zen-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(234, 242, 237, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.zen-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.zen-modal-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(135, 169, 149, 0.25);
  padding: 30px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zen-modal-overlay.open .zen-modal-card {
  transform: translateY(0);
}

.zen-modal-card h3 {
  font-family: var(--font-accent);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.zen-modal-card p {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.zen-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.zen-modal-actions .btn {
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
}

/* Gentle throb animation for Take Break button */
@keyframes throb-gently-anim {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--color-shadow);
  }

  50% {
    transform: scale(1.05);
    background-color: var(--color-accent);
    box-shadow: 0 8px 25px rgba(var(--color-primary-rgb), 0.4);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px var(--color-shadow);
  }
}

.throb-gently {
  animation: throb-gently-anim 1.5s infinite ease-in-out !important;
}

/* Floating Map Tooltip */
.map-tooltip {
  position: fixed;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(135, 169, 149, 0.25);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--color-text-main);
  pointer-events: none;
  z-index: 2000;
  /* Ensure tooltip sits on top of overlay elements */
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-15px);
}

.map-tooltip-title {
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-accent-light);
  padding-bottom: 4px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-tooltip-users {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.map-tooltip-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-text-main);
}

.map-tooltip-avatar {
  font-size: 14px;
}

/* ─── Still-Here & Forced-Break Modal Styles ─── */
.countdown-container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.countdown-timer {
  font-family: var(--font-accent);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
  animation: pulse-countdown 1.5s infinite ease-in-out;
}

@keyframes pulse-countdown {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.03);
    opacity: 0.85;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.countdown-bar-wrapper {
  width: 100%;
  height: 8px;
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.countdown-bar {
  height: 100%;
  background: var(--color-primary);
  width: 100%;
  border-radius: 4px;
  transition: width 1s linear;
}

/* ─── Sound Effects (SFX) Mute Toggle & Study Pulse Ticker ─── */

.btn-mute-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-glass-fill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-glass-border);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  box-shadow: 0 4px 15px var(--color-shadow);
  transition: var(--transition-smooth);
  pointer-events: auto;
}

.btn-mute-toggle:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.05);
}

.btn-mute-toggle.muted {
  background: rgba(220, 100, 100, 0.2);
  border-color: rgba(220, 100, 100, 0.3);
}

.study-pulse-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.pulse-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-glass-fill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 4px 15px var(--color-shadow);
  pointer-events: auto;
  animation: pulse-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
             pulse-fade-out 0.5s ease 6.5s forwards;
  font-size: 12px;
  color: var(--color-text-main);
  opacity: 0;
  transform: translateY(20px);
}

.pulse-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.pulse-text {
  font-weight: 500;
  line-height: 1.4;
}

.pulse-text b {
  font-weight: 700;
  color: var(--color-primary);
}

@keyframes pulse-slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-fade-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .profile-nav-btn {
    padding-left: 56px !important;
  }
  .btn-mute-toggle {
    top: 16px;
    left: 16px;
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .study-pulse-container {
    left: 12px;
    right: 12px;
    bottom: 85px;
    width: auto;
    max-width: none;
    align-items: center;
  }
  .pulse-item {
    font-size: 11px;
    padding: 6px 12px;
  }
}

/* ─── Searchable Select (Typeahead) & Premium Avatar Picker Styles ─── */

.custom-select-container {
  position: relative;
  width: 100%;
}

.custom-select-input {
  width: 100%;
  padding: 12px 36px 12px 16px;
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid var(--color-glass-border) !important;
  border-radius: 12px !important;
  font-family: var(--font-primary) !important;
  font-size: 14px !important;
  color: var(--color-text-main) !important;
  outline: none;
  transition: var(--transition-fast) !important;
}

.custom-select-input:focus {
  border-color: var(--color-primary) !important;
  background: white !important;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1) !important;
}

.custom-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 12px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.custom-select-container.open .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  z-index: 999;
  scrollbar-width: thin;
}

.custom-select-dropdown.hidden {
  display: none !important;
}

.custom-select-option {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text-main);
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-select-option:hover,
.custom-select-option.highlighted {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
}

.custom-select-option.selected {
  background: var(--color-primary) !important;
  color: white !important;
  font-weight: 600;
}

/* ─── Premium Avatar Picker Styles ─── */
.avatar-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-avatar-picker-trigger {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6) ;
  border: 1.5px solid var(--color-glass-border) ;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px var(--color-shadow);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.25s ease;
}

.btn-avatar-picker-trigger:hover {
  transform: scale(1.08);
  background-color: white;
}

.selected-avatar-preview {
  font-size: 32px;
  line-height: 1;
}

.avatar-picker-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 1.5px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Avatar modal popup layout grid */
.avatar-picker-card {
  max-width: 320px !important;
}

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 15px 0;
  padding: 5px;
  max-height: 240px;
  overflow-y: auto;
}

.avatar-picker-option {
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px solid var(--color-glass-border);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease;
}

.avatar-picker-option:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.15);
}

.avatar-picker-option.selected {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 4px 10px var(--color-shadow);
  transform: scale(1.08);
}