@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --gold-grad: linear-gradient(180deg, #ffe066 0%, #d4af37 45%, #996515 85%, #5a3c05 100%);
  --red-grad: linear-gradient(180deg, #ff5c8a 0%, #c9184a 45%, #800f2f 85%, #3d0010 100%);
  --blue-grad: linear-gradient(180deg, #64dfdf 0%, #0077b6 45%, #023e8a 85%, #001233 100%);
  --emerald-grad: linear-gradient(180deg, #52b788 0%, #2d6a4f 60%, #081c15 100%);
  --panel-bg: rgba(10, 14, 22, 0.95);
  --panel-bg-card: rgba(18, 24, 38, 0.85);
  --border-gold: #e5b842;
  --border-gold-dark: #6e4e14;
  --border-subtle: rgba(212, 175, 55, 0.25);
  --glow-gold: 0 0 15px rgba(229, 184, 66, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #03070d;
  font-family: 'Rajdhani', sans-serif;
  color: #f1f5f9;
  user-select: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(4, 7, 13, 0.9);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37, #5a3c05);
  border-radius: 4px;
}

/* Header HUD */
#hud-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58px;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.98) 0%, rgba(13, 19, 32, 0.94) 80%, rgba(20, 29, 48, 0.85) 100%);
  border-bottom: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.9), inset 0 -1px 0 rgba(255, 215, 0, 0.3);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  white-space: nowrap;
}

.res-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.9) 0%, rgba(10, 14, 24, 0.95) 100%);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #3d4a63;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 3px 8px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.res-badge:hover {
  border-color: var(--border-gold);
  box-shadow: var(--glow-gold);
}

.badge-god {
  background: linear-gradient(90deg, #d90429, #ffb703) !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  box-shadow: 0 0 18px rgba(255, 183, 3, 0.8) !important;
  text-shadow: 0 1px 3px #000;
}

/* Marching HUD Progress Panel */
#march-hud-panel {
  position: absolute;
  top: 68px;
  right: 16px;
  width: 320px;
  background: var(--panel-bg);
  border: 1.5px solid var(--border-gold);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.95), inset 0 0 15px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.march-bar-container {
  width: 100%;
  height: 10px;
  background: #080c14;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #334155;
  margin-top: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.march-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  transition: width 0.1s linear;
}

/* 3D Floating Interactive Labels */
.bldg-label {
  position: absolute;
  background: rgba(12, 17, 29, 0.94);
  border: 1.5px solid var(--border-gold);
  color: #ffe066;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -100%);
  z-index: 50;
  white-space: nowrap;
  text-shadow: 0 1px 3px #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  letter-spacing: 0.4px;
}

.bldg-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: var(--border-gold) transparent transparent transparent;
}

.label-guard {
  border-color: #ef4444 !important;
  color: #fecaca !important;
  background: rgba(50, 10, 18, 0.95) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
}

.label-guard::after {
  border-color: #ef4444 transparent transparent transparent !important;
}

.label-enemy {
  border-color: #0ea5e9 !important;
  color: #e0f2fe !important;
  background: rgba(8, 28, 54, 0.95) !important;
}

.label-enemy::after {
  border-color: #0ea5e9 transparent transparent transparent !important;
}

.label-bandit {
  border-color: #a855f7 !important;
  color: #f3e8ff !important;
  background: rgba(40, 12, 60, 0.95) !important;
}

.label-bandit::after {
  border-color: #a855f7 transparent transparent transparent !important;
}

.label-throne {
  border-color: #f59e0b !important;
  color: #fef08a !important;
  background: rgba(45, 25, 0, 0.96) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7) !important;
}

.label-throne::after {
  border-color: #f59e0b transparent transparent transparent !important;
}

.label-res {
  border-color: #10b981 !important;
  color: #d1fae5 !important;
  background: rgba(6, 40, 24, 0.95) !important;
}

.label-res::after {
  border-color: #10b981 transparent transparent transparent !important;
}

/* Lencana Batalyon Marching */
.squad-army-banner {
  position: absolute;
  background: rgba(6, 26, 14, 0.95);
  border: 1.5px solid #22c55e;
  color: #86efac;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -120%);
  z-index: 60;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.65);
}

/* Bottom Controls */
#hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
  max-width: 98vw;
  overflow-x: auto;
  padding: 6px 12px;
  background: rgba(6, 10, 18, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
}

.btn-action {
  font-family: 'Cinzel', serif;
  background: var(--gold-grad);
  border: 1px solid #ffe880;
  border-radius: 6px;
  padding: 9px 15px;
  color: #1a1202;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-action:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.15);
  box-shadow: 0 6px 18px rgba(229, 184, 66, 0.5);
}

.btn-action:active {
  transform: translateY(1px) scale(0.98);
}

.btn-red {
  background: var(--red-grad);
  border-color: #ff85a1;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-red:hover {
  box-shadow: 0 6px 18px rgba(201, 24, 74, 0.6);
}

.btn-blue {
  background: var(--blue-grad);
  border-color: #90e0ef;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-blue:hover {
  box-shadow: 0 6px 18px rgba(0, 119, 182, 0.6);
}

/* Modals */
.modal-overlay {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 94vw;
  background: var(--panel-bg);
  border: 2px solid var(--border-gold);
  border-radius: 10px;
  padding: 24px;
  z-index: 1000;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.98), inset 0 0 25px rgba(0, 0, 0, 0.85);
  max-height: 88vh;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

@keyframes modalPop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-overlay h2 {
  font-family: 'Cinzel', serif;
  margin-top: 0;
  color: #fde047;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.4);
  padding-bottom: 10px;
  font-size: 18px;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.input-box {
  width: 100%;
  padding: 10px 12px;
  background: rgba(10, 15, 26, 0.9);
  border: 1px solid #334155;
  color: #f8fafc;
  border-radius: 6px;
  margin: 6px 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-box:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.close-btn {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1px solid #475569;
  color: #f1f5f9;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.close-btn:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.ali-card {
  background: var(--panel-bg-card);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s;
}

.ali-card:hover {
  border-color: var(--border-gold);
}

