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

body {
  font-family: 'Courier New', monospace;
  background: #000;
  color: #00ff00;
  overflow: hidden;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* Intro Video Styles */
#intro-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1000;
}

#intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#skip-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(0, 255, 0, 0.8);
  color: #000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

/* Game Container */
#game-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

.game-stage {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(45deg, #000, #001100);
}

/* Video Sequence Stage */
.video-sequence-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 800px;
}

#story-video {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  margin: 20px 0;
}

.story-btn {
  background: #00ff00;
  color: #000;
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
}

/* Success Video Stage */
.video-success-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 800px;
}

#success-video {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  margin: 20px 0;
}

/* Game Space Stage */
.game-space-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  max-width: 900px;
}

.game-space-container h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.challenge-card {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s;
}

.challenge-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #00ff00;
}

.challenge-card h3 {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: #00ff00;
}

.challenge-btn {
  background: #00ff00;
  color: #000;
  border: none;
  padding: 12px 25px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  margin-top: 15px;
}

.progress-indicator {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.progress-item {
  font-size: 2em;
  padding: 10px;
  border: 2px solid #333;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.progress-item.completed {
  border-color: #00ff00;
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 15px #00ff00;
}

/* Wire Connection Puzzle */
.puzzle-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 1000px;
}

.wire-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 60px;
  margin: 40px 0;
  position: relative;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.wire-node {
  background: #333;
  border: 3px solid #00ff00;
  border-radius: 15px;
  padding: 25px 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  font-size: 1.3em;
  position: relative;
  min-width: 120px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wire-node:hover {
  background: #00ff00;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 20px #00ff00;
}

.wire-node.selected {
  background: #ffff00;
  color: #000;
  border-color: #ffff00;
  box-shadow: 0 0 25px #ffff00;
}

.wire-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.connection-line {
  position: absolute;
  background: #00ff00;
  height: 4px;
  transform-origin: left center;
  z-index: 1;
  box-shadow: 0 0 8px #00ff00;
}

.puzzle-btn {
  background: #00ff00;
  color: #000;
  border: none;
  padding: 10px 20px;
  margin: 10px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

/* Secret Code Stage */
.secret-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  max-width: 600px;
}

.code-display {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.code-segment {
  background: #333;
  border: 2px solid #00ff00;
  padding: 15px 20px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.2em;
  color: #00ff00;
}

.code-input {
  margin: 30px 0;
}

#secret-code {
  padding: 15px;
  font-size: 1.2em;
  background: #000;
  border: 2px solid #00ff00;
  color: #00ff00;
  border-radius: 5px;
  width: 250px;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.hint {
  margin-top: 20px;
  color: #ffff00;
  font-style: italic;
}

/* Tunnel Map Stage */
.map-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  max-width: 700px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin: 30px 0;
}

.map-node {
  background: #333;
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 20px 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.map-node:hover {
  background: #00ff00;
  color: #000;
}

.map-node.start {
  background: #00ff00;
  color: #000;
}

.map-node.end {
  background: #ffff00;
  color: #000;
}

.map-node.completed {
  background: #00ff00;
  color: #000;
}

.map-controls {
  margin: 20px 0;
}

/* Tunnel Escape Stage */
.tunnel-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
}

.tunnel-maze {
  width: 600px;
  height: 400px;
  background: #111;
  border: 2px solid #00ff00;
  position: relative;
  margin: 20px auto;
  overflow: hidden;
}

.player {
  width: 20px;
  height: 20px;
  background: #00ff00;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  box-shadow: 0 0 10px #00ff00;
}

.exit {
  width: 30px;
  height: 30px;
  background: #ffff00;
  border-radius: 50%;
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  box-shadow: 0 0 15px #ffff00;
}

.obstacle {
  width: 40px;
  height: 40px;
  background: #ff0000;
  position: absolute;
  border-radius: 5px;
}

.tunnel-controls {
  margin-top: 20px;
}

/* Victory Screen */
.victory-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  max-width: 600px;
}

.victory-container h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00;
}

.completion-stats {
  margin: 30px 0;
}

.stat {
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid #00ff00;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-weight: bold;
}

/* Animations */
@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes errorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

@keyframes progressFill {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

@keyframes glitchBtn {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-1px, 1px); }
  20% { transform: translate(1px, -1px); }
  30% { transform: translate(-1px, -1px); }
  40% { transform: translate(1px, 1px); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .challenge-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .game-space-container {
    padding: 20px;
    margin: 20px;
  }
  
  .wire-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .tunnel-maze {
    width: 90%;
    height: 300px;
  }
  
  .map-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .code-display {
    flex-direction: column;
    align-items: center;
  }
  
  .puzzle-container,
  .tunnel-container,
  .secret-container,
  .victory-container,
  .map-container {
    margin: 20px;
    padding: 20px;
  }
}

/* Map Assembly Game */
.map-assembly-container {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 1200px;
  margin: 20px auto;
}

.map-assembly-container h2 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #00ff00;
  text-shadow: 0 0 15px #00ff00;
}

.map-game-area {
  display: flex;
  gap: 40px;
  margin: 30px 0;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.target-section, .piece-section {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 10px;
  padding: 20px;
  min-width: 350px;
}

.target-section h3, .piece-section h3 {
  color: #00ff00;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 255, 0, 0.1);
}

.piece-slot {
  width: 90px;
  height: 90px;
  border: 2px dashed #00ff00;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.3s;
}

.piece-slot:hover {
  border-color: #ffff00;
  background: rgba(255, 255, 0, 0.1);
}

.piece-slot.filled {
  border-color: #00ff00;
  border-style: solid;
  background: rgba(0, 255, 0, 0.2);
}

.piece-pool {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
}

.piece {
  width: 80px;
  height: 80px;
  background-size: cover;
  background-position: center;
  border: 2px solid #00ff00;
  border-radius: 5px;
  cursor: grab;
  transition: all 0.3s;
  position: relative;
}

.piece:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #00ff00;
  border-color: #ffff00;
}

.piece:active {
  cursor: grabbing;
}

.piece.correct {
  border-color: #00ff00;
  box-shadow: 0 0 20px #00ff00;
}

.piece.incorrect {
  border-color: #ff0000;
  box-shadow: 0 0 20px #ff0000;
}

.map-controls {
  margin: 30px 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

#map-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
}

#map-message.success {
  background: rgba(0, 255, 0, 0.2);
  border: 2px solid #00ff00;
  color: #00ff00;
}

#map-message.error {
  background: rgba(255, 0, 0, 0.2);
  border: 2px solid #ff0000;
  color: #ff0000;
}

/* Responsive Design for Map Assembly */
@media (max-width: 768px) {
  .map-game-area {
    flex-direction: column;
    align-items: center;
  }
  
  .target-section, .piece-section {
    min-width: 300px;
  }
  
  .target-grid, .piece-pool {
    width: 250px;
    height: 250px;
  }
  
  .piece-slot {
    width: 70px;
    height: 70px;
  }
  
  .piece {
    width: 65px;
    height: 65px;
  }
}
