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

body {
  background-color: #101010;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: #e5e5e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
}

/* === TOP BAR === */
#stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background-color: #181818;
  border-bottom: 1px solid #333;
  width: 100%;
  padding: 8px 0;
  font-size: 14px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
}

#stats p {
  margin: 0;
  padding: 2px 8px;
  background: #222;
  border-radius: 6px;
}

/* === MAP === */
#map {
  display: grid;
  grid-template-columns: repeat(40, 16px);
  grid-template-rows: repeat(20, 16px);
  gap: 1px;
  margin-top: 70px;
  justify-content: center;
  background-color: #202020;
  border: 2px solid #303030;
  border-radius: 8px;
  padding: 6px;
}

.tile {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.tile:hover {
  transform: scale(1.2);
  z-index: 2;
}

/* === BASE COLORS === */
.red { background-color: #d43d3d; }
.blue { background-color: #3d6ad4; }

/* === REBEL / ANARCHY COLORS === */
[class*="PURPLE"], .rebel-purple { background-color: #9b59b6 !important; }
[class*="GREEN"], .rebel-green { background-color: #2ecc71 !important; }
[class*="ORANGE"], .rebel-orange { background-color: #e67e22 !important; }
[class*="TEAL"], .rebel-teal { background-color: #1abc9c !important; }
[class*="YELLOW"], .rebel-yellow { background-color: #f1c40f !important; color: #000; }
[class*="MAGENTA"], .rebel-magenta { background-color: #e84393 !important; }
[class*="CYAN"], .rebel-cyan { background-color: #00cec9 !important; color: #000; }
[class*="BROWN"], .rebel-brown { background-color: #8e5c3b !important; }

/* === MISSILE FLASH === */
.missile {
  animation: missileFlash 0.4s ease-in-out alternate infinite;
}
@keyframes missileFlash {
  from { background-color: #fff; transform: scale(1.1); }
  to { background-color: #ff3838; transform: scale(1); }
}

/* === CAPTURE HIGHLIGHT === */
.tile.captured {
  outline: 1px solid #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.6);
  animation: captureFlash 0.5s ease-out;
}
@keyframes captureFlash {
  0% { opacity: 0.8; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); box-shadow: none; }
}

/* === SPEED CONTROLS === */
#speed-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
}

.speed-btn {
  padding: 5px 10px;
  font-size: 14px;
  color: #ddd;
  background: #1b1b1b;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.speed-btn:hover {
  background: #2a2a2a;
}

/* === LOG PANEL === */
#log {
  margin-top: 8px;
  width: 95%;
  max-width: 800px;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #ccc;
  max-height: 150px;
  overflow-y: auto;
}

/* === MOBILE VIEW === */
@media (max-width: 768px) {
  #map {
    grid-template-columns: repeat(25, 12px);
    grid-template-rows: repeat(15, 12px);
    padding: 4px;
  }

  .tile {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }

  #stats {
    font-size: 12px;
    padding: 6px;
  }

  #log {
    font-size: 11px;
    padding: 6px;
  }
}