/* ============================================================
   COMBAT STYLES — Arthurian Legends: The Fallen Crown
   ============================================================ */

/* Combat Canvas */
#combat-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: #0a0a0a;
  cursor: crosshair;
}

/* Combat UI Overlay */
.combat-ui {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  pointer-events: none;
}

.combat-ui > * {
  pointer-events: auto;
}

/* Combat HUD */
.combat-hud {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 80%, transparent 100%);
  padding: var(--space-md);
  gap: var(--space-sm);
}

/* Turn Info */
.turn-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid rgba(197, 165, 90, 0.3);
}

.turn-label {
  font-family: var(--font-display);
  color: var(--color-gold);
  font-size: var(--font-size-lg);
}

.turn-unit {
  color: var(--color-parchment);
  font-size: var(--font-size-base);
  font-weight: bold;
}

/* Unit Panel */
.unit-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.unit-name {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  color: var(--color-gold);
  text-shadow: var(--shadow-sm);
}

/* Stat Bars */
.stat-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.stat-label {
  min-width: 35px;
  font-size: var(--font-size-sm);
  color: var(--color-silver);
  font-weight: bold;
  text-transform: uppercase;
}

.bar-container {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 6px 6px 0 0;
}

.bar-fill.hp {
  background: linear-gradient(90deg, #8B0000, #DC143C, #FF4500);
}

.bar-fill.stamina {
  background: linear-gradient(90deg, #228B22, #32CD32, #7CFC00);
}

.bar-fill.mana {
  background: linear-gradient(90deg, #00008B, #1E90FF, #87CEEB);
}

.stat-value {
  min-width: 60px;
  text-align: right;
  font-size: var(--font-size-sm);
  color: var(--color-parchment);
  font-family: monospace;
}

/* AP Display */
.ap-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.ap-label {
  color: var(--color-silver);
  font-size: var(--font-size-sm);
}

.ap-value {
  color: var(--color-gold);
  font-size: var(--font-size-lg);
  font-weight: bold;
  font-family: var(--font-display);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  background: rgba(197, 165, 90, 0.1);
  border: 1px solid var(--color-gold-dark);
  border-radius: var(--border-radius-md);
  color: var(--color-parchment);
  min-width: 80px;
  transition: all var(--transition-fast);
}

.btn-action:hover:not(.disabled) {
  background: rgba(197, 165, 90, 0.25);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-glow-gold);
}

.btn-action.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-action.selected {
  background: rgba(197, 165, 90, 0.3);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-glow-gold);
}

.action-icon {
  font-size: 20px;
}

.action-name {
  font-size: var(--font-size-sm);
  font-family: var(--font-body);
}

.action-cost {
  font-size: 10px;
  color: var(--color-gold);
  opacity: 0.8;
}

.btn-end-turn {
  background: rgba(139, 0, 0, 0.3) !important;
  border-color: var(--color-burgundy) !important;
  margin-left: auto;
}

.btn-end-turn:hover {
  background: rgba(139, 0, 0, 0.5) !important;
}

/* Combat Log */
.combat-log {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry {
  font-size: var(--font-size-sm);
  color: var(--color-silver);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  line-height: 1.4;
}

.log-entry:first-child {
  color: var(--color-parchment);
  font-weight: bold;
}

/* Combat Result */
.combat-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: var(--space-2xl);
  background: rgba(0, 0, 0, 0.9);
  border: var(--border-ornate);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: scaleIn 0.5s ease;
}

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

.combat-result h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-lg);
}

.combat-result.victory h2 {
  color: var(--color-gold);
  text-shadow: var(--shadow-glow-gold);
}

.combat-result.defeat h2 {
  color: var(--color-blood);
  text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.rewards {
  margin-bottom: var(--space-lg);
}

.rewards p {
  font-size: var(--font-size-lg);
  color: var(--color-parchment);
  margin-bottom: var(--space-sm);
}

/* Responsive Combat */
@media (max-width: 768px) {
  .action-buttons {
    justify-content: center;
  }
  
  .btn-action {
    min-width: 65px;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .action-name {
    font-size: 10px;
  }
  
  .stat-value {
    min-width: 45px;
    font-size: 11px;
  }
}
