:root {
  --bg: #0e1521;
  --panel-bg: #141f2e;
  --ink: #e8edf4;
  --muted: #8ba0b8;
  --accent: #6ee7b7;
  --bugfix: #e08f4e;
  --feature: #6ab0f3;
  --infra: #b593e8;
  --research: #e8c15c;
  --deploy: #6ee7b7;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  height: 100%;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(180deg, #121c2a, #0e1521);
  border-bottom: 1px solid #1f2b3d;
  position: relative;
  z-index: 3;
}

.brand { font-weight: 700; letter-spacing: 0.02em; display: flex; gap: 8px; align-items: center; }
.brand-icon { color: var(--accent); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; display: inline-block; border-radius: 2px; }
.swatch.bugfix { background: var(--bugfix); }
.swatch.feature { background: var(--feature); }
.swatch.infra { background: var(--infra); }
.swatch.research { background: var(--research); }
.swatch.deploy { background: var(--deploy); }

main {
  position: relative;
  width: 100%;
  height: calc(100% - 96px);
  overflow: hidden;
}

#village {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: grab;
  background: radial-gradient(ellipse at 50% 30%, #1a2636 0%, #0b1119 70%);
}
#village:active { cursor: grabbing; }

.hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  background: rgba(10, 16, 24, 0.6);
  padding: 4px 10px;
  border-radius: 10px;
  pointer-events: none;
}

.panel {
  position: fixed;
  top: 70px;
  right: 18px;
  width: 300px;
  max-width: calc(100vw - 36px);
  background: var(--panel-bg);
  border: 1px solid #253448;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 10;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.panel.hidden { opacity: 0; transform: translateY(-6px); pointer-events: none; }

.panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.panel-close:hover { color: var(--ink); }

.panel-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
#panel-title { font-size: 16px; margin: 0 0 4px 0; }
.panel-date { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
#panel-desc { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 0; }

.footer {
  padding: 8px 18px;
  font-size: 11px;
  color: var(--muted);
  background: #0e1521;
  border-top: 1px solid #1f2b3d;
  position: relative;
  z-index: 3;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.sep { margin: 0 8px; opacity: 0.5; }

@media (max-width: 720px) {
  .legend { display: none; }
  .panel { left: 18px; right: 18px; width: auto; }
}
