:root {
  --bg: #11140f;
  --panel: #1a1e18;
  --text: #e6e8e1;
  --muted: #9aa292;
  --line: #2d3329;
  --accent: #e0b24f;
  --good: #7fc77a;
  --bad: #e0705a;
  --series-1: #3987e5; /* Ameisen gesamt */
  --series-2: #d95926; /* größte Kolonie */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { display: flex; height: 100%; }
#stage { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
#world { display: block; cursor: crosshair; image-rendering: pixelated; border-radius: 6px; }
#panel { width: 340px; flex: none; overflow-y: auto; padding: 16px 18px; background: var(--panel);
  border-left: 1px solid var(--line); }
h1 { font-size: 20px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.hint { color: var(--muted); margin: 0 0 10px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.pill.up { background: #24401f; color: var(--good); }
.pill.down { background: #4a2620; color: var(--bad); }
.piles { margin: 0 0 10px; display: flex; flex-direction: column; gap: 2px; }
.mypiles { font-weight: 600; font-variant-numeric: tabular-nums; }
.mypiles.full { color: var(--accent); }
.piles small { color: var(--muted); }
.controls { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 8px 0 0; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.chartbox { position: relative; }
#chart { width: 100%; height: 170px; display: block; cursor: crosshair; }
.tip { position: absolute; top: 4px; pointer-events: none; background: #252b22; border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.45; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.tip b { font-weight: 600; }
.tip i, .legend i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.tip small { color: var(--muted); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 4px; }
i.s1 { background: var(--series-1); }
i.s2 { background: var(--series-2); }
details.table { margin-top: 6px; color: var(--muted); font-size: 12px; }
details.table summary { cursor: pointer; }
details.table table { width: 100%; border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
details.table th, details.table td { text-align: right; padding: 2px 4px; border-bottom: 1px solid var(--line); }
details.table th { color: var(--muted); font-weight: 500; }
.colonies, .events { list-style: none; padding: 0; margin: 0; }
.colonies li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; padding: 3px 0;
  border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.colonies .dot { width: 10px; height: 10px; border-radius: 50%; }
.colonies small, .events small { color: var(--muted); }
.events li { padding: 3px 0; border-bottom: 1px solid var(--line); }
#banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #4a2620; color: #ffd9cf;
  padding: 6px 14px; border-radius: 6px; }
#toast { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: #2a3126; color: var(--text);
  padding: 6px 14px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
@media (max-width: 800px) {
  main { flex-direction: column; }
  #stage { flex: none; height: 62vh; }
  #panel { width: auto; border-left: 0; border-top: 1px solid var(--line); }
}
