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

:root {
  --yellow: #fff200;
  --pink: #ff2bd6;
  --cyan: #00f0ff;
  --green: #7dff00;
  --red: #ff2a2a;
  --dark: #050505;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 43, 214, .18), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(0, 240, 255, .18), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(125, 255, 0, .14), transparent 32%),
    #050505;
  color: white;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

button {
  font: inherit;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .08;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    #fff 4px
  );
}

.warning-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 11px;
  text-align: center;
  color: #000;
  background: var(--yellow);
  border-bottom: 4px solid #000;
  letter-spacing: .08em;
  animation: warningPulse 1.1s ease-in-out infinite alternate;
}

.hero {
  min-height: 100vh;
  padding: 80px 20px 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.glitch-wrap {
  position: relative;
}

.glitch {
  position: relative;
  font-size: clamp(3.8rem, 11vw, 9rem);
  line-height: .85;
  letter-spacing: -.04em;
  color: white;
  text-shadow:
    5px 5px 0 var(--pink),
    -5px -5px 0 var(--cyan);
  transform: skew(-4deg);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--cyan);
  transform: translate(4px, -2px);
  clip-path: inset(0 0 52% 0);
  animation: glitchOne .95s infinite steps(2);
}

.glitch::after {
  color: var(--pink);
  transform: translate(-4px, 3px);
  clip-path: inset(52% 0 0 0);
  animation: glitchTwo .75s infinite steps(2);
}

.subtitle {
  margin-top: 28px;
  max-width: 760px;
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 3vw, 1.45rem);
  letter-spacing: .04em;
}

.status-box {
  margin-top: 24px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 2px solid white;
  background: rgba(0,0,0,.75);
  box-shadow: 7px 7px 0 var(--pink);
  font-family: monospace;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  animation: blink 1s infinite;
}

.dance-floor {
  width: min(100%, 980px);
  min-height: 350px;
  margin-top: 45px;
  padding: 35px 20px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 20px;
  border: 5px solid white;
  background:
    linear-gradient(45deg, rgba(255,255,255,.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.08) 75%),
    #111;
  background-size: 48px 48px;
  background-position: 0 0, 0 24px, 24px -24px, -24px 0;
  box-shadow:
    0 0 0 8px #000,
    0 0 0 12px var(--cyan),
    18px 18px 0 var(--pink);
  overflow: hidden;
}

.dance-floor::after {
  content: "DANCE FLOOR";
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--yellow);
  font-size: .8rem;
  letter-spacing: .2em;
}

.dancer {
  height: 220px;
  position: relative;
  transform-origin: bottom center;
  animation: dance 1s ease-in-out infinite alternate;
}

.dancer:nth-child(2) { animation-delay: -.25s; }
.dancer:nth-child(3) { animation-delay: -.5s; }
.dancer:nth-child(4) { animation-delay: -.75s; }

.head {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 64px;
  transform: translateX(-50%);
  z-index: 4;
}

.body {
  position: absolute;
  top: 76px;
  left: 50%;
  width: 54px;
  height: 85px;
  transform: translateX(-50%);
  background: linear-gradient(var(--pink), var(--cyan));
  border: 4px solid white;
  border-radius: 18px 18px 8px 8px;
}

.arm,
.leg {
  position: absolute;
  width: 18px;
  height: 88px;
  background: var(--yellow);
  border: 4px solid white;
  transform-origin: top center;
}

.arm {
  top: 84px;
}

.arm.left {
  left: calc(50% - 52px);
  transform: rotate(34deg);
  animation: armLeft .55s ease-in-out infinite alternate;
}

.arm.right {
  right: calc(50% - 52px);
  transform: rotate(-34deg);
  animation: armRight .55s ease-in-out infinite alternate;
}

.leg {
  top: 150px;
  height: 75px;
  background: var(--green);
}

.leg.l1 {
  left: calc(50% - 30px);
  transform: rotate(11deg);
}

.leg.l2 {
  right: calc(50% - 30px);
  transform: rotate(-11deg);
}

