/* SimCity Multiplayer - SNES Style */

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

body {
  background: #1a1a2e;
  color: #eee;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* ===== LOBBY SCREEN ===== */
.lobby-container {
  background: #16213e;
  border: 4px solid #4a6fa5;
  border-radius: 8px;
  padding: 30px 50px;
  text-align: center;
  box-shadow: 0 0 30px rgba(74, 111, 165, 0.3);
}

.game-title {
  font-size: 48px;
  color: #4aa3ff;
  text-shadow: 3px 3px 0 #1a1a2e, 4px 4px 0 #4a6fa5;
  margin-bottom: 5px;
  letter-spacing: 4px;
}

.subtitle {
  font-size: 18px;
  color: #888;
  margin-bottom: 25px;
}

.room-info {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.room-info label {
  color: #aaa;
}

#room-code-input {
  background: #0f0f23;
  border: 2px solid #4a6fa5;
  color: #4aa3ff;
  font-size: 24px;
  font-family: inherit;
  text-align: center;
  width: 120px;
  padding: 5px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#copy-link-btn {
  background: #4a6fa5;
  border: none;
  color: #fff;
  padding: 8px 15px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 4px;
}

#copy-link-btn:hover {
  background: #4aa3ff;
}

/* Players List */
.players-list {
  margin: 20px 0;
}

.player-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  margin: 5px 0;
  background: #0f0f23;
  border-radius: 4px;
  border: 1px solid #333;
}

.player-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.player-color.p1 { background: #4aa3ff; }
.player-color.p2 { background: #ff9f43; }
.player-color.p3 { background: #5cd65c; }
.player-color.p4 { background: #e056fd; }

.player-name {
  flex: 1;
  margin-left: 15px;
  text-align: left;
  color: #888;
}

.player-slot.connected .player-name {
  color: #fff;
}

.player-status {
  font-size: 14px;
  color: #666;
}

.player-slot.ready .player-status::after {
  content: 'READY';
  color: #5cd65c;
}

.player-slot.host .player-name::after {
  content: ' (Host)';
  color: #4aa3ff;
  font-size: 12px;
}

/* Ready Button */
.ready-btn {
  background: linear-gradient(180deg, #5cd65c 0%, #3da03d 100%);
  border: 3px solid #2d7a2d;
  color: #fff;
  font-size: 24px;
  font-family: inherit;
  padding: 12px 50px;
  cursor: pointer;
  margin-top: 15px;
  text-shadow: 1px 1px 0 #2d7a2d;
  border-radius: 6px;
  transition: transform 0.1s;
}

.ready-btn:hover {
  transform: scale(1.05);
}

.ready-btn.is-ready {
  background: linear-gradient(180deg, #ff6b6b 0%, #cc5555 100%);
  border-color: #993333;
}

.hint {
  margin-top: 15px;
  color: #666;
  font-size: 14px;
}

/* ===== COUNTDOWN SCREEN ===== */
.countdown-container {
  text-align: center;
}

#countdown-number {
  font-size: 120px;
  color: #4aa3ff;
  text-shadow: 4px 4px 0 #1a1a2e;
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.countdown-text {
  font-size: 24px;
  color: #888;
  margin-top: 20px;
}

/* ===== GAME SCREEN ===== */
#game-screen {
  flex-direction: column;
  background: #0a0a15;
}

/* Top Bar */
#top-bar {
  height: 40px;
  background: #16213e;
  border-bottom: 2px solid #4a6fa5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  font-size: 14px;
  z-index: 100;
}

.top-section {
  display: flex;
  gap: 20px;
}

#date-display {
  color: #aaa;
}

#population-display {
  color: #5cd65c;
}

#city-class {
  color: #4aa3ff;
}

#funds-display {
  color: #ffd700;
  font-weight: bold;
}

#speed-display {
  color: #888;
}

/* Game Container */
#game-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Toolbar */
#toolbar {
  width: 60px;
  background: #16213e;
  border-right: 2px solid #4a6fa5;
  display: flex;
  flex-direction: column;
  padding: 5px;
  gap: 5px;
  overflow-y: auto;
  z-index: 100;
}

