/**
 * hud-ck.css - Cities & Knights Event Die, Barbarian Fleet Track, and City Improvements
 */

.die-event {
  font-size: 16px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.die-event .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.die-event .ico svg {
  width: 24px;
  height: 24px;
}

.die-event.event-barbarian {
  background: linear-gradient(180deg, #334155, #0f172a);
  color: #fef3c7;
  border-color: #d97706;
}

.die-event.event-trade {
  background: linear-gradient(180deg, #ffd166, #ffb703);
  color: #422006;
}

.die-event.event-politics {
  background: linear-gradient(180deg, #48cae4, #219ebc);
  color: #023047;
}

.die-event.event-science {
  background: linear-gradient(180deg, #95d5b2, #52b788);
  color: #081c15;
}

.die-event.event-flash {
  animation: shakeDice 0.45s ease-in-out;
}

.barbarian-track {
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.barbarian-track.barbarian-warning {
  border-color: #f43f5e;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
  animation: pulse-danger 2s infinite ease-in-out;
}

.barbarian-track.barbarian-danger {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(88, 28, 28, 0.6) 0%, rgba(30, 27, 75, 0.7) 100%);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.barbarian-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.barbarian-track-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fecdd3;
}

.barbarian-icon {
  font-size: 14px;
}

.barbarian-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(225, 29, 72, 0.25);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.barbarian-voyage-container {
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  display: flex;
  align-items: center;
}

.barbarian-voyage-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 36px;
  height: 3px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.3) 0%, rgba(244, 63, 94, 0.6) 100%);
  border-radius: 2px;
  z-index: 1;
}

.barbarian-ship-wrapper {
  position: absolute;
  top: 2px;
  left: 0;
  width: 34px;
  height: 28px;
  z-index: 3;
  transition: left 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.barbarian-ship-wrapper.ship-warning {
  filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.8));
  animation: ship-bob 1.5s infinite ease-in-out;
}

.barbarian-ship-wrapper.ship-danger {
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 1));
  animation: ship-bob 0.8s infinite ease-in-out;
}

@keyframes ship-bob {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(2deg);
  }
}

.barbarian-waypoints {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  z-index: 2;
}

