* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2a 50%, #0f0f23 100%);
  color: #00ffff;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
  perspective: 1000px;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 255, 0.03) 2px,
      rgba(0, 255, 255, 0.03) 4px);
  pointer-events: none;
  z-index: 1;
}

.container {
  max-width: 1200px;
  margin: 50px auto 0 auto;
  position: relative;
  z-index: 2;
  transition: transform 0.1s ease-out;
  transform-style: preserve-3d;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  animation: glow 5s ease-in-out infinite alternate;
}

.history-card {
  background: rgba(15, 10, 40, 0.85);
  border: 2px solid rgba(0, 255, 255, 0.4);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 40px;
  box-shadow: 0 0 35px rgba(0, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.history-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(120deg, rgba(0, 255, 255, 0.6), rgba(255, 0, 255, 0.4), rgba(0, 255, 255, 0.6));
  background-size: 200% 200%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: borderGradient 4s ease infinite;
}

.history-card:hover::before {
  opacity: 0.25;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.history-header h2 {
  color: #00ffff;
  letter-spacing: 2px;
  font-size: 1.6rem;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
}

.history-header p {
  color: rgba(0, 255, 255, 0.7);
  font-size: 0.85rem;
  max-width: 420px;
  line-height: 1.4;
}

.range-presets {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.preset-button {
  background: rgba(0, 255, 255, 0.12);
  color: #00ffff;
  border: 1px solid rgba(0, 255, 255, 0.5);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.preset-button:hover,
.preset-button:focus {
  background: rgba(255, 0, 255, 0.2);
  border-color: rgba(255, 0, 255, 0.6);
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.35);
  outline: none;
}

.preset-button.active {
  background: rgba(255, 0, 255, 0.25);
  border-color: rgba(255, 0, 255, 0.8);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
  color: #fff;
}

.history-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 25px;
}

.range-label {
  color: #ff00ff;
  font-size: 0.75rem;
  letter-spacing: 3px;
  font-weight: bold;
}

.double-slider {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}

.double-slider input[type="range"] {
  position: absolute;
  width: 100%;
  pointer-events: none;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}

.double-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 2px solid #ff00ff;
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

.double-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 2px solid #ff00ff;
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

.slider-track {
  position: absolute;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: rgba(0, 255, 255, 0.15);
  border: 1px solid rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.slider-range {
  position: absolute;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.6), rgba(255, 0, 255, 0.6));
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.4);
}

.range-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(0, 255, 255, 0.8);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.history-chart-wrapper {
  width: 100%;
  height: 320px;
  background: radial-gradient(circle at top, rgba(0, 255, 255, 0.15), rgba(10, 10, 30, 0.2));
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.15);
}

.history-chart-wrapper canvas {
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .history-card {
    padding: 18px;
  }

  .history-chart-wrapper {
    height: 260px;
  }

  .range-values {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}

.header h1 {
  font-size: 3rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 7s ease infinite;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 4px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 8px rgba(0, 255, 255, 0.3));
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
  }

  to {
    text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff, 0 0 40px #ff00ff;
  }
}

.server-card {
  background: rgba(10, 10, 30, 0.8);
  border: 2px solid #00ffff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.server-card:hover {
  border-color: #ff00ff;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.4);
  transform: translateY(-2px);
}

.server-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff, #ff00ff);
  background-size: 400% 400%;
  border-radius: 10px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: borderGradient 3s ease infinite;
}

.server-card:hover::before {
  opacity: 0.3;
}

@keyframes borderGradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.server-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  cursor: pointer;
  user-select: none;
}

.server-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 15px;
}

.player-count {
  font-size: 1.2rem;
  color: #ff00ff;
  font-weight: bold;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff00;
  box-shadow: 0 0 10px #00ff00;
  animation: pulse 2s infinite;
}

.status-indicator.loading {
  background: #ffff00;
  box-shadow: 0 0 10px #ffff00;
  animation: pulse 1s infinite;
}

.status-indicator.offline {
  background: #ff0000;
  box-shadow: 0 0 10px #ff0000;
  animation: none;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.expand-icon {
  font-size: 1.2rem;
  color: #00ffff;
  transition: transform 0.3s ease;
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.players-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.players-list.expanded {
  max-height: 500px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 5px 0;
  background: rgba(0, 255, 255, 0.1);
  border-left: 3px solid #00ffff;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.player-item:hover {
  background: rgba(255, 0, 255, 0.1);
  border-left-color: #ff00ff;
  transform: translateX(5px);
}

.player-name {
  color: #00ffff;
  font-weight: bold;
}

.player-ping {
  color: #ff00ff;
  font-family: 'Courier New', monospace;
}

.ping-good {
  color: #00ff00;
}

.ping-medium {
  color: #ffff00;
}

.ping-bad {
  color: #ff0000;
}

.skeleton {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 25%, rgba(255, 0, 255, 0.1) 50%, rgba(0, 255, 255, 0.1) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 3px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 20px;
  margin: 5px 0;
}

.error-message {
  color: #ff0000;
  text-align: center;
  padding: 10px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid #ff0000;
  border-radius: 5px;
  margin: 10px 0;
}

.refresh-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(45deg, #00ffff, #ff00ff);
  border: none;
  color: #000;
  padding: 15px 20px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.refresh-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.7);
}

.refresh-btn:active {
  transform: scale(0.95);
}

.last-update {
  text-align: center;
  margin-top: 20px;
  padding: 10px;
  color: #00ffff;
  font-size: 0.9rem;
  opacity: 0.7;
}

.auto-refresh-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(10, 10, 30, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(5px);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .auto-refresh-control {
    gap: 15px;
    padding: 10px;
  }
}

.refresh-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  color: #00ffff;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 5px #00ffff;
}

.cyber-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 0, 255, 0.2);
  border: 2px solid #ff00ff;
  transition: 0.3s;
  border-radius: 24px;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.cyber-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: linear-gradient(45deg, #ff00ff, #ff0080);
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 0 5px #ff00ff;
}

.cyber-switch input:checked+.cyber-slider {
  background: rgba(0, 255, 255, 0.3);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.cyber-switch input:checked+.cyber-slider:before {
  transform: translateX(26px);
  background: linear-gradient(45deg, #00ffff, #00ff80);
  box-shadow: 0 0 10px #00ffff;
}

.cyber-slider:hover {
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.cyber-switch input:checked+.cyber-slider:hover {
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
}

.refresh-interval {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 100%;
}

@media (max-width: 768px) {
  .refresh-interval {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }
}

.refresh-interval label {
  color: #00ffff;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 5px #00ffff;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  max-width: 100%;
  padding-top: 10px;
}

@media (max-width: 768px) {
  .slider-container {
    min-width: 100%;
    width: 100%;
  }
}

.refresh-interval input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(255, 0, 255, 0.2);
  border: 1px solid #ff00ff;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  transition: all 0.3s ease;
}

.refresh-interval input[type="range"]:hover {
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.refresh-interval input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  border: 2px solid #00ffff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.refresh-interval input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.refresh-interval input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  border: 2px solid #00ffff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.refresh-interval input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.slider-value {
  color: #00ffff;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 0 5px #00ffff;
  letter-spacing: 1px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #00ffff, #ff00ff);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #ff00ff, #00ffff);
}