/* ==========================================================
   ARK DECK PUZZLE & LAYOUT STYLES
   ========================================================== */

.puzzle-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 1100px) {
  .puzzle-layout {
    grid-template-columns: 1fr;
  }
}

/* Deck Top Bar & Ballast Meter */
.deck-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 16px;
}

.ballast-meter {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
}

.ballast-track {
  width: 140px;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 99px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ballast-needle {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 18px;
  background: var(--brass-light);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.3s ease;
  box-shadow: 0 0 6px var(--brass);
}

.ballast-needle.severe {
  background: var(--danger-red);
  box-shadow: 0 0 8px var(--danger-red);
}

.readiness-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.readiness-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.readiness-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}

.readiness-badge.blocked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

/* Ship Deck Vessel Frame */
.ark-ship-frame {
  background: radial-gradient(circle at 50% 50%, #3e1f08 0%, #1a0c02 100%);
  border: 3px solid #824317;
  border-radius: 120px 120px 24px 24px;
  padding: 36px 24px 30px 24px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.ark-ship-frame::before {
  content: 'BOW (FORWARD)';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: rgba(234, 179, 8, 0.4);
  font-family: var(--font-serif);
}

.ark-ship-frame::after {
  content: 'STERN (AFT)';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: rgba(234, 179, 8, 0.4);
  font-family: var(--font-serif);
}

.deck-divider-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--brass-light);
  font-weight: 600;
  letter-spacing: 1px;
}

/* The Ark Deck Grid */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(4, 100px);
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  .deck-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(8, 90px);
  }
}

/* Cell Stalls */
.deck-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  padding: 4px;
}

.deck-cell:hover {
  background: rgba(234, 179, 8, 0.08);
  border-color: var(--brass);
}

.deck-cell.selected {
  border-color: var(--brass-light);
  box-shadow: 0 0 12px var(--brass);
  background: rgba(234, 179, 8, 0.15);
}

.deck-cell.empty .empty-icon {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.2);
}

.deck-cell.empty .empty-txt {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Solid Oak Bulkhead Cell */
.deck-cell.bulkhead {
  background: repeating-linear-gradient(
    45deg,
    #2a1707,
    #2a1707 8px,
    #3f230c 8px,
    #3f230c 16px
  );
  border: 2px solid #b45309;
  cursor: pointer;
}

.bulkhead-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brass-light);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Animal Occupied Cell */
.deck-cell.occupied {
  border-style: solid;
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
}

.deck-cell.conflict-fatal {
  border-color: var(--danger-red) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: pulseDanger 1.2s infinite;
}

.deck-cell.conflict-warning {
  border-color: var(--warning-amber) !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.deck-cell.synergy-calmed {
  border-color: var(--success-emerald) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

@keyframes pulseDanger {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.cell-animal-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell-animal-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cell-pen-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 0.6rem;
  background: rgba(0,0,0,0.6);
  padding: 1px 4px;
  border-radius: 2px;
}

.cell-weight-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.6rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.6);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Side Inspector & Action Drawer */
.puzzle-inspector {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
}

.inspector-card h3 {
  font-size: 1rem;
  color: var(--brass-light);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.staging-animals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.staging-animal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.staging-animal-item:hover {
  background: rgba(234, 179, 8, 0.1);
  border-color: var(--brass);
}

.staging-animal-item.assigned {
  opacity: 0.45;
  cursor: default;
}

.staging-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staging-icon {
  width: 32px;
  height: 32px;
}

.staging-text h5 {
  font-size: 0.82rem;
  color: var(--text-main);
}

.staging-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Conflicts & Warnings List */
.conflicts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.conflict-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.35;
}

.conflict-item.fatal {
  background: rgba(239, 68, 68, 0.15);
  border-left: 3px solid var(--danger-red);
  color: #fca5a5;
}

.conflict-item.warning {
  background: rgba(245, 158, 11, 0.15);
  border-left: 3px solid var(--warning-amber);
  color: #fde68a;
}

.conflict-item.synergy {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid var(--success-emerald);
  color: #6ee7b7;
}

/* Provisions Checklist */
.provisions-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.provision-meter {
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.provision-meter.lacking {
  color: var(--danger-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
