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

body {
  overflow: hidden;
  background: #000;
  font-family: monospace;
  color: #e0e0e0;
}

#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#currency-hud {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-family: monospace;
  font-size: 2.2rem;
  font-weight: bold;
  color: #ffdd44;
  text-shadow: 0 0 8px rgba(255, 200, 0, 0.4), 2px 2px 0 #000;
  pointer-events: none;
  letter-spacing: 2px;
}

#currency-hud.hidden { display: none; }

#dps-hud {
  position: fixed;
  top: 12px;
  left: 170px;
  z-index: 30;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: bold;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#dps-hud.hidden { display: none; }

.dps-row {
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 1px 1px 0 #000;
}

.dps-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
}

.screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
}

.screen.hidden { display: none; }

.screen h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ffaa00;
  font-family: monospace;
}

.screen p {
  font-size: 1.2rem;
  margin: 0.5rem 0;
  font-family: monospace;
}

.screen button {
  font-family: monospace;
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  margin: 0.5rem;
  background: #334;
  color: #e0e0e0;
  border: 2px solid #ffaa00;
  cursor: pointer;
  transition: background 0.15s;
}

.screen button:hover { background: #445; }
.screen button:disabled { opacity: 0.4; cursor: not-allowed; }

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  background: #223;
  border: 1px solid #556;
}

.tab.active {
  background: #445;
  border-color: #ffaa00;
}

.tab-content {
  width: 80%;
  max-width: 600px;
  max-height: 60vh;
  overflow-y: auto;
}

.tab-content.hidden { display: none; }

.hire-card, .team-card, .upgrade-card {
  background: #223;
  border: 1px solid #556;
  padding: 1rem;
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 4px;
}

.hire-btn {
  font-size: 1.1rem !important;
  padding: 1rem 1.5rem !important;
  min-width: 120px;
}

.hire-card:hover, .team-card:hover, .upgrade-card:hover {
  border-color: #888;
}

.card-info {
  flex: 1;
}

.card-info h3 {
  color: #ffaa00;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.card-info p {
  font-size: 0.85rem;
  color: #aaa;
  margin: 0.15rem 0;
}

.currency-display {
  color: #ffdd44;
  font-size: 1.3rem;
  margin: 0.5rem 0;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 160px;
  height: 100vh;
  background: rgba(10, 10, 25, 0.9);
  border-right: 2px solid #333;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.7rem;
  font-family: monospace;
  gap: 1rem;
}

#sidebar.hidden { display: none; }

.sidebar-section {
  text-align: center;
}

.sidebar-currency {
  color: #ffdd44;
  font-size: 1.3rem;
  font-weight: bold;
}

.sidebar-level {
  color: #aaa;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-btn {
  font-family: monospace;
  font-size: 0.95rem;
  padding: 0.6rem 0.5rem;
  background: #223;
  color: #ccc;
  border: 1px solid #556;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-btn:hover:not(:disabled) {
  background: #334;
  border-color: #ffaa00;
  color: #fff;
}

.sidebar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: #666;
  border-color: #333;
}

.sidebar-btn.active {
  background: #445;
  border-color: #ffaa00;
  color: #999;
  cursor: default;
}

.hire-timer {
  float: right;
  font-size: 0.7rem;
  color: #888;
}

#overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overlay-screen.hidden { display: none; }

.overlay-panel {
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid #444;
  border-radius: 6px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #333;
}

.overlay-header h2 {
  color: #ffaa00;
  font-size: 1.2rem;
  margin: 0;
  font-family: monospace;
}

.overlay-currency {
  color: #ffdd44;
  font-size: 1rem;
  font-family: monospace;
}

.overlay-header button {
  font-family: monospace;
  font-size: 1rem;
  background: none;
  border: 1px solid #666;
  color: #aaa;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
}

.overlay-header button:hover {
  color: #fff;
  border-color: #fff;
}

.overlay-body {
  padding: 1rem;
  overflow-y: auto;
  overflow-x: auto;
  font-family: monospace;
}

.overlay-panel-wide {
  width: 90vw;
  max-width: 1060px;
  max-height: 90vh;
}

.skill-node {
  position: absolute;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 0.7rem;
  font-weight: bold;
  border: 2px solid transparent;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  z-index: 1;
}

.skill-node-locked {
  background: #1a1a1a;
  border-color: #222;
  color: #444;
  font-size: 1rem;
}

.skill-node-available {
  background: #1e1e1e;
  border-color: #444;
  color: #888;
  cursor: pointer;
}

.skill-node-available:hover {
  background: #2a2a2a;
  border-color: #66aadd;
  box-shadow: 0 0 8px rgba(100, 170, 220, 0.3);
}

.skill-node-common {
  background: #3a3a3a;
  border-color: #aaa;
  color: #ddd;
  cursor: pointer;
}
.skill-node-common:hover {
  background: #4a4a4a;
  border-color: #ccc;
  box-shadow: 0 0 8px rgba(200, 200, 200, 0.3);
}

