/* ═══════════════════════════════════════════════════════
   服务器实时对局监控 — 样式（暗黑红金主题）
   ═══════════════════════════════════════════════════════ */

/* ── 触发按钮 ────────────────────────────────────────── */
.live-duels-trigger {
  position: absolute;
  top: 64px;
  right: 24px;
  background: linear-gradient(135deg, #1E1E1E, #121212);
  color: var(--light-gold);
  border: 1px solid rgba(216, 30, 68, 0.5);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 100;
}
.live-duels-trigger:hover {
  background: linear-gradient(135deg, var(--red), var(--dark-red));
  box-shadow: 0 0 12px rgba(216, 30, 68, 0.5);
  transform: scale(1.05);
}

/* ── Overlay ─────────────────────────────────────────── */
.live-duels-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(4px);
}
.live-duels-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Modal ───────────────────────────────────────────── */
.live-duels-modal {
  background: linear-gradient(135deg, #1a1a1a, var(--black));
  border: 2px solid var(--red);
  border-radius: 20px;
  width: 95vw;
  max-width: 1300px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  position: relative;
}

.live-duels-header {
  display: flex;
  align-items: center;
  padding: 20px 24px 14px;
  flex-shrink: 0;
}
.live-duels-header h2 {
  flex: 1;
  color: var(--gold);
  font-size: 1.4rem;
  text-align: center;
}
.live-duels-count {
  background: var(--red);
  color: var(--light-gold);
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-right: 12px;
}
.live-duels-close {
  background: linear-gradient(135deg, var(--red), var(--dark-red));
  color: var(--light-gold);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: 0.3s;
  flex-shrink: 0;
}
.live-duels-close:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(216, 30, 68, 0.6);
}

/* ── Admin 面板 ──────────────────────────────────────── */
.live-duels-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-top: 1px solid rgba(216, 30, 68, 0.2);
  border-bottom: 1px solid rgba(216, 30, 68, 0.2);
  flex-shrink: 0;
  flex-wrap: wrap;
  background: rgba(216, 30, 68, 0.04);
}
.live-duels-admin input {
  background: var(--black);
  border: 1px solid rgba(216, 30, 68, 0.3);
  color: #ddd;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border 0.2s;
}
.live-duels-admin input:focus {
  border-color: var(--red);
}
.admin-login-form input {
  width: 110px;
}
#adminShoutInput {
  min-width: 220px;
  flex: 1;
  max-width: 400px;
}
.admin-btn {
  background: linear-gradient(135deg, var(--dark-gray), var(--black));
  color: var(--light-gold);
  border: 1px solid rgba(216, 30, 68, 0.4);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: 0.3s;
  white-space: nowrap;
}
.admin-btn:hover {
  background: linear-gradient(135deg, var(--red), var(--dark-red));
  box-shadow: 0 0 10px rgba(216, 30, 68, 0.4);
}
.admin-btn.danger {
  border-color: rgba(255, 152, 0, 0.5);
  color: #FF9800;
}
.admin-btn.danger:hover {
  background: linear-gradient(135deg, #FF9800, #e67e22);
  color: #fff;
}
.admin-logged-in {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.admin-name {
  color: var(--light-gold);
  font-weight: bold;
  font-size: 0.9rem;
}

/* ── 对局表格 ────────────────────────────────────────── */
.live-duels-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 24px;
}
.live-duels-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.live-duels-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.live-duels-table th {
  background: var(--black);
  color: var(--light-gold);
  padding: 10px 12px;
  text-align: left;
  font-weight: bold;
  font-size: 0.8rem;
  border-bottom: 2px solid rgba(216, 30, 68, 0.5);
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.live-duels-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #ccc;
  white-space: nowrap;
}
.live-duels-table tbody tr {
  transition: background 0.2s;
}
.live-duels-table tbody tr:hover {
  background: rgba(216, 30, 68, 0.08);
}
.live-duels-table tbody tr.dueling {
  border-left: 4px solid var(--green);
}
.live-duels-table tbody tr.waiting {
  border-left: 4px solid #666;
}
.live-duels-table tbody tr.death {
  border-left: 4px solid var(--orange);
  background: rgba(255, 152, 0, 0.06);
}

/* LP 颜色 */
.lp-high { color: var(--green); font-weight: 700; }
.lp-mid  { color: var(--orange); font-weight: 700; }
.lp-low  { color: var(--red); font-weight: 700; }

/* 操作按钮 */
.actions-cell {
  display: flex;
  gap: 6px;
}
.action-btn-sm {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(216, 30, 68, 0.3);
  background: var(--black);
  color: #ccc;
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
  font-weight: bold;
}
.action-btn-sm.death-btn:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.action-btn-sm.kick-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Toast */
.live-duels-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--dark-gray), var(--black));
  border: 1px solid var(--red);
  color: var(--light-gold);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 2100;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ── 空状态 ──────────────────────────────────────────── */
.empty-message {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 1rem;
}

/* ── 加载提示 ────────────────────────────────────────── */
.loading-hint {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

/* ── 移动端 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .live-duels-trigger {
    position: fixed;
    top: 100px;
    right: 12px;
    font-size: 0.75rem;
    padding: 7px 12px;
    border-radius: 8px;
  }
  .live-duels-modal {
    width: 98vw;
    height: 94vh;
    border-radius: 14px;
  }
  .live-duels-header {
    padding: 14px 14px 10px;
  }
  .live-duels-header h2 {
    font-size: 1.1rem;
  }
  .live-duels-admin {
    padding: 8px 14px;
    gap: 6px;
  }
  .live-duels-admin input {
    font-size: 0.75rem;
    padding: 6px 8px;
  }
  .admin-login-form input {
    width: 80px;
  }
  #adminShoutInput {
    min-width: 120px;
  }
  .live-duels-body {
    padding: 8px 8px 16px;
    overflow-x: auto;
  }
  .live-duels-table {
    font-size: 0.72rem;
  }
  .live-duels-table th,
  .live-duels-table td {
    padding: 5px 7px;
  }
}
