/* SimCity Multiplayer - SNES Style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'PressStart';
  src: local('Press Start 2P');
}

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

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* Lobby Screen */
#lobby-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.lobby-container {
  text-align: center;
  padding: 2rem;
}

.game-title {
  font-size: 4rem;
  color: #4ecdc4;
  text-shadow: 4px 4px 0 #1a1a2e, 6px 6px 0 #0f3460;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #888;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.room-info {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

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

#room-code-input {
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  width: 8rem;
  text-align: center;
  text-transform: uppercase;
  background: #16213e;
  border: 2px solid #4ecdc4;
  color: #4ecdc4;
  letter-spacing: 0.2em;
}

#copy-link-btn {
  padding: 0.5rem 1rem;
  background: #4ecdc4;
  border: none;
  color: #1a1a2e;
  cursor: pointer;
  font-weight: bold;
}

#copy-link-btn:hover {
  background: #45b7aa;
}

.player-slots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.player-slot {
  width: 120px;
  padding: 1rem;
  background: #16213e;
  border: 2px solid #333;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-slot.occupied {
  border-color: #4ecdc4;
}

.player-slot.ready {
  border-color: #5cd65c;
  background: #1a3a2e;
}

#slot-1.occupied { border-color: #4aa3ff; }
#slot-2.occupied { border-color: #ff9f43; }
#slot-3.occupied { border-color: #5cd65c; }
#slot-4.occupied { border-color: #e056fd; }

.slot-label {
  font-weight: bold;
  color: #888;
}

.slot-status {
  font-size: 0.8rem;
  color: #666;
}

.ready-btn {
  padding: 1rem 3rem;
  font-size: 1.5rem;
  background: #4ecdc4;
  border: none;
  color: #1a1a2e;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.ready-btn:hover {
  background: #45b7aa;
  transform: scale(1.05);
}

.ready-btn.is-ready {
  background: #5cd65c;
}

.countdown-display {
  margin-top: 2rem;
}

#countdown-number {
  font-size: 6rem;
  color: #4ecdc4;
  animation: pulse 0.5s infinite;
}

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

/* Game Screen */
#game-screen {
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
}

/* Top Bar */
#top-bar {
  height: 40px;
  background: #16213e;
  border-bottom: 2px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.top-info {
  display: flex;
  gap: 2rem;
}

.top-info span {
  color: #4ecdc4;
  font-weight: bold;
}

#funds-display {
  color: #5cd65c !important;
}

.speed-controls {
  display: flex;
  gap: 0.25rem;
}

.speed-btn {
  padding: 0.25rem 0.5rem;
  background: #333;
  border: 1px solid #444;
  color: #888;
  cursor: pointer;
  font-size: 0.8rem;
}

.speed-btn:hover {
  background: #444;
}

.speed-btn.active {
  background: #4ecdc4;
  color: #1a1a2e;
  border-color: #4ecdc4;
}

/* Game Area */
#game-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Toolbar */
#toolbar {
  width: 60px;
  background: #16213e;
  border-right: 2px solid #333;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.5rem;
  overflow-y: auto;
}

.tool-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-label {
  font-size: 0.6rem;
  color: #666;
  text-align: center;
  margin-bottom: 0.25rem;
}

.tool-btn {
  width: 44px;
  height: 36px;
  background: #333;
  border: 2px solid #444;
  color: #888;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8rem;
  transition: all 0.1s;
}

.tool-btn:hover {
  background: #444;
  border-color: #666;
}

.tool-btn.active {
  background: #4ecdc4;
  color: #1a1a2e;
  border-color: #4ecdc4;
}

.tool-btn[data-tool="residential"] { color: #C84040; }
.tool-btn[data-tool="commercial"] { color: #4040C8; }
.tool-btn[data-tool="industrial"] { color: #C8C840; }
.tool-btn[data-tool="road"] { color: #888; }
.tool-btn[data-tool="rail"] { color: #A0522D; }
.tool-btn[data-tool="power"] { color: #FFD700; }
.tool-btn[data-tool="coal"] { color: #555; }
.tool-btn[data-tool="nuclear"] { color: #90EE90; }
.tool-btn[data-tool="bulldoze"] { color: #FF6B6B; }

.tool-btn.active[data-tool="residential"] { background: #C84040; color: #fff; border-color: #C84040; }
.tool-btn.active[data-tool="commercial"] { background: #4040C8; color: #fff; border-color: #4040C8; }
.tool-btn.active[data-tool="industrial"] { background: #C8C840; color: #000; border-color: #C8C840; }

/* Canvas Container */
#canvas-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: crosshair;
}

#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Right Panel */
#right-panel {
  width: 140px;
  background: #16213e;
  border-left: 2px solid #333;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.5rem;
}

.panel-section {
  background: #1a1a2e;
  border: 1px solid #333;
  padding: 0.5rem;
}

/* RCI Meter */
.rci-meter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rci-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rci-label {
  width: 12px;
  font-size: 0.7rem;
  font-weight: bold;
}

.rci-label:nth-child(1) { color: #C84040; }

.bar-container {
  flex: 1;
  height: 10px;
  background: #333;
  position: relative;
}

.demand-bar {
  position: absolute;
  top: 0;
  height: 100%;
  transition: width 0.3s;
}

.demand-bar.residential { background: #C84040; left: 50%; }
.demand-bar.commercial { background: #4040C8; left: 50%; }
.demand-bar.industrial { background: #C8C840; left: 50%; }

/* Minimap */
#minimap {
  width: 100%;
  height: auto;
  background: #40A040;
  image-rendering: pixelated;
}

/* Player List */
#player-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.player-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.player-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.player-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dr. Wright Popup */
#wright-popup {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #16213e;
  border: 3px solid #4ecdc4;
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  max-width: 400px;
  z-index: 100;
}

.wright-portrait {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #5cd65c 30%, #3a8a3a 70%);
  border: 2px solid #333;
  border-radius: 4px;
}

.wright-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#wright-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

#wright-close {
  align-self: flex-end;
  padding: 0.25rem 1rem;
  background: #4ecdc4;
  border: none;
  color: #1a1a2e;
  cursor: pointer;
  font-weight: bold;
}

/* Tool Info */
#tool-info {
  position: absolute;
  bottom: 10px;
  left: 80px;
  background: rgba(22, 33, 62, 0.9);
  padding: 0.5rem 1rem;
  border: 1px solid #333;
  display: flex;
  gap: 1rem;
}

#tool-name {
  color: #4ecdc4;
  font-weight: bold;
}

#tool-cost {
  color: #5cd65c;
}

/* Coordinates */
#coords-display {
  position: absolute;
  bottom: 10px;
  right: 160px;
  background: rgba(22, 33, 62, 0.9);
  padding: 0.5rem 1rem;
  border: 1px solid #333;
  font-size: 0.8rem;
  color: #888;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Responsive */
@media (max-width: 800px) {
  #right-panel {
    display: none;
  }

  #toolbar {
    width: 50px;
  }

  .tool-btn {
    width: 38px;
    height: 32px;
    font-size: 0.7rem;
  }

  .game-title {
    font-size: 2.5rem;
  }

  .player-slots {
    flex-direction: column;
    align-items: center;
  }
}
