/* ── Missions, Settings, Streaks, XP, Level HUD ── */
/* Streak stars & badges */
.streak-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.streak-stars {
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1;
}

.streak-badges {
  display: flex;
  gap: 2px;
  align-items: center;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(59,130,246,0.12);
  font-size: 11px;
  cursor: default;
  position: relative;
}

.badge-chip:hover::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  background: #0f172a;
  color: #e0e0e0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* Streak results section */
.streak-result {
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.streak-result .streak-active {
  color: #fbbf24;
  font-weight: 700;
}

.streak-result .streak-lost {
  color: #64748b;
}

.streak-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  margin: 2px;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.25);
  border-radius: 12px;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
}


/* HUD level + XP bar */
.hud-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-heading);
  font-weight: 600;
}

.xp-bar-mini {
  display: inline-block;
  width: 36px;
  height: 5px;
  background: #1a1a2e;
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}

.xp-fill-mini {
  display: block;
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* XP results section */
.xp-section {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 10px;
  text-align: center;
}

.xp-gained {
  font-size: 14px;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 6px;
}

.xp-bar-wrap {
  margin: 6px 0;
}

.xp-bar-outer {
  height: 10px;
  background: #1a1a2e;
  border-radius: 5px;
  overflow: hidden;
}

.xp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 5px;
  transition: width 0.6s ease;
}

.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.xp-level-up {
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(234,179,8,0.12);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 8px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 14px;
}

.xp-unlock {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-heading);
}

.xp-title-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Daily missions panel */
.missions-panel {
  padding: 2px 8px;
  font-size: 11px;
}

.missions-panel .missions-header {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: #64748b;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
}

.missions-panel .missions-header:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.05);
}

/* Missions popup overlay */
.missions-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 90vw;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-size: 12px;
}

.missions-popup.hidden { display: none; }

.missions-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-heading);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.missions-popup-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.missions-popup-close:hover { color: #e0e0e0; }

.mission-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: #94a3b8;
}

.mission-row.completed {
  color: #4ade80;
  text-decoration: line-through;
  opacity: 0.7;
}

.mission-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid #475569;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.mission-row.completed .mission-check {
  border-color: #22c55e;
  color: #22c55e;
}

.mission-desc {
  flex: 1;
}

.mission-progress {
  font-weight: 600;
  color: #60a5fa;
  white-space: nowrap;
}

.mission-row.completed .mission-progress {
  color: #4ade80;
}

.mission-daily-bonus {
  text-align: center;
  color: #fbbf24;
  font-weight: 600;
  padding: 2px 0;
}

/* Mission results in overlay */
.mission-results {
  margin-top: 8px;
  text-align: center;
}

.mission-complete-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
  color: #4ade80;
}

.mission-complete-item .mc-check {
  color: #22c55e;
  font-weight: 700;
}

.mission-complete-item .mc-xp {
  color: #60a5fa;
  font-weight: 700;
}

.mission-daily-complete {
  padding: 6px 10px;
  margin-top: 4px;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.25);
  border-radius: 8px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 13px;
}

/* Settings modal overlay */
#settings-panel {
  /* overlay base handled by .overlay class + showOverlay() */
  align-items: center;
  justify-content: center;
}

.settings-card {
  max-width: min(480px, calc(100vw - 48px));
  width: 100%;
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.settings-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: 20px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-header h3 {
  color: var(--text-heading);
  font-size: 18px;
  margin: 0;
}

.settings-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.settings-close:hover { color: #e0e0e0; }

.settings-group {
  border-bottom: 1px solid var(--border);
}

.settings-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.settings-group-header:hover {
  background: rgba(59,130,246,0.08);
}

.settings-chevron {
  font-size: 10px;
  color: #64748b;
}

.settings-group-body {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.25s ease;
}

.settings-group-body.collapsed {
  max-height: 0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  gap: 12px;
}

.settings-row label {
  font-size: 13px;
  color: #94a3b8;
  flex: 1;
  white-space: nowrap;
  cursor: help;
  position: relative;
}

.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #334155;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

.setting-label:hover .tip-icon {
  background: #3b82f6;
  color: #fff;
}

/* Native title tooltip — custom styled on hover */
.setting-label[title] {
  position: relative;
}
.setting-label[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: #0f172a;
  color: #e0e0e0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  width: 240px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.settings-row input[type="number"] {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.settings-row input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
}

.settings-note {
  text-align: center;
  font-size: 11px;
  color: #475569;
  padding: 12px 20px 0;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .settings-card {
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 140px);
    border-radius: 10px;
    padding: 12px 10px;
  }
  .settings-header {
    padding: 10px 14px;
  }
  .settings-header h3 { font-size: 15px; }
}

