/* Replay System — "Watch the Battle" cinematic replays */

.replay-system {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.replay-header {
  text-align: center;
  margin-bottom: 24px;
}

.replay-header h2 {
  font-size: 1.8rem;
  margin: 0 0 4px;
}

.replay-subtitle {
  color: #888;
  font-size: 0.95rem;
  margin: 0;
}

.replay-loading {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.2rem;
  color: #aaa;
}

.replay-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 1.1rem;
  color: #888;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px dashed #444;
}

/* Featured Replay */
.featured-replay {
  position: relative;
  border: 2px solid #444;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 24px;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.featured-badge {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.featured-emoji {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.featured-narration {
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: 16px;
  font-weight: 500;
}

.featured-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #888;
  flex-wrap: wrap;
}

.meta-drama {
  font-weight: 700;
}

.featured-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.replay-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #555;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.replay-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #888;
}

.replay-nav-pos {
  font-size: 0.85rem;
  color: #888;
}

/* Controls */
.replay-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid #333;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
}

.speed-buttons {
  display: flex;
  gap: 4px;
}

.speed-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #444;
  color: #ccc;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.speed-btn.active {
  background: #4488ff;
  border-color: #4488ff;
  color: #fff;
  font-weight: 700;
}

.speed-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
}

.filter-actor, .filter-type {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #444;
  color: #ccc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.play-btn {
  background: rgba(68, 136, 255, 0.2);
  border: 1px solid #4488ff;
  color: #4488ff;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  margin-left: auto;
}

.play-btn:hover {
  background: rgba(68, 136, 255, 0.35);
}

.play-btn.playing {
  background: rgba(255, 136, 0, 0.2);
  border-color: #ff8800;
  color: #ff8800;
}

/* Drama Timeline */
.replay-timeline {
  margin-bottom: 24px;
}

.replay-timeline h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.timeline-container {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 8px 0;
  overflow-x: auto;
}

.timeline-bar-wrap {
  flex: 1;
  min-width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.timeline-bar-wrap:hover {
  opacity: 0.8;
}

.timeline-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.bar-emoji {
  font-size: 0.65rem;
  margin-top: 2px;
}

.timeline-tick {
  font-size: 0.55rem;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
}

/* Replay Feed */
.replay-feed {
  margin-bottom: 24px;
}

.replay-feed h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  transition: background 0.2s;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.feed-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-narration {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.feed-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #888;
}

.feed-drama {
  font-weight: 600;
}

/* Drama Stats */
.drama-stats {
  margin-bottom: 24px;
}

.drama-stats h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-distribution {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.type-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.type-emoji {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.type-name {
  width: 120px;
  color: #aaa;
  font-size: 0.8rem;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-bar {
  height: 8px;
  background: linear-gradient(90deg, #4488ff, #44aaff);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.type-count {
  color: #888;
  font-size: 0.8rem;
  min-width: 24px;
  text-align: right;
}

/* Light mode */
.light-mode .replay-controls {
  background: rgba(0, 0, 0, 0.03);
  border-color: #ddd;
}

.light-mode .speed-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: #ccc;
  color: #555;
}

.light-mode .filter-actor,
.light-mode .filter-type {
  background: rgba(0, 0, 0, 0.05);
  border-color: #ccc;
  color: #333;
}

.light-mode .replay-nav-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: #ccc;
  color: #333;
}

.light-mode .feed-item {
  background: rgba(0, 0, 0, 0.03);
}

.light-mode .stat-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: #ddd;
}

.light-mode .stat-value {
  color: #222;
}

.light-mode .featured-narration {
  color: #222;
}

.light-mode .replay-empty {
  background: rgba(0, 0, 0, 0.03);
  border-color: #ccc;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .replay-system {
    padding: 10px;
  }

  .replay-header h2 {
    font-size: 1.4rem;
  }

  .featured-replay {
    padding: 20px 16px;
  }

  .featured-emoji {
    font-size: 2.2rem;
  }

  .featured-narration {
    font-size: 1rem;
  }

  .replay-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .control-group {
    justify-content: space-between;
  }

  .play-btn {
    margin-left: 0;
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-container {
    height: 80px;
  }

  .timeline-bar-wrap {
    min-width: 14px;
  }

  .type-name {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .featured-meta {
    flex-direction: column;
    gap: 4px;
  }

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

  .stat-card {
    padding: 10px;
  }

  .stat-value {
    font-size: 1.2rem;
  }
}
