/* RedVBlue - shared theme. Red (attack) vs Blue (defend), dark command look. */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2230;
  --ink: #e6edf3;
  --muted: #8b98a9;
  --line: #2d3645;
  --red: #e5484d;
  --red-dim: #7d2327;
  --blue: #3b82f6;
  --blue-dim: #1e3a66;
  --green: #3fb950;
  --amber: #d29922;
  --accent: #a371f7;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 24px; }
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: 0.3px; }
.brand .r { color: var(--red); }
.brand .b { color: var(--blue); }
.muted { color: var(--muted); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; margin: 16px 0;
}
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 26px; margin: 0 0 6px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; font: inherit;
}
button {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel2); color: var(--ink); font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
button.red { background: var(--red); border-color: var(--red); color: #fff; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.side-red { border-top: 3px solid var(--red); }
.side-blue { border-top: 3px solid var(--blue); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.red { background: var(--red-dim); border-color: var(--red); }
.pill.blue { background: var(--blue-dim); border-color: var(--blue); }
.pill.on { background: var(--green); border-color: var(--green); color: #04260c; }
.pill.off { background: #30363d; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.meter {
  position: relative; height: 26px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(90deg, var(--red) 0%, #30363d 50%, var(--blue) 100%);
  border: 1px solid var(--line);
}
.meter .needle { position: absolute; top: -3px; bottom: -3px; width: 3px; background: #fff; box-shadow: 0 0 4px #000; }
.meter-label { display:flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.scorebig { font-size: 44px; font-weight: 800; }
.notice { padding: 10px 12px; border-radius: 7px; background: var(--panel2); border: 1px solid var(--line); font-size: 14px; }
.notice.warn { border-color: var(--amber); }
.notice.err { border-color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 16px; }
.tile h3 { margin: 0 0 6px; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.hidden { display: none; }

/* A1 board map */
.boardmap { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.node {
  flex: 1; min-width: 120px; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px; background: var(--panel2); position: relative;
}
.node.held { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.node.detected { outline: 2px dashed var(--amber); }
.node.isolated { opacity: 0.5; }
.node.objective { border-color: var(--accent); }
.node .nname { font-weight: 600; font-size: 14px; }
.node .nmeta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.node .ctrl { display: inline-block; margin: 2px 2px 0 0; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; background: var(--blue-dim); border: 1px solid var(--blue); }
.node .redflag { position: absolute; top: 6px; right: 8px; color: var(--red); font-size: 11px; }
.boardarrow { align-self: center; color: var(--muted); }
