/* Universal Utilons — deliberately minimal, after decisionproblem.com/paperclips */

:root {
  --bg: #fff;
  --fg: #000;
  --dim: #666;
  --dimmer: #999;
  --faint: #ccc;
  --hover: #f0f0f0;
  --winner: #e8e8e8;
}
:root[data-theme="dark"] {
  --bg: #111;
  --fg: #e8e8e8;
  --dim: #9a9a9a;
  --dimmer: #777;
  --faint: #444;
  --hover: #222;
  --winner: #2e2e2e;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  margin: 12px;
}

h1 {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 4px 0;
}

h2 {
  font-size: 14px;
  font-weight: bold;
  margin: 0 0 6px 0;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}

.hidden { display: none !important; }

#topDiv { margin-bottom: 10px; }

#consoleDiv {
  font-size: 12px;
  max-width: 680px;
  margin-bottom: 8px;
  min-height: 78px;
}
#consoleOld { color: var(--dimmer); }
#consoleOld div { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#consoleNew { color: var(--fg); }
#cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

#flashDiv {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  letter-spacing: 8px;
}

#columnsDiv {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.column { width: 330px; max-width: 100%; }

.panel { margin-bottom: 18px; }

.row { margin: 4px 0; }

.lbl { }

.cost { color: var(--dim); font-size: 12px; margin-left: 6px; }

button {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--dim);
  border-radius: 2px;
  padding: 1px 8px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--hover); }

button:disabled { color: var(--dimmer); border-color: var(--faint); cursor: default; }

.perf {
  font-size: 12px;
  font-style: italic;
  color: var(--dim);
  margin: 4px 0;
}

/* projects */
.project {
  border: 1px solid var(--fg);
  padding: 6px 8px;
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--bg);
}
.project:hover { background: var(--hover); }
.project.unaffordable { color: var(--dimmer); border-color: var(--faint); cursor: default; }
.project.unaffordable:hover { background: var(--bg); }
.project .ptitle { font-weight: bold; font-size: 13px; }
.project .pcost { font-size: 12px; color: var(--dim); }
.project.unaffordable .pcost { color: var(--dimmer); }
.project .pdesc { font-size: 12px; margin-top: 2px; }

/* parliament */
#parliamentGrid { border-collapse: collapse; margin: 6px 0; font-size: 12px; }
#parliamentGrid td, #parliamentGrid th {
  border: 1px solid var(--faint);
  padding: 2px 6px;
  text-align: left;
}
#parliamentGrid .winner { background: var(--winner); font-weight: bold; }

/* contemplation chips */
#chipsDiv { margin: 6px 0; }
.chip {
  display: inline-block;
  width: 24px; height: 10px;
  border: 1px solid var(--fg);
  margin-right: 4px;
  background: var(--bg);
}

/* stocks */
#stockTable { border-collapse: collapse; font-size: 11px; margin-top: 6px; }
#stockTable td { border: 1px solid var(--faint); padding: 1px 6px; }

/* probe design */
#probeDesignTable { font-size: 12px; border-collapse: collapse; }
#probeDesignTable td { padding: 1px 4px; }
#probeDesignTable button { font-size: 11px; padding: 0 4px; }

#battleCanvasWrap { border: 1px solid var(--fg); width: 312px; margin-top: 6px; }

#footer {
  margin-top: 30px;
  font-size: 11px;
  color: var(--dimmer);
}
#footer a { color: var(--dimmer); }
.sep { margin: 0 6px; }

/* ending */
#endingOverlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  padding: 60px 20px;
  z-index: 10;
}
#endingText {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}
#endingChoices { max-width: 560px; margin: 30px auto; }
#endingChoices .project { max-width: 400px; }

@media (max-width: 1100px) {
  #columnsDiv { flex-direction: column; }
}

/* message log overlay */
#logOverlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 15;
  overflow-y: auto;
  padding: 20px;
}
#logInner { max-width: 680px; margin: 0 auto; }
#logHeader { margin-bottom: 12px; }
#logHeader a { color: var(--dim); margin-left: 12px; font-size: 12px; }
.logline { font-size: 12px; margin: 3px 0; }
.logtime { color: var(--dimmer); margin-right: 8px; font-size: 11px; }
