body {
  font-family: 'Press Start 2P', cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: #0a0a0a;
  overflow: hidden;
  position: relative;
}

/* Replace CRT effect with cyberpunk grid background */
body::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      transparent 0 1px,
      rgba(0, 255, 255, 0.1) 1px 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 1px,
      rgba(0, 255, 255, 0.1) 1px 3px
    ),
    radial-gradient(circle at center, #00081d 0%, #000 100%);
  z-index: 0;
  animation: grid-pulse 8s infinite linear;
}

/* Add animated hexagonal grid pattern */
body::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M50 0L100 25V75L50 100L0 75V25L50 0Z" fill="none" stroke="%2300fff740" stroke-width="0.5"/></svg>');
  animation: grid-move 20s linear infinite;
  opacity: 0.3;
  top: -50%;
  left: -50%;
}

@keyframes grid-move {
  0% { transform: translate(0,0) rotate(0deg); }
  100% { transform: translate(-50%,-50%) rotate(0.5deg); }
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

#game-container {
  position: relative;
  text-align: center;
  border: 4px solid #0ff;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5), 
              inset 0 0 15px rgba(0, 255, 255, 0.3);
  background: rgba(0, 10, 20, 0.95);
  padding: 2rem;
  border-radius: 8px;
  z-index: 1;
  color: #0ff;
  text-shadow: 0 0 10px #0f0;
}

#problem {
  font-size: 24px;
  margin: 20px 0;
  letter-spacing: 2px;
}

input[type="number"] {
  width: 80px;
  padding: 10px;
  background: #001100;
  border: 2px solid #0f0;
  color: #0f0;
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
}

button {
  border: 2px solid #90f;
  background: rgba(144, 0, 255, 0.1);
  color: #90f;
  padding: 12px 24px;
  border-radius: 0;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

button:hover {
  background: rgba(144, 0, 255, 0.3);
  box-shadow: 0 0 25px rgba(144, 0, 255, 0.5);
  text-shadow: 0 0 15px #90f;
}

#message {
  margin-top: 20px;
  font-size: 14px;
  min-height: 24px;
}

/* Enhance noise effect with color variation */
.noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="1.8" numOctaves="3"/><feDisplacementMap in="SourceGraphic" scale="15"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.3"/></svg>');
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

#victory-screen {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 2rem;
  background: rgba(0, 20, 40, 0.95);
  border: 4px solid #0ff;
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.7);
  z-index: 2;
  color: #0ff;
  text-shadow: 0 0 15px #0ff;
}

#victory-screen h2 {
  font-size: 2.5em;
  margin-bottom: 1rem;
  animation: rainbow-pulse 2s infinite;
}

@keyframes rainbow-pulse {
  0% { color: #ff0000; }
  25% { color: #00ff00; }
  50% { color: #0000ff; }
  75% { color: #ff00ff; }
  100% { color: #ff0000; }
}

.confetti {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

#restart-button {
  margin-top: 1.5rem;
  font-size: 1.2em;
  padding: 1rem 2rem;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #0ff;
  color: #0ff;
  cursor: pointer;
  transition: all 0.3s ease;
}

#restart-button:hover {
  background: rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}