:root {
  --background: #07111f;
  --foreground: #eef6ff;
  --panel: rgba(8, 18, 33, 0.76);
  --panel-strong: rgba(13, 29, 52, 0.92);
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(59, 130, 246, 0.32), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(168, 85, 247, 0.24), transparent 28rem),
    linear-gradient(135deg, #07111f 0%, #0e223c 48%, #07111f 100%);
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.map-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 20px;
  height: 100vh;
  min-height: 0;
  padding: 20px;
}

.toolbar {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: stretch;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(139, 197, 255, 0.48) rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.toolbar::-webkit-scrollbar {
  width: 10px;
}

.toolbar::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.toolbar::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 18, 33, 0.74);
  border-radius: 999px;
  background: rgba(139, 197, 255, 0.55);
}

.eyebrow {
  margin: 0 0 10px;
  color: #8bc5ff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.hint {
  margin: 16px 0 0;
  color: rgba(238, 246, 255, 0.72);
  line-height: 1.6;
}

kbd {
  display: inline-flex;
  min-width: 1.65em;
  justify-content: center;
  padding: 0.05em 0.35em;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom-width: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 800;
}

.status-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

.status-card span,
.control-card span {
  display: block;
  margin-bottom: 8px;
  color: rgba(238, 246, 255, 0.54);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.control-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.control-card select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px;
  background: #0d1d34;
  color: white;
  outline: none;
}

.control-card small {
  display: block;
  margin-top: 8px;
  color: rgba(238, 246, 255, 0.52);
  font-size: 0.76rem;
  line-height: 1.45;
}

.status-card strong {
  display: block;
  min-height: 1.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card.compact strong {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.status-card small {
  display: block;
  margin-top: 8px;
  color: rgba(238, 246, 255, 0.56);
  line-height: 1.4;
}

.palette {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  aspect-ratio: 1;
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), transparent 42%),
    var(--swatch);
  color: white;
  cursor: pointer;
  box-shadow: inset 0 -12px 18px rgba(0, 0, 0, 0.18), 0 10px 24px rgba(0, 0, 0, 0.2);
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.swatch:hover {
  filter: saturate(1.18) brightness(1.08);
  transform: translateY(-2px);
}

.swatch[data-active="true"] {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

.swatch span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  font-weight: 900;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.actions button {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.actions button:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.map-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  background: #07111f;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

canvas:active {
  cursor: grabbing;
}

.zoom-meter {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 18, 33, 0.72);
  backdrop-filter: blur(14px);
}

.zoom-meter span {
  color: rgba(238, 246, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zoom-meter strong {
  font-size: 0.9rem;
}

.attribution {
  position: absolute;
  left: 18px;
  bottom: 18px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(8, 18, 33, 0.58);
  color: rgba(238, 246, 255, 0.58);
  font-size: 0.72rem;
  backdrop-filter: blur(14px);
}

.loading-note {
  fill: rgba(238, 246, 255, 0.72);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-anchor: middle;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .map-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 12px;
  }

  .toolbar {
    border-radius: 24px;
    max-height: none;
    overflow: visible;
  }

  .map-card {
    min-height: 62vh;
    border-radius: 24px;
  }

}
