/* The Undermeadow — minimal, elegant chrome around a living scene. */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #14100c;
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
#ui > * { pointer-events: auto; }

/* ---------- tool dock ---------- */
.dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(24, 16, 10, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 214, 150, 0.14);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  max-width: min(96vw, 640px);
}
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #e8d9c0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.16s, border-color 0.16s, transform 0.1s;
}
.tool:hover { background: rgba(255, 220, 160, 0.1); }
.tool:active { transform: scale(0.94); }
.tool.active {
  background: rgba(255, 200, 120, 0.18);
  border-color: rgba(255, 214, 150, 0.4);
}
.tool .ic { font-size: 19px; line-height: 1; filter: saturate(0.85); }
.tool .lb { font-size: 10.5px; letter-spacing: 0.04em; opacity: 0.85; }

/* ---------- right cluster ---------- */
.cluster {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
}
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 150, 0.16);
  background: rgba(24, 16, 10, 0.66);
  backdrop-filter: blur(8px);
  color: #e8d9c0;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.chip:hover { background: rgba(255, 220, 160, 0.12); }
.chip.active {
  background: rgba(255, 200, 120, 0.22);
  border-color: rgba(255, 214, 150, 0.45);
}

/* ---------- ant tooltip ---------- */
.tip {
  position: absolute;
  max-width: 210px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(20, 13, 8, 0.88);
  border: 1px solid rgba(255, 214, 150, 0.25);
  color: #f0e4cc;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none !important;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.tip b { display: block; font-size: 12.5px; color: #ffd98f; margin-bottom: 1px; }
.tip.hidden { display: none; }

/* ---------- facts panel ---------- */
.facts {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 252px;
  border-radius: 13px;
  background: rgba(24, 16, 10, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 214, 150, 0.14);
  color: #e8d9c0;
  overflow: hidden;
}
.facts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #c9a869;
}
.facts-next {
  background: none;
  border: none;
  color: #c9a869;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  transition: transform 0.3s;
}
.facts-next:hover { transform: rotate(80deg); color: #ffd98f; }
.facts-body {
  padding: 2px 12px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2d3b4;
  transition: opacity 0.18s;
  min-height: 60px;
}

/* ---------- colony readout ---------- */
.readout {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(24, 16, 10, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 214, 150, 0.12);
  color: #d8c8a8;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.readout b { color: #ffd98f; font-weight: 600; }

/* ---------- hint ---------- */
.hint {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 13, 8, 0.72);
  border: 1px solid rgba(255, 214, 150, 0.2);
  color: #efe2c4;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  transition: opacity 1.2s;
  white-space: nowrap;
  max-width: 92vw;
  pointer-events: none !important;
}
.hint.fade { opacity: 0; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .facts { display: none; }
  .tool { padding: 6px 7px; }
  .tool .lb { display: none; }
  .readout { font-size: 10px; gap: 8px; padding: 6px 10px; }
  .hint { font-size: 11px; top: auto; bottom: 74px; }
}
