/* ═══════════════════════════════════════════════════════════════
   DXX Live Tracker Styles
   Sleek, High-Contrast, Purple/Black Theme
   ═══════════════════════════════════════════════════════════════ */

.live-tracker-body {
  background: var(--bg);
  min-height: 100vh;
  /* Lighter overlay to show more stars */
  background-image: 
    linear-gradient(rgba(2, 0, 5, 0.5), rgba(2, 0, 5, 0.5)),
    url('../images/space.png');
  background-attachment: fixed;
  background-size: cover;
}

/* ── Navigation ── */
.main-nav {
  background: rgba(10, 0, 20, 0.98);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 0 20px rgba(213, 0, 249, 0.2);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav-center {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nav-center .tab {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.nav-center .tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.nav-center .tab.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-logo .logo-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-heading);
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--accent);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: transparent;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* ── Live Hero ── */
.live-hero {
  text-align: center;
  padding: 1.5rem 2rem;
  background: transparent;
  border-bottom: none;
}

/* ── Connection Status ── */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1.2rem;
  background: #000;
  border: 1px solid var(--accent-dim);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--text-muted);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.connection-status.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: signal-pulse 2s infinite;
}

.connection-status.disconnected .status-dot {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

@keyframes signal-pulse {
  0% { box-shadow: 0 0 5px var(--green); opacity: 1; }
  50% { box-shadow: 0 0 20px var(--green); opacity: 0.7; }
  100% { box-shadow: 0 0 5px var(--green); opacity: 1; }
}

/* ── Game Sections ── */
.live-games-section,
.recent-games-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--bg-card-hover);
  padding-bottom: 0.5rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-shadow: 0 0 20px rgba(213, 0, 249, 0.2);
}

.game-count {
  font-family: var(--font-heading);
  color: var(--accent);
  background: rgba(213, 0, 249, 0.1);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--accent-dim);
  font-size: 0.9rem;
}

/* ── Active Game Cards ── */
.active-games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
}

.active-game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}

.active-game-card:hover {
  border-color: var(--accent);
}

/* Card Header Strip */
.game-card-header {
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.5rem;
}

.live-badge {
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.game-card-meta {
  padding: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.game-card-meta-item + .game-card-meta-item::before {
  content: ' / ';
  color: var(--text-muted);
}

/* Players List */
.game-card-players {
  padding: 0.5rem 1rem;
}

.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.player-row:last-child { border-bottom: none; }

.player-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.player-stats {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.6rem;
}

.stat-kills { color: var(--green); font-weight: 700; }
.stat-deaths { color: var(--red); }
.stat-suicides { color: var(--text-muted); }

.game-card-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.kill-feed-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 1rem;
}

/* ── No Games State ── */
.no-games-message {
  text-align: center;
  padding: 6rem 2rem;
  background: rgba(10, 0, 20, 0.4);
  border: 1px dashed var(--border);
}

.waiting-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
}

.pulse-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: radar-ping 3s infinite;
  opacity: 0;
}
.pulse-ring.delay-1 { animation-delay: 1s; }
.pulse-ring.delay-2 { animation-delay: 2s; }

@keyframes radar-ping {
  0% { transform: scale(0.5); opacity: 0; border-width: 4px; }
  5% { opacity: 1; }
  100% { transform: scale(2); opacity: 0; border-width: 0px; }
}

.waiting-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: var(--text-dim);
}

.no-games-message h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ── Recent Games List ── */
.recent-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.recent-game-card {
  background: var(--bg-surface);
  border-left: 3px solid var(--border);
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: 140px 1fr 150px;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
}

.recent-game-card:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--accent);
  padding-left: 2rem; /* Slide effect */
}

.recent-game-time {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.recent-game-map {
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.recent-game-players {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.recent-game-stats {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* ── Setup Info ── */
.setup-info {
  margin-top: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.setup-info summary {
  color: var(--accent);
  font-family: var(--mono);
  cursor: pointer;
  outline: none;
  font-weight: 600;
}

.setup-info code {
  background: #000;
  color: var(--green);
  padding: 0.2rem 0.5rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
}

/* ── Load All Button ── */
.btn-load-all {
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, #d500f9 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(213, 0, 249, 0.3);
}

.btn-load-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(213, 0, 249, 0.5);
}

/* ── Confirmation Modal ── */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.confirm-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(213, 0, 249, 0.2);
}

.modal-content {
  padding: 2rem;
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: var(--accent);
}

.modal-content p {
  margin: 0.75rem 0;
  color: var(--text);
  line-height: 1.6;
}

.modal-content strong {
  color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .active-games-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .live-hero-inner h1 { font-size: 2.5rem; }
  .recent-game-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
    border-left: none;
    border-top: 3px solid var(--border);
  }
  .recent-game-card:hover { padding-left: 1rem; padding-top: 1.5rem; border-top-color: var(--accent); }
  .recent-game-stats { text-align: left; margin-top: 0.5rem; }
}
