/* Trippysquidsman Enterprises - coming soon. Colours taken from the Zombie TD icon. */
:root {
  --night: #131517;
  --night-2: #1b1e21;
  --building: #262320;
  --window: #8a6a2a;
  --rot: #6b7a4f;
  --rot-dark: #3a4229;
  --blood: #e63333;
  --gold: #f0bf5a;
  --text: #e8e4d8;
  --muted: #a39f92;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--night);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--gold); }
a:hover, a:focus-visible { color: #fff; }

main {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.brand {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* The icon's crosshair, slowly hunting. */
.scope {
  width: 9rem;
  height: 9rem;
  margin: 0 auto 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 0 0 3px var(--rot-dark), 0 0 40px rgba(107, 122, 79, 0.35);
  animation: sway 6s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-4px); }
}

h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  color: var(--rot);
  text-shadow: 3px 3px 0 var(--rot-dark);
}

h1 .soon {
  display: block;
  color: var(--gold);
  font-size: 0.55em;
  letter-spacing: 0.2em;
  text-shadow: none;
  animation: flicker 7s infinite;
}

/* A failing streetlight. Slow, no rapid strobe. */
@keyframes flicker {
  0%, 18%, 22%, 62%, 66%, 100% { opacity: 1; }
  20%, 64% { opacity: 0.35; }
}

.lede { font-size: 1.15rem; margin: 0 auto 1.75rem; max-width: 32rem; }

/* Radio log teaser */
.radio {
  text-align: left;
  background: var(--night-2);
  border: 1px solid var(--rot-dark);
  border-left: 4px solid var(--blood);
  border-radius: 0.5rem;
  padding: 0.9rem 1.1rem;
  margin: 0 auto 1.75rem;
  max-width: 30rem;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.radio p { margin: 0.2rem 0; }
.radio .tag { color: var(--blood); font-weight: 700; }
.radio .cursor::after { content: "_"; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Horde meter */
.horde { max-width: 30rem; margin: 0 auto 2rem; text-align: left; font-size: 0.9rem; color: var(--muted); }
.horde .bar {
  height: 0.9rem;
  background: var(--night-2);
  border: 1px solid var(--rot-dark);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.horde .fill {
  height: 100%;
  width: 87%;
  background: repeating-linear-gradient(-45deg, var(--rot) 0 10px, var(--rot-dark) 10px 20px);
  animation: creep 20s linear infinite;
}
@keyframes creep { from { background-position: 0 0; } to { background-position: 283px 0; } }

.small { color: var(--muted); font-size: 0.9rem; }

/* Skyline and street */
.city {
  position: relative;
  height: 11rem;
  flex-shrink: 0;
  background:
    linear-gradient(to top, var(--building) 0 2.5rem, transparent 2.5rem),
    var(--night);
  overflow: hidden;
}
.skyline {
  position: absolute;
  inset: 0 0 2.5rem 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  opacity: 0.9;
}
.skyline span {
  flex: 1;
  background:
    radial-gradient(circle, var(--window) 0 2px, transparent 2.5px) 0 0 / 14px 18px,
    var(--building);
  border-top: 2px solid #302c28;
}
.skyline span:nth-child(1) { height: 55%; }
.skyline span:nth-child(2) { height: 80%; }
.skyline span:nth-child(3) { height: 40%; }
.skyline span:nth-child(4) { height: 95%; }
.skyline span:nth-child(5) { height: 60%; }
.skyline span:nth-child(6) { height: 75%; }
.skyline span:nth-child(7) { height: 35%; }
.skyline span:nth-child(8) { height: 88%; }
.skyline span:nth-child(9) { height: 50%; }
.skyline span:nth-child(10) { height: 70%; }
.skyline span:nth-child(11) { height: 45%; }
.skyline span:nth-child(12) { height: 85%; }

.street {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5rem;
  background: #1d1b19;
  border-top: 2px dashed #3d3a33;
}

/* Zombies shambling across. The sprites face up, so 90deg points them right. */
.walker {
  position: absolute;
  bottom: -0.3rem;
  left: -4rem;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: crosshair;
  animation: shamble linear infinite;
}
.walker img { width: 100%; height: 100%; transform: rotate(90deg); animation: lurch 0.9s ease-in-out infinite; }
.walker:focus-visible { outline: 2px solid var(--gold); border-radius: 50%; }
@keyframes shamble { from { left: -4rem; } to { left: calc(100% + 4rem); } }
@keyframes lurch {
  0%, 100% { transform: rotate(84deg) translateY(0); }
  50% { transform: rotate(96deg) translateY(-2px); }
}
.walker.big { width: 5rem; height: 5rem; bottom: -0.6rem; }
.walker.splatted { animation-play-state: paused; cursor: default; }
.walker.splatted img { animation: none; }

.splat {
  position: absolute;
  width: 3.5rem;
  height: 3.5rem;
  pointer-events: none;
  animation: fade 2.5s ease-out forwards;
}
@keyframes fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

.score {
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--gold);
  z-index: 3;
}

footer {
  background: var(--building);
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  padding: 0.9rem 1rem 1.25rem;
}
footer p { margin: 0.2rem 0; }

/* /play page */
.card {
  text-align: left;
  background: var(--night-2);
  border: 1px solid var(--rot-dark);
  border-radius: 0.75rem;
  padding: 1.25rem 1.4rem;
  margin: 0 auto 1.5rem;
}
.card h2 { margin: 0 0 0.75rem; color: var(--gold); font-size: 1.2rem; }
.card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  background: var(--rot-dark);
  color: var(--text);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  font-size: 0.85rem;
}
@media (max-width: 30rem) {
  .card dl { grid-template-columns: 1fr; gap: 0 0; }
  .card dd { margin-bottom: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .walker { display: none; }
}
