/* Igor Hunt - NES Duck Hunt Style */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body {
  background: #000;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  overflow: hidden;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.screen.hidden {
  display: none !important;
  visibility: hidden;
}

#gameover-screen {
  z-index: 1000;
}

#title-screen {
  z-index: 999;
}

/* ============================================
   TITLE SCREEN - NES Style
   ============================================ */

#title-screen {
  background: linear-gradient(180deg,
    #5c94fc 0%,      /* NES sky blue */
    #5c94fc 60%,
    #00a800 60%,     /* NES grass green */
    #00a800 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.title-content {
  background: rgba(0, 0, 0, 0.85);
  padding: 40px 60px;
  border: 8px solid #fcfcfc;
  box-shadow:
    0 0 0 4px #000,
    inset 0 0 0 4px #000;
}

.title-content h1 {
  font-size: 42px;
  color: #fc9838;
  text-shadow:
    4px 4px 0 #a81000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  margin-bottom: 10px;
  letter-spacing: 2px;
  animation: title-flash 1s ease-in-out infinite;
}

@keyframes title-flash {
  0%, 100% { color: #fc9838; }
  50% { color: #fcfc54; }
}

.subtitle {
  font-size: 14px;
  color: #fcfcfc;
  margin-bottom: 30px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.igor-preview {
  margin: 30px 0;
}

.igor-preview img {
  filter: drop-shadow(4px 4px 0 #000);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.instructions {
  margin-top: 20px;
  color: #b8f8b8;
  font-size: 10px;
  line-height: 2.5;
  text-transform: uppercase;
}

/* NES Style Button */
.pixel-btn {
  background: #e40000;
  color: #fcfcfc;
  border: none;
  padding: 16px 48px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  box-shadow:
    inset -4px -4px 0 #a81000,
    inset 4px 4px 0 #fc5454,
    0 8px 0 #000;
  transition: all 0.1s;
}

.pixel-btn:hover {
  background: #fc5454;
  transform: translateY(-2px);
  box-shadow:
    inset -4px -4px 0 #e40000,
    inset 4px 4px 0 #fcb8b8,
    0 10px 0 #000;
}

.pixel-btn:active {
  transform: translateY(4px);
  box-shadow:
    inset -4px -4px 0 #a81000,
    inset 4px 4px 0 #fc5454,
    0 4px 0 #000;
}

/* ============================================
   GAME SCREEN
   ============================================ */

#game-screen {
  cursor: crosshair;
  background: #5c94fc; /* NES sky blue */
}

/* HUD - NES Style */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 30px;
  z-index: 100;
  border-bottom: 4px solid #fcfcfc;
}

.hud-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hud-section .label {
  color: #5c94fc;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hud-section .value {
  color: #fcfcfc;
  font-size: 24px;
  text-shadow: 2px 2px 0 #5c94fc;
}

#shots-display {
  display: flex;
  gap: 8px;
}

#shots-display .bullet {
  color: #e40000;
  font-size: 24px;
  text-shadow: 2px 2px 0 #a81000;
  transition: opacity 0.2s;
}

#shots-display .bullet.used {
  opacity: 0.2;
}

#hit-display {
  display: flex;
  gap: 4px;
}

#hit-display .igor-icon {
  color: #585858;
  font-size: 16px;
  transition: all 0.3s;
}

#hit-display .igor-icon.hit {
  color: #00a800;
  text-shadow: 1px 1px 0 #005800;
}

#hit-display .igor-icon.miss {
  color: #e40000;
  text-shadow: 1px 1px 0 #a81000;
}

/* ============================================
   GAME AREA - NES Duck Hunt Style
   ============================================ */

#game-area {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 200px;
  /* Classic NES sky gradient */
  background: linear-gradient(180deg,
    #5c94fc 0%,
    #5c94fc 40%,
    #90d0fc 60%,
    #b8f8fc 100%
  );
  overflow: hidden;
}

/* NES Style Clouds */
.cloud {
  position: absolute;
  background: #fcfcfc;
  border-radius: 0;
  animation: float-cloud 40s linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: #fcfcfc;
}

.cloud-1 {
  width: 120px;
  height: 40px;
  top: 40px;
  left: -120px;
  animation-delay: 0s;
}

.cloud-1::before {
  width: 60px;
  height: 40px;
  top: -30px;
  left: 20px;
}

.cloud-1::after {
  width: 40px;
  height: 30px;
  top: -20px;
  left: 70px;
}

.cloud-2 {
  width: 100px;
  height: 35px;
  top: 100px;
  left: -100px;
  animation-delay: -15s;
}

.cloud-2::before {
  width: 50px;
  height: 35px;
  top: -25px;
  left: 15px;
}

.cloud-2::after {
  width: 35px;
  height: 25px;
  top: -15px;
  left: 55px;
}

.cloud-3 {
  width: 140px;
  height: 45px;
  top: 160px;
  left: -140px;
  animation-delay: -30s;
}

