:root {
  --bg: #07111a;
  --panel: rgba(7, 17, 26, 0.9);
  --panel-strong: rgba(11, 24, 35, 0.96);
  --panel-soft: rgba(19, 37, 51, 0.86);
  --line: rgba(183, 224, 255, 0.14);
  --text: #eef6fb;
  --muted: #9eb2c2;
  --accent: #8ed1b6;
  --accent-strong: #d1ff87;
  --danger: #f97777;
  --extract: #7de2b3;
  --spawn: #ffd37f;
  --loot: #75b8ff;
  --boss: #ff7b7b;
  --task: #c89cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --ui-font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(35, 85, 90, 0.4), transparent 36%),
    linear-gradient(140deg, #081017, #0c1822 52%, #101b24);
  color: var(--text);
  font-family: var(--ui-font);
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(6, 12, 18, 0.94), rgba(8, 15, 22, 0.84));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand,
.panel,
.viewer-toolbar,
.viewer-stage,
.camera-shell,
.viewer-footer {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand,
.panel {
  background: var(--panel);
  border-radius: var(--radius);
}

.brand {
  padding: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1;
}

.summary,
.meta-copy,
.source-note,
.poi-note,
#selectionDetails {
  color: var(--muted);
}

.summary {
  margin-top: 12px;
  line-height: 1.45;
}

.panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.select-input,
.text-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
}

.select-input:focus,
.text-input:focus,
.toolbar-button:focus,
.ghost-button:focus,
.poi-item:focus {
  outline: 2px solid rgba(209, 255, 135, 0.5);
  outline-offset: 2px;
}

.meta-copy {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.filter-list,
.source-list {
  display: grid;
  gap: 10px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.filter-chip input {
  accent-color: currentColor;
}

.filter-chip[data-kind="extract"] {
  color: var(--extract);
}

.filter-chip[data-kind="spawn"] {
  color: var(--spawn);
}

.filter-chip[data-kind="loot"] {
  color: var(--loot);
}

.filter-chip[data-kind="boss"] {
  color: var(--boss);
}

.filter-chip[data-kind="task"] {
  color: var(--task);
}

.ghost-button,
.toolbar-button,
.poi-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.ghost-button,
.toolbar-button {
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.pill,
.status-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.poi-panel {
  flex: 1;
  min-height: 220px;
}

.poi-list {
  display: grid;
  gap: 10px;
  max-height: 34vh;
  overflow: auto;
}

.poi-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
}

.poi-item strong,
.source-title {
  display: block;
  margin-bottom: 4px;
}

.poi-item.active {
  border-color: rgba(209, 255, 135, 0.34);
  background: rgba(209, 255, 135, 0.08);
}

.poi-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.source-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.source-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.source-item a {
  color: var(--accent-strong);
}

.viewer-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 24px;
}

.viewer-toolbar,
.viewer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.viewer-stage {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(9, 21, 31, 0.7), rgba(10, 19, 27, 0.98)),
    linear-gradient(135deg, rgba(86, 124, 111, 0.4), rgba(51, 73, 98, 0.26));
}

.camera-shell {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 194, 92, 0.18), transparent 28%),
    linear-gradient(160deg, rgba(18, 26, 35, 0.98), rgba(13, 21, 29, 0.94));
}

.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.camera-meta {
  max-width: 420px;
  color: var(--muted);
  text-align: right;
}

.camera-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.camera-scene {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-radius: 26px;
  background:
    linear-gradient(180deg, #8cb6d9 0%, #466786 36%, #1a2b38 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  perspective: 1200px;
}

.camera-sky,
.camera-haze,
.camera-terrain,
.camera-floor,
.camera-layers {
  position: absolute;
  inset: 0;
}

.camera-sky {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 227, 172, 0.55), transparent 14%),
    linear-gradient(180deg, rgba(244, 200, 122, 0.48), rgba(65, 96, 125, 0.06) 44%, transparent 70%);
}

.camera-haze {
  inset: auto 0 25% 0;
  height: 28%;
  background: linear-gradient(180deg, rgba(208, 222, 231, 0), rgba(208, 222, 231, 0.16), rgba(208, 222, 231, 0));
}

.camera-terrain {
  inset: auto -5% 16% -5%;
  height: 42%;
  background:
    linear-gradient(180deg, rgba(76, 99, 84, 0.5), rgba(36, 51, 42, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 14px, rgba(255, 255, 255, 0.01) 14px 28px);
  clip-path: polygon(0 62%, 15% 53%, 32% 57%, 46% 42%, 58% 46%, 74% 35%, 100% 50%, 100% 100%, 0 100%);
}

.camera-floor {
  inset: auto -12% -16% -12%;
  height: 46%;
  background:
    linear-gradient(180deg, rgba(98, 81, 59, 0.28), rgba(56, 44, 31, 0.98)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 32px, rgba(255, 255, 255, 0.02) 32px 64px);
  transform: rotateX(70deg);
  transform-origin: top center;
}

.camera-layers {
  pointer-events: none;
}

.camera-layer {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: max(180px, calc(420px - var(--depth) * 42px));
  transform:
    translateX(-50%)
    translateZ(calc(var(--depth) * 1px))
    translateY(calc(var(--depth) * -5px))
    scale(calc(1.18 - var(--scale-drop)));
  transform-style: preserve-3d;
}

.camera-slab {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    rgba(10, 17, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.camera-slab strong {
  display: block;
  margin-bottom: 6px;
}

.camera-kind {
  color: var(--accent-strong);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.camera-distance {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.camera-sidebar {
  display: grid;
  gap: 14px;
}

.camera-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.camera-focus {
  line-height: 1.45;
  color: var(--text);
}

.camera-neighbors {
  display: grid;
  gap: 10px;
}

.camera-jump {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.camera-jump span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
  overflow: hidden;
  cursor: grab;
}

.map-viewport.dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 1000px;
  transform-origin: top left;
}

.map-image,
.grid-overlay,
.marker-layer {
  position: absolute;
  inset: 0;
}

.map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-overlay {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 100px 100px;
  mix-blend-mode: soft-light;
  border-radius: 28px;
  pointer-events: none;
}

.marker-layer {
  pointer-events: none;
}

.marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}

.marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.marker[data-kind="extract"] {
  background: var(--extract);
}

.marker[data-kind="spawn"] {
  background: var(--spawn);
}

.marker[data-kind="loot"] {
  background: var(--loot);
}

.marker[data-kind="boss"] {
  background: var(--boss);
}

.marker[data-kind="task"] {
  background: var(--task);
}

.marker.active {
  box-shadow: 0 0 0 12px rgba(209, 255, 135, 0.16);
}

.marker-label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.84);
  color: var(--text);
  font-size: 0.78rem;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .poi-list {
    max-height: none;
  }

  .map-viewport {
    min-height: 520px;
  }

  .camera-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .viewer-shell {
    padding: 16px;
  }

  .viewer-toolbar,
  .viewer-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .map-viewport {
    min-height: 420px;
  }

  .camera-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .camera-meta {
    text-align: left;
  }
}
