html,
body {
  height: 100%;
  margin: 0;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Header info styling */
.header-info {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 400px;
}

.header-info h1 {
  margin: 0 0 5px 0;
  font-size: clamp(18px, 2vw, 24px);
  color: #2c3e50;
  font-weight: 700;
}

.header-info p {
  margin: 0;
  font-size: clamp(12px, 1.2vw, 14px);
  color: #555;
}

/* Legend styling */
.legend {
  position: fixed;
  top: 140px;
  right: 20px;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 350px;
}

.legend h3 {
  margin: 0 0 10px 0;
  font-size: clamp(14px, 1.4vw, 16px);
  color: #2c3e50;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: clamp(11px, 1.1vw, 13px);
  color: #333;
}

.legend-icon {
  font-size: clamp(16px, 1.6vw, 20px);
  margin-right: 10px;
  min-width: 25px;
}

/* Map legend styling */
.map-legend {
  position: fixed;
  top: 38%;
  left: 3%;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 240px;
  max-width: 280px;
}

.map-legend h4 {
  margin: 0 0 10px 0;
  font-size: clamp(13px, 1.3vw, 15px);
  color: #2c3e50;
  font-weight: 600;
}

.color-gradient {
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(to right, #c0392b 0%, #f1c40f 50%, #27ae60 100%);
  margin-bottom: 5px;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, 1vw, 12px);
  color: #555;
}

.country-selector {
  position: absolute;
  bottom: 50%;
  right: 85%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.selector-label {
  font-size: clamp(11px, 0.9vw, 13px);
  color: #2c3e50;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
}

#country-toggle {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: clamp(11px, 0.85vw, 14px);
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

#country-toggle:hover {
  background: rgba(255, 255, 255, 1);
}

#country-dropdown {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: clamp(11px, 0.85vw, 14px);
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
  overflow: hidden;
  background-color: #202020;
}

