/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
  height: 48px;
  flex-shrink: 0;
}

#top-bar .stats {
  display: flex;
  gap: 24px;
  font-size: 15px;
  font-weight: 600;
}

#top-bar .stats span { display: flex; align-items: center; gap: 6px; }
.stat-icon { font-size: 18px; }
.gold-color { color: #ffd700; }
.lives-color { color: #ff6b6b; }
.wave-color { color: #74b9ff; }
.score-color { color: #a29bfe; }

#top-bar .controls { display: flex; gap: 8px; }
#top-bar button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
#top-bar button:hover { transform: translateY(-1px); }

#btn-start-wave {
  background: #00b894;
  color: #fff;
}
#btn-start-wave:hover { background: #00a381; }
#btn-start-wave:disabled { background: #555; cursor: default; transform: none; }

#btn-speed {
  background: #6c5ce7;
  color: #fff;
}

#btn-editor {
  background: #e17055;
  color: #fff;
}

#main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#game-canvas {
  cursor: crosshair;
  display: block;
}

#sidebar {
  width: 220px;
  background: #16213e;
  border-left: 2px solid #0f3460;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

#sidebar h3 {
  padding: 10px 12px 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #74b9ff;
  border-bottom: 1px solid #0f3460;
}

.tower-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #0f3460;
}
.tower-btn:hover { background: #1a2a4a; }
.tower-btn.selected { background: #0f3460; outline: 2px solid #74b9ff; outline-offset: -2px; }
.tower-btn.disabled { opacity: 0.4; cursor: not-allowed; }

.tower-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tower-info { flex: 1; }
.tower-info .name { font-size: 13px; font-weight: 600; }
.tower-info .cost { font-size: 11px; color: #ffd700; }
.tower-info .desc { font-size: 10px; color: #888; margin-top: 1px; }

/* Tower detail panel (when a placed tower is selected) */
#tower-detail {
  display: none;
  padding: 12px;
  border-top: 2px solid #0f3460;
}
#tower-detail h4 { font-size: 14px; margin-bottom: 6px; }
#tower-detail .detail-stats { font-size: 12px; color: #aaa; line-height: 1.6; }
#tower-detail .detail-stats span { color: #e0e0e0; font-weight: 600; }

#btn-upgrade, #btn-sell {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
#btn-upgrade { background: #00b894; color: #fff; }
#btn-upgrade:hover { background: #00a381; }
#btn-upgrade:disabled { background: #555; cursor: default; }
#btn-sell { background: #d63031; color: #fff; }
#btn-sell:hover { background: #b71c1c; }

/* Map editor */
#editor-panel {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #1a1a2e;
  z-index: 100;
  flex-direction: column;
}
#editor-panel.active { display: flex; }

#editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
  height: 48px;
}
#editor-top h2 { font-size: 16px; }
#editor-top .tools { display: flex; gap: 6px; }
#editor-top button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: #2d3436;
  color: #e0e0e0;
}
#editor-top button:hover { background: #3d4446; }
#editor-top button.active { background: #6c5ce7; color: #fff; }

#editor-canvas { cursor: crosshair; display: block; }

/* Wave announcement */
#wave-announce {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(116, 185, 255, 0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 50;
}
#wave-announce.show { opacity: 1; }

/* Game over overlay */
#game-over {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#game-over.active { display: flex; }
#game-over h1 { font-size: 64px; color: #ff6b6b; margin-bottom: 16px; }
#game-over .final-score { font-size: 24px; color: #a29bfe; margin-bottom: 24px; }
#game-over button {
  padding: 12px 32px;
  background: #00b894;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Tooltip */
#tooltip {
  display: none;
  position: fixed;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  z-index: 60;
  pointer-events: none;
  max-width: 220px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
/* Mobile responsive */
@media (max-width: 768px) {
  #top-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 10px;
    gap: 6px;
  }
  #top-bar .stats { gap: 12px; font-size: 12px; flex-wrap: wrap; }
  #top-bar .controls { gap: 4px; }
  #top-bar button { padding: 6px 10px; font-size: 11px; }
  #main-area { flex-direction: column; }
  #sidebar {
    width: 100%;
    border-left: none;
    border-top: 2px solid #0f3460;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 160px;
    overflow-y: auto;
  }
  #sidebar h3 { width: 100%; padding: 6px 10px 4px; font-size: 11px; }
  .tower-btn { padding: 6px 8px; min-width: 48%; flex: 1 1 48%; }
  .tower-icon { width: 28px; height: 28px; font-size: 16px; }
  .tower-info .name { font-size: 11px; }
  .tower-info .cost { font-size: 10px; }
  .tower-info .desc { display: none; }
  #tower-detail { padding: 8px; }
  #tower-detail h4 { font-size: 12px; }
  #tower-detail .detail-stats { font-size: 11px; }
  #btn-upgrade, #btn-sell { padding: 6px; font-size: 11px; min-height: 44px; }
  #game-canvas { max-width: 100vw; max-height: 50vh; }
}

@media (max-width: 480px) {
  #top-bar .stats { gap: 8px; font-size: 11px; }
  #top-bar button { padding: 5px 8px; font-size: 10px; min-height: 44px; }
  #sidebar { max-height: 140px; }
  .tower-btn { min-width: 100%; }
  #game-over h1 { font-size: 36px; }
  #game-over .final-score { font-size: 18px; }
  #game-over button { padding: 10px 24px; font-size: 16px; min-height: 44px; }
}