.tool-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.section-label {
  font-size: 8px;
  color: #666;
  text-align: center;
  margin-top: 5px;
}

.tool-btn, .speed-btn {
  width: 50px;
  height: 32px;
  background: #0f0f23;
  border: 2px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover, .speed-btn:hover {
  background: #1a1a3a;
  border-color: #4a6fa5;
}

.tool-btn.selected, .speed-btn.selected {
  background: #4a6fa5;
  border-color: #4aa3ff;
  color: #fff;
}

/* Zone colors */
.tool-btn[data-tool="residential"] { color: #ff6b6b; }
.tool-btn[data-tool="commercial"] { color: #6b6bff; }
.tool-btn[data-tool="industrial"] { color: #ffff6b; }
.tool-btn[data-tool="road"] { color: #888; }
.tool-btn[data-tool="rail"] { color: #8b4513; }
.tool-btn[data-tool="power"] { color: #ffcc00; }
.tool-btn[data-tool="coal"] { color: #666; }
.tool-btn[data-tool="nuclear"] { color: #ff00ff; }
.tool-btn[data-tool="police"] { color: #4aa3ff; }
.tool-btn[data-tool="fire"] { color: #ff4444; }
.tool-btn[data-tool="park"] { color: #5cd65c; }

/* Canvas - crisp pixel rendering for SNES-style graphics */
#game-canvas {
  flex: 1;
  background: #1a3a1a;
  cursor: crosshair;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* RCI Meter */
#rci-meter {
  position: absolute;
  right: 130px;
  top: 10px;
  background: rgba(22, 33, 62, 0.9);
  border: 2px solid #4a6fa5;
  padding: 8px;
  border-radius: 4px;
  z-index: 50;
}

.rci-label {
  font-size: 10px;
  color: #888;
  text-align: center;
  margin-bottom: 5px;
}

.rci-bar {
  display: flex;
  align-items: center;
  margin: 3px 0;
}

.rci-letter {
  width: 15px;
  font-size: 12px;
  font-weight: bold;
}

.rci-letter:nth-child(1) { color: #ff6b6b; }

.rci-bar:nth-child(2) .rci-letter { color: #ff6b6b; }
.rci-bar:nth-child(3) .rci-letter { color: #6b6bff; }
.rci-bar:nth-child(4) .rci-letter { color: #ffff6b; }

.rci-track {
  width: 80px;
  height: 10px;
  background: #0a0a15;
  border: 1px solid #333;
  position: relative;
}

.rci-fill {
  height: 100%;
  transition: width 0.3s;
}

.r-fill { background: #ff6b6b; }
.c-fill { background: #6b6bff; }
.i-fill { background: #ffff6b; }

/* Minimap */
#minimap {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 120px;
  height: 100px;
  background: #0a0a15;
  border: 2px solid #4a6fa5;
  z-index: 50;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Bottom Bar */
#bottom-bar {
  height: 50px;
  background: #16213e;
  border-top: 2px solid #4a6fa5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  z-index: 100;
}

#message-area {
  flex: 1;
  font-size: 14px;
  color: #aaa;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#players-cursors {
  display: flex;
  gap: 15px;
}

.cursor-indicator {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #0a0a15;
}

.cursor-indicator.p1 { color: #4aa3ff; border: 1px solid #4aa3ff; }
.cursor-indicator.p2 { color: #ff9f43; border: 1px solid #ff9f43; }
.cursor-indicator.p3 { color: #5cd65c; border: 1px solid #5cd65c; }
.cursor-indicator.p4 { color: #e056fd; border: 1px solid #e056fd; }

/* Message toast */
.toast-message {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 33, 62, 0.95);
  border: 2px solid #4aa3ff;
  padding: 15px 25px;
  border-radius: 6px;
  z-index: 1000;
  animation: fadeInOut 4s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.toast-message .speaker {
  color: #5cd65c;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 800px) {
  #toolbar {
    width: 50px;
  }
  .tool-btn, .speed-btn {
    width: 40px;
    height: 28px;
    font-size: 10px;
  }
  #rci-meter {
    right: 70px;
    top: 5px;
    padding: 5px;
  }
  #minimap {
    width: 60px;
    height: 50px;
    right: 5px;
    top: 5px;
  }
}