.bg-piece {
  position: absolute;
  display: block;
  object-fit: cover;
  width: auto;
  height: auto;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.bg .wall {
  left: 0;
  top: 100;
  width: 100%;
  height: 85%;
}

.bg .window {
  right: 0;
  top: 0;
  width: 35%;
  height: 85%;
}

.bg .floor {
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  width: 100%;
}

.content {
  z-index: 1;
  position: relative;
  height: 100%;
  width: 100%;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.desk-setup {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
}

.desk {
  display: block;
  width: 100%;
}

.monitor {
  position: absolute;
  bottom: 99%;
  left: 45%;
  transform: translateX(-50%);
  width: 66%;
}

.phone1 {
  position: absolute;
  bottom: 41%;
  right: 72%;
  width: 11%;
  rotate: -5deg;
}
.phone2 {
  position: absolute;
  bottom: 67%;
  right: 40%;
  width: 11%;
  rotate: -2deg;
}
.phone3 {
  position: absolute;
  bottom: 67%;
  right: 34%;
  width: 11%;
  rotate: 1deg;
}
.phone4 {
  position: absolute;
  bottom: 67%;
  right: 28%;
  width: 11%;
  rotate: 5deg;
}
.paper1 {
  position: absolute;
  bottom: 44%;
  left: 1%;
  width: 22%;
  rotate: 0deg;
  pointer-events: auto;
}

.paper2 {
  position: absolute;
  bottom: 24%;
  left: 51%;
  width: 21%;
  rotate: 0deg;
}
.paper3 {
  position: absolute;
  bottom: 24%;
  left: 63%;
  width: 21%;
  rotate: -4deg;
}
.paper4 {
  position: absolute;
  bottom: 24%;
  left: 75%;
  width: 21%;
  rotate: -4deg;
}

.paper1-flag {
  position: absolute;
  bottom: 76%;
  left: 9%;
  width: 5%;
  height: auto;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.paper2-flag {
  position: absolute;
  bottom: 53%;
  left: 59%;
  width: 5%;
  height: auto;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.paper3-flag {
  position: absolute;
  bottom: 52%;
  left: 71%;
  width: 5%;
  height: auto;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.paper4-flag {
  position: absolute;
  bottom: 53%;
  left: 83%;
  width: 5%;
  height: auto;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.plant1 {
  position: absolute;
  bottom: 80%;
  right: 73%;
  width: 9%;
  z-index: 2;
}
.plant2 {
  position: absolute;
  bottom: 84%;
  right: 21%;
  width: 9%;
  z-index: 2;
}
.plant3 {
  position: absolute;
  bottom: 84%;
  right: 13%;
  width: 9%;
  z-index: 2;
}
.plant4 {
  position: absolute;
  bottom: 84%;
  right: 5%;
  width: 9%;
  z-index: 2;
}
.onscreen {
  position: absolute;
  bottom: 107%;
  right: 22.5%;
  width: 65%;
}

.map-container {
  position: relative;
  top: 3%;
  left: 3%;
  width: 32vw;
  max-width: 720px;
  aspect-ratio: 2 / 1;
  border: 2px solid #111;
  border-radius: 0px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: -10;
  overflow: visible;
  transform-origin: top left;
  will-change: transform;
}

#worldMap {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  resize: none !important;
  transform: translateY(10%);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

.controls {
  position: absolute;
  bottom: 3%;
  left: 3%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 0.3em 0.6em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-size: clamp(11px, 0.85vw, 14px);
  line-height: 1.2;
  width: auto;
  pointer-events: auto;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.controls h3 {
  margin: 0 0 5px 0;
  font-size: clamp(12px, 1vw, 15px);
  color: #2c3e50;
  font-weight: 600;
}

.controls-hint {
  margin: 0 0 8px 0;
  font-size: clamp(9px, 0.75vw, 11px);
  color: #666;
  font-style: italic;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0;
  white-space: nowrap;
}

.controls input {
  transform: scale(0.8);
}

.map-title {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  text-align: right;
  pointer-events: none;
}

.map-title h2 {
  margin: 0 0 2px 0;
  font-size: clamp(11px, 1vw, 14px);
  color: #2c3e50;
  font-weight: 600;
}

.map-title p {
  margin: 0;
  font-size: clamp(9px, 0.85vw, 11px);
  color: #666;
}

.desk,
.paper1,
.paper2,
.paper3,
.plant1,
.plant2,
.plant3,
.phone1,
.phone2,
.phone3 {
  pointer-events: auto !important;
  transition: filter 0.3s ease;
}

.paper1:hover,
.paper2:hover,
.paper3:hover,
.plant1:hover,
.plant2:hover,
.plant3:hover,
.phone1:hover,
.phone2:hover,
.phone3:hover {
  cursor: pointer;
  z-index: 10;
  filter: brightness(0.85);
}

.map-zoom-lens {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  border: 2px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.map-zoom-lens img {
  position: absolute;
  user-select: none;
  pointer-events: none;
  transform-origin: top left;
  width: 150px;
  height: 150px;
}

.map-hover-layer {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: none;
}

.popup {
  position: absolute;
  display: none; /* shown via JS */
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #bdbdbd;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  padding: 0.75rem 0.9rem;
  width: clamp(180px, 14vw, 260px); /* scales with viewport */
  pointer-events: auto;
}

.popup h4 {
  margin: 0 0 0.5rem 0;
  font: 600 clamp(12px, 1.1vw, 14px) / 1.2 "Lato", system-ui, -apple-system,
    Segoe UI, Roboto, Arial, sans-serif;
  color: #222;
}

.popup .bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: clamp(8px, 0.9vw, 12px);
  align-items: end; /* align bars on baseline */
  height: clamp(90px, 12vw, 140px); /* chart area height scales */
}

.popup .bar {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
}

.popup .bar .col {
  border-radius: 4px;
  background: #dcdcdc; /* default gray; NL overridden to blue */
  transition: transform 0.15s ease;
}

.popup .bar .col:hover {
  transform: translateY(-3px);
}

.popup .bar label {
  text-align: center;
  font-size: clamp(10px, 0.9vw, 12px);
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup .note {
  margin-top: 0.4rem;
  font-size: clamp(9px, 0.85vw, 11px);
  color: #666;
}

html {
  zoom: 100%; /* locks global zoom baseline */
}

.slope1,
.slope2,
.slope3 {
  position: absolute;
  pointer-events: none;
  width: 18%;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 20;
}

.slope1 {
  bottom: 130%;
  right: 10%;
}
.slope2 {
  bottom: 128%;
  right: 5%;
}
.slope3 {
  bottom: 110%;
  right: 9%;
}

.slope-visible {
  opacity: 1;
}

.hidden {
  display: none;
}

.hover-zone {
  position: absolute;
  width: 7%;
  height: 10%;
  background: rgba(255, 0, 0, 0);
  cursor: pointer;
  z-index: 5;
}

.zone1 {
  bottom: 153%;
  right: 28%;
}
.zone2 {
  bottom: 141%;
  right: 22%;
}
.zone3 {
  bottom: 128%;
  right: 27%;
}

.slope4,
.slope5,
.slope6 {
  position: absolute;
  pointer-events: none;
  width: 18%;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 20;
}

.slope4 {
  bottom: 130%;
  left: 2%;
}
.slope5 {
  bottom: 115%;
  left: 2%;
}
.slope6 {
  bottom: 100%;
  left: 2%;
}

.zone4,
.zone5,
.zone6 {
  position: absolute;
  width: 7%;
  height: 10%;
  background: rgba(255, 0, 0, 0);
  cursor: pointer;
  z-index: 5;
}

.zone4 {
  bottom: 142%;
  left: 20%;
}
.zone5 {
  bottom: 130%;
  left: 20%;
}
.zone6 {
  bottom: 117%;
  left: 20%;
}

.slope-visible {
  opacity: 1;
}

/* Popup SVGs for consistent countries (flags on building) */
.flag-slope1,
.flag-slope2,
.flag-slope3 {
  position: absolute;
  pointer-events: none;
  width: 18%;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 20;
}

/* Tune these 3 positions so the popups sit nicely near the flag on the building */
.flag-slope1 {
  bottom: 170%;
  right: 50%;
} /* biggest popup */
.flag-slope2 {
  bottom: 170%;
  right: 45%;
}
.flag-slope3 {
  bottom: 170%;
  right: 40%;
}

/* Hover areas over the 3 flags on the building */
.flag-hover {
  position: absolute;
  width: 6%;
  height: 8%;
  background: rgba(255, 0, 0, 0); /* invisible hit area */
  cursor: pointer;
  z-index: 5;
}

/* Adjust these three to sit directly on top of the flags */
.flag-hover1 {
  bottom: 165%;
  right: 58%;
}
.flag-hover2 {
  bottom: 165%;
  right: 52%;
}
.flag-hover3 {
  bottom: 165%;
  right: 46%;
}

.slope-visible {
  opacity: 1;
}
