/* ========================================
   TOURS - Towers
   ======================================== */

/* Shop de tours */
.tower-shop {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tower-btn {
  background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
  border: 2px solid #4a5bc5;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: white;
  text-align: center;
  min-height: 100px;
}

.tower-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
  border-color: #667eea;
  background: linear-gradient(135deg, #7889ef 0%, #6679de 100%);
}

.tower-btn.selected {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, #7889ef 0%, #6679de 100%);
}

.tower-icon {
  font-size: 32px;
  min-width: auto;
  text-align: center;
}

.tower-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tower-name {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
}

.tower-stats {
  font-size: 10px;
  color: #ddd;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cost {
  background: rgba(255, 215, 0, 0.3);
  padding: 3px 6px;
  border-radius: 4px;
  color: #ffd700;
  font-weight: bold;
  font-size: 11px;
  align-self: center;
}

/* Menu de tour */
.tower-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 2000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  border: 2px solid #667eea;
  min-width: 350px;
  max-height: 90vh;
  overflow-y: auto;
}

.tower-menu h3 {
  margin: 0;
  color: #ffd700;
  text-align: center;
  font-size: 20px;
  margin-bottom: 15px;
}

.tower-stats-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #0f3460;
  margin-bottom: 15px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  font-weight: bold;
}

.stat-value {
  font-size: 16px;
  color: #fff;
  font-weight: bold;
}

.stat-value.upgrade {
  color: #27ae60;
  font-size: 18px;
}

.upgrade-arrow {
  color: #ffd700;
  font-size: 18px;
  font-weight: bold;
}

