/* Shared styles for the game (index.html) and the scenario editor (editor.html). */
:root {
  --bg: #0b1420;
  --panel: rgba(12, 22, 34, 0.92);
  --line: #22364d;
  --text: #d8e4f0;
  --muted: #8aa0b8;
  --blue: #4da3ff;
  --red: #ff5a52;
  --amber: #ffb547;
  --green: #4cd18a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); overflow: hidden; }
#globe { position: absolute; inset: 0; }
.cesium-viewer-bottom { display: none; }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(6px); }
#topbar { top: 10px; left: 10px; right: 10px; height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 12px; }
#topbar h1 { font-size: 14px; margin: 0; font-weight: 600; white-space: nowrap; }
.toolbar { display: flex; gap: 6px; }
#infobar { top: 62px; left: 10px; right: 10px; height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; }
#timeLine { font: 600 13px var(--mono); color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.seg button:last-child { border-right: 0; }
button { background: #13243a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font: inherit; cursor: pointer; }
button:hover { background: #1b3352; }
button.on { background: var(--blue); color: #001428; font-weight: 600; }
button.fire { background: #3a1716; border-color: #6b2622; color: #ffd6d3; }
button.fire:hover { background: #5a1f1c; }
button:disabled { opacity: 0.4; cursor: default; }
label.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.spacer { flex: 1; }
#units { top: 106px; left: 10px; width: 250px; max-height: calc(100% - 380px); overflow: auto; padding: 10px; }
#status { top: 106px; right: 10px; bottom: 10px; width: 340px; overflow: auto; padding: 12px; }
#msglog { bottom: 10px; left: 10px; width: 520px; height: 250px; overflow: auto; padding: 8px 10px; }
#hint { top: 106px; left: 50%; transform: translateX(-50%); padding: 7px 14px; color: var(--amber); display: none; z-index: 4; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 2px; }
.sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.unit { padding: 7px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.unit:hover { background: #13243a; }
.unit.sel { border-color: var(--blue); background: #102338; }
.unit .n { font-weight: 600; }
.unit .c { color: var(--muted); font-size: 12px; }
.bar { height: 4px; background: #1d2f45; border-radius: 2px; margin-top: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); }
.grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; margin-bottom: 12px; }
.grid dt { color: var(--muted); }
.grid dd { margin: 0; font-family: var(--mono); }
.orders { display: flex; gap: 6px; align-items: end; margin-bottom: 12px; }
.orders label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 11px; }
.orders input { width: 72px; background: #0c1828; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 5px 6px; font: 13px var(--mono); }
.contact { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 5px; cursor: pointer; font-size: 12px; }
.contact:hover { background: #13243a; }
.contact.sel { border-color: var(--amber); background: #2a2210; }
.target { display: flex; justify-content: space-between; gap: 8px; }
.meta { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.act { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.presets { margin-bottom: 8px; }
.presets button { flex: 1; padding: 5px 4px; }
.emcon { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
table.wstat { border-collapse: collapse; font: 12px var(--mono); margin-bottom: 12px; }
table.wstat th, table.wstat td { padding: 2px 10px 2px 0; text-align: right; }
table.wstat th { color: var(--muted); font-weight: 600; text-align: left; }
.contact .top { display: flex; justify-content: space-between; gap: 8px; }
.contact .meta { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.contact .act { display: flex; gap: 6px; margin-top: 6px; }
.hostile { color: var(--red); }
.inv { font-family: var(--mono); font-size: 12px; margin-bottom: 12px; }
.ev { display: flex; justify-content: space-between; gap: 10px; font: 12px/1.45 var(--mono); padding-left: 14px; }
.ev time { color: var(--muted); white-space: nowrap; }
.lg-head { cursor: pointer; font-weight: 600; font-size: 12px; padding: 3px 0; color: var(--text); user-select: none; }
.lg-head:hover { color: var(--blue); }
#modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 9, 15, 0.6); z-index: 9; }
#modal[hidden] { display: none; }
#modal .card { position: static; width: min(720px, calc(100% - 32px)); max-height: 80%; overflow: auto; padding: 18px 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font: 12px/1.6 var(--mono); }
.two-col h2 { margin-top: 12px; }
.side-blue { color: var(--blue); }
.side-red { color: var(--red); }
.ev.threat, .ev.damage, .ev.lost { color: var(--red); }
.ev.hit, .ev.kill { color: var(--green); }
.ev.launch { color: var(--amber); }
.ev.miss, .ev.info { color: var(--muted); }
#brief { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 9, 15, 0.7); z-index: 10; }
#brief .card { width: min(560px, calc(100% - 32px)); padding: 22px 24px; position: static; }
#brief p { color: var(--text); }
#brief ul { color: var(--muted); padding-left: 18px; }
#scenarioPick { width: 100%; margin: 4px 0 14px; background: #0c1828; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; font: inherit; }
#banner { top: 40%; left: 50%; transform: translate(-50%, -50%); padding: 18px 28px; font-size: 20px; font-weight: 600; display: none; z-index: 5; }
.muted { color: var(--muted); }
@media (max-width: 900px) {
  #units { display: none; }
  #status { width: calc(100% - 20px); top: auto; bottom: 230px; height: 40%; }
  #msglog { width: calc(100% - 20px); height: 200px; }
  #topbar h1, #timeLine { display: none; }
  .toolbar button { padding: 5px 6px; }
}

/* links styled as buttons, briefing actions */
a.btn { display: inline-block; background: #13243a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; text-decoration: none; }
a.btn:hover { background: #1b3352; }
.brief-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
