:root {
  --bg: #000;
  --ink: #e9ffe9;
  --green: #39ff7a;
  --green-dim: #0f5a2a;
  --red: #ff2a2a;
  --muted: #6f8a76;
  --display: "Anton", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--mono); }
button { font: inherit; cursor: pointer; }
#loop { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: .18;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .9) 0 1px, transparent 1px 3px);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .85) 100%);
}

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding: 14px 16px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { font-family: var(--display); font-size: 1.35rem; letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--red); font-size: .7em; margin: 0 .15em; vertical-align: .15em; }
.war { display: flex; align-items: center; gap: .6rem; font-size: .7rem; }
.war .side { display: flex; align-items: baseline; gap: .4rem; }
.war small { color: var(--muted); letter-spacing: .15em; font-size: .62rem; }
.war b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; }
.war .h b { color: var(--green); }
.war .a b { color: var(--red); }
.meter { width: clamp(80px, 18vw, 240px); height: 6px; background: var(--red); position: relative; overflow: hidden; box-shadow: 0 0 14px rgba(255, 42, 42, .5); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.online { font-size: .68rem; color: var(--muted); letter-spacing: .08em; display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.online i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- whisper (center text) ---------- */
.whisper {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  font-family: var(--display); font-size: clamp(2rem, 7vw, 5.5rem); line-height: 1; text-align: center;
  width: min(1100px, calc(100% - 32px)); letter-spacing: .02em; color: var(--ink);
  text-shadow: 0 0 18px rgba(57, 255, 122, .8), 0 0 60px rgba(57, 255, 122, .35);
  transition: opacity .6s;
}
.whisper .g { color: var(--green); }
.whisper.red { text-shadow: 0 0 18px rgba(255, 42, 42, .9), 0 0 60px rgba(255, 42, 42, .4); }

/* ---------- gate nav ---------- */
.gates {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; flex-direction: column; gap: .3rem;
}
.gates button {
  background: none; border: 0; color: var(--muted); font-size: .66rem; letter-spacing: .14em;
  display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: .35rem 0; text-align: right;
}
.gates button i { width: 8px; height: 8px; border: 1px solid currentColor; transform: rotate(45deg); transition: all .3s; }
.gates button:hover, .gates button.near { color: var(--ink); }
.gates button.near i { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px var(--green); }
.gates button.locked { opacity: .5; }

/* ---------- gate card ---------- */
.gate-card {
  position: fixed; left: 50%; bottom: 9vh; transform: translateX(-50%); z-index: 6;
  width: min(520px, calc(100% - 32px)); text-align: center; padding: 1.4rem 1.4rem 1.2rem;
  background: rgba(0, 12, 4, .72); border: 1px solid rgba(57, 255, 122, .35);
  backdrop-filter: blur(8px); box-shadow: 0 0 40px rgba(57, 255, 122, .15), inset 0 0 30px rgba(57, 255, 122, .06);
  animation: rise .4s cubic-bezier(.2, .8, .2, 1);
}
.gate-card.red { border-color: rgba(255, 42, 42, .45); background: rgba(14, 0, 0, .72); box-shadow: 0 0 40px rgba(255, 42, 42, .18); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } }
.gc-kicker { font-size: .66rem; letter-spacing: .25em; color: var(--green); }
.gate-card.red .gc-kicker { color: var(--red); }
.gate-card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1; margin: .35rem 0 .5rem; }
.gate-card p#gc-desc { color: #a9c9b1; font-size: .8rem; line-height: 1.55; margin-bottom: 1rem; }
.enter {
  font-family: var(--display); font-size: 1.3rem; letter-spacing: .08em; color: #000; background: var(--green);
  border: 0; padding: .75rem 2.2rem; clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  box-shadow: 0 0 30px rgba(57, 255, 122, .6); transition: transform .15s, filter .15s;
}
.enter:hover { transform: scale(1.05); filter: brightness(1.15); }
.enter:disabled { background: #333; color: #888; box-shadow: none; cursor: not-allowed; transform: none; }
.gate-card.red .enter { background: var(--red); box-shadow: 0 0 30px rgba(255, 42, 42, .6); }

/* ---------- hint ---------- */
.hint {
  position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%); z-index: 5; font-size: .66rem;
  letter-spacing: .25em; color: var(--muted); display: flex; align-items: center; gap: .7rem; transition: opacity .6s; white-space: nowrap;
}
.mouse { width: 14px; height: 22px; border: 1.5px solid currentColor; border-radius: 8px; position: relative; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; background: var(--green); transform: translateX(-50%); animation: wheel 1.4s infinite; }
@keyframes wheel { to { transform: translate(-50%, 8px); opacity: 0; } }

.flash { position: fixed; inset: 0; background: #eaffef; z-index: 20; pointer-events: none; opacity: 0; transition: opacity .5s; }
.flash.on { opacity: 1; transition: opacity .35s ease-in; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; }
  .brand { order: 1; }
  .online { order: 2; }
  .war { order: 3; width: 100%; justify-content: center; }
  .gates { top: auto; bottom: 26vh; transform: none; }
  .gates button span { display: none; }
  .gate-card { bottom: 7vh; }
}
@media (prefers-reduced-motion: reduce) {
  .online i, .mouse::after { animation: none; }
}
