/* css/theme.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  color: #0f0;
}

#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#ui-overlay > * { pointer-events: auto; }

.hidden { display: none !important; }

/* Tooltip */
#tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #00ff00;
  padding: 8px 12px;
  font-size: 11px;
  max-width: 250px;
  z-index: 20;
}

.tt-name {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

.tt-row { color: #00aa00; margin: 2px 0; }
.tt-placeholder { color: #005500; font-style: italic; }

/* Resource Bar */
#resource-bar {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #00aa00;
  padding: 6px 12px;
  display: flex;
  gap: 15px;
  font-size: 12px;
  z-index: 10;
}

.resource { color: #00ff00; white-space: nowrap; }
.res-water { color: #4488ff; }
.res-food { color: #ffcc00; }

/* DEFCON */
#defcon-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #00ff00;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  text-shadow: 0 0 5px currentColor;
}

.defcon-critical {
  animation: defcon-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes defcon-pulse {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

/* Action Buttons */
#action-buttons {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.action-btn {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00aa00;
  color: #00ff00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
}

.action-btn:hover {
  background: rgba(0, 50, 0, 0.6);
  text-shadow: 0 0 8px #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.btn-build { border-color: #00aa00; }
.btn-build:hover { border-color: #00ff00; }
.btn-research { border-color: #3366cc; color: #4488ff; }
.btn-research:hover { text-shadow: 0 0 8px #4488ff; box-shadow: 0 0 10px rgba(68, 136, 255, 0.3); }
.btn-gather { border-color: #cc9900; color: #ffcc00; }
.btn-gather:hover { text-shadow: 0 0 8px #ffcc00; box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); }
.btn-attack { border-color: #cc2020; color: #ff2020; }
.btn-attack:hover { text-shadow: 0 0 8px #ff2020; box-shadow: 0 0 10px rgba(255, 32, 32, 0.3); }

/* Mini-Info */
#mini-info {
  position: fixed;
  bottom: 55px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #00aa00;
  padding: 6px 10px;
  font-size: 10px;
  color: #00aa00;
  z-index: 10;
}

/* Modal */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#modal {
  background: #000;
  border: 2px solid #00ff00;
  outline: 1px solid #00aa00;
  outline-offset: 3px;
  min-width: 350px;
  max-width: 500px;
}

#modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #00aa00;
}

#modal-title {
  font-size: 14px;
  font-weight: bold;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

#modal-close {
  background: none;
  border: 1px solid #00aa00;
  color: #00aa00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
}

#modal-close:hover {
  color: #00ff00;
  border-color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

#modal-body {
  padding: 15px;
  min-height: 120px;
}

.modal-placeholder {
  color: #005500;
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
}

/* CRT Overlay */
#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

#crt-overlay::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.3) 2px,
    rgba(0, 0, 0, 0.3) 4px
  );
}

#crt-overlay::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.7);
}

/* Global text glow */
body * {
  text-shadow: 0 0 5px currentColor;
}

/* Text transform */
#ui-overlay, #ui-overlay * {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loading state */
#game-canvas.loading {
  display: none;
}

.loading-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #00ff00;
  font-size: 16px;
  text-shadow: 0 0 10px #00ff00;
  z-index: 5;
}
