:root {
  --primary-color: #ff82ac;
  --secondary-color: #f5427e;
  --accent-color: #ff82ac;
  --background-dark: #000000;
  --background-medium: #0a0a0a;
  --background-light: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #f5427e;
  --text-muted: #bf0543;
  --border-color: #ff82ac;
  --glow-color: #bf0543;
  --danger-color: #8b0000;
  --success-color: #ff82ac;
}

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

body {
  font-family: 'Roboto Mono', monospace;
  background: var(--background-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  animation: scanlines 0.1s linear infinite;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 0, 0.03) 2px,
      rgba(0, 255, 0, 0.03) 4px
    );
  pointer-events: none;
  z-index: -1;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

.terminal-text {
  font-family: 'Roboto Mono', monospace;
  color: var(--primary-color);
  text-shadow: 0 0 5px var(--primary-color);
  animation: flicker 2s infinite;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

.title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary-color);
  text-shadow: 
    0 0 5px var(--primary-color),
    0 0 10px var(--primary-color),
    0 0 15px var(--primary-color);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
  animation: flicker 1.5s infinite;
  font-family: 'Roboto Mono', monospace;
}


.subtitle {
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 400;
  letter-spacing: 0.05em;
  font-family: 'Roboto Mono', monospace;
  text-shadow: 0 0 3px var(--primary-color);
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.welcome-message {
  max-width: 600px;
  padding: 2rem;
  background: #000000;
  border: 1px solid var(--primary-color);
  border-radius: 0;
  box-shadow: 
    0 0 20px #bf0543,
    inset 0 0 20px #f5427e;
  position: relative;
}

.welcome-message::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, var(--primary-color), transparent, var(--primary-color));
  z-index: -1;
  animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.greeting {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
  line-height: 1.6;
  font-family: 'Roboto Mono', monospace;
  text-shadow: 0 0 3px var(--primary-color);
}

.rules-container {
  margin-bottom: 2rem;
}

.rules-container h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  text-shadow: 0 0 5px var(--primary-color);
  font-family: 'Roboto Mono', monospace;
}

.rules-grid {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.rule-item {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0;
  border: 1px solid var(--primary-color);
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.rule-item:hover {
  background: #ff82ac;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px #bf0543;
}

.pill {
  font-size: 1.5rem;
  margin-right: 1rem;
  min-width: 2rem;
  text-align: center;
}

.rule-text {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.game-button {
  background: var(--background-dark);
  border: 2px solid var(--primary-color);
  padding: 1rem 2rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px #bf0543;
  font-family: 'Roboto Mono', monospace;
}

.game-button:hover {
  background: rgba(255, 130, 172, 0.1);
  box-shadow: 0 0 20px #bf0543;
  text-shadow: 0 0 5px var(--primary-color);
}

.game-button:active {
  background: #bf0543;
}

.game-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.game-button:hover::before {
  left: 100%;
}

.game-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.game-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.score-display, .level-display, .speed-display {
  background: #000000;
  padding: 0.8rem 1.5rem;
  border-radius: 0;
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 10px #bf0543;
  font-family: 'Roboto Mono', monospace;
}

.label {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-right: 0.5rem;
  font-family: 'Roboto Mono', monospace;
}

.score, .level, .speed {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 5px var(--primary-color);
  font-family: 'Roboto Mono', monospace;
}

#gameCanvas {
  background: var(--background-dark);
  border: 3px solid var(--primary-color);
  border-radius: 0;
  box-shadow: 
    0 0 20px #bf0543,
    inset 0 0 20px rgba(255, 130, 172, 0.1);
  display: block;
  max-width: 90vw;
  max-height: 70vh;
}

.controls-hint {
  text-align: center;
  color: var(--primary-color);
  font-size: 0.9rem;
  line-height: 1.4;
  font-family: 'Roboto Mono', monospace;
  text-shadow: 0 0 3px var(--primary-color);
}

.game-over-content {
  max-width: 500px;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--danger-color);
  border-radius: 0;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
  font-family: 'Roboto Mono', monospace;
}

.game-over-title {
  color: var(--danger-color);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px var(--danger-color);
  font-family: 'Roboto Mono', monospace;
}

.final-stats {
  margin-bottom: 1.5rem;
}

.final-stats p {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.final-score, .final-level, .survival-time {
  color: var(--primary-color);
  font-family: 'Roboto Mono', monospace;
}

.final-stats span {
  color: var(--primary-color);
  font-weight: 700;
  font-family: 'Roboto Mono', monospace;
}

.performance-rating {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0;
  border: 1px solid var(--primary-color);
  font-family: 'Roboto Mono', monospace;
}

.rating-label {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-family: 'Roboto Mono', monospace;
}

.rating {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Roboto Mono', monospace;
  text-shadow: 0 0 5px var(--primary-color);
}

.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.retry-button {
  background: var(--background-dark);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.menu-button {
  background: var(--background-dark);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.pause-content {
  text-align: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--primary-color);
  border-radius: 0;
  box-shadow: 0 0 20px #bf0543;
  font-family: 'Roboto Mono', monospace;
}

.pause-title {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--primary-color);
  font-family: 'Roboto Mono', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .title {
    font-size: 2.5rem;
  }
  
  .game-info {
    gap: 1rem;
  }
  
  .score-display, .level-display, .speed-display {
    padding: 0.6rem 1rem;
  }
  
  #gameCanvas {
    max-width: 95vw;
    max-height: 60vh;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .game-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }
  
  .welcome-message {
    padding: 1.5rem;
  }
  
  .rules-grid {
    gap: 0.8rem;
  }
  
  .rule-item {
    padding: 0.6rem;
  }
}