.cloud-3::before {
  width: 70px;
  height: 45px;
  top: -35px;
  left: 25px;
}

.cloud-3::after {
  width: 50px;
  height: 35px;
  top: -25px;
  left: 85px;
}

@keyframes float-cloud {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* ============================================
   GROUND - NES Duck Hunt Style
   ============================================ */

#ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  /* Classic Duck Hunt: grass on top, dark brown/black bar at bottom */
  background: linear-gradient(180deg,
    #00a800 0%,
    #00a800 60%,
    #583800 60%,
    #402800 100%
  );
}

/* Grass detail line at top */
.grass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  /* Grass blades effect */
  background:
    linear-gradient(180deg, #00e800 0%, #00a800 100%);
  border-top: 4px solid #58f858;
}

/* NES Style Bushes - sitting on grass above brown bar */
.bush {
  position: absolute;
  bottom: 90px;
  background: #006800;
  border: 4px solid #004000;
}

.bush::before {
  content: '';
  position: absolute;
  background: #006800;
  border: 4px solid #004000;
}

.bush-1 {
  width: 100px;
  height: 60px;
  left: 5%;
  border-radius: 50% 50% 10% 10%;
}

.bush-1::before {
  width: 70px;
  height: 50px;
  top: -35px;
  left: 10px;
  border-radius: 50%;
}

.bush-2 {
  width: 140px;
  height: 70px;
  left: 40%;
  border-radius: 50% 50% 10% 10%;
}

.bush-2::before {
  width: 90px;
  height: 60px;
  top: -40px;
  left: 20px;
  border-radius: 50%;
}

.bush-3 {
  width: 110px;
  height: 65px;
  right: 8%;
  border-radius: 50% 50% 10% 10%;
}

.bush-3::before {
  width: 80px;
  height: 55px;
  top: -38px;
  left: 12px;
  border-radius: 50%;
}

/* NES Style Trees - sitting on grass above brown bar */
.tree {
  position: absolute;
  bottom: 90px;
}

.tree::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 80px;
  background: #885818;
  border: 4px solid #583800;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.tree::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 140px solid #006800;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 0 #004000);
}

.tree-1 {
  left: 15%;
}

.tree-2 {
  right: 20%;
}

/* Dog Area - on the grass */
#dog-area {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
}

#dog {
  width: 100%;
  height: 100%;
  position: relative;
}

#dog::before {
  font-size: 60px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(3px 3px 0 #000);
}

#dog.laughing::before {
  content: '🤣';
  animation: laugh 0.2s ease-in-out infinite;
}

#dog.celebrating::before {
  content: '🎉';
  animation: bounce 0.4s ease-in-out infinite;
}

@keyframes laugh {
  0%, 100% { transform: translate(-50%, -50%) rotate(-10deg); }
  50% { transform: translate(-50%, -50%) rotate(10deg); }
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-15px); }
}

/* ============================================
   IGOR SPRITE - Flying Reverser
   ============================================ */

.igor {
  position: absolute;
  width: 140px;
  height: 140px;
  cursor: crosshair;
  transition: none;
  z-index: 50;
  filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.5));
}

.igor-sprite {
  width: 100%;
  height: 100%;
  position: relative;
  animation: fly 0.2s ease-in-out infinite;
}

/* Igor Character Design - using SVG */
.igor-sprite::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  background: url('igor.svg') no-repeat center center;
  background-size: contain;
  top: 10px;
  left: 10px;
  filter: drop-shadow(2px 2px 0 #000);
}

.igor-sprite::after {
  content: '';
  display: none;
}

/* Wings */
.igor-sprite .wing {
  position: absolute;
  width: 50px;
  height: 25px;
  background: linear-gradient(180deg, #fcfc54 0%, #e4a000 100%);
  border: 3px solid #885818;
  border-radius: 50%;
  animation: flap 0.1s ease-in-out infinite alternate;
}

.igor-sprite .wing-left {
  left: -15px;
  top: 55px;
  transform-origin: right center;
}

.igor-sprite .wing-right {
  right: -15px;
  top: 55px;
  transform-origin: left center;
}

@keyframes fly {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes flap {
  0% { transform: rotate(-30deg) scaleY(0.8); }
  100% { transform: rotate(30deg) scaleY(1); }
}

/* Igor Hit State */
.igor.hit .igor-sprite {
  animation: spin-fall 1s ease-in forwards;
}

.igor.hit .igor-sprite::before {
  filter: brightness(0.3);
}

.igor.hit .igor-sprite::after {
  content: '💀';
  display: block;
  font-size: 60px;
  position: absolute;
  top: 35px;
  left: 40px;
  filter: drop-shadow(2px 2px 0 #000);
}

.igor.hit .igor-sprite .wing {
  animation: none;
  opacity: 0.5;
}

@keyframes spin-fall {
  0% { transform: rotate(0deg) translateY(0); }
  100% { transform: rotate(720deg) translateY(600px); }
}

/* Igor Escaping */
.igor.escaping {
  animation: escape 1.5s ease-in forwards;
}

@keyframes escape {
  0% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translateY(-800px);
  }
}

/* ============================================
   EFFECTS
   ============================================ */

/* Hit Effect */
#hit-effect {
  position: absolute;
  z-index: 200;
  pointer-events: none;
}

#hit-effect .points {
  font-size: 28px;
  font-weight: bold;
  color: #fcfc54;
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
  animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.5);
  }
}