.buttons {
  margin-top: 55px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.btn {
  min-height: 58px;
  padding: 0 28px;
  border: 4px solid #000;
  cursor: pointer;
  box-shadow: 8px 8px 0 white;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:active {
  transform: translate(6px, 6px);
  box-shadow: 2px 2px 0 white;
}

.main-btn {
  background: var(--green);
  color: #000;
}

.escape-btn {
  background: var(--red);
  color: white;
  position: relative;
}

.tiny {
  margin-top: 26px;
  color: #aaa;
  font-family: monospace;
}

.stats {
  width: min(calc(100% - 32px), 1050px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stat-card {
  padding: 26px 18px;
  text-align: center;
  border: 4px solid white;
  background: #0c0c0c;
  box-shadow: 10px 10px 0 var(--cyan);
}

.stat-card:nth-child(2) {
  box-shadow: 10px 10px 0 var(--pink);
}

.stat-card:nth-child(3) {
  box-shadow: 10px 10px 0 var(--green);
}

.stat-card span {
  display: block;
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.stat-card small {
  display: block;
  margin-top: 10px;
  font-family: monospace;
  color: #bbb;
}

.terminal {
  width: min(calc(100% - 32px), 1050px);
  margin: 80px auto;
  border: 4px solid #777;
  background: #020402;
  box-shadow: 16px 16px 0 rgba(125,255,0,.35);
  font-family: monospace;
}

.terminal-head {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #181818;
  border-bottom: 2px solid #555;
}

.terminal-head span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--red);
}

.terminal-head span:nth-child(2) { background: var(--yellow); }
.terminal-head span:nth-child(3) { background: var(--green); }

.terminal-head b {
  margin-left: 8px;
  color: #aaa;
}

.terminal-body {
  min-height: 280px;
  padding: 28px;
  color: var(--green);
  font-size: clamp(.85rem, 2vw, 1.05rem);
  line-height: 1.8;
}

.marquee-section {
  overflow: hidden;
  transform: rotate(-2deg) scale(1.05);
  border-block: 5px solid black;
  background: var(--yellow);
  color: black;
}

.marquee {
  width: max-content;
  padding: 20px 0;
  display: flex;
  gap: 60px;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  animation: marquee 16s linear infinite;
}

.finale {
  padding: 120px 20px;
  text-align: center;
}

.finale h2 {
  max-width: 1000px;
  margin: 0 auto;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .9;
  text-shadow: 6px 6px 0 var(--pink);
}

.boss-btn {
  margin-top: 55px;
  background: var(--red);
  color: white;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.fake-popup {
  width: min(calc(100% - 30px), 420px);
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 500;
  transform: translate(-50%, -50%) scale(.8);
  opacity: 0;
  pointer-events: none;
  border: 5px solid #000;
  background: #e9e9e9;
  color: #000;
  box-shadow: 16px 16px 0 var(--pink);
  transition: .2s ease;
}

.fake-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.popup-head {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  background: #001a8d;
  color: white;
  font-family: Arial, sans-serif;
}

.popup-head button {
  width: 28px;
  height: 24px;
  border: 0;
  background: #ddd;
  color: #000;
  cursor: pointer;
}

.popup-content {
  padding: 28px;
  text-align: center;
  font-family: Arial, sans-serif;
}

.popup-icon {
  font-size: 64px;
}

.popup-content h3 {
  margin-top: 10px;
  font-size: 2rem;
}

.popup-content p {
  margin-top: 10px;
}

.popup-content button {
  margin-top: 20px;
  padding: 10px 18px;
  border: 3px solid #000;
  background: var(--yellow);
  font-weight: 800;
  cursor: pointer;
}

#confetti {
  position: fixed;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: -40px;
  font-size: 28px;
  animation: fall linear forwards;
}

footer {
  padding: 30px 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 4px solid white;
  background: #000;
  color: #aaa;
  font-family: monospace;
}

body.chaos {
  animation: hue 5s linear infinite;
}

body.chaos .dancer {
  animation-duration: .23s;
}

body.chaos .glitch {
  animation: shake .17s infinite;
}

@keyframes dance {
  0% { transform: rotate(-8deg) translateY(0) scaleY(1); }
  100% { transform: rotate(8deg) translateY(-18px) scaleY(.95); }
}

@keyframes armLeft {
  from { transform: rotate(55deg); }
  to { transform: rotate(-20deg); }
}

@keyframes armRight {
  from { transform: rotate(-55deg); }
  to { transform: rotate(20deg); }
}

@keyframes glitchOne {
  0%, 100% { transform: translate(4px, -2px); }
  50% { transform: translate(-8px, 4px); }
}

@keyframes glitchTwo {
  0%, 100% { transform: translate(-4px, 3px); }
  50% { transform: translate(8px, -4px); }
}

@keyframes blink {
  50% { opacity: .2; }
}

@keyframes warningPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.25); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(900deg);
    opacity: .9;
  }
}

@keyframes hue {
  to { filter: hue-rotate(360deg); }
}

@keyframes shake {
  0% { transform: translate(0) skew(-4deg); }
  25% { transform: translate(3px, -2px) skew(-4deg); }
  50% { transform: translate(-3px, 2px) skew(-4deg); }
  75% { transform: translate(2px, 3px) skew(-4deg); }
  100% { transform: translate(0) skew(-4deg); }
}

