/* ═══════════════════════════════════════════════════════════════
   COMBAT OVERHAUL — Phase 1 CSS
   Formation-based battle layout: Warfront & Breach modes
   ═══════════════════════════════════════════════════════════════ */

.co-hp-val {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.co-phase-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.co-phase-label.phase-deploy { color: #00c864; background: rgba(0, 200, 100, 0.1); }
.co-phase-label.phase-attack { color: #ff6420; background: rgba(255, 100, 32, 0.1); }
.co-phase-label.phase-ai     { color: #ff4040; background: rgba(255, 64, 64, 0.1); }
.co-phase-label.phase-draw   { color: #00aaff; background: rgba(0, 170, 255, 0.1); }

.co-mode-badge {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  opacity: 0.45;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── ARENA ───────────────────────────────────────────────────── */
.co-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.4rem 0.5rem;
  gap: 0.3rem;
  position: relative;
}

/* ── ROWS ────────────────────────────────────────────────────── */
.co-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.co-row-label {
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.38;
  padding: 0 0.25rem;
}

.co-row-ai .co-row-label { color: #ff6060; }
.co-row-player .co-row-label { color: #00c864; }

.co-row-slots {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

/* ── SLOTS ───────────────────────────────────────────────────── */
.co-slot {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.4rem 0.4rem 0.35rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-height: 64px;
  user-select: none;
}

.co-slot-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-slot-empty-label {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.1);
}

.co-slot-clickable {
  cursor: pointer;
  border-color: rgba(0, 200, 100, 0.25);
}
.co-slot-clickable:hover, .co-slot-clickable:active {
  border-color: rgba(0, 200, 100, 0.55);
  background: rgba(0, 200, 100, 0.06);
}

.co-slot-selected {
  border-color: #00aaff !important;
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
  background: rgba(0, 100, 200, 0.08) !important;
}

.co-slot-targetable {
  cursor: pointer;
  border-color: rgba(255, 80, 80, 0.5);
  box-shadow: 0 0 6px rgba(255, 80, 80, 0.2);
  animation: coTargetPulse 1.0s ease-in-out 4;
}
@keyframes coTargetPulse {
  0%, 100% { border-color: rgba(255, 80, 80, 0.4); box-shadow: 0 0 4px rgba(255, 80, 80, 0.15); }
  50%       { border-color: rgba(255, 80, 80, 0.85); box-shadow: 0 0 12px rgba(255, 80, 80, 0.42); }
}

@media (prefers-reduced-motion: reduce) {
  .co-slot-targetable {
    animation: none;
    border-color: rgba(255, 80, 80, 0.8);
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.4);
  }
}

.co-slot-spent { opacity: 0.5; }

.co-slot-hidden {
  background: rgba(20, 10, 0, 0.5);
  border-color: rgba(100, 60, 0, 0.3);
  align-items: center;
  justify-content: center;
}
.co-hidden-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 180, 40, 0.45);
  letter-spacing: 0.1em;
}
.co-hidden-sublabel {
  font-size: 0.42rem;
  letter-spacing: 0.2em;
  color: rgba(255, 150, 20, 0.3);
}

/* ── UNIT CONTENT ────────────────────────────────────────────── */
.co-unit-name {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e0efff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.co-unit-type {
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  color: rgba(192, 220, 255, 0.38);
  text-transform: uppercase;
}

.co-hp-bar-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.15rem;
}

.co-hp-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.co-unit-hp {
  font-size: 0.55rem;
  color: rgba(192, 220, 255, 0.5);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.co-spent-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.38rem;
  letter-spacing: 0.12em;
  color: rgba(200, 180, 100, 0.55);
  font-weight: 700;
}

.co-select-badge {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.38rem;
  letter-spacing: 0.12em;
  color: #00aaff;
  font-weight: 700;
}

.co-shielded-badge {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.38rem;
  letter-spacing: 0.08em;
  color: rgba(0, 200, 200, 0.55);
  font-weight: 700;
}

/* ── BATTLE LINE ─────────────────────────────────────────────── */
.co-battle-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0;
  flex-shrink: 0;
}

.co-battle-line-track {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 80, 0, 0.25), transparent);
}

.co-battle-line-label {
  font-size: 0.44rem;
  letter-spacing: 0.25em;
  color: rgba(255, 100, 32, 0.4);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── ATTACK PICKER ───────────────────────────────────────────── */
.co-attack-picker {
  background: rgba(6, 13, 8, 0.97);
  border-top: 1px solid rgba(0, 200, 100, 0.18);
  padding: 0.6rem 0.75rem 0.5rem;
  flex-shrink: 0;
}

.co-attack-picker-title {
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  color: rgba(0, 200, 100, 0.5);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.co-attack-btns {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.co-attack-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 50, 30, 0.3);
  border: 1px solid rgba(0, 200, 100, 0.2);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Rajdhani', sans-serif;
  color: #c8dfff;
}
.co-attack-btn:hover, .co-attack-btn:active {
  background: rgba(0, 80, 50, 0.4);
  border-color: rgba(0, 200, 100, 0.5);
}
.co-attack-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
}

.co-attack-btn-name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.co-attack-btn-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.co-attack-btn-cost {
  font-size: 0.65rem;
  font-weight: 700;
  color: #00c864;
  letter-spacing: 0.06em;
}
.co-attack-btn.disabled .co-attack-btn-cost { color: rgba(100, 200, 100, 0.3); }

.co-attack-btn-dmg {
  font-size: 0.6rem;
  color: rgba(192, 220, 255, 0.5);
}

.co-retreat-btn {
  background: rgba(200, 150, 0, 0.1);
  border-color: rgba(200, 150, 0, 0.25);
  color: #ffcc40;
}
.co-retreat-btn:hover, .co-retreat-btn:active {
  background: rgba(200, 150, 0, 0.2);
  border-color: rgba(200, 150, 0, 0.5);
}

.co-cancel-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(192, 220, 255, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.co-cancel-btn:hover, .co-cancel-btn:active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(192, 220, 255, 0.8);
}

/* ── BOTTOM BAR ──────────────────────────────────────────────── */
.co-bottom-bar {
  background: rgba(6, 13, 8, 0.97);
  border-top: 1px solid rgba(0, 240, 100, 0.1);
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.co-hand-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 20, 12, 0.9);
  border: 1px solid rgba(0, 200, 100, 0.2);
  border-radius: 5px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  min-width: 52px;
  font-family: 'Rajdhani', sans-serif;
}
.co-hand-card:hover, .co-hand-card:active {
  border-color: rgba(0, 200, 100, 0.5);
  background: rgba(0, 60, 30, 0.5);
}

