* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0e13; }
body { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #e8e6e0; user-select: none; -webkit-user-select: none; }

#map { position: absolute; inset: 0; display: block; cursor: default; }

.hidden { display: none !important; }

/* ---------- top bar ---------- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 42px;
  display: flex; align-items: center; gap: 16px; padding: 0 12px;
  background: rgba(12, 16, 24, 0.92); border-bottom: 1px solid #2a3242;
  font-size: 13px; z-index: 10; white-space: nowrap;
}
#topbar .spacer { flex: 1; }
#topbar .chip { padding: 2px 10px; border-radius: 10px; font-weight: 600; color: #fff; }
#topbar .clicky { cursor: pointer; color: #9ecbff; }
#topbar .clicky:hover { text-decoration: underline; }
button {
  background: #232c3d; color: #e8e6e0;
  border: 1px solid #3a4560; border-radius: 6px; padding: 5px 12px;
  font-size: 13px; cursor: pointer;
}
button:hover { background: #2d3850; }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: #2f6b3a; border-color: #3f8f4e; font-weight: 600; }
button.primary:hover { background: #388046; }
button.attn { background: #7a5a1e; border-color: #a97e2f; }
button.danger { background: #6b2f2f; border-color: #8f3f3f; }

/* ---------- bottom panel ---------- */
#panel {
  position: absolute; left: 12px; bottom: 12px; min-width: 300px; max-width: 420px;
  background: rgba(12, 16, 24, 0.94); border: 1px solid #2a3242; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; z-index: 10;
}
#panel h3 { font-size: 15px; margin-bottom: 4px; }
#panel .row { margin: 3px 0; color: #b9c2d0; }
#panel .btns { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.hpbar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; margin: 4px 0; }
.hpbar > div { height: 100%; background: #4caf50; }

/* ---------- notifications ---------- */
#notes { position: absolute; top: 50px; right: 12px; width: 280px; z-index: 12; pointer-events: none; }
.note {
  background: rgba(20, 26, 38, 0.95); border: 1px solid #35405a; border-left: 3px solid #6a8fd8;
  border-radius: 6px; padding: 7px 10px; margin-bottom: 6px; font-size: 12.5px;
  animation: notein 0.2s ease-out;
}
@keyframes notein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- minimap ---------- */
#minimap {
  position: absolute; right: 12px; bottom: 12px; z-index: 10;
  border: 1px solid #2a3242; border-radius: 6px; background: #000; cursor: pointer;
}

/* ---------- modal ---------- */
#modalWrap {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55); z-index: 20;
  display: flex; align-items: center; justify-content: center;
}
#modal {
  background: #131926; border: 1px solid #35405a; border-radius: 12px;
  padding: 18px 20px; max-width: 760px; max-height: 84vh; overflow-y: auto;
  min-width: 420px; font-size: 13.5px;
}
#modal h2 { margin-bottom: 10px; font-size: 19px; }
#modal h4 { margin: 12px 0 6px; color: #9fb3d1; }
#modal .muted { color: #8a93a5; }
#modal table { border-collapse: collapse; width: 100%; }
#modal td { padding: 3px 8px 3px 0; }

.prodItem, .techItem {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 3px 0;
  background: #1a2233; border: 1px solid #2a3448; border-radius: 7px; cursor: pointer;
}
.prodItem:hover, .techItem:hover { background: #223052; }
.prodItem.disabled, .techItem.done, .techItem.locked { opacity: 0.5; cursor: default; }
.techItem.current { border-color: #6a8fd8; background: #1e2c4a; }
.prodItem .grow, .techItem .grow { flex: 1; }
.prodItem .cost, .techItem .cost { color: #8a93a5; font-size: 12px; }
.buyBtn { font-size: 11.5px; padding: 2px 8px; }
.icon { font-size: 17px; width: 24px; text-align: center; }

.yields span { margin-right: 12px; }
.closeX { float: right; cursor: pointer; color: #8a93a5; font-size: 18px; padding: 0 4px; }
.closeX:hover { color: #fff; }

/* ---------- start screen ---------- */
#startWrap {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #17233a 0%, #0b0e13 75%);
}
#startBox { text-align: center; max-width: 460px; }
#startBox h1 { font-size: 46px; letter-spacing: 2px; margin-bottom: 8px; }
#startBox .sub { color: #b9c2d0; margin-bottom: 22px; line-height: 1.5; }
#startBox .tiny { color: #667089; font-size: 11.5px; margin-top: 26px; line-height: 1.6; }
#startButtons button { font-size: 16px; padding: 10px 26px; margin: 0 6px; }