@media (max-width: 760px) {
  .dance-floor {
    grid-template-columns: repeat(2, 1fr);
    min-height: 620px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
    max-width: 360px;
  }

  .btn {
    width: 100%;
  }

  footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* AIM TRAINER */
.aim-section {
  width: min(calc(100% - 32px), 1180px);
  margin: 100px auto 30px;
  padding: 64px 0;
}

.aim-heading { text-align: center; margin-bottom: 36px; }
.aim-heading > span { color: var(--yellow); letter-spacing: .18em; font-size: .82rem; }
.aim-heading h2 { margin-top: 14px; font-size: clamp(2.7rem, 7vw, 6.2rem); line-height: .92; text-shadow: 5px 5px 0 var(--cyan); }
.aim-heading p { margin-top: 18px; font-family: Arial, sans-serif; font-weight: 700; color: #bbb; }

.aim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.aim-game-card, .leaderboard-card { border: 4px solid white; background: #0a0a0d; box-shadow: 12px 12px 0 var(--pink); }
.aim-game-card { padding: 22px; }
.leaderboard-card { padding: 20px; box-shadow: 12px 12px 0 var(--cyan); }

.aim-toolbar { display: flex; gap: 14px; align-items: end; margin-bottom: 18px; }
.aim-toolbar label { flex: 1; display: grid; gap: 8px; font-family: monospace; color: #bbb; }
.aim-toolbar input { width: 100%; min-height: 52px; padding: 0 14px; border: 3px solid white; background: #000; color: white; font: 800 1rem Arial, sans-serif; outline: none; }
.aim-toolbar input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(125,255,0,.18); }
.aim-start-btn { background: var(--yellow); color: #000; box-shadow: 6px 6px 0 var(--cyan); white-space: nowrap; }
.aim-start-btn:disabled { opacity: .55; cursor: not-allowed; }

.aim-hud { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.aim-hud div { padding: 12px; text-align: center; border: 2px solid #444; background: #111; }
.aim-hud strong { display: block; color: var(--green); font-size: clamp(1.4rem, 3vw, 2.3rem); }
.aim-hud span { display: block; margin-top: 4px; font: 700 .68rem monospace; color: #aaa; }

.aim-arena {
  height: 540px;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  border: 4px solid #555;
  background:
    linear-gradient(rgba(0,240,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,.06) 1px, transparent 1px),
    radial-gradient(circle at center, #191925, #050507 70%);
  background-size: 32px 32px, 32px 32px, auto;
}
.aim-arena.playing { box-shadow: inset 0 0 60px rgba(0,240,255,.1); }
.aim-overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; background: rgba(0,0,0,.55); z-index: 3; pointer-events: none; }
.aim-overlay strong { font-size: clamp(2rem, 5vw, 4.5rem); color: var(--yellow); text-shadow: 4px 4px 0 var(--pink); }
.aim-overlay span { font-family: Arial, sans-serif; color: #ccc; font-weight: 700; }
.aim-overlay.hidden { display: none; }

.aim-target {
  width: 58px; height: 58px;
  position: absolute;
  display: none;
  border: 0; border-radius: 50%; cursor: crosshair;
  background:
    radial-gradient(circle, #fff 0 10%, var(--red) 11% 28%, #fff 29% 45%, var(--red) 46% 65%, #111 66%);
  box-shadow: 0 0 0 4px rgba(255,255,255,.7), 0 0 28px var(--red);
  transform: translate(-50%, -50%);
  animation: targetPulse .7s ease-in-out infinite alternate;
  z-index: 2;
}
.aim-target.show { display: block; }
.aim-target.hit { animation: targetHit .12s ease forwards; }

.aim-result { margin-top: 16px; padding: 18px; text-align: center; border: 3px solid var(--yellow); background: rgba(255,242,0,.08); }
.aim-result h3 { color: var(--yellow); font-size: 2rem; }
.aim-result p { margin-top: 8px; font: 700 1rem Arial,sans-serif; color: #ddd; }

.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 2px solid #333; }
.leaderboard-head h3 { font-size: 1.2rem; }
.leaderboard-head button { padding: 8px 10px; border: 2px solid white; background: var(--red); color: white; cursor: pointer; font: 800 .72rem monospace; }
.leaderboard-list { margin-top: 14px; list-style-position: inside; }
.leaderboard-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 12px 8px; border-bottom: 1px solid #292929; font-family: Arial,sans-serif; }
.leaderboard-list li:first-child { color: var(--yellow); }
.leaderboard-list li:nth-child(2) { color: #ddd; }
.leaderboard-list li:nth-child(3) { color: #d9985f; }
.leaderboard-list .rank { font-weight: 900; }
.leaderboard-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.leaderboard-list .score { color: var(--green); font-weight: 900; }
.leaderboard-empty { padding: 22px 8px; text-align: center; color: #888; font-family: monospace; }
.leaderboard-note { margin-top: 16px; color: #777; font: .75rem monospace; line-height: 1.5; }

.aim-float { position:absolute; pointer-events:none; font: 900 1.1rem monospace; color:var(--green); animation: floatScore .55s ease forwards; z-index:4; }
.aim-float.miss { color: var(--red); }

@keyframes targetPulse { to { transform: translate(-50%,-50%) scale(1.08); } }
@keyframes targetHit { to { transform: translate(-50%,-50%) scale(.15); opacity:0; } }
@keyframes floatScore { to { transform: translateY(-45px) scale(1.3); opacity:0; } }

@media (max-width: 900px) {
  .aim-layout { grid-template-columns: 1fr; }
  .aim-arena { height: 480px; }
}
@media (max-width: 620px) {
  .aim-toolbar { flex-direction: column; align-items: stretch; }
  .aim-hud { grid-template-columns: repeat(2,1fr); }
  .aim-arena { height: 430px; }
}
