* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #070a14;
  color: #dfe6ff;
  font-family: 'Consolas', 'Menlo', monospace;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  background: #0b0f1e;
  border-bottom: 1px solid #1c2440;
  flex-wrap: wrap;
}
#starInfo { color: #ffd76a; white-space: nowrap; }
#chips { display: flex; gap: 10px; flex: 1; }
.chip {
  background: #131a30;
  border: 1px solid #232d52;
  border-radius: 4px;
  padding: 3px 9px;
  white-space: nowrap;
}
#chipPoints { color: #ffe9a0; }
#chipScore { color: #9fe8a8; }
#timeCtl { display: flex; align-items: center; gap: 10px; }
#speed { display: flex; gap: 4px; }

button {
  background: #131a30;
  color: #dfe6ff;
  border: 1px solid #2a355f;
  border-radius: 4px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #1b2445; }
button:disabled { opacity: 0.38; cursor: default; }
button.on { background: #2a3766; border-color: #5a6cb8; }
button.primary { background: #2a4d2e; border-color: #4d8f55; }
button.primary:hover { background: #35603a; }

#mid { display: flex; flex: 1; min-height: 0; }
#sysWrap { flex: 1; min-width: 0; position: relative; overflow: hidden; }
#sys { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: grab; }
#sys:active { cursor: grabbing; }

#popup {
  position: absolute;
  z-index: 5;
  width: 250px;
  background: rgba(13, 18, 38, 0.92);
  border: 1px solid #2a355f;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

#side {
  width: 330px;
  background: #0b0f1e;
  border-left: 1px solid #1c2440;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
  overflow-y: auto;
}

#eventArea { display: flex; flex-direction: column; gap: 6px; }
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #23182a;
  border: 1px solid #5a3a55;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}
.banner.warn { background: #2a2318; border-color: #5a4a2a; }
.banner button { padding: 3px 8px; font-size: 12px; }

#card { display: flex; gap: 10px; }
#portrait {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
  background: #070a14;
  border: 1px solid #1c2440;
  border-radius: 4px;
  flex-shrink: 0;
}
#cardInfo { font-size: 12.5px; line-height: 1.55; min-width: 0; }
.cname { color: #ffd76a; font-size: 15px; margin-bottom: 2px; }
.crow b { color: #9fe8a8; }
.crow.warn { color: #ffb08c; }
.muted { color: #8b94b8; }
.bar {
  display: inline-block;
  width: 60px;
  height: 7px;
  background: #131a30;
  border: 1px solid #2a355f;
  vertical-align: middle;
  margin-left: 4px;
}
.bar i { display: block; height: 100%; background: #7ee27e; }

#actions { display: flex; flex-direction: column; gap: 4px; }
#actions button { text-align: left; display: flex; justify-content: space-between; }
#actions .cost { color: #ffe9a0; }
#massRow { display: flex; gap: 4px; }
#massRow button { flex: 1; text-align: center; display: block; font-size: 12px; padding: 4px 2px; }

#log {
  font-size: 12px;
  line-height: 1.5;
  color: #aab4d8;
  border-top: 1px solid #1c2440;
  padding-top: 8px;
}
#log .lt { color: #5d6690; }

#tlWrap { background: #0b0f1e; border-top: 1px solid #1c2440; }
#timeline { display: block; width: 100%; }

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.panel {
  background: #0d1226;
  border: 1px solid #2a355f;
  border-radius: 8px;
  padding: 26px 30px;
  max-width: 560px;
}
.panel.small { max-width: 420px; }
.panel h1 { letter-spacing: 8px; color: #ffd76a; margin-bottom: 4px; }
.panel h2 { color: #ffd76a; margin-bottom: 10px; }
.panel .sub { color: #8b94b8; margin-bottom: 14px; font-size: 12.5px; }
.panel ul { margin: 0 0 18px 18px; line-height: 1.65; font-size: 13.5px; }
.panel li { margin-bottom: 6px; }
.introRow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
#introSeed {
  width: 90px;
  background: #131a30;
  color: #dfe6ff;
  border: 1px solid #2a355f;
  border-radius: 4px;
  padding: 5px 8px;
  font-family: inherit;
}

#btnNew2 {
  position: fixed;
  right: 344px;
  top: 54px;
  z-index: 10;
  opacity: 0.7;
}

@media (max-width: 900px) {
  #side { width: 270px; }
  #btnNew2 { right: 284px; }
}
