/* Windows 95 style chrome for Cold Contact */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: Tahoma, "MS Sans Serif", Geneva, sans-serif;
  font-size: 11px;
  background: #008080;
  cursor: default;
  -webkit-user-select: none; user-select: none;
}

/* --- 3D chrome helpers --- */
.raised {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}
.sunken {
  background: #fff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* --- desktop / app frame --- */
#app {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
}
#titlebar {
  height: 22px;
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff; font-weight: bold;
  display: flex; align-items: center;
  padding: 0 4px; flex: 0 0 auto;
}
#titlebar .tbtn {
  margin-left: 2px; width: 16px; height: 14px;
  background: #c0c0c0; color: #000;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
  font-size: 9px; line-height: 12px; text-align: center; font-weight: bold;
}
#titlebar .title { flex: 1; }

#menubar {
  height: 20px; background: #c0c0c0;
  display: flex; align-items: center;
  border-bottom: 1px solid #808080;
  flex: 0 0 auto;
}
#menubar .menu {
  padding: 2px 8px;
}
#menubar .menu:hover, #menubar .menu.open { background: #000080; color: #fff; }
#menubar .menu u { text-decoration: underline; }

.menupop {
  position: absolute; z-index: 500;
  background: #c0c0c0;
  border: 2px solid; border-color: #fff #404040 #404040 #fff;
  box-shadow: 2px 2px 4px rgba(0,0,0,.4);
  min-width: 190px;
  padding: 2px;
}
.menupop .mi {
  padding: 3px 20px 3px 20px;
  display: flex; justify-content: space-between;
  white-space: nowrap;
}
.menupop .mi:hover { background: #000080; color: #fff; }
.menupop .mi.disabled { color: #808080; }
.menupop .mi.disabled:hover { background: none; color: #808080; }
.menupop .sep { border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 3px 1px; }
.menupop .key { margin-left: 24px; }

/* --- command & control bar --- */
#cmdbar {
  height: 30px; background: #c0c0c0;
  display: flex; align-items: center;
  padding: 2px 4px; gap: 3px;
  border-bottom: 1px solid #808080;
  flex: 0 0 auto;
}
button.b95 {
  background: #c0c0c0;
  border: 2px solid; border-color: #fff #404040 #404040 #fff;
  padding: 2px 8px;
  font-family: inherit; font-size: 11px;
  min-height: 22px;
}
button.b95:active:not(:disabled) { border-color: #404040 #fff #fff #404040; }
button.b95:disabled { color: #808080; text-shadow: 1px 1px 0 #fff; }
button.b95.default { outline: 1px solid #000; }
#tcindicator {
  min-width: 58px; text-align: center;
  background: #fff; padding: 3px 4px;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
}

/* --- main play area --- */
#playarea { flex: 1; position: relative; overflow: hidden; background: #808080; }

.window {
  position: absolute;
  background: #c0c0c0;
  border: 2px solid; border-color: #fff #404040 #404040 #fff;
  box-shadow: 1px 1px 6px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
}
.window .wtitle {
  height: 18px;
  background: linear-gradient(to right, #808080, #b0b0b0);
  color: #fff; font-weight: bold;
  display: flex; align-items: center;
  padding: 0 3px;
  flex: 0 0 auto;
}
.window.active .wtitle { background: linear-gradient(to right, #000080, #1084d0); }
.window .wtitle .wname { flex: 1; overflow: hidden; white-space: nowrap; }
.window .wtitle .wx {
  width: 14px; height: 12px; background: #c0c0c0; color: #000;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
  font-size: 9px; line-height: 10px; text-align: center; font-weight: bold;
}
.window .wbody { flex: 1; position: relative; overflow: hidden; }

.zoombar {
  height: 18px; background: #c0c0c0;
  display: flex; align-items: center; gap: 1px;
  padding: 1px 2px;
  border-bottom: 1px solid #808080;
  flex: 0 0 auto;
}
.zoombar .zb {
  font-size: 9px; padding: 1px 4px;
  background: #c0c0c0;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
}
.zoombar .zb.sel { border-color: #404040 #fff #fff #404040; background: #a0a0a0; }
.zoombar .zlabel { margin-left: auto; font-size: 9px; font-weight: bold; padding-right: 3px; }

/* Continuous zoom trackbar, styled as a Win95 slider so it sits beside the
   stepped buttons rather than looking bolted on. */
.zoombar .ztrack {
  -webkit-appearance: none; appearance: none;
  width: 74px; height: 12px; margin-left: 6px;
  background: transparent;
}
.zoombar .ztrack::-webkit-slider-runnable-track {
  height: 4px; background: #808080;
  border: 1px solid; border-color: #404040 #fff #fff #404040;
}
.zoombar .ztrack::-moz-range-track {
  height: 4px; background: #808080;
  border: 1px solid; border-color: #404040 #fff #fff #404040;
}
.zoombar .ztrack::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 8px; height: 14px; margin-top: -6px;
  background: #c0c0c0;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
}
.zoombar .ztrack::-moz-range-thumb {
  width: 8px; height: 14px; border-radius: 0;
  background: #c0c0c0;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
}

canvas.mapcanvas { position: absolute; inset: 0; }

/* --- report window --- */
#reportbody {
  padding: 4px; font-size: 11px; overflow: auto;
  position: absolute; inset: 0;
}
#reportbody table { border-collapse: collapse; width: 100%; }
#reportbody td { padding: 1px 4px; vertical-align: top; }
#reportbody .rname { font-weight: bold; }
#reportbody .sunk { color: #a00000; text-decoration: line-through; }

/* --- status bar --- */
#statusbar {
  height: 20px; background: #c0c0c0;
  border-top: 1px solid #fff;
  display: flex; align-items: center;
  padding: 0 4px; gap: 6px;
  flex: 0 0 auto;
}
#statusbar .cell {
  border: 1px solid; border-color: #808080 #fff #fff #808080;
  padding: 1px 8px;
  white-space: nowrap;
}
#statusbar #sb-info { flex: 1; overflow: hidden; }

/* --- dialogs --- */
#modal-overlay {
  position: absolute; inset: 0; z-index: 900;
  display: none;
}
.dialog {
  position: absolute; z-index: 950;
  background: #c0c0c0;
  border: 2px solid; border-color: #fff #404040 #404040 #fff;
  box-shadow: 3px 3px 8px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  min-width: 240px;
}
.dialog .dtitle {
  height: 18px;
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff; font-weight: bold;
  display: flex; align-items: center;
  padding: 0 4px; flex: 0 0 auto;
}
.dialog .dtitle .wname { flex: 1; }
.dialog .dbody { padding: 8px; overflow: auto; max-height: 70vh; }
.dialog .dbtns {
  display: flex; justify-content: flex-end; gap: 6px;
  padding: 6px 8px;
}
.dialog .dbtns.left { justify-content: flex-start; }
.dialog fieldset {
  border: 1px solid; border-color: #808080 #fff #fff #808080;
  padding: 6px; margin: 4px 0;
}
.dialog fieldset legend { padding: 0 4px; }
.dialog label { display: block; padding: 2px 0; }
.dialog input[type=text], .dialog input[type=number] {
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  padding: 2px 3px; font-family: inherit; font-size: 11px;
  background: #fff;
}
.dialog select {
  font-family: inherit; font-size: 11px;
  background: #fff;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
}

.listbox {
  background: #fff;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  overflow-y: auto;
  font-size: 11px;
}
.listbox .li { padding: 1px 4px; white-space: nowrap; }
.listbox .li.sel { background: #000080; color: #fff; }
.listbox .li.dim { color: #808080; }

.grid {
  background: #fff;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  overflow: auto;
}
.grid table { border-collapse: collapse; width: 100%; font-size: 11px; }
.grid th {
  background: #c0c0c0; text-align: left; font-weight: normal;
  border: 1px solid; border-color: #fff #404040 #404040 #fff;
  padding: 1px 5px;
  position: sticky; top: 0;
}
.grid td { padding: 1px 5px; white-space: nowrap; }
.grid tr.sel td { background: #000080; color: #fff; }

.staffmsg { display: flex; gap: 8px; align-items: flex-start; }
.staffface {
  width: 64px; height: 64px; flex: 0 0 auto;
  background: #000040;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  position: relative;
}
.stafftext {
  flex: 1; background: #fff; min-height: 64px;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  padding: 4px;
}

/* setup screens */
#setup {
  position: absolute; inset: 0;
  background: #008080;
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
}
.setupdlg { min-width: 480px; max-width: 640px; }
.setupdlg .desc {
  background: #fff; padding: 6px; margin-top: 6px;
  border: 2px solid; border-color: #404040 #fff #fff #404040;
  height: 140px; overflow: auto;
  font-size: 11px; line-height: 1.35;
}
.radio-row { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.radio-row .rlabel { flex: 1; }

h1.gametitle {
  font-size: 28px; font-style: italic; color: #fff;
  text-shadow: 2px 2px #000;
  text-align: center; padding: 8px;
  font-family: "Times New Roman", serif;
}

.formation-canvas { background: #00c0c0; }

.hidden { display: none !important; }

/* Formation editor drag ghost. Follows the cursor while a hull or a
   helicopter is being moved onto a station. */
.formghost {
  position: fixed; z-index: 9999; pointer-events: none;
  background: #ffffe0; border: 1px solid #808080;
  padding: 2px 6px; font-size: 11px; color: #000;
  box-shadow: 2px 2px 4px rgba(0,0,0,.35);
}
.formghost.over { border-color: #008000; background: #e0ffe0; }