.barbarian-waypoint {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid rgba(148, 163, 184, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.barbarian-waypoint.passed {
  background: #e11d48;
  border-color: #fda4af;
  box-shadow: 0 0 6px rgba(225, 29, 72, 0.5);
}

.barbarian-waypoint.current {
  background: #fbbf24;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.barbarian-waypoint.catan-shore {
  border-color: #ef4444;
}

.barbarian-sublabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
  letter-spacing: 0.02em;
}


/* Knights vs Barbarians strength row */
.knights-vs-barb-row {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid oklch(1 0 0 / 0.08);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.kvb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.kvb-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.kvb-vs {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.35);
  letter-spacing: 0.05em;
  padding: 0 1px;
}
.kvb-icon {
  font-size: 13px;
  color: #a78bfa;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.kvb-icon-barb {
  color: #f43f5e;
}
.kvb-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}
.kvb-count {
  font-size: 12px;
  font-weight: 800;
  color: #a78bfa;
  min-width: 14px;
  text-align: right;
  transition: color 0.3s ease;
}
.kvb-count.kvb-safe   { color: #4ade80; }
.kvb-count.kvb-warn   { color: #fbbf24; }
.kvb-count.kvb-danger { color: #f87171; }
.kvb-barb-count {
  color: #f43f5e;
}
.kvb-bar-track {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: oklch(1 0 0 / 0.08);
  overflow: hidden;
}
.kvb-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease, background-color 0.3s ease;
  background: #4ade80;
}
.kvb-bar-fill.kvb-warn   { background: #fbbf24; }
.kvb-bar-fill.kvb-danger { background: #f87171; }
.ck-improvements-panel {
  flex-direction: column;
  gap: 10px;
  background: oklch(1 0 0 / 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px;
}

.ck-panel-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.ck-improvements-panel.collapsed .improvement-track {
  display: none;
}



.improvement-track.track-metro {
  outline: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 6px;
  background: rgba(251, 191, 36, 0.08);
}

.improvement-track {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.track-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.track-trade {
  color: #ffb703;
}

.track-politics {
  color: #219ebc;
}

.track-science {
  color: #52b788;
}

.track-progress {
  height: 6px;
  border-radius: 99px;
  background: oklch(1 0 0 / 0.08);
  overflow: hidden;
}

.track-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 0.25s ease;
}

.track-fill-trade {
  background: #ffb703;
}

.track-fill-politics {
  background: #219ebc;
}

.track-fill-science {
  background: #52b788;
}

.track-perk {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-secondary);
}

.improvement-track.track-perk-on .track-perk {
  color: inherit;
}

.btn-improve {
  width: 100%;
  font-size: 11px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.btn-improve .improve-cost {
  font-weight: 800;
  color: var(--gold-primary);
}

.improvement-track.track-ready .btn-improve {
  border-color: var(--gold-primary);
}


/* Color theme for bank pill icons matching the hexes */
.bank-pill.bank-res-wood {
  border-color: rgba(45, 106, 79, 0.4);
  background: rgba(45, 106, 79, 0.18);
}

.bank-pill.bank-res-wood .bank-pill-icon {
  color: #52b788;
}

.bank-pill.bank-res-brick {
  border-color: rgba(217, 4, 41, 0.4);
  background: rgba(217, 4, 41, 0.18);
}

.bank-pill.bank-res-brick .bank-pill-icon {
  color: #ff6b6b;
}

.bank-pill.bank-res-wool {
  border-color: rgba(116, 198, 157, 0.4);
  background: rgba(116, 198, 157, 0.18);
}

.bank-pill.bank-res-wool .bank-pill-icon {
  color: #99d98c;
}

.bank-pill.bank-res-wheat {
  border-color: rgba(224, 159, 62, 0.4);
  background: rgba(224, 159, 62, 0.18);
}

.bank-pill.bank-res-wheat .bank-pill-icon {
  color: #ffe6a7;
}

.bank-pill.bank-res-ore {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.18);
}

.bank-pill.bank-res-ore .bank-pill-icon {
  color: #e2e8f0;
}

.bank-pill.bank-com-cloth {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.18);
}

.bank-pill.bank-com-cloth .bank-pill-icon {
  color: #a5b4fc;
}

.bank-pill.bank-com-coin {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.18);
}

.bank-pill.bank-com-coin .bank-pill-icon {
  color: #fde047;
}

.bank-pill.bank-com-paper {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.18);
}

.bank-pill.bank-com-paper .bank-pill-icon {
  color: #6ee7b7;
}

.bank-pill.bank-deck-trade {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.12);
}

.bank-pill.bank-deck-trade .bank-pill-icon {
  color: #facc15;
}

.bank-pill.bank-deck-politics {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.12);
}

.bank-pill.bank-deck-politics .bank-pill-icon {
  color: #60a5fa;
}

.bank-pill.bank-deck-science {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.12);
}

.bank-pill.bank-deck-science .bank-pill-icon {
  color: #4ade80;
}

.bank-pill.bank-deck-dev {
  border-color: rgba(192, 132, 252, 0.35);
  background: rgba(192, 132, 252, 0.12);
}

.bank-pill.bank-deck-dev .bank-pill-icon {
  color: #c084fc;
}

.bank-pill-label {
  color: var(--text-secondary);
  font-size: 10px;
}

.bank-pill-count {
  font-weight: 700;
  color: #fff;
  background: oklch(1 0 0 / 0.18);
  padding: 0 4px;
  border-radius: 4px;
  min-width: 16px;
  text-align: center;
}

.bank-strip-right {
  display: flex;
  align-items: center;
}

.btn-defense-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-defense-summary.safe {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.btn-defense-summary.danger {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  animation: pulse-danger-border 1.8s infinite ease-in-out;
}

@keyframes pulse-danger-border {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

