/* === Battle Detail/Replay Page === */

.main {
  height: 100vh;
  padding: 5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.loading,
.error {
  text-align: center;
  padding: 4rem 2rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  color: var(--chrome-silver);
  font-size: 0.9rem;
}

.error {
  color: var(--claw-red);
}

.backLink {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--plasma-cyan);
  text-decoration: none;
  transition: opacity 0.2s;
}

.backLink:hover {
  opacity: 0.7;
}

/* Header */
.header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.headerInfo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.title {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--star-white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.outcomeBadge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: rgba(255, 217, 61, 0.15);
  color: var(--warning-yellow);
  border: 1px solid rgba(255, 217, 61, 0.3);
  -webkit-text-fill-color: var(--warning-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.headerMeta {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  flex-wrap: wrap;
}

/* Sides */
.sidesRow {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.sideCard {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--nebula-blue);
  border-radius: 4px;
  border: 1px solid var(--hull-grey);
}

.sideColorDot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sideName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--star-white);
}

.winnerLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--warning-yellow);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Main content layout */
.content {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.vizSection {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  position: relative;
}

.canvasContainer {
  flex: 1;
  min-height: 200px;
  background: #050810;
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Ship info overlay — floats over the canvas */
.shipInfo {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  background: rgba(5, 8, 16, 0.9);
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  pointer-events: none;
  max-width: 260px;
}

.shipInfoHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.shipInfoName {
  font-weight: 700;
  font-size: 0.85rem;
}

.shipInfoClass {
  color: var(--hull-grey);
  font-size: 0.7rem;
}

.shipInfoBars {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.barRow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.barLabel {
  width: 40px;
  color: var(--hull-grey);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.barTrack {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

.barFill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.barValue {
  width: 65px;
  text-align: right;
  color: var(--chrome-silver);
  font-size: 0.65rem;
}

.shipInfoDetails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--chrome-silver);
  font-size: 0.7rem;
}

.shipInfoModules {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(61, 90, 108, 0.3);
}

.shipInfoModulesLabel {
  color: var(--hull-grey);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.moduleRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0;
}

.moduleName {
  color: var(--chrome-silver);
  font-size: 0.7rem;
}

.moduleQuality {
  font-size: 0.65rem;
  font-weight: 600;
}

/* Event feed */
.feedSection {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  background: var(--deep-void);
  overflow: hidden;
}

.feedHeader {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--hull-grey);
  color: var(--chrome-silver);
}

.feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 0;
}

.feedEmpty {
  text-align: center;
  padding: 2rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--hull-grey);
}

.feedEvent {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}

.feedTick {
  color: var(--hull-grey);
  font-size: 0.6rem;
  min-width: 28px;
  flex-shrink: 0;
  padding-top: 1px;
}

.feedDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.feedText {
  color: var(--chrome-silver);
}

/* Timeline / Playback */
.timeline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--deep-void);
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  flex-wrap: wrap;
}

.controls {
  display: flex;
  gap: 0.25rem;
}

.controlBtn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  color: var(--chrome-silver);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.controlBtn:hover {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.playBtn {
  width: 40px;
  font-size: 16px;
}

.scrubber {
  flex: 1;
  min-width: 100px;
}

.scrubberInput {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hull-grey);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.scrubberInput::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--plasma-cyan);
  cursor: pointer;
  border: 2px solid var(--deep-void);
}

.scrubberInput::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--plasma-cyan);
  cursor: pointer;
  border: 2px solid var(--deep-void);
}

.timelineInfo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tickCounter {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  white-space: nowrap;
}

.speedControls {
  display: flex;
  gap: 0.2rem;
}

.speedBtn {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  background: none;
  border: 1px solid var(--hull-grey);
  border-radius: 3px;
  color: var(--hull-grey);
  cursor: pointer;
  transition: all 0.2s;
}

.speedBtn:hover,
.speedBtnActive {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.speedBtnActive {
  background: rgba(0, 212, 255, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
  .content {
    flex-direction: column;
  }

  .feedSection {
    width: 100%;
  }

  .feed {
    max-height: 250px;
    min-height: 200px;
  }

  .timeline {
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .timelineInfo {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 600px) {
  .main {
    padding: 4rem 0.75rem 0.75rem;
  }

  .canvasContainer {
    min-height: 250px;
  }

  .controls {
    gap: 0.15rem;
  }

  .controlBtn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .playBtn {
    width: 34px;
    font-size: 14px;
  }
}
