/* ThrowBack Wars - graphical experience (modern flat). Only applies once the player chose "graphical" at login
   (body.gui-mode); the command-line screen keeps style.css alone. */
body.gui-mode {
  --g-bg: #0b1220; --g-panel: #131c2e; --g-panel2: #1a2540; --g-line: #26324d; --g-text: #e2e8f0; --g-muted: #8b98b3;
  --g-accord: #3b82f6; --g-accord-soft: #1e3a8a; --g-covenant: #ef4444; --g-covenant-soft: #7f1d1d;
  --g-neutral: #94a3b8; --g-star: #facc15; --g-rift: #a855f7; --g-seeker: #fb923c; --g-ok: #22c55e; --g-warn: #f59e0b;
  background: var(--g-bg); color: var(--g-text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
@media (prefers-color-scheme: light) {
  body.gui-mode {
    --g-bg: #eef2f8; --g-panel: #ffffff; --g-panel2: #f1f4fa; --g-line: #d5dcea; --g-text: #172033; --g-muted: #5b6782;
    --g-accord-soft: #dbe7ff; --g-covenant-soft: #ffe0e0;
  }
}
body.gui-mode #frame { max-width: 1280px; padding: 8px 14px; }
body.gui-mode #bar, body.gui-mode #foot label { display: none; }
body.gui-mode #foot a { color: var(--g-muted); }

/* Three columns: controls | map | nearest, chart and comms. #g-main only groups them in the markup. */
#gui { display: grid; gap: 10px; align-items: start; grid-template-columns: 280px minmax(0, 1fr) 300px;
  grid-template-areas: "top top top" "side map right"; }
#g-main { display: contents; }
#g-top { grid-area: top; } #g-mapwrap { grid-area: map; } #g-side { grid-area: side; } #g-right { grid-area: right; }
#g-side, #g-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.gui-mode #frame { height: auto; min-height: 100%; }
#gui .card { background: var(--g-panel); border: 1px solid var(--g-line); border-radius: 10px; padding: 10px 12px; }
#gui h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--g-muted); }
#gui .muted { color: var(--g-muted); margin: 0 0 8px; }
#gui .small { font-size: 12px; color: var(--g-muted); }
#gui button {
  background: var(--g-panel2); color: var(--g-text); border: 1px solid var(--g-line); border-radius: 8px;
  padding: 6px 10px; font: inherit; font-weight: 600; cursor: pointer;
}
#gui button:hover:not(:disabled), #gui button:focus-visible { border-color: var(--g-accord); background: var(--g-panel2); color: var(--g-text); outline: none; }
#gui button:disabled { opacity: .4; cursor: default; }
#gui kbd { font: 11px ui-monospace, monospace; color: var(--g-muted); border: 1px solid var(--g-line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
#gui .btns { display: flex; flex-wrap: wrap; gap: 8px; }
#gui input[type=range] { flex: 1; accent-color: var(--g-accord); min-width: 80px; }
#gui .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; justify-content: space-between; }
#gui .row em, #gui .bar em { font-style: normal; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }

#g-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--g-panel); border: 1px solid var(--g-line); border-radius: 10px; padding: 8px 12px; }
#g-id { font-weight: 700; font-size: 16px; }
#g-hulltype { color: var(--g-muted); font-weight: 400; font-size: 13px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.badge.accord { background: var(--g-accord); }
.badge.covenant { background: var(--g-covenant); }
#g-score { display: flex; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
#g-score .sc.accord b { color: var(--g-accord); }
#g-score .sc.covenant b { color: var(--g-covenant); }
#g-score small { color: var(--g-muted); }
#g-clock { font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--g-panel2); }
#g-helpbtn { width: 32px; height: 32px; border-radius: 50%; padding: 0; }

#g-mapwrap { position: relative; background: var(--g-panel); border: 1px solid var(--g-line); border-radius: 10px;
  padding: 8px; display: flex; justify-content: center; align-items: flex-start; }
