:root {
  --bg-0: #04130e;
  --bg-1: #082018;
  --ink: #d9f7ec;
  --ink-dim: #7fb8a4;
  --green: #4ade80;
  --green-dim: #1f6b46;
  --orange: #f59e0b;
  --red: #ef4444;
  --red-deep: #7f1d1d;
  --panel: rgba(6, 22, 17, 0.72);
  --panel-border: rgba(74, 222, 128, 0.25);
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--bg-1) 0%, var(--bg-0) 70%, #000 100%);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#arena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  cursor: crosshair;
}

.hidden {
  display: none !important;
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(4, 19, 14, 0.6), rgba(0, 0, 0, 0.85));
  backdrop-filter: blur(4px);
  z-index: 5;
}

.card {
  width: min(520px, 90vw);
  padding: 28px 30px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 0 60px rgba(74, 222, 128, 0.12), inset 0 0 30px rgba(74, 222, 128, 0.05);
}

.card h1 {
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--green);
  margin-bottom: 8px;
}

.card p {
  color: var(--ink-dim);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tips {
  list-style: none;
  margin: 14px 0 22px;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.9;
}

.tips .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px currentColor;
}
.tips .green { color: var(--green); background: var(--green); }
.tips .red { color: var(--red); background: var(--red); }
.tips .orange { color: var(--orange); background: var(--orange); }
.tips .redv { color: var(--red); background: var(--red); }

.btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1b6a45, #0e3b27);
  color: var(--ink);
  border: 1px solid var(--green-dim);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}
.btn:active { transform: translateY(1px); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 20px;
}
.stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.04);
}
.stats .label {
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stats span:last-child {
  font-size: 18px;
  color: var(--green);
  margin-top: 4px;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 4;
}
#hud .row {
  display: flex;
  gap: 10px;
  align-items: center;
}
#hud .row.bottom { justify-content: space-between; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.pill .label {
  color: var(--ink-dim);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.hint {
  font-size: 11px;
  color: var(--ink-dim);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 6px 12px;
}

#infection-panel {
  pointer-events: none;
  min-width: 260px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--red);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.35);
  animation: infectPulse 1.2s ease-in-out infinite;
}
#infection-panel.is-orange {
  border-color: var(--orange);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
}
#infection-panel.is-red {
  border-color: var(--red);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.45);
}

.infection-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#infection-panel.is-orange #infection-name { color: var(--orange); }
#infection-panel.is-red #infection-name { color: var(--red); }
#infection-timer { color: var(--ink); font-variant-numeric: tabular-nums; }

.bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 8px 0 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.12s linear;
}
#infection-panel.is-orange .bar-fill { background: var(--orange); }
#infection-panel.is-red .bar-fill { background: var(--red); }

.infection-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-dim);
}
#infection-penalty { color: var(--red); }

@keyframes infectPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
