/* ==========================================================================
   PRESSURES — the controls for exploring a real pressure in your view:
     .mode-bar          Animals · Fireworks · Headlights · Pesticide · Plastic
     .pressure-panel    live readings · recovery bar · distance · With / Without
     .place-hint        "Tap where the fireworks go off"
     .source-marker     reticle where you placed it
     .consequence       card: for the animal · for you · for the environment
   ========================================================================== */

/* ---------- Mode bar ---------- */
.mode-bar {
  display: flex; justify-content: space-between; gap: 0;
  max-width: 440px; width: 100%; margin: 0 auto;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mode-bar::-webkit-scrollbar { display: none; }
.mode-bar button {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 6px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.3s;
}
.mode-bar button.is-active { color: var(--ink); }
.mode-bar button.is-active::after {
  content: "";
  position: absolute; left: 6px; right: 6px; bottom: 3px;
  height: 1px;
  background: var(--ink);
}
.mode-bar button:not([data-tab="animals"]).is-active::before {
  content: "";
  position: absolute; top: 3px; right: 3px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--danger);
}

/* ---------- Panel ---------- */
.pressure-panel {
  margin: 0 var(--gutter);
  padding: 12px 14px 12px;
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--glass-border);
}
.pressure-panel.is-waiting .pressure-panel__readings,
.pressure-panel.is-waiting .pressure-panel__controls { opacity: 0.35; pointer-events: none; }

.pressure-panel__readings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 52px;
}
.reading { padding-right: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reading + .reading { padding-left: 10px; border-left: 1px solid var(--hairline); }
.reading__label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.3;
}
.reading__value {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.reading.is-warn .reading__value { color: #ff8a7e; }
.reading__note { font-size: 10px; color: var(--ink-faint); line-height: 1.25; }

.pressure-panel__progress {
  height: 2px; margin-top: 10px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.pressure-panel__progress i {
  display: block; height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: var(--ink);
  transition: width 0.2s linear;
}

/* Two rows so nothing gets squeezed: distance on top, the With / Instead switch below */
.pressure-panel__controls {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

/* Distance slider — hairline track, white thumb */
.pressure-panel__distance { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pressure-panel__distance span,
.pressure-panel__distance output {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.pressure-panel__distance span,
.pressure-panel__distance output { flex: 0 0 auto; }
.pressure-panel__distance output { color: var(--ink); min-width: 56px; text-align: right; }
.pressure-panel__distance input {
  flex: 1; min-width: 0;
  height: 24px;
  background: none;
  -webkit-appearance: none; appearance: none;
}
.pressure-panel__distance input::-webkit-slider-runnable-track { height: 1px; background: var(--hairline-strong); }
.pressure-panel__distance input::-moz-range-track { height: 1px; background: var(--hairline-strong); }
.pressure-panel__distance input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.pressure-panel__distance input::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: var(--ink);
}

/* With / Without */
.segmented {
  display: flex;
  padding: 2px;
  border-radius: 99px;
  border: 1px solid var(--hairline-strong);
}
.segmented button {
  flex: 1;
  padding: 8px 12px;
  white-space: nowrap;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: background 0.3s, color 0.3s;
}
.segmented button.is-active { background: var(--ink); color: #0b0b0a; }

/* ---------- Placement hint ---------- */
.place-hint {
  position: absolute; z-index: 15;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}
.place-hint i {
  position: relative;
  width: 64px; height: 64px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  animation: hint-breathe 2.4s var(--ease-in-out) infinite;
}
.place-hint i::before, .place-hint i::after {
  content: ""; position: absolute; background: var(--ink);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.place-hint i::before { width: 1px; height: 18px; }
.place-hint i::after  { width: 18px; height: 1px; }
.place-hint span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  white-space: nowrap;
}
@keyframes hint-breathe { 50% { transform: scale(1.12); opacity: 0.7; } }

/* ---------- Source marker ---------- */
.source-marker {
  position: absolute; z-index: 15;
  left: 0; top: 0;
  pointer-events: none;
  will-change: transform;
}
.source-marker__reticle {
  position: absolute; left: -14px; top: -14px;
  width: 28px; height: 28px;
  border: 1px solid rgba(244, 242, 238, 0.7);
  border-radius: 50%;
}
.source-marker__reticle::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; margin: -2.5px;
  border-radius: 50%;
  background: var(--danger);
}
.source-marker.is-off .source-marker__reticle::after { background: var(--ink-faint); }
.source-marker__label {
  position: absolute; left: 22px; top: -7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

/* ---------- Consequence card ---------- */
.consequence { cursor: pointer; }
.consequence.is-visible { pointer-events: auto; }
.consequence__row {
  display: grid; grid-template-columns: 82px 1fr; gap: 10px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.consequence__row b {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.4;
  padding-top: 2px;
}
.consequence__row p { font-size: 12.5px; line-height: 1.45; }
.consequence { top: calc(var(--safe-top) + 100px); padding: 12px 14px 10px; }
.consequence__lead {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
}
.consequence__source {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.consequence__more { display: none; }
.consequence.is-expanded .consequence__more { display: block; }
.consequence__toggle {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.consequence__toggle .is-open,
.consequence.is-expanded .consequence__toggle .is-closed { display: none; }
.consequence.is-expanded .consequence__toggle .is-open { display: inline; }

/* While a pressure is shown, the split hint steps aside */
body.is-simulating .split__hint { opacity: 0; }
