/* SimCity Multiplayer - SNES Style */

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

:root {
  /* SNES-inspired colors */
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-light: #0f3460;
  --accent: #e94560;
  --text: #eaeaea;
  --text-dim: #888;

  /* Zone colors */
  --zone-r: #c84040;
  --zone-c: #4040c8;
  --zone-i: #c8c840;

  /* Terrain */
  --grass: #40a040;
  --water: #4080c8;
  --road: #606060;
  --rail: #404040;

  /* Player colors */
  --p1: #4aa3ff;
  --p2: #ff9f43;
  --p3: #5cd65c;
  --p4: #e056fd;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: 'Courier New', monospace;
  color: var(--text);
  image-rendering: pixelated;
}

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

.screen.hidden {
  display: none;
}

/* ==================== LOBBY ==================== */

.lobby-container {
  background: var(--bg-medium);
  border: 4px solid var(--accent);
  padding: 30px 40px;
  text-align: center;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

.game-title {
  font-size: 48px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 8px;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--text-dim);
  margin-bottom: 25px;
  font-size: 14px;
}

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

.room-info label {
  font-size: 14px;
}

.room-info input {
  width: 100px;
  padding: 8px;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
  background: var(--bg-dark);
  border: 2px solid var(--bg-light);
  color: var(--text);
  font-family: inherit;
}

.room-info input:focus {
  outline: none;
  border-color: var(--accent);
}

#copy-link-btn {
  padding: 8px 12px;
  background: var(--bg-light);
  border: 2px solid var(--text-dim);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

#copy-link-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 25px;
}

.player-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  background: var(--bg-dark);
  border: 2px solid var(--bg-light);
}

.player-slot.active {
  border-color: var(--accent);
}

.player-color {
  width: 20px;
  height: 20px;
  border: 2px solid #000;
}

.player-color.p1 { background: var(--p1); }
.player-color.p2 { background: var(--p2); }
.player-color.p3 { background: var(--p3); }
.player-color.p4 { background: var(--p4); }

.player-name {
  flex: 1;
  text-align: left;
  color: var(--text-dim);
}

.player-slot.active .player-name {
  color: var(--text);
}

.player-status {
  font-size: 12px;
  color: var(--text-dim);
}

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

.big-btn {
  padding: 15px 50px;
  font-size: 20px;
  font-family: inherit;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: transform 0.1s;
}

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

.big-btn:active {
  transform: scale(0.95);
}

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

.status-text {
  margin-top: 15px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ==================== COUNTDOWN ==================== */

.countdown-container {
  text-align: center;
}

.countdown-container h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text-dim);
}

#countdown-number {
  font-size: 120px;
  color: var(--accent);
  text-shadow: 4px 4px 0 #000;
}

/* ==================== GAME SCREEN ==================== */

#game-screen {
  display: none;
  flex-direction: column;
}

#game-screen:not(.hidden) {
  display: flex;
}

/* Top Bar */
#top-bar {
  height: 36px;
  background: var(--bg-medium);
  border-bottom: 2px solid var(--bg-light);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 20px;
  z-index: 100;
}

.top-section {
  display: flex;
  gap: 15px;
  align-items: center;
}

#city-name {
  font-weight: bold;
  color: var(--accent);
}

#date-display {
  color: var(--text);
}

#population-display {
  color: var(--zone-r);
}

#city-class {
  color: var(--text-dim);
  font-size: 12px;
}

#budget-display {
  color: #5cd65c;
  font-weight: bold;
}

.speed-controls {
  margin-left: auto;
}

.speed-btn {
  width: 32px;
  height: 24px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-light);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 10px;
  font-family: inherit;
}

.speed-btn:hover {
  background: var(--bg-light);
}

.speed-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Toolbar */
#toolbar {
  position: absolute;
  left: 0;
  top: 36px;
  bottom: 30px;
  width: 60px;
  background: var(--bg-medium);
  border-right: 2px solid var(--bg-light);
  display: flex;
  flex-direction: column;
  padding: 5px;
  gap: 5px;
  overflow-y: auto;
  z-index: 100;
}

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

.tool-label {
  font-size: 8px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 5px;
}

.tool-btn {
  width: 48px;
  height: 40px;
  background: var(--bg-dark);
  border: 2px solid var(--bg-light);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.tool-btn:hover {
  border-color: var(--text-dim);
}

.tool-btn.active {
  border-color: var(--accent);
  background: var(--bg-light);
}

.tool-icon {
  font-size: 18px;
  font-weight: bold;
}

.tool-sub {
  font-size: 8px;
  color: var(--text-dim);
}

.tool-btn.zone-r .tool-icon { color: var(--zone-r); }
.tool-btn.zone-c .tool-icon { color: var(--zone-c); }
.tool-btn.zone-i .tool-icon { color: var(--zone-i); }

/* Canvas */
#game-canvas {
  position: absolute;
  left: 60px;
  top: 36px;
  right: 0;
  bottom: 30px;
  background: var(--water);
  cursor: crosshair;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Minimap */
#minimap-container {
  position: absolute;
  right: 10px;
  bottom: 40px;
  width: 150px;
  height: 125px;
  background: var(--bg-dark);
  border: 2px solid var(--bg-light);
  z-index: 100;
}

#minimap {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* RCI Meter */
#rci-meter {
  position: absolute;
  right: 170px;
  bottom: 40px;
  width: 80px;
  height: 100px;
  background: var(--bg-medium);
  border: 2px solid var(--bg-light);
  padding: 5px;
  z-index: 100;
}

.rci-label {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.rci-bar-container {
  display: flex;
  gap: 5px;
  height: 60px;
  justify-content: center;
}

.rci-bar {
  width: 18px;
  height: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--bg-light);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

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

.r-bar .rci-fill { background: var(--zone-r); }
.c-bar .rci-fill { background: var(--zone-c); }
.i-bar .rci-fill { background: var(--zone-i); }

.rci-labels {
  display: flex;
  justify-content: space-around;
  font-size: 10px;
  margin-top: 5px;
}

.rci-labels span:nth-child(1) { color: var(--zone-r); }
.rci-labels span:nth-child(2) { color: var(--zone-c); }
.rci-labels span:nth-child(3) { color: var(--zone-i); }

/* Info Panel */
#info-panel {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  height: 30px;
  background: var(--bg-medium);
  border-top: 2px solid var(--bg-light);
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: space-between;
  z-index: 100;
}

#tool-info {
  color: var(--text);
  font-size: 12px;
}

#cursor-pos {
  color: var(--text-dim);
  font-size: 12px;
}

/* Players Panel */
#players-panel {
  position: absolute;
  right: 10px;
  top: 46px;
  z-index: 100;
}

#player-cursors {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.player-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 11px;
}

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

/* Dr Wright Message */
#wright-message {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-medium);
  border: 4px solid var(--accent);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 500px;
  z-index: 200;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#wright-message.hidden {
  display: none;
}

.wright-portrait {
  width: 64px;
  height: 64px;
  background: #40a040;
  border: 2px solid #000;
  flex-shrink: 0;
  /* Green haired man placeholder */
  background: linear-gradient(180deg, #2d8a2d 0%, #2d8a2d 30%, #f4c896 30%, #f4c896 60%, #2b4c7d 60%);
}

.wright-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.wright-close {
  padding: 5px 15px;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

/* Budget popup would go here */

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

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}
