:root {
  --primary: #818cf8;
  --secondary: #c084fc;
  --bg-gradient: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  --text-color: #f8fafc;
  --font-main: 'Courier New', Courier, monospace;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font-main);
  color: var(--text-color);
  touch-action: none;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-gradient);
}

/* CRT Scanline Effect */
#game-container::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 4px;
  z-index: 10;
  pointer-events: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.1);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #4ade80, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
  letter-spacing: -2px;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

h2 {
  font-size: 4rem;
  color: #f87171;
  margin-bottom: 0.5rem;
  text-shadow: 4px 4px 0px #7f1d1d;
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

p {
  font-size: 1.2rem;
  margin: 0.5rem 0;
  text-align: center;
  font-weight: bold;
}

.instructions {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 2rem;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 20px;
  border-radius: 20px;
  background: rgba(0,0,0,0.3);
}

#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-main);
  font-size: 1.5rem;
  color: #fff;
  pointer-events: none;
}

#hud.hidden {
  display: none;
}

button {
  margin-top: 30px;
  padding: 15px 40px;
  font-size: 1.5rem;
  font-family: var(--font-main);
  font-weight: bold;
  border: 4px solid #fff;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

button:hover {
  background: #fff;
  color: #000;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
}

button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px rgba(0,0,0,0.5);
}
