/* ── Cylinder City Modal ───────────────────────────────────────────────────── */
#cylinder-city-btn {
  background: linear-gradient(135deg, #103a44, #082028);
  border: 1.5px solid #2a8aa8;
  border-radius: 8px;
  color: #9be0f0;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
  letter-spacing: 0.02em;
  box-shadow: 0 0 10px 2px rgba(70, 180, 220, 0.30), 0 0 20px 4px rgba(70, 180, 220, 0.15);
}
#cylinder-city-btn:hover {
  background: linear-gradient(135deg, #1a566a, #0c3040);
  border-color: #4ec0e0;
  color: #d0f4ff;
  box-shadow: 0 0 14px 3px rgba(110, 220, 255, 0.55), 0 0 28px 6px rgba(70, 180, 220, 0.32);
}

.ccity-modal {
  background: #0a1418;
  border: 1.5px solid #2a8aa8;
  border-radius: 16px;
  padding: 18px 18px 16px;
  max-width: 1480px;
  width: 96vw;
  height: 96vh;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 28px rgba(70, 180, 220, 0.2);
  font-family: Calibri, sans-serif;
}
.ccity-x-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
}
.ccity-newcity-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: linear-gradient(135deg, #2a5a30, #143c1c);
  border: 1.5px solid #6cc066;
  color: #d4f0c8;
  font-family: Calibri, sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 7px 17px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 10px 2px rgba(108, 192, 102, 0.30), 0 0 20px 4px rgba(108, 192, 102, 0.12);
}
.ccity-newcity-btn:hover {
  background: linear-gradient(135deg, #3c7a40, #1f562c);
  border-color: #8edc88;
  color: #f0ffe4;
  box-shadow: 0 0 14px 3px rgba(140, 220, 130, 0.55), 0 0 28px 6px rgba(108, 192, 102, 0.32);
}
.ccity-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-right: 60px;
  padding-left: 130px;
}
.ccity-title {
  color: #9be0f0;
  text-shadow: 0 0 10px rgba(110, 220, 255, 0.4);
  margin: 0;
}
.ccity-sub {
  color: #6da8b8;
  font-size: 17px;
  font-weight: 600;
  font-family: Calibri, sans-serif;
}
.ccity-sub b { color: #d0f4ff; }
.ccity-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #06101a;
  border: 1px solid #1a4a5a;
  border-radius: 10px;
  touch-action: none;       /* drag-pan, not browser scroll, on touch */
  position: relative;       /* containing block for the floating zoom controls */
}
/* Floating +/- zoom controls. Position is absolute inside the wrap, but
   a JS scroll listener translates them by scrollLeft/scrollTop so they
   stay pinned to the visible top-left corner regardless of pan state. */
.ccity-zoom-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;     /* let drag-pan reach the canvas underneath */
  will-change: transform;
}
.ccity-zoom-btn {
  pointer-events: auto;     /* but the buttons themselves stay clickable */
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 220, 240, 0.40);
  color: #d0e8ff;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.15s;
}
.ccity-zoom-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.55);
  border-color: #6cc0e0;
  color: #fff;
  box-shadow: 0 0 10px 2px rgba(110, 220, 255, 0.4);
}
.ccity-zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#ccity-canvas {
  display: block;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#ccity-canvas.ccity-grabbing {
  cursor: grabbing;
}
.ccity-hint {
  color: #4d8090;
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  font-family: Calibri, sans-serif;
}

/* ── Build Toolbar ──────────────────────────────────────────────────── */
.ccity-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: #0d1a22;
  border: 1px solid #2a4a5a;
  border-radius: 8px;
  flex-shrink: 0;
  align-items: stretch;
}
.ccity-tool-group {
  position: relative;
  display: inline-flex;
}
.ccity-tool-btn {
  background: #0d1418;
  border: 1px solid #2a8aa8;
  color: #9be0f0;
  font-family: Calibri, sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.ccity-tool-btn:hover {
  background: #1a3540;
  border-color: #4ec0e0;
  color: #d0f4ff;
}
.ccity-tool-btn.ccity-tool-active {
  background: #245060;
  border-color: #6ed0f0;
  color: #fff;
  box-shadow: 0 0 8px rgba(110, 220, 255, 0.5);
}
.ccity-flyout {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #0d1a22;
  border: 1px solid #2a8aa8;
  border-radius: 6px;
  padding: 5px;
  z-index: 12;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  min-width: 100px;
}
.ccity-flyout.ccity-hidden { display: none; }

/* ── Isometric toggle button (in modal header banner) ─────────────────── */
.ccity-iso-btn {
  background: #0d1418;
  border: 1.5px solid #2a8aa8;
  color: #9be0f0;
  font-family: Calibri, sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 7px 17px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.18s;
}
.ccity-iso-btn:hover {
  background: #1a3540;
  border-color: #4ec0e0;
  color: #d0f4ff;
}
.ccity-iso-btn.ccity-iso-active {
  background: #245060;
  border-color: #6ed0f0;
  color: #fff;
  box-shadow: 0 0 8px rgba(110, 220, 255, 0.5);
}

/* ── New City confirmation popup ──────────────────────────────────────
   Same layout as the shared minigame close-confirm dialog, but with
   the cylinder-city blue palette so it reads as part of this UI. */
#ccity-newcity-confirm {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  font-family: Calibri, sans-serif;
}
#ccity-nc-box {
  background: rgba(10, 24, 32, 0.92);
  border: 1.5px solid #2a8aa8;
  border-radius: 14px;
  padding: 22px 28px;
  text-align: center;
  box-shadow: 0 0 32px 8px rgba(70, 180, 220, 0.40);
  min-width: 320px;
  max-width: 440px;
}
#ccity-nc-msg {
  font-size: 22px;
  color: #d0f4ff;
  margin-bottom: 18px;
  line-height: 1.5;
  font-weight: 700;
}
#ccity-nc-sub {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  color: #6da8b8;
  font-weight: 500;
}
#ccity-nc-sub b { color: #d0f4ff; }
#ccity-nc-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}
#ccity-nc-yes,
#ccity-nc-no {
  font-family: Calibri, sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 26px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
#ccity-nc-yes {
  background: linear-gradient(135deg, #2a5a30, #143c1c);
  border: 1px solid #6cc066;
  color: #d4f0c8;
}
#ccity-nc-yes:hover {
  background: linear-gradient(135deg, #3c7a40, #1f562c);
  color: #f0ffe4;
  box-shadow: 0 0 12px 2px rgba(108, 192, 102, 0.5);
}
#ccity-nc-no {
  background: #0d1a22;
  border: 1px solid #2a8aa8;
  color: #9be0f0;
}
#ccity-nc-no:hover {
  background: #1a3540;
  border-color: #4ec0e0;
  color: #d0f4ff;
  box-shadow: 0 0 12px 2px rgba(110, 220, 255, 0.45);
}
