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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0e14;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  --display-frame-inset: 0px;
}

#map-bg,
#heatmap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#map-bg {
  z-index: 0;
}

#heatmap {
  z-index: 1;
  pointer-events: none;
}

#lon-chart {
  position: absolute;
  top: calc(4px + var(--display-frame-inset));
  left: var(--display-frame-inset);
  width: calc(100% - 2 * var(--display-frame-inset));
  height: 220px;
  z-index: 3;
  pointer-events: none;
}

.activity-readout {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  min-width: 11rem;
  max-width: min(92vw, 22rem);
  padding: 0.45rem 0.75rem 0.5rem;
  border-radius: 6px;
  background: rgba(12, 18, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  color: #e8ecf2;
  text-align: center;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: left 0.1s linear, top 0.1s linear;
}

.activity-readout[hidden] {
  display: none !important;
}

.activity-readout-inner {
  line-height: 1.25;
}

.activity-readout-value {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.activity-readout-value #couples-value {
  color: #f0d78c;
}

.activity-readout-heart {
  color: #f06a8f;
  margin-right: 0.35rem;
  font-size: 1.05rem;
  vertical-align: baseline;
}

.activity-readout-unit {
  margin-left: 0.35rem;
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.88;
  text-transform: lowercase;
}

.activity-readout-caption {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  opacity: 0.72;
  font-weight: 400;
}

#node-tooltip {
  position: fixed;
  z-index: 6;
  display: none;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font: 12px/1.35 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
}

#stats-panel {
  position: fixed;
  right: calc(12px + var(--display-frame-inset));
  bottom: calc(12px + var(--display-frame-inset));
  z-index: 5;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font: 12px/1.35 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#stats-panel > div {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

#stats-panel > div:last-child {
  border-bottom: none;
}

#hud {
  position: absolute;
  z-index: 2;
  left: var(--display-frame-inset);
  right: var(--display-frame-inset);
  bottom: calc(8px + var(--display-frame-inset));
  padding: 0.75rem 1.25rem 0.95rem;
  background: linear-gradient(
    to top,
    rgba(8, 12, 20, 0.92) 0%,
    rgba(8, 12, 20, 0.55) 55%,
    transparent 100%
  );
  color: #e8ecf2;
  pointer-events: none;
}

#hud h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}

#hud .subtitle {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-bottom: 0.5rem;
}

#hud .data-status {
  font-size: 0.72rem;
  opacity: 0.9;
  color: #a8c4e8;
  margin-bottom: 0.65rem;
  min-height: 1.1em;
}

#hud .controls {
  pointer-events: auto;
  max-width: 28rem;
}

#hud label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

#hud .utc-freeze-hint {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.65;
  margin-top: 0.2rem;
}

#time-slider {
  width: 100%;
  height: 0.45rem;
  accent-color: #c9a227;
  margin-bottom: 0.65rem;
}

#hud .row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#play-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f4fa;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#play-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

#play-btn[aria-pressed="true"] {
  background: rgba(201, 162, 39, 0.35);
  border-color: rgba(201, 162, 39, 0.6);
}

#hud .hint {
  font-size: 0.72rem;
  opacity: 0.65;
}