.skill-node-uncommon {
  background: #2a4a1a;
  border-color: #6cbf3a;
  color: #a0e060;
  cursor: pointer;
}
.skill-node-uncommon:hover {
  background: #3a5a2a;
  border-color: #8cdf5a;
  box-shadow: 0 0 8px rgba(108, 191, 58, 0.3);
}

.skill-node-rare {
  background: #1a3050;
  border-color: #4a9adf;
  color: #80c0ff;
  cursor: pointer;
}
.skill-node-rare:hover {
  background: #2a4060;
  border-color: #6abaff;
  box-shadow: 0 0 8px rgba(74, 154, 223, 0.3);
}

.skill-node-epic {
  background: #3a1a4a;
  border-color: #9a4adf;
  color: #c080ff;
  cursor: pointer;
}
.skill-node-epic:hover {
  background: #4a2a5a;
  border-color: #ba6aff;
  box-shadow: 0 0 8px rgba(154, 74, 223, 0.3);
}

.skill-node-affordable {
  border-color: #ffaa00 !important;
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

.skill-node-legendary {
  background: #4a1111;
  border-color: #ff4444;
  color: #ff8888;
}

.skill-node-label {
  font-size: 0.6rem;
  line-height: 1;
}

.skill-node-level {
  font-size: 0.5rem;
  color: #aaa;
  line-height: 1;
}

.skill-node-maxed .skill-node-level {
  color: #ff6666;

.skill-info-panel {
  position: absolute;
  top: 720px;
  left: 500px;
  transform: translateX(-50%);
  width: 220px;
  min-height: 60px;
  background: rgba(10, 10, 25, 0.9);
  border: 1px solid #555;
  padding: 0.7rem 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #ddd;
  text-align: center;
  z-index: 5;
}

#debug-toggle {
  position: fixed;
  bottom: 50px;
  right: 12px;
  z-index: 999;
  font-family: monospace;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: #333;
  color: #ffaa00;
  border: 2px solid #ffaa00;
  cursor: pointer;
}

#debug-toggle:hover { background: #444; }

#debug-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: rgba(10, 10, 20, 0.95);
  border-left: 2px solid #444;
  z-index: 998;
  font-family: monospace;
  font-size: 0.8rem;
  color: #ccc;
  display: flex;
  flex-direction: column;
}

#debug-panel.hidden { display: none; }

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #333;
}

.debug-header h2 {
  font-size: 1rem;
  color: #ffaa00;
  margin: 0;
}

.debug-header-buttons {
  display: flex;
  gap: 0.3rem;
}

.debug-header button {
  font-family: monospace;
  font-size: 0.75rem;
  background: none;
  border: 1px solid #666;
  color: #aaa;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.debug-header button:hover { color: #fff; border-color: #fff; }

#debug-save { border-color: #44aa44; color: #44aa44; }
#debug-save:hover { color: #66ff66; border-color: #66ff66; }
#debug-export { border-color: #4488cc; color: #4488cc; }
#debug-export:hover { color: #66aaff; border-color: #66aaff; }
#debug-reset { border-color: #cc4444; color: #cc4444; }
#debug-reset:hover { color: #ff6666; border-color: #ff6666; }

.debug-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
}

.debug-section {
  margin-bottom: 2rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1.2rem;
}

.debug-section h3 {
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.debug-upgrade-group {
  margin-bottom: 0.8rem;
  padding-left: 0.7rem;
  border-left: 2px solid #333;
}

.debug-upgrade-group h4 {
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 0.3rem;
}

.debug-field {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  margin: 0.4rem 0;
  padding-left: 0.5rem;
}

.debug-field label {
  color: #999;
  font-size: 0.8rem;
}

.debug-field input[type="number"] {
  width: 100%;
  max-width: 120px;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0.4rem;
  background: #1a1a2e;
  color: #eee;
  border: 1px solid #444;
  text-align: right;
}

.debug-field input[type="number"]:focus {
  border-color: #ffaa00;
  outline: none;
}

.debug-readonly {
  font-size: 0.7rem;
  color: #666;
  font-style: italic;
}

#between-rounds-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
}

#between-rounds-screen.hidden { display: none; }

.between-rounds-panel {
  text-align: center;
  pointer-events: auto;
}

.between-rounds-panel h2 {
  font-family: monospace;
  font-size: 1.8rem;
  color: #ffaa00;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.4), 2px 2px 0 #000;
}

.between-rounds-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.between-btn {
  font-family: monospace;
  font-size: 1.2rem;
  padding: 0.8rem 2rem;
  background: #334;
  color: #e0e0e0;
  border: 2px solid #ffaa00;
  cursor: pointer;
  transition: background 0.15s;
  min-width: 120px;
}

.between-btn:hover {
  background: #445;
}

.sidebar-round {
  color: #888;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
