/* Idle Zombie Outbreak - Retro Pixel Dark Theme */
:root {
  --bg: #0d0d0d;
  --panel: #151515;
  --text: #c8ffcf;
  --accent: #39ff14; /* toxic green */
  --accent-dim: #2ad10f;
  --danger: #ff3b3b;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% 0%, #0f0f0f 0%, var(--bg) 40%, #000 100%);
  color: var(--text);
  font-family: "Press Start 2P", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  letter-spacing: 0.5px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.header {
  padding: 16px 20px;
  text-align: center;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.7), 0 0 16px rgba(57, 255, 20, 0.35);
  border-bottom: 2px solid rgba(57, 255, 20, 0.25);
}

.header h1 {
  margin: 0;
  font-size: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  background: var(--panel);
  border: 2px solid rgba(57, 255, 20, 0.25);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.12);
}

.label {
  display: block;
  font-size: 12px;
  color: #a6e8ad;
  margin-bottom: 8px;
}

.value {
  display: block;
  font-size: 18px;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.6);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn {
  appearance: none;
  border: 2px solid var(--accent);
  color: var(--bg);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-shadow: none;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.4), 0 0 36px rgba(57, 255, 20, 0.2);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(57, 255, 20, 0.55);
  filter: saturate(120%);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.hint {
  margin-top: 6px;
  color: #8bd493;
  font-size: 10px;
}

.footer {
  padding: 14px 20px;
  text-align: center;
  font-size: 10px;
  color: #7fc489;
  border-top: 2px solid rgba(57, 255, 20, 0.25);
}

/* Terminal Dashboard */
.terminal {
  background: var(--panel);
  border: 2px solid rgba(57, 255, 20, 0.35);
  border-radius: 6px;
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
  position: relative;
  overflow: hidden;
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(57, 255, 20, 0.05) 0px,
    rgba(57, 255, 20, 0.05) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: lighten;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(57, 255, 20, 0.25);
  background: #0f0f0f;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}
.dot.red { background: #ff3b3b; box-shadow: 0 0 8px rgba(255, 59, 59, 0.6); }
.dot.yellow { background: #ffd43b; box-shadow: 0 0 8px rgba(255, 212, 59, 0.6); }
.dot.green { background: #39ff14; }

.title {
  color: var(--accent);
  font-size: 10px;
}

.terminal-body {
  padding: 14px 16px;
  color: var(--accent);
  font-size: 12px;
}

.line {
  margin: 6px 0;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.6);
  white-space: nowrap;
}

.cursor {
  margin-left: 6px;
  display: inline-block;
  animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.term-value.flicker {
  animation: flicker 120ms ease-in-out;
}

@keyframes flicker {
  0% { opacity: 0.9; text-shadow: 0 0 3px rgba(57, 255, 20, 0.5); }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(57, 255, 20, 0.85); }
  100% { opacity: 0.95; text-shadow: 0 0 6px rgba(57, 255, 20, 0.6); }
}

.divider {
  height: 2px;
  background: rgba(57, 255, 20, 0.25);
  margin: 10px 0 8px;
}

.flavor {
  font-size: 10px;
  color: #a6f8ae;
  opacity: 0.9;
  min-height: 1em;
}

.offline-text {
  font-size: 9px;
  color: #9aeaa5;
  opacity: 0.9;
  min-height: 1em;
  margin-top: 4px;
  transition: opacity 600ms ease;
}

.offline-text.fade-out {
  opacity: 0;
}

.progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(57, 255, 20, 0.12);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(57, 255, 20, 0.15);
  margin: 6px 0 4px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 100%);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.45);
  transition: width 200ms linear;
}

.line.small { font-size: 9px; color: #9aeaa5; }

.btn:disabled {
  filter: grayscale(40%);
  opacity: 0.7;
  cursor: not-allowed;
}

.upgrades {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.upgrades-title {
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 8px 0;
}

.perk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.perk-name {
  flex: 1;
  color: var(--accent);
}

.perk-status {
  font-size: 11px;
  color: #9ef58f;
}

.upgrades-controls { margin-bottom: 8px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal {
  width: min(520px, 92%);
  background: var(--bg);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--accent-dim);
}

.modal-body {
  padding: 12px 14px;
}

.btn.small { padding: 8px 10px; font-size: 11px; }

.creator-cta {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 900; /* below modal overlay (1000) */
  font-size: 10px;
  color: #a6f8ae;
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
  text-decoration: none;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.15);
  backdrop-filter: blur(2px);
}
.creator-cta:hover {
  color: var(--accent);
  border-color: rgba(57, 255, 20, 0.5);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
}