/* Mission-console palette. The subject is rocket telemetry, so the page
   borrows from instrument displays rather than a generic dashboard: a deep
   navy ground with a slight blue bias in every neutral, phosphor cyan as the
   working accent, and amber reserved for the rocket itself. Balloon magenta
   and pop red are the environment's own colours (balloon_world.py:810), kept
   so the 3D view and the tables speak the same language. */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  color-scheme: dark;

  --bg:        #080b14;
  --panel:     #0f1420;
  --panel-2:   #151c2b;
  --line:      #1e2739;
  --line-soft: #172032;

  --fg:        #e4eaf5;
  --dim:       #7d8aa3;
  --dimmer:    #4d586e;

  /* Phosphor cyan: the interface accent, used for anything the reader acts on. */
  --accent:    #4dd4c4;
  --accent-dim:#2a7d75;
  /* Amber belongs to the vehicle -- the rocket, its trail, its readouts. */
  --amber:     #f0a830;
  /* Semantic, and deliberately not the accent hue. */
  --pop:       #e8536b;
  --ok:        #5ec98a;
  --balloon:   #e0559a;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", ui-sans-serif, system-ui, "Noto Sans TC", sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* --- header ---------------------------------------------------------------- */
.bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.bar h1 {
  margin: 0;
  font: 600 16px/1.2 var(--display);
  letter-spacing: -0.01em;
}
/* A thin cyan rule under the title, the one place the accent appears in the
   chrome -- it reads as an instrument bezel rather than a decorative bar. */
.bar h1::after {
  content: ""; display: block;
  width: 26px; height: 2px; margin-top: 5px;
  background: var(--accent);
}
.bar .spacer { flex: 1; }

.dim { color: var(--dim); }
.small { font-size: 12px; }
.link { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.link:hover { border-bottom-color: var(--accent); }

main { padding: 22px 24px 56px; max-width: 1180px; margin: 0 auto; }

/* --- upload ---------------------------------------------------------------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 24px; margin-bottom: 20px; cursor: pointer;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--panel);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent-dim); background: var(--panel-2); }
.drop.over { border-style: solid; }
.drop strong { font: 500 13px var(--body); }

.progress {
  width: 100%; max-width: 440px; height: 3px; margin-top: 10px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .12s linear; }
.status {
  margin-top: 7px; min-height: 1.4em; text-align: center;
  font: 400 12px var(--mono);
}
.status .err { color: var(--pop); }
.status .ok  { color: var(--ok); }

/* --- table ----------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 8px 12px; text-align: left;
  font: 500 10px/1 var(--mono);
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--dimmer);
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--panel); }

.rank { color: var(--dimmer); font-size: 12px; }
/* The leader is the one thing on this page worth lifting, so it gets the
   accent and a rail; every other row stays quiet. */
.rank-1 td { background: #0d1720; }
.rank-1 .rank { color: var(--accent); font-weight: 700; }
.rank-1 td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

.team { font-weight: 500; }
.agent { color: var(--dim); font-size: 13px; max-width: 300px; overflow: hidden;
         text-overflow: ellipsis; white-space: nowrap; }
.popped { font-weight: 700; color: var(--ok); }

/* A seed is an identity, not a quantity: a chip reads as one at a glance. */
.seed {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--line);
  font: 500 11px var(--mono); color: var(--dim);
}

.del {
  border: 0; background: none; color: var(--dimmer);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px;
  transition: color .12s;
}
.del:hover { color: var(--pop); }
.empty { padding: 34px; text-align: center; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
