/* -- SCORE PANEL -- */
#panel {
  position: fixed; left: 16px; top: 16px; bottom: 16px; transform: none;
  z-index: 100; width: 400px;
  overflow-y: auto; overflow-x: hidden;
  background: transparent;
  border: none;
  padding: 0 8px 20px;
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  -webkit-overflow-scrolling: touch;
}
#panel > * { flex-shrink: 0; }
#panel.collapsed {
  transform: translateX(calc(-100% - 16px));
}
/* Toggle tab */
#panel-toggle {
  position: fixed; z-index: 101;
  width: 28px; height: 56px;
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border); border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--teal); font-size: 13px; user-select: none;
  transition: left 0.3s cubic-bezier(.4,0,.2,1), top 0.3s cubic-bezier(.4,0,.2,1);
}
#panel-toggle:hover { background: rgba(57,255,20,0.10); }

/* Shimmer top edge — hidden on transparent panel */
#panel::before { display: none; }

/* Glass card style for each section */
.panel-status-bar,
#loc-wrap,
.gauge-wrap,
.cond-box,
.foot {
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.panel-status-bar { border-bottom: none; }
#no-location-msg {
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 8px;
}

/* -- SCORE GAUGE -- */
.gauge-wrap { margin-bottom: 10px; flex-shrink: 0; }
.gauge-svg  { display: block; width: 100%; }
#verdict { margin-top: 4px; font-size: 18px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; text-align: center; }

/* -- DIVIDER -- hidden, spacing handled by card margins */
.hr { display: none; }

/* -- METRIC CARDS -- v1 2-col grid -- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; gap: 8px; min-width: 0; margin-bottom: 8px; }
.metric {
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 0; min-width: 0; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.m-lbl { font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Scope badge — globe icon inline after metric label text */
.m-scope {
  display: inline-flex; align-items: center;
  margin-left: 3px; margin-top: -3px;
  color: rgba(100, 160, 255, 0.35);
  pointer-events: none;
}
.m-scope svg { display: block; }
/* Make label + globe sit on same line */
.m-lbl, .m-lbl + .m-scope { display: inline; vertical-align: middle; }

/* -- METRIC TOOLTIPS -- */
.metric { position: relative; }
.tip-hint {
  position: absolute; top: 2px; right: 2px;
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 2px 2px 0 0;
  color: rgba(0,245,212,0.45);
}
.tip-hint svg { display: block; width: 18px; height: 18px; flex-shrink: 0; }
.tip-hint:hover,
.metric.tip-active .tip-hint { color: var(--teal); }

/* Floating tooltip bubble -- child of body, position: fixed */
#tip-bubble {
  position: fixed; z-index: 9999;
  max-width: 320px;
  background: rgba(3,14,3,0.97); border: 1px solid rgba(57,255,20,0.3);
  color: var(--text); font-size: 14px; font-weight: 500;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.3px; line-height: 1.6;
  padding: 14px 16px; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
  white-space: normal;
}
#tip-bubble.visible { opacity: 1; }
#tip-bubble .tip-desc { margin-bottom: 8px; color: rgba(204,255,204,0.75); }
#tip-bubble ul { margin: 0; padding-left: 0; list-style: none; }
#tip-bubble li { padding-left: 16px; position: relative; margin-bottom: 5px; }
#tip-bubble li::before { content: '\203A'; position: absolute; left: 2px; color: var(--teal); font-weight: 700; }
#tip-bubble .clr-go { color: #00ff41; }
#tip-bubble .clr-warn { color: #ffff00; }
#tip-bubble .clr-no { color: #ff4500; }
.m-val { font-family: 'Bebas Neue', sans-serif; font-size: 42px; line-height: 1; flex: 1; display: flex; align-items: center; }
.m-unit { font-size: 15px; font-family: 'Rajdhani', sans-serif; font-weight: 500; color: var(--muted); }
.m-bar  { height: 6px; background: rgba(255,255,255,0.07); margin-top: 10px; overflow: hidden; border-radius: 3px; }
.m-bar-fill { height: 100%; border-radius: 3px; transition: width 1.2s ease, background .5s; }

