:root {
  --bg: #111;
  --text: #e0e0e0;
  --accent: #d4a017;
  --box-bg: #222;
  --box-border: #444;
  --light: #4488ff;
  --dark: #cf2f2f;
  --neutral: #888;
  --city: #00bfff;
  --guild: #32cd32;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  color: var(--text);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

#wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.box {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.9em;
  color: var(--accent);
  letter-spacing: 0.01em;
}

h3 {
  margin-top: 0;
  color: var(--accent);
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.center {
  text-align: center;
}

.dimmed {
  color: #666;
  font-style: italic;
}

header {
  padding: 20px 20px 0;
  max-width: 1200px;
  margin: 0 auto;
}
header .sub {
  margin: 0 0 4px;
  color: #888;
}

.status-header-text {
  font-size: 2.6em;
  font-weight: bold;
  color: #fff;
  line-height: 1.1;
}
.status-header-text .label {
  font-size: 0.36em;
  font-weight: normal;
  color: #aaa;
  margin-left: 8px;
}

.status-date {
  font-size: 0.9em;
  color: #888;
  margin: 6px 0 0;
}

.note {
  margin: 14px auto 0;
  max-width: 640px;
  font-size: 0.85em;
  line-height: 1.5;
  color: #777;
}

.server-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  text-align: center;
}

.stat-row {
  padding: 8px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
}
.stat-row:last-child {
  border-bottom: 0;
}

.stat-label {
  font-weight: bold;
  color: #aaa;
}

.stat-val {
  color: #fff;
  text-align: right;
  font-family: monospace;
  font-size: 1.1em;
}

.stat-highlight {
  color: var(--accent);
  font-weight: bold;
  font-size: 1.2em;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-weight: bold;
  color: #aaa;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 10px 8px 0;
  border-bottom: 2px solid #555;
}

td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid #333;
}

tr:last-child td {
  border-bottom: 0;
}

td.name {
  color: var(--accent);
  font-weight: bold;
}

td.pos {
  font-family: monospace;
  color: #888;
}

.faction {
  display: inline-block;
  font-size: 0.85em;
  padding: 2px 9px;
  border-radius: 3px;
  border: 1px solid currentColor;
}
.faction.light {
  color: #8cbaff;
  background: rgba(68, 136, 255, 0.08);
}
.faction.dark {
  color: #ff6b6b;
  background: rgba(207, 47, 47, 0.08);
}
.faction.neutral {
  color: #bbb;
  background: rgba(128, 128, 128, 0.08);
}

.empty {
  color: #888;
  font-style: italic;
}

.map-controls {
  text-align: center;
  margin-bottom: 12px;
  background: rgba(30, 30, 30, 0.8);
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #444;
  display: inline-block;
}
.map-controls label {
  margin: 0 10px;
  color: #ccc;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
}
.map-controls input {
  margin-right: 5px;
  vertical-align: middle;
}

.map-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 2px solid #444;
  line-height: 0;
}

.world-map {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

#markers {
  line-height: normal;
}

.marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 0 4px #000;
  z-index: 50;
  border: 1px solid #fff;
}
.marker.light {
  background-color: var(--light);
}
.marker.dark {
  background-color: var(--dark);
}
.marker.neutral {
  background-color: var(--neutral);
}

.marker-city {
  background-color: var(--city);
  z-index: 40;
  border-radius: 2px;
}

.marker-guild {
  width: 0 !important;
  height: 0 !important;
  background-color: transparent !important;
  border: none !important;
  border-left: 7px solid transparent !important;
  border-right: 7px solid transparent !important;
  border-bottom: 14px solid var(--guild) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 2px #000);
  z-index: 45;
}

.marker:hover,
.marker-city:hover,
.marker-guild:hover {
  z-index: 100;
  transform: translate(-50%, -50%) scale(1.4);
}

.tooltip {
  display: none;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid var(--accent);
  color: #fff;
  line-height: 1.4;
  padding: 8px;
  width: 200px;
  text-align: center;
  border-radius: 4px;
  pointer-events: none;
  font-size: 12px;
  z-index: 9999;
}
.tooltip strong {
  display: block;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 1.1em;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
}

.marker-city .tooltip {
  border-color: var(--city);
  width: auto;
  white-space: nowrap;
}
.marker-city .tooltip strong {
  color: var(--city);
  border-bottom: none;
  margin-bottom: 0;
}

.marker-guild .tooltip {
  border-color: var(--guild);
  color: var(--guild);
  width: 260px;
  white-space: normal;
}
.marker-guild .tooltip strong {
  color: var(--guild);
}

.marker:hover .tooltip,
.marker-city:hover .tooltip,
.marker-guild:hover .tooltip {
  display: block;
}

.tooltip-meta {
  color: #bbb;
  font-size: 0.92em;
}

.marker-cluster {
  width: 16px !important;
  height: 16px !important;
  font-size: 10px;
  font-weight: bold;
  color: #000;
  text-align: center;
  line-height: 16px;
  background-color: #fff;
  border: 2px solid #000;
  z-index: 60;
}

.marker-cluster:hover {
  z-index: 110;
  transform: translate(-50%, -50%) scale(1.2);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 0, 0, 0);
  }
}
.error {
  background: rgba(207, 47, 47, 0.12);
  border: 1px solid var(--dark);
  color: #ff6b6b;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  #wrapper, header {
    padding: 12px;
  }
  .box {
    padding: 14px;
  }
  th:nth-child(n+4), td:nth-child(n+4) {
    display: none;
  }
}
.guildless-container {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #444;
}

.guildless-list span {
  display: inline-block;
  margin: 0 10px;
  color: #ccc;
  font-weight: 500;
}

.guild-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  text-align: left;
}

.guild-col {
  padding: 15px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.gc-light {
  background-color: rgba(68, 136, 255, 0.08);
  border-color: rgba(68, 136, 255, 0.15);
}

.gc-neutral {
  background-color: rgba(128, 128, 128, 0.08);
  border-color: rgba(128, 128, 128, 0.15);
}

.gc-dark {
  background-color: rgba(207, 47, 47, 0.08);
  border-color: rgba(207, 47, 47, 0.15);
}

.col-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 15px;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 2px solid #555;
}
.col-title.light {
  border-color: var(--light);
  color: #8cbaff;
}
.col-title.dark {
  border-color: var(--dark);
  color: #ff6b6b;
}

.guild-entry {
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 4px;
}
.guild-entry:last-child {
  margin-bottom: 0;
}

.guild-entry-name {
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
}

.guild-entry-members {
  font-size: 0.9em;
  color: #bbb;
  line-height: 1.4;
}

.guild-entry-count {
  margin-top: 6px;
  font-size: 0.82em;
  color: #777;
}
