* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  background: #0b1622;
  color: #cfe6ff;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
#game {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
}
#game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.overlay {
  position: fixed;
  left: 0; right: 0;
  display: flex; gap: 1rem; align-items: center;
  padding: 0.6rem 1rem;
  pointer-events: none;
  z-index: 10;
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.overlay > * { pointer-events: auto; }
.overlay.top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0));
}
.overlay.bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  flex-wrap: wrap;
}
.overlay h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#status { color: #ffb56b; font-family: ui-monospace, monospace; }
#status.ok { color: #9be36b; }
#tide { font-family: ui-monospace, monospace; color: #cfe6ff; }
.info { margin-left: auto; opacity: 0.6; font-family: ui-monospace, monospace; font-size: 0.75rem; }

.toolbar { gap: 0.4rem; }
.tool {
  background: rgba(20, 30, 45, 0.7);
  color: #e8f4ff;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  backdrop-filter: blur(6px);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.tool:hover { background: rgba(40,60,90,0.85); }
.tool:active { transform: translateY(1px); }
.tool.active {
  background: #2a4f63;
  border-color: #6bd6ff;
  color: white;
  box-shadow: 0 0 0 2px rgba(107,214,255,0.25);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.scoop  { background: #ffd66b; }
.dot.pack   { background: #9be36b; }
.dot.carve  { background: #ff7b6b; }
.dot.splash { background: #6bd6ff; }

.legend {
  display: inline-flex; gap: 0.5rem; align-items: center;
  font-size: 0.72rem; color: #cfe6ff; opacity: 0.85;
  margin-left: auto;
}
.sw {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.25);
  margin-right: 0.2rem;
  vertical-align: middle;
}
.vlink {
  font-size: 0.72rem; opacity: 0.6; color: #cfe6ff;
  text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.3);
}
.vlink:hover { opacity: 1; }

.hint {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.6;
  font-family: ui-monospace, monospace;
}

/* Minimap — top-right */
#minimap {
  top: 56px; right: 12px; left: auto;
  width: 200px;
  background: rgba(10, 18, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.6rem;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.mini-title {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ec9e8;
  opacity: 0.85;
}
#mini-canvas {
  position: relative;
  width: 100%;
  height: 130px;
  background: linear-gradient(180deg, #1a3148 0%, #2c5070 50%, #4a7e8e 100%);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.mini-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.mini-node.available { background: rgba(155, 227, 107, 0.55); border-color: #9be36b; }
.mini-node.here { background: #ffd66b; border-color: #fff; box-shadow: 0 0 8px #ffd66b; }
.mini-node.locked { opacity: 0.4; }
.mini-node:hover { transform: translate(-50%, -50%) scale(1.15); }
.mini-edge {
  position: absolute;
  height: 1px;
  background: rgba(255,255,255,0.2);
  transform-origin: 0 0;
  pointer-events: none;
}
.mini-here {
  font-size: 0.75rem;
  color: #ffd66b;
  text-align: center;
  font-weight: 500;
}

/* Activity feed — left side */
#feed {
  top: 56px; left: 12px; right: auto;
  width: 240px;
  max-height: 260px;
  background: rgba(10, 18, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.6rem;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  overflow: hidden;
}
.feed-title {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ec9e8;
  opacity: 0.85;
}
#feed-list {
  list-style: none;
  margin: 0; padding: 0;
  overflow-y: auto;
  flex: 1;
  font-size: 0.78rem;
  display: flex; flex-direction: column-reverse; /* newest at top */
  max-height: 220px;
}
#feed-list li {
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  color: #cfe6ff;
  border-left: 2px solid transparent;
  transition: background 0.1s;
  line-height: 1.3;
}
#feed-list li:hover {
  background: rgba(107,214,255,0.12);
  border-left-color: #6bd6ff;
}
#feed-list li.kind-tide { border-left-color: #6bd6ff; }
#feed-list li.kind-join { border-left-color: #9be36b; }
#feed-list li.kind-leave { border-left-color: rgba(255,255,255,0.25); opacity: 0.7; }
#feed-list li.kind-build { border-left-color: #ffd66b; }
.feed-ts { opacity: 0.45; font-family: ui-monospace, monospace; font-size: 0.65rem; margin-right: 0.3rem; }

@media (max-width: 700px) {
  #feed, #minimap { width: 150px; }
  #feed-list { max-height: 140px; font-size: 0.7rem; }
}
