@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=VT323&family=Martian+Mono:wght@100;400;800&display=swap');

:root {
  --c0: #0d0d0f;
  --c1: #ff2d6b;
  --c2: #00f5d4;
  --c3: #ffe45e;
  --c4: #7b2fff;
  --w: #f0ece2;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--c0);
  font-family: 'Martian Mono', monospace;
  cursor: none;
  user-select: none;
}

#bg { position: fixed; inset: 0; z-index: 0; }

#scanlines {
  position: fixed; inset: 0; z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  animation: scan 8s linear infinite;
}
@keyframes scan {
  0%   { background-position: 0 0; }
  100% { background-position: 0 80px; }
}

#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.85) 100%);
}

#cursor {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
}
#cursor::before {
  content: '+';
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: var(--c2);
  text-shadow: 0 0 10px var(--c2);
  position: absolute;
  top: -10px; left: -6px;
  animation: cursorPulse 1s steps(1) infinite;
}
@keyframes cursorPulse {
  0%,49%  { color: var(--c2); text-shadow: 0 0 10px var(--c2); }
  50%,100%{ color: var(--c1); text-shadow: 0 0 10px var(--c1); }
}

#ui {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.glitch-wrap { position: relative; margin-bottom: 0.2em; }

#title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: clamp(5rem, 16vw, 13rem);
  color: var(--w);
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
  transition: color 0.08s;
}
#title::before, #title::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}
#title::before {
  color: var(--c1);
  animation: glitch1 2.5s infinite steps(1);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
#title::after {
  color: var(--c2);
  animation: glitch2 2.5s infinite steps(1);
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}
@keyframes glitch1 {
  0%,90%,100%{ transform:translate(0); opacity:0; }
  91%{ transform:translate(-4px,2px); opacity:1; }
  93%{ transform:translate(4px,-2px); opacity:1; }
  95%{ transform:translate(0); opacity:0; }
}
@keyframes glitch2 {
  0%,85%,100%{ transform:translate(0); opacity:0; }
  86%{ transform:translate(5px,1px); opacity:1; }
  88%{ transform:translate(-3px,-1px); opacity:1; }
  90%{ transform:translate(0); opacity:0; }
}

#ticker {
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--c3);
  letter-spacing: 0.2em;
  margin-bottom: 2.5rem;
  min-height: 2em;
  text-align: center;
  text-shadow: 0 0 14px var(--c3);
  overflow: hidden;
  white-space: nowrap;
}

#btn {
  position: relative;
  background: none;
  border: none;
  cursor: none;
  padding: 0;
  outline: none;
}
#btn-inner {
  font-family: 'Black Han Sans', sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  letter-spacing: 0.15em;
  color: var(--c0);
  background: var(--c2);
  padding: 1.1em 2.6em;
  display: block;
  position: relative;
  transition: background 0.1s, transform 0.08s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
#btn:hover #btn-inner { background: var(--c1); transform: scale(1.04); }
#btn:active #btn-inner { transform: scale(0.97); }
#btn-shadow {
  position: absolute; inset: 0;
  background: var(--c4);
  transform: translate(6px, 6px);
  z-index: -1;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: transform 0.1s;
}
#btn:hover #btn-shadow { transform: translate(10px, 10px); }

#stats {
  margin-top: 2.5rem;
  display: flex;
  gap: 3rem;
  align-items: flex-end;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-label {
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: #444;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.stat-val {
  font-family: 'VT323', monospace;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1;
  color: var(--c1);
  text-shadow: 0 0 20px var(--c1);
  min-width: 3ch;
  text-align: center;
  transition: color 0.2s, text-shadow 0.2s;
}

#toast-pool { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.toast {
  position: absolute;
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.1em;
  pointer-events: none;
  animation: toastFly 1.8s ease-out forwards;
  white-space: nowrap;
}
@keyframes toastFly {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(0.85); }
}

.ripple {
  position: fixed;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 15;
}
@keyframes rippleOut {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@keyframes bodyShake {
  0%,100%{transform:translate(0)}
  20%{transform:translate(-8px,4px)}
  40%{transform:translate(8px,-4px)}
  60%{transform:translate(-5px,6px)}
  80%{transform:translate(6px,-3px)}
}
.chaos { animation: bodyShake 0.35s ease; }

#footer {
  position: fixed; bottom: 1rem; left: 0; right: 0;
  text-align: center;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: #222;
  z-index: 10;
  text-transform: uppercase;
}