/* System-plot styling. Split from app.css purely to keep each sheet readable. */

/* ───────────── map ───────────── */
/* Full width on a phone; capped once there is room, so the plot stops dominating the page
   and the fleet list stays visible without scrolling past a giant circle. */
.plot-wrap { position: relative; }
@media (min-width: 560px) {
  .plot-wrap { max-width: 480px; }
}
.plot {
  background: #050810; border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden;
  /* The map owns every gesture that starts on it, or a drag would scroll the page instead
     of panning. The page still scrolls from anywhere else on the screen. */
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.plot svg { display: block; width: 100%; height: auto; }
/* Decoration must not eat a tap. Names, reticle ticks and the reticle ring are drawn OVER
   the markers, and a tap is hit-tested by position (map.js `pickAt`), so without this a
   selected dot cannot be tapped again through its own reticle. */
.plot svg text, .plot svg line, .plot svg .sel-pulse { pointer-events: none; }

/* ───────────── zoom controls ───────────── */
.plot-zoom {
  position: absolute; top: 8px; right: 8px; display: grid; gap: 6px;
  /* The plot below takes every gesture that starts on it. These sit OVER the plot and are
     ordinary buttons: `manipulation` keeps the tap but drops the double-tap-zoom wait, so
     a second tap to zoom again registers immediately instead of being held by the browser
     to see whether it was a double tap. */
  touch-action: manipulation;
}
.plot-zoom-btn {
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 20, 32, .82); color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font); font-size: 16px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.plot-zoom-btn.wide { width: auto; min-width: 34px; padding: 0 7px; font-size: 12px; }
/* Guarded, or a phone leaves the last-tapped button lit: a touch screen has no way to
   leave a hover state once it enters one. */
@media (hover: hover) {
  .plot-zoom-btn:hover { color: var(--fg); border-color: var(--accent); }
}
.plot-zoom-btn:disabled { opacity: .4; cursor: default; border-color: var(--line); color: var(--faint); }
.plot-detail {
  margin: 8px 0 0; padding: 10px 12px; min-height: 42px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r);
  font-size: 13px; color: var(--dim);
}
.plot-detail strong { color: var(--fg); }
.hit { cursor: pointer; }

/* ───────────── progress ───────────── */
.progress { padding: 4px 2px 2px; }
.progress-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; }
.progress-step { color: var(--dim); }
.progress-count { color: var(--faint); font-family: var(--font); }
.progress-track { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; background: var(--accent); border-radius: 2px;
  transition: width .25s ease;
}


/* Indeterminate variant, used by the EVENTS screen. The market bar reports real stages;
   a single request has none, so this one creeps toward — and stops short of — the end
   rather than inventing a percentage. */
@keyframes progress-creep {
  0%   { width: 6%; }
  100% { width: 92%; }
}
.progress-fill.creep { animation: progress-creep 14s cubic-bezier(.16, .9, .3, 1) forwards; }
@media (prefers-reduced-motion: reduce) {
  .progress-fill.creep { animation: none; width: 40%; }
}

/* ───────────── plot rows ───────────── */
/* The disc colour is set from JS, from the same lookup that colours the dot on the plot.
   Nothing here may hard-code a standing colour, or the two halves can drift apart. */
.plot-row { gap: 10px; }
.row-dot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--faint); box-shadow: 0 0 0 2px #050810;
}
.plot-row .row-main { flex: 1; }
.plot-row .row-note { text-transform: uppercase; letter-spacing: .08em; }

/* The selected row's edge matches its dot, so the pair is unmistakable at a glance. */
.row.selected[data-standing="hostile"] { box-shadow: inset 3px 0 0 var(--red); }
.row.selected[data-standing="ally"],
.row.selected[data-standing="consortium"] { box-shadow: inset 3px 0 0 var(--green); }
.row.selected[data-standing="neutral"] { box-shadow: inset 3px 0 0 var(--dim); }

/* ───────────── selection reticle ───────────── */
/* Only stroke-opacity is animated. Animating an SVG geometry property such as `r` from
   CSS is not something every browser this app runs on agrees about; opacity is. */
@keyframes sel-pulse {
  0%, 100% { stroke-opacity: 1; }
  50%      { stroke-opacity: .3; }
}
.sel-pulse { animation: sel-pulse 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .sel-pulse { animation: none; }
}