/* Status colours */
.c-go   { color: var(--green); }
.c-good { color: #adff2f; }
.c-warn { color: var(--amber); }
.c-cam  { color: #8888cc; }
.c-no   { color: var(--orange); }
.c-mute { color: #1a3d1a; }
.b-go   { background: var(--green);  box-shadow: 0 0 8px rgba(0,255,65,0.7); }
.b-good { background: #adff2f;       box-shadow: 0 0 6px rgba(173,255,47,0.5); }
.b-warn { background: var(--amber);  box-shadow: 0 0 6px rgba(255,255,0,0.4); }
.b-no   { background: var(--orange); }
.b-mute { background: #0a1a0a; }

/* -- CONDITIONS BOX -- inherits glass card from .cond-box rule above */
.cond-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 5px;
  display: flex; align-items: center;
}
.cond-lbl span { flex: 1; }
#funny-toggle {
  background: none; border: none; cursor: pointer;
  padding: 0; color: var(--muted);
  transition: color .2s; -webkit-tap-highlight-color: transparent;
}
#funny-toggle svg { width: 16px; height: 16px; display: block; }
#funny-toggle:hover { color: var(--text); }
#funny-toggle.active { color: var(--green); }
.cond-text { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; }
.cond-text ul { margin: 0; padding-left: 16px; list-style: none; }
.cond-text li { position: relative; padding-left: 4px; margin-bottom: 4px; }
.cond-text li::before { content: '\203A'; position: absolute; left: -12px; color: var(--teal); font-weight: 700; }

/* Aurora-zone note — styled as a sub-card inside .cond-box, matching the panel palette.
   Uses the same glass + themed border pattern as .cond-box, with a left-accent border
   color drawn from the theme's canonical severity tokens (--orange / --amber). */
.cond-zone {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: var(--inset-bg);     /* = rgba(57,255,20,0.06) — matches panel insets */
  font-family: 'Rajdhani', sans-serif;
}
.cond-zone.hidden { display: none; }
.cond-zone[data-zone="none"]        { border-left-color: var(--orange); }
.cond-zone[data-zone="rare"]        { border-left-color: var(--amber);  }
.cond-zone[data-zone="occasional"]  { border-left-color: #8888cc;       }

.cond-zone-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  position: relative;
}
/* Label colors mirror the verdict severity classes (c-no, c-warn, c-cam) */
.cond-zone[data-zone="none"] .cond-zone-label       { color: var(--orange); }
.cond-zone[data-zone="rare"] .cond-zone-label       { color: var(--amber);  }
.cond-zone[data-zone="occasional"] .cond-zone-label { color: #8888cc;       }

/* Warning emoji — renders as the native ⚠️ glyph (color emoji on all platforms) */
.cond-zone[data-zone="none"] .cond-zone-label::before {
  content: "\26A0\FE0F";   /* ⚠ + VS16 → color emoji variant */
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  flex-shrink: 0;
  /* Reset any inherited color — emoji uses its own native palette */
  color: initial;
}
.cond-zone-note {
  font-size: 13px; font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

/* -- FOOTER -- */
.foot { margin-top: 14px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }

/* Status bar — top of panel */
.panel-status-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.ft-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px rgba(57,255,20,0.8);
  animation: ft-blink 1.5s ease infinite;
  flex-shrink: 0;
}
@keyframes ft-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
.ft-label {
  font-family: 'Rajdhani', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); line-height: 1;
}
.digi-display {
  font-family: 'Bebas Neue', monospace;
  font-size: 15px;
  letter-spacing: 2.5px;
  line-height: 1;
  color: var(--green);
  text-shadow:
    0 0 4px rgba(57,255,20,0.7),
    0 0 12px rgba(57,255,20,0.3);
  margin-left: auto;
}

/* -- CREDIT (desktop) -- hidden, credit is now in the panel footer */
#credit-desktop { display: none; }
.ig-icon { width: 12px; height: 12px; flex-shrink: 0; }
#credit-mobile {
  display: none;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  color: rgba(204,255,204,0.30); text-align: center;
}
#credit-mobile a {
  color: rgba(57,255,20,0.65); text-shadow: 0 1px 0 rgba(0,0,0,0.8); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
#credit-mobile a:hover { color: rgba(57,255,20,0.85); }

/* -- SHARE BUTTON (prominent) -- */
#share-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(57,255,20,0.12) 0%, rgba(0,200,100,0.08) 100%);
  border: 1px solid rgba(57,255,20,0.3);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--green);
  transition: all .25s;
  -webkit-tap-highlight-color: transparent;
}
#share-btn:hover {
  background: linear-gradient(135deg, rgba(57,255,20,0.2) 0%, rgba(0,200,100,0.15) 100%);
  border-color: rgba(57,255,20,0.5);
  box-shadow: 0 0 16px rgba(57,255,20,0.15);
}
#share-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* -- BOTTOM ROW: feedback + credit -- */
.foot-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
#feedback-btn {
  background: none; border: none;
  color: var(--muted);
  padding: 0;
  display: flex; align-items: center; gap: 5px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
#feedback-btn:hover { color: var(--green); }
#feedback-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.foot-credit {
  color: rgba(57,255,20,0.4); text-decoration: none;
  font-family: 'Rajdhani', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 5px;
  transition: color .2s;
}
.foot-credit:hover { color: rgba(57,255,20,0.7); }
.foot-credit .ig-icon { width: 11px; height: 11px; }
.foot-spacer { flex: 1; }
.foot-date {
  font-family: 'Rajdhani', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px;
  color: rgba(204,255,204,0.2);
}

/* -- MINI WIDGET (desktop collapsed state) -- */
#panel-mini {
  position: fixed; left: 16px; top: 16px; transform: none;
  z-index: 101; width: 144px; height: 144px;
  background: rgba(3,14,3,0.80);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#panel-mini.visible {
  opacity: 1; pointer-events: all;
}
#panel-mini:hover {
  transform: scale(1.04);
}
#panel-mini svg { display: block; width: 100%; height: 100%; }
