:root {
  --ink: #111;
  --bg: #f7f4ee;
  --panel: rgba(255, 255, 255, 0.94);
  --rule: #d8d2c5;
  --accent: #2a4d8f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

#map { position: absolute; inset: 0; }

.panel {
  position: absolute;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.45;
  z-index: 5;
}

.panel-tl {
  top: 14px;
  left: 14px;
  max-width: 420px;
}

.panel-tr {
  top: 14px;
  right: 14px;
  max-width: 280px;
}

h1 {
  font-size: 18px;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.dek {
  margin: 0;
  color: #333;
  font-size: 12.5px;
}

.big-toggle {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  z-index: 6;
}

.big-toggle-btn {
  background: transparent;
  border: 0;
  padding: 12px 28px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 120ms ease, color 120ms ease;
}

.big-toggle-btn:hover { color: #111; }

.big-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.big-toggle-btn.active .kbd-hint {
  background: rgba(255, 255, 255, 0.22);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.kbd-hint {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  background: #eee6d4;
  color: #555;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.2;
}

@media (max-width: 700px) {
  .big-toggle { top: 8px; }
  .big-toggle-btn { padding: 10px 18px; font-size: 14px; }
  .kbd-hint { display: none; }
}

.toggle {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.toggle button {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #444;
}

.toggle button.active {
  background: var(--accent);
  color: white;
}

.legend { margin-bottom: 8px; }
.legend.hidden { display: none; }

.legend-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
}

.multiplier-note {
  font-weight: 400;
  color: #666;
}

.ramp {
  height: 10px;
  border-radius: 2px;
  margin: 4px 0 2px;
}

.ramp-pop {
  background: linear-gradient(to right, #fde725, #5ec962, #21918c, #3b528b, #440154);
}

.ramp-bldg {
  background: linear-gradient(to right, #f7f4f9, #d4b9da, #df65b0, #ce1256, #67001f);
}

.ramp-bldg-styled {
  background: linear-gradient(to right, #f5e6b8 0%, #ffb084 20%, #ff6b9a 40%, #a946e0 60%, #3fc7ff 80%, #ffe34f 100%);
}

.ramp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #555;
}

.multiplier {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #333;
}

.multiplier select {
  font: inherit;
  margin-left: 4px;
}

.links {
  margin: 6px 0 0 0;
  font-size: 11.5px;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(17, 17, 17, 0.92);
  color: white;
  padding: 6px 9px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 10;
  white-space: nowrap;
  transform: translate(8px, 8px);
}

.tooltip.hidden { display: none; }
.tooltip strong { font-weight: 600; }

.rotate-row {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
}

.ghost-btn {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #333;
  flex: 0 0 auto;
}

.ghost-btn:hover { background: #f0ebde; }

.ghost-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#btn-orbit { flex: 1; }

.hint {
  margin: 4px 0 8px;
  font-size: 11px;
  color: #666;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .panel-tl { max-width: calc(100% - 28px); }
  .panel-tr {
    max-width: calc(100% - 28px);
    top: auto;
    bottom: 14px;
    right: 14px;
    left: 14px;
  }
}
