/* ========================================
   INDEPTH PAGE – AGE OF EMPIRES IV
   Cinematic | Imperial | Regal | Tactical
======================================== */

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
  border-bottom: 2px solid var(--color-gold);
}

.hero-text {
  max-width: 60ch;
  margin-bottom: var(--space-8);
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
}

.hero-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl), var(--shadow-gold);
  margin-top: var(--space-8);
}

/* Deep-Dive Navigator */
.deep-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg-overlay);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-stone-dark);
  padding: var(--space-4) 0;
}

.deep-nav-list {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.deep-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-stone-dark);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.deep-nav-list a:hover,
.deep-nav-list a.active {
  background: var(--color-crimson);
  border-color: var(--color-crimson-light);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-crimson);
}

.deep-nav-list a::after {
  content: attr(data-estimate);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

.deep-nav-list a.active::after {
  color: var(--color-gold-light);
}

/* Section Images */
.section-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: var(--space-6) 0;
}

/* Civ Spotlight Matrix */
.civ-grid {
  margin-top: var(--space-8);
}

.civ-tile {
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid var(--color-stone-dark);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-tertiary));
  transition: all var(--transition-base);
  cursor: pointer;
}

.civ-tile:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-4px);
}

.civ-name {
  font-size: var(--font-size-xl);
  color: var(--color-gold);
}

.civ-icons {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

/* Balance Patch Timeline */
.timeline-wrapper {
  overflow-x: auto;
  padding: var(--space-4) 0;
}

.timeline-slider {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--color-stone-dark);
  border-radius: var(--radius-full);
}

.timeline-track {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-warning), var(--color-danger));
  border-radius: var(--radius-full);
  width: 100%;
}

/* Tech-Tree Explorer */
.tech-controls {
  justify-content: center;
}

.tech-canvas {
  width: 100%;
  height: 600px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-stone-dark);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

/* Pro Build Order Library */
.build-filters {
  justify-content: center;
  flex-wrap: wrap;
}

.build-stack {
  margin-top: var(--space-6);
}

.build-card {
  cursor: pointer;
  transition: transform var(--transition-base);
}

.build-card:hover {
  transform: translateY(-4px);
}

.build-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.build-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  color: var(--color-gold);
}

.build-meta {
  display: flex;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.build-phases {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.build-phase {
  margin-bottom: var(--space-3);
}

.build-phase h5 {
  font-size: var(--font-size-base);
  color: var(--color-gold-light);
  margin-bottom: var(--space-2);
}

.build-phase ol {
  list-style: decimal inside;
  color: var(--color-text-secondary);
}

.build-download {
  margin-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Map Meta Heat-Maps */
.map-controls {
  justify-content: center;
}

.map-gallery {
  margin-top: var(--space-6);
}

.map-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.map-item img {
  width: 100%;
  height: auto;
}

.map-overlay {
  position: absolute;
  inset: 0;
  background: rgba(212, 175, 55, 0.25);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.map-label {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Unit Match-Up Calculator */
.calc-grid {
  align-items: start;
}

.unit-card {
  min-height: 280px;
}

.calc-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

#radar-canvas {
  max-width: 100%;
  height: auto;
}

.outcome-badge {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-base);
}

.outcome-badge.strong {
  background: var(--color-success);
  color: var(--color-text-primary);
}

.outcome-badge.even {
  background: var(--color-warning);
  color: var(--color-gray-900);
}

.outcome-badge.weak {
  background: var(--color-danger);
  color: var(--color-text-primary);
}

/* Micro Tips Gallery */
.carousel-wrapper {
  position: relative;
  max-width: 1000px;
  margin: var(--space-8) auto 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-base);
  background: var(--color-bg-overlay);
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: var(--font-size-3xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.carousel-btn:hover {
  background: var(--color-gold);
  color: var(--color-gray-900);
}

.carousel-btn.left {
  left: var(--space-2);
}

.carousel-btn.right {
  right: var(--space-2);
}

.carousel-slides {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.slide {
  min-width: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: auto;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(0deg, rgba(26, 22, 18, 0.95) 0%, transparent 100%);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
}

/* Tier-List Poll */
.tier-board {
  margin-top: var(--space-6);
}

.tier-column {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-stone-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.tier-header {
  font-family: var(--font-primary);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  text-align: center;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.tier-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 120px;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-base);
}

.tier-item {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-stone-dark);
  border-radius: var(--radius-base);
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: grab;
  transition: all var(--transition-fast);
}

.tier-item:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}

.tier-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.tier-actions {
  justify-content: center;
}

.tier-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

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

.tier-bar-label {
  flex: 0 0 80px;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  color: var(--color-gold);
}

.tier-bar-track {
  flex: 1;
  height: 24px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tier-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-crimson), var(--color-gold));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.tier-bar-value {
  flex: 0 0 50px;
  text-align: right;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .deep-nav-list {
    gap: var(--space-2);
  }
  .deep-nav-list a {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-3);
  }
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-xl);
  }
  .tier-board {
    grid-template-columns: repeat(3, 1fr);
  }
}