.tower-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-action {
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-upgrade {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.btn-upgrade:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-move {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.btn-move:hover {
  background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
}

.btn-sell {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-sell:hover {
  background: linear-gradient(135deg, #ec7063 0%, #e74c3c 100%);
}

.btn-close {
  background: linear-gradient(135deg, #7f8c8d 0%, #566573 100%);
}

.btn-close:hover {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

/* Ciblage */
.tower-targeting-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.tower-targeting-section h4 {
  color: #ffd700;
  margin-bottom: 10px;
  font-size: 14px;
}

.targeting-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.targeting-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #555;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
  text-align: center;
}

.targeting-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.2);
}

.targeting-btn.active {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.2);
}

.targeting-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}

.targeting-name {
  font-size: 10px;
  display: block;
}

/* Abilities */
.tower-abilities-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.tower-abilities-section h4 {
  color: #ffd700;
  margin-bottom: 10px;
  font-size: 14px;
}

.abilities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ability-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
  text-align: left;
}

.ability-btn:hover:not(.owned):not(.locked) {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.ability-btn.owned,
.ability-btn.purchased {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.4) 0%, rgba(39, 174, 96, 0.5) 100%);
  border-color: #27ae60;
  border-width: 3px;
  cursor: default;
  opacity: 1;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.ability-btn.owned .ability-cost,
.ability-btn.purchased .ability-cost {
  color: #2ecc71;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.ability-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.ability-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 5px;
}

.ability-name {
  font-size: 12px;
  font-weight: bold;
  display: block;
  margin-bottom: 2px;
}

.ability-cost {
  font-size: 10px;
  color: #ffd700;
}

.ability-desc {
  font-size: 10px;
  color: #aaa;
  margin-top: 4px;
  display: block;
}
/* ========================================
   MODAL LISTE DES TOURS
   ======================================== */

.towers-modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

.towers-modal.hidden {
  display: none !important;
}

.towers-modal-content {
  background: linear-gradient(135deg, #2a2a1e 0%, #1e1e16 100%);
  border: 3px solid #5a4a2a;
  padding: 25px;
  border-radius: 15px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(90, 74, 42, 0.3);
  color: #ecf0f1;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.towers-header-modal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 3px solid #5a4a2a;
  padding-bottom: 15px;
  flex-shrink: 0;
  gap: 15px;
}

.towers-header-modal h2 {
  color: #ffd700;
  font-size: 1.8em;
  margin: 0;
  flex: 1;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.towers-money-display {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid #f39c12;
  box-shadow: 0 2px 10px rgba(243, 156, 18, 0.3);
}

.towers-money-display span {
  color: #f39c12;
  font-size: 1.2em;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(243, 156, 18, 0.5);
}

.towers-list-content {
  min-height: 100px;
}

.no-towers-message {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 40px 20px;
  font-size: 1.1em;
}

.towers-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.towers-table thead {
  background: linear-gradient(135deg, #3a3a2a 0%, #2a2a1a 100%);
}

.towers-table th {
  padding: 14px 12px;
  text-align: left;
  color: #ffd700;
  font-weight: bold;
  font-size: 0.95em;
  border-bottom: 2px solid #5a4a2a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.towers-table td {
  padding: 12px;
  border-bottom: 1px solid #3a3a2a;
  vertical-align: top;
}

.tower-row {
  transition: all 0.2s ease;
}

.tower-row:hover {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

.tower-cell-type {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
}

.tower-cell-level {
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tower-cell-upgrade {
  min-height: 60px;
}

.tower-cell-augments {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tower-cell-target {
  min-height: 60px;
  display: flex;
  align-items: center;
}
}

.tower-cell-level {
  text-align: center;
}

.tower-level {
  display: inline-block;
  background: linear-gradient(135deg, #4a4a3a 0%, #3a3a2a 100%);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: bold;
  color: #ffd700;
  min-width: 35px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.tower-cell-upgrade {
  text-align: center;
}

.upgrade-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.multi-upgrade-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.target-level-input {
  width: 50px;
  padding: 6px;
  border: 2px solid #3498db;
  border-radius: 6px;
  background: rgba(52, 152, 219, 0.1);
  color: white;
  font-weight: bold;
  text-align: center;
  font-size: 0.9em;
}

.target-level-input:focus {
  outline: none;
  border-color: #5dade2;
  background: rgba(52, 152, 219, 0.2);
}

.btn-multi-upgrade {
  background: linear-gradient(135deg, #3498db 0%, #2874a6 100%);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85em;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  flex: 1;
}

.btn-multi-upgrade:hover:not(:disabled) {
  background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.btn-multi-upgrade:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.towers-panel-header {
  padding: 15px;
  background: rgba(15, 52, 96, 0.3);
  border-bottom: 2px solid #3498db;
  margin-bottom: 10px;
}

.global-level-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.global-level-selector label {
  font-weight: bold;
  color: #ffd700;
  font-size: 1em;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.global-level-input {
  width: 60px;
  padding: 8px;
  border: 2px solid #3498db;
  border-radius: 8px;
  background: rgba(52, 152, 219, 0.15);
  color: white;
  font-weight: bold;
  text-align: center;
  font-size: 1.1em;
}

.global-level-input:focus {
  outline: none;
  border-color: #5dade2;
  background: rgba(52, 152, 219, 0.25);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.btn-apply-global-level {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.btn-apply-global-level:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.5);
}

.btn-reset-all-levels {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.btn-reset-all-levels:hover {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(230, 126, 34, 0.5);
}

.btn-upgrade-list {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.btn-upgrade-list:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.5);
}

.max-level-badge {
  display: inline-block;
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.85em;
  color: white;
  box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.tower-cell-target {
  text-align: center;
}

.tower-cell-augments {
  text-align: center;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.augment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid;
}

.augment-available {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  opacity: 0.7;
}

.augment-available:hover {
  background: rgba(231, 76, 60, 0.5);
  opacity: 1;
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

.augment-owned {
  background: rgba(46, 204, 113, 0.4);
  border-color: #2ecc71;
  cursor: default;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.no-augments {
  color: #666;
  font-size: 0.9em;
  font-style: italic;
}

.target-mode-select {
  background: #2c3e50;
  border: 2px solid #5a6a7a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
  min-width: 110px;
  font-weight: 500;
}

.target-mode-select option {
  background: #2c3e50;
  color: #fff;
  padding: 10px;
}

.target-mode-select:hover {
  border-color: #7a8a9a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.target-mode-select:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}