#g-map { display: block; max-width: 100%; cursor: crosshair; touch-action: manipulation; }
#g-tip { position: absolute; pointer-events: none; background: var(--g-panel2); border: 1px solid var(--g-line);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; white-space: nowrap; z-index: 2; }
#g-overlay { position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(11, 18, 32, .72); border-radius: 8px; font-size: 20px; font-weight: 700; color: #fff; z-index: 3; }
.bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.lbl { width: 64px; flex: none; color: var(--g-muted); font-size: 12px; }
.meter { flex: 1; height: 10px; background: var(--g-panel2); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--g-ok); transition: width .25s; }
.meter i.mid { background: var(--g-warn); }
.meter i.low { background: var(--g-covenant); }
#g-energy-bar { background: var(--g-accord); }
#g-ready-bar { width: 100%; background: var(--g-ok); }
#g-readyrow.busy #g-ready-bar { background: var(--g-warn); }
#g-readyrow.busy em { color: var(--g-warn); font-weight: 600; }
#g-systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; margin-top: 6px; font-size: 11px; color: var(--g-muted); }
#g-systems .sys { display: flex; flex-direction: column; gap: 2px; }
#g-systems .meter { flex: none; height: 5px; }
#g-locate-list, #g-roster { list-style: none; margin: 0; padding: 0; }
#g-locate-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0;
  border-top: 1px solid var(--g-line); font-size: 13px; }
#g-locate-list li:first-child { border-top: 0; }
#g-locate-list li b { font-variant-numeric: tabular-nums; }
#g-locate-list li .k { color: var(--g-muted); width: 92px; }
#g-locate-list button { padding: 2px 10px; font-size: 12px; }

#g-chart { display: block; width: 210px; height: 210px; cursor: pointer; margin: 0 auto; }
#g-comms { display: flex; flex-direction: column; min-height: 0; }
/* flex: none, so the fixed height holds and the log scrolls inside its box; with flex: 1 the column's content-sized
   height let it grow with every line (operator 2026-11-27: 'The running dialog box fills and scrolls off the screen'). */
#g-log { flex: none; height: 240px; overflow-y: auto; overscroll-behavior: contain; font-size: 13px; }
#g-log div { padding: 1px 0; border-bottom: 1px dashed transparent; }
#g-log .err { color: var(--g-covenant); }
#g-log .me { color: var(--g-muted); }
#g-chat { display: flex; gap: 6px; margin-top: 6px; }
#g-chat select, #g-chat input { background: var(--g-panel2); color: var(--g-text); border: 1px solid var(--g-line);
  border-radius: 8px; padding: 6px 8px; font: inherit; }
#g-chat input { flex: 1; min-width: 0; }
#g-roster { max-height: 240px; overflow-y: auto; font-size: 13px; }
#g-roster li { display: flex; justify-content: space-between; gap: 6px; padding: 2px 0; cursor: pointer; }
#g-roster li .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
#g-roster li .dot.accord { background: var(--g-accord); }
#g-roster li .dot.covenant { background: var(--g-covenant); }
#g-roster li.gone { opacity: .5; }
#g-help { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 10; }
#g-help .card { max-width: 560px; margin: 16px; }
#g-help pre { font: 12px/1.5 ui-monospace, monospace; white-space: pre-wrap; }

@media (max-width: 1180px) {
  #gui { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "top top" "map side" "right right"; }
  #g-right { display: grid; grid-template-columns: 1fr 236px 1fr; align-items: start; }
}
@media (max-width: 780px) {
  #gui { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "map" "side" "right"; }
  #g-right { display: flex; }
  #g-score { gap: 8px; font-size: 12px; }
}

/* play-as choice on the Sign in and New Pilot panels */
#login form .uipick { border: 1px solid var(--dim); padding: 4px 10px 8px; margin: 10px 0 4px; max-width: 32ch; }
#login form .uipick legend { color: var(--dim); padding: 0 4px; }
#login form .uipick label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 16px 0 0; color: var(--fg); }
#login form .uipick input { display: inline-block; width: auto; margin: 0; accent-color: var(--fg); }