.co-hand-card-name {
  font-size: 0.58rem;
  font-weight: 700;
  color: #c8dfff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-hand-card-type {
  font-size: 0.4rem;
  letter-spacing: 0.12em;
  color: rgba(192, 220, 255, 0.35);
  text-transform: uppercase;
}

/* ── ROW SELECT MODAL ────────────────────────────────────────── */
.co-row-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.co-row-modal {
  background: rgba(8, 16, 10, 0.98);
  border: 1px solid rgba(0, 200, 100, 0.2);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 1.2rem 1.25rem 1.5rem;
  width: 100%;
  max-width: 480px;
  font-family: 'Rajdhani', sans-serif;
  animation: coModalSlideUp 0.22s ease-out;
}

@keyframes coModalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.co-row-modal-title {
  font-size: 0.52rem;
  letter-spacing: 0.25em;
  color: rgba(0, 200, 100, 0.45);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.co-row-modal-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e0efff;
  margin-bottom: 1rem;
}

.co-row-modal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.co-row-btn {
  background: rgba(0, 50, 30, 0.3);
  border: 1px solid rgba(0, 200, 100, 0.25);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  color: #c8dfff;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.co-row-btn:hover, .co-row-btn:active {
  background: rgba(0, 80, 50, 0.5);
  border-color: rgba(0, 200, 100, 0.55);
}
.co-row-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(100, 100, 100, 0.2);
  background: rgba(20, 20, 20, 0.3);
}

.co-row-btn-icon {
  font-size: 1.4rem;
}

.co-row-btn-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.co-row-btn-desc {
  font-size: 0.58rem;
  color: rgba(192, 220, 255, 0.45);
  letter-spacing: 0.04em;
  text-align: center;
}

.co-row-btn-slots {
  font-size: 0.52rem;
  color: rgba(0, 200, 100, 0.55);
  letter-spacing: 0.06em;
}

.co-row-modal-cancel {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.5rem;
  color: rgba(192, 220, 255, 0.45);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.15s;
}
.co-row-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(192, 220, 255, 0.8);
}

/* ── LOG STRIP ───────────────────────────────────────────────── */
.co-log-strip {
  max-height: 48px;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  font-size: 0.62rem;
  color: rgba(192, 220, 255, 0.45);
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.co-log-strip::-webkit-scrollbar { display: none; }

/* ── AI TURN OVERLAY ─────────────────────────────────────────── */

@keyframes coAiBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── ACCESSIBILITY ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .co-slot,
  .co-attack-btn,
  .co-row-btn,
  .co-hand-card,
  .co-hp-bar {
    transition: none !important;
  }

  .co-row-modal {
    animation: none !important;
  }
}

