/* Country detail page — buildings roadmap */

.buildings-road {
  position: relative;
  padding: 16px 0 0;
}

/* SVG road path */
.bld-road-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Building node */
.bld-node {
  position: relative;
  z-index: 1;
  display: flex;
  margin-bottom: 18px;
  cursor: pointer;
}
.bld-node:active { opacity: 0.8; }

/* Zigzag positioning */
.bld-node.pos-right {
  justify-content: flex-end;
  padding-right: 10px;
}
.bld-node.pos-left {
  justify-content: flex-start;
  padding-left: 10px;
}

/* Building column: image + progress bar */
.bld-building {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
}

/* Image wrapper */
.bld-img-wrap {
  width: 160px;
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  transition: all 0.2s;
}
.bld-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* States */
.bld-img-wrap.state-absent img {
  filter: grayscale(1) brightness(0.4);
}
.bld-img-wrap.state-damaged img {
  filter: sepia(1) saturate(5) hue-rotate(-30deg) brightness(0.5) blur(0.5px);
}
.bld-img-wrap.state-active {
  /* normal, no filter */
}
.bld-img-wrap.state-building img {
  filter: brightness(0.8);
}
/* Overlay icons for damaged/absent */
.bld-img-wrap .bld-state-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}
.bld-img-wrap.state-damaged .bld-state-icon {
  color: #ef4444;
}
.bld-img-wrap.state-absent .bld-state-icon {
  color: #94a3b8;
}
/* Harmonious circular badge for under-construction / absent state */
.bld-img-wrap .bld-state-badge {
  position: absolute;
  right: 10%;
  bottom: 10%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 2;
  pointer-events: none;
}
.bld-img-wrap .bld-state-badge .lc {
  width: 20px;
  height: 20px;
  color: #cbd5e1;
}

/* Progress bar under building */
.bld-node-progress {
  width: 200px;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.bld-node-progress > div {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s;
}
.bld-node-progress .fill-green { background: #22c55e; }
.bld-node-progress .fill-yellow { background: #f59e0b; }
.bld-node-progress .fill-accent { background: var(--accent); }

/* Guard inline panel (right of checkpoint) */
.guard-inline-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  width: 140px;
  flex-shrink: 0;
  margin-left: 6px;
}
.guard-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.guard-inline-header .g-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.guard-inline-header .g-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.guard-inline-header .g-count .g-max {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}
.guard-inline-def {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  margin-top: -2px;
}
.guard-inline-def .g-delta {
  color: #22c55e;
  font-weight: 700;
}
.guard-inline-controls {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
}
.guard-pm-btn {
  width: 26px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.guard-pm-btn:active { background: rgba(255,255,255,0.08); }
.guard-inline-controls input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  box-shadow: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.guard-inline-controls input:focus {
  outline: none;
  box-shadow: none;
  border-left-color: rgba(255,255,255,0.06);
  border-right-color: rgba(255,255,255,0.06);
}
.guard-inline-controls input::-webkit-outer-spin-button,
.guard-inline-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.guard-hire-btn {
  padding: 7px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guard-hire-btn:active {
  background: rgba(255,255,255,0.08);
  transform: scale(0.98);
}
.guard-hire-btn .g-cost {
  color: var(--gold, #fbbf24);
  font-weight: 700;
}
.guard-max-label {
  padding: 8px 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
