:root {
  --bg: #181818;
  --fg: #00ff00;
  --accent: #00ff00;
  --table-bg: #181818;
  --table-fg: #b5ffb5;
  --border: #00ff00;
  --button-bg: #111;
  --button-fg: #00ff00;
  --button-hover-bg: #00ff00;
  --button-hover-fg: #181818;
  --font: 'Fira Mono', 'Consolas', 'Menlo', monospace;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  margin: 0;
  min-height: 100vh;
}

.terminal-container {
  max-width: 700px;
  margin: 40px auto;
  background: #222;
  border-radius: 8px;
  box-shadow: 0 0 24px #000a;
  padding: 2rem 2.5rem 2.5rem 2.5rem;
  border: 2px solid var(--border);
}

h1 {
  color: var(--accent);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

p {
  color: var(--table-fg);
  margin-bottom: 1.5rem;
}

button#retest-btn, button#theme-toggle-btn, #center-me-btn {
  background: var(--button-bg);
  color: var(--button-fg);
  border: 1px solid var(--accent);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  margin-right: 0.5rem;
  transition: background 0.2s, color 0.2s;
  outline: none;
  min-width: 44px;
  min-height: 44px;
}
button#retest-btn:focus, button#theme-toggle-btn:focus, #center-me-btn:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button#retest-btn:hover, button#theme-toggle-btn:hover {
  background: var(--button-hover-bg);
  color: var(--button-hover-fg);
}

table#latency-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background: var(--table-bg);
}
table#latency-table th, table#latency-table td {
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #333;
}
table#latency-table th {
  color: var(--accent);
  font-size: 1.1rem;
  border-bottom: 2px solid var(--accent);
}
table#latency-table td {
  color: var(--table-fg);
  font-size: 1rem;
}

/* Latency indicators */
.latency-fast {
  color: #00ff00;
  font-weight: bold;
}
.latency-medium {
  color: #ffff00;
  font-weight: bold;
}
.latency-slow {
  color: #ff4444;
  font-weight: bold;
}

#leaderboard-map {
  margin-top: 2rem;
  color: var(--accent);
  min-height: 60px;
  text-align: center;
  font-size: 1.1rem;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 1rem;
  background: var(--table-bg);
}

/* Themes */
body.theme-matrix {
  --bg: #000;
  --fg: #39ff14;
  --accent: #39ff14;
  --table-bg: #000;
  --table-fg: #b5ffb5;
  --border: #39ff14;
  --button-bg: #111;
  --button-fg: #39ff14;
  --button-hover-bg: #39ff14;
  --button-hover-fg: #000;
  --font: 'Share Tech Mono', 'Fira Mono', 'Consolas', monospace;
}
body.theme-classic {
  --bg: #181818;
  --fg: #ffcc00;
  --accent: #ffcc00;
  --table-bg: #181818;
  --table-fg: #fff7d6;
  --border: #ffcc00;
  --button-bg: #222;
  --button-fg: #ffcc00;
  --button-hover-bg: #ffcc00;
  --button-hover-fg: #181818;
  --font: 'Courier New', 'Consolas', monospace;
}
body.theme-light {
  --bg: #f7f7f7;
  --fg: #222;
  --accent: #0074d9;
  --table-bg: #fff;
  --table-fg: #222;
  --border: #0074d9;
  --button-bg: #fff;
  --button-fg: #0074d9;
  --button-hover-bg: #0074d9;
  --button-hover-fg: #fff;
  --font: 'Fira Mono', 'Consolas', 'Menlo', monospace;
}

/* WarGames animation styles */
.wargames-glow {
  filter: drop-shadow(0 0 8px #39ff14) drop-shadow(0 0 16px #39ff14);
}
.pulse-marker .pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(57,255,20,0.3);
  position: relative;
  animation: pulse 0.7s infinite;
  border: 2px solid #39ff14;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0.7; }
}

#feedback-message {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  min-height: 1.5em;
}
#feedback-message.error {
  color: #ff4444;
  background: #2a0000;
  border: 1px solid #ff4444;
  border-radius: 4px;
  padding: 0.5em 1em;
}
#feedback-message.success {
  color: #00ff00;
  background: #002a00;
  border: 1px solid #00ff00;
  border-radius: 4px;
  padding: 0.5em 1em;
}
#loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}
.spinner {
  border: 4px solid #333;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin-right: 0.7em;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
button:disabled, button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .terminal-container {
    max-width: 98vw;
    padding: 1.2rem 0.5rem 1.5rem 0.5rem;
  }
  #latency-map {
    height: 300px !important;
  }
}
@media (max-width: 600px) {
  .terminal-container {
    max-width: 100vw;
    padding: 0.5rem 0.2rem 1rem 0.2rem;
    border-radius: 0;
    box-shadow: none;
  }
  h1 {
    font-size: 1.3rem;
  }
  #latency-map {
    height: 200px !important;
  }
  table#latency-table th, table#latency-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.9rem;
  }
  button#retest-btn, button#theme-toggle-btn, #center-me-btn {
    font-size: 0.95rem;
    padding: 0.5rem 0.7rem;
    min-width: 38px;
    min-height: 38px;
  }
} 