/* Shot Effect - NES Style Flash */
#shot-effect {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  animation: shot-flash 0.15s ease-out forwards;
  z-index: 150;
}

#shot-effect::before {
  content: '✦';
  font-size: 60px;
  color: #fcfcfc;
  text-shadow:
    0 0 20px #fcfc54,
    0 0 40px #e40000;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes shot-flash {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(2) rotate(180deg);
    opacity: 0;
  }
}

/* Screen Flash on Shot */
.screen-flash {
  animation: flash 0.1s ease-out;
}

@keyframes flash {
  0% {
    filter: brightness(3);
    background: #fcfcfc !important;
  }
  100% {
    filter: brightness(1);
  }
}

/* ============================================
   ANNOUNCEMENTS
   ============================================ */

/* Round Announcement - NES Style */
#round-announcement {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  color: #fcfcfc;
  padding: 30px 80px;
  font-size: 32px;
  border: 8px solid #fcfcfc;
  box-shadow:
    0 0 0 4px #000,
    inset 0 0 0 4px #5c94fc;
  z-index: 200;
  animation: announce 2s ease-in-out forwards;
  text-transform: uppercase;
  letter-spacing: 4px;
}

@keyframes announce {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  25% {
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

/* Fly Away Message - NES Style */
#fly-away {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #e40000;
  font-size: 40px;
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  z-index: 200;
  text-transform: uppercase;
  letter-spacing: 4px;
  display: none;
}

#fly-away.visible {
  display: block;
  animation: fly-away-shake 0.6s ease-in-out;
}

@keyframes fly-away-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  20% { transform: translate(-50%, -50%) rotate(-8deg) scale(1.1); }
  40% { transform: translate(-50%, -50%) rotate(8deg) scale(1.1); }
  60% { transform: translate(-50%, -50%) rotate(-8deg); }
  80% { transform: translate(-50%, -50%) rotate(8deg); }
}

/* Perfect Bonus */
.perfect-bonus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  color: #fcfc54;
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #e40000,
    2px -2px 0 #e40000,
    -2px 2px 0 #e40000;
  z-index: 200;
  animation: perfect 1.5s ease-out forwards;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes perfect {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
  }
  40% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-60px) scale(0.8);
  }
}

/* ============================================
   GAME OVER SCREEN - NES Style
   ============================================ */

#gameover-screen {
  background: linear-gradient(180deg,
    #5c94fc 0%,
    #5c94fc 50%,
    #000 50%,
    #000 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 1000;
}

#gameover-screen.hidden {
  display: none !important;
}

.gameover-content {
  background: #000;
  padding: 50px 80px;
  border: 8px solid #e40000;
  box-shadow:
    0 0 0 4px #000,
    inset 0 0 0 4px #a81000,
    0 0 60px rgba(228, 0, 0, 0.5);
}

.gameover-content h1 {
  font-size: 48px;
  color: #e40000;
  text-shadow:
    4px 4px 0 #a81000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  margin-bottom: 30px;
  animation: game-over-flash 0.5s ease-in-out infinite;
  text-transform: uppercase;
  letter-spacing: 4px;
}

@keyframes game-over-flash {
  0%, 100% { color: #e40000; }
  50% { color: #fc5454; }
}

.final-score {
  margin: 30px 0;
}

.final-score .label {
  display: block;
  color: #5c94fc;
  font-size: 14px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.final-score .score {
  font-size: 56px;
  color: #fcfc54;
  text-shadow:
    4px 4px 0 #e4a000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
}

.stats {
  color: #fcfcfc;
  font-size: 12px;
  margin: 30px 0;
  line-height: 2.5;
  text-transform: uppercase;
}

.stats span {
  color: #00e800;
  text-shadow: 1px 1px 0 #005800;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .title-content h1 {
    font-size: 24px;
  }

  .title-content {
    padding: 30px 40px;
  }

  #hud {
    height: 60px;
    padding: 5px 15px;
  }

  .hud-section .label {
    font-size: 8px;
  }

  .hud-section .value {
    font-size: 16px;
  }

  #game-area {
    top: 60px;
    bottom: 150px;
  }

  #ground {
    height: 150px;
  }

  .igor {
    width: 100px;
    height: 100px;
  }

  .igor-sprite::before {
    width: 90px;
    height: 90px;
  }

  #round-announcement,
  #fly-away {
    font-size: 24px;
    padding: 20px 40px;
  }

  .gameover-content h1 {
    font-size: 32px;
  }

  .final-score .score {
    font-size: 40px;
  }
}
