/* Cosmic Rings */
.cosmic-rings {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  opacity: 0.15;
}

.cosmic-rings:before,
.cosmic-rings:after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 6px solid rgba(138, 43, 226, 0.8);
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cosmic-rings:before {
  animation: rotate 60s linear infinite;
  border-color: rgba(138, 43, 226, 0.8) rgba(0, 191, 255, 0.8) rgba(255, 69, 0, 0.8) rgba(0, 255, 127, 0.8);
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

.cosmic-rings:after {
  width: 800px;
  height: 800px;
  animation: rotate 90s linear infinite reverse;
  border-color: rgba(0, 191, 255, 0.8) rgba(255, 69, 0, 0.8) rgba(0, 255, 127, 0.8) rgba(138, 43, 226, 0.8);
  box-shadow: 0 0 40px rgba(0, 191, 255, 0.5);
}

@keyframes rotate {
  0% {
      transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
      transform: translate(-50%, -50%) rotate(360deg);
  }
}@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;700&display=swap');

:root {
  --primary-color: #8a2be2;
  --secondary-color: #00bfff;
  --accent-color: #ff4500;
  --background-color: #000;
  --text-color: #fff;
  --correct-color: #00ff7f;
  --wrong-color: #ff4500;
  --button-color: #8a2be2;
  --button-hover: #9d4edd;
}

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

body {
  font-family: 'Exo 2', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow: hidden;
  height: 100vh;
  position: relative;
}

.game-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Gradient Background */
body:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  z-index: -3;
}

/* Subtle Stars */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
}

.stars:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 4px);
  background-size: 100px 100px;
  background-position: 0 0, 50px 50px;
  opacity: 0.3;
}

/* Floating Particles */
.twinkling {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.twinkling:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
      radial-gradient(white, rgba(255,255,255,0) 30px),
      radial-gradient(white, rgba(255,255,255,0) 20px),
      radial-gradient(white, rgba(255,255,255,0) 15px),
      radial-gradient(rgba(255,255,255,.4), rgba(255,255,255,0) 10px);
  background-position: 
      5% 20%,
      15% 85%,
      60% 40%,
      90% 70%;
  background-size: 
      150px 150px,
      100px 100px,
      70px 70px,
      50px 50px;
  background-repeat: no-repeat;
  animation: float-particles 15s ease-in-out infinite alternate;
  opacity: 0.5;
}

@keyframes float-particles {
  0% {
      background-position: 
          5% 20%,
          15% 85%,
          60% 40%,
          90% 70%;
  }
  100% {
      background-position: 
          10% 25%,
          20% 80%,
          65% 45%,
          85% 65%;
  }
}

/* Header styling */
header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  z-index: 1;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 10px var(--secondary-color), 
               0 0 20px var(--secondary-color),
               0 0 30px var(--secondary-color);
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
      text-shadow: 0 0 10px var(--secondary-color),
                   0 0 20px var(--secondary-color);
  }
  to {
      text-shadow: 0 0 15px var(--secondary-color),
                   0 0 25px var(--secondary-color),
                   0 0 35px var(--secondary-color);
  }
}

.game-stats {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  display: flex;
  gap: 20px;
}

/* Spaceship styling */
.spaceship-container {
  position: absolute;
  top: 15%;
  right: 10%;
  z-index: 1;
  transform: rotate(-15deg);
  animation: float 6s ease-in-out infinite;
}

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

.spaceship {
  position: relative;
  width: 120px;
  height: 60px;
}

.cockpit {
  position: absolute;
  width: 40px;
  height: 20px;
  background: rgba(135, 206, 250, 0.7);
  border: 2px solid #fff;
  border-radius: 50% 50% 0 0;
  top: 0;
  left: 40px;
}

.body {
  position: absolute;
  width: 80px;
  height: 30px;
  background: linear-gradient(to right, #8a2be2, #00bfff);
  border: 2px solid #fff;
  border-radius: 40px;
  top: 15px;
  left: 20px;
}

.wing {
  position: absolute;
  width: 30px;
  height: 15px;
  background: var(--primary-color);
  border: 1px solid #fff;
}

.wing-left {
  left: 15px;
  top: 25px;
  transform: skew(-20deg);
  border-radius: 10px 0 0 0;
}

.wing-right {
  right: 15px;
  top: 25px;
  transform: skew(20deg);
  border-radius: 0 10px 0 0;
}

.thruster {
  position: absolute;
  width: 15px;
  height: 10px;
  background: #888;
  border: 1px solid #aaa;
  bottom: 0;
}

.thruster-left {
  left: 35px;
}

.thruster-right {
  right: 35px;
}

.flame {
  position: absolute;
  width: 10px;
  height: 20px;
  background: linear-gradient(to bottom, #ff4500, #ffd700);
  border-radius: 0 0 50% 50%;
  animation: flicker 0.3s infinite alternate;
  bottom: -18px;
}

.flame-left {
  left: 37px;
}

.flame-right {
  right: 37px;
}

@keyframes flicker {
  0% { height: 15px; opacity: 0.8; }
  100% { height: 25px; opacity: 1; }
}

/* Game area styling */
.game-area {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  margin-top: -50px;
  z-index: 1;
}

.hangman-container {
  width: 300px;
  height: 300px;
  position: relative;
}

.moon {
  width: 200px;
  height: 50px;
  background: linear-gradient(to top, #444, #888);
  border-radius: 50% 50% 0 0;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.astro-container {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
}

.astro-head {
  width: 50px;
  height: 50px;
  background: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 50%;
  position: relative;
}

.astro-head::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 20px;
  background: rgba(135, 206, 250, 0.5);
  border-radius: 50%;
  top: 10px;
  left: 3px;
}

.astro-body {
  width: 70px;
  height: 80px;
  background: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 10px;
  position: absolute;
  top: 45px;
  left: -10px;
}

.astro-arm-left, .astro-arm-right {
  width: 20px;
  height: 60px;
  background: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 10px;
  position: absolute;
}

.astro-arm-left {
  top: 50px;
  left: -25px;
  transform: rotate(-15deg);
}

.astro-arm-right {
  top: 50px;
  right: -25px;
  transform: rotate(15deg);
}

.astro-leg-left, .astro-leg-right {
  width: 25px;
  height: 70px;
  background: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 10px;
  position: absolute;
  top: 120px;
}

.astro-leg-left {
  left: -5px;
}

.astro-leg-right {
  right: -5px;
}

.astro-head.hidden,
.astro-body.hidden,
.astro-arm-left.hidden,
.astro-arm-right.hidden,
.astro-leg-left.hidden,
.astro-leg-right.hidden {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.astro-head:not(.hidden),
.astro-body:not(.hidden),
.astro-arm-left:not(.hidden),
.astro-arm-right:not(.hidden),
.astro-leg-left:not(.hidden),
.astro-leg-right:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Word container */
.word-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60%;
}

.word {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.letter {
  font-family: 'Orbitron', sans-serif;
  width: 40px;
  height: 50px;
  border-bottom: 4px solid var(--secondary-color);
  font-size: 2rem;
  text-align: center;
  text-transform: uppercase;
  margin: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 5px var(--secondary-color);
  animation: letter-appear 0.3s ease;
}

@keyframes letter-appear {
  from {
      transform: translateY(-20px);
      opacity: 0;
  }
  to {
      transform: translateY(0);
      opacity: 1;
  }
}

.category, .hint {
  font-size: 1.2rem;
  margin-bottom: 10px;
  text-align: center;
}

.category span, .hint span {
  color: var(--secondary-color);
  font-weight: bold;
}

.hint.hidden {
  opacity: 0;
  height: 0;
  margin: 0;
  transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
}

.hint:not(.hidden) {
  opacity: 1;
  height: auto;
  margin-bottom: 10px;
  transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
}

/* Controls styling */
.controls {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  z-index: 1;
}

.keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
}

.key {
  font-family: 'Orbitron', sans-serif;
  width: 45px;
  height: 45px;
  background: linear-gradient(145deg, #9d4edd, #8a2be2);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.key:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, #9d4edd, #7b24d6);
}

.key:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.key.correct {
  background: linear-gradient(145deg, #00ff9d, #00d67f);
  color: #000;
}

.key.wrong {
  background: linear-gradient(145deg, #ff6347, #d63f24);
  opacity: 0.7;
}

.key.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.game-buttons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.btn {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(145deg, #9d4edd, #8a2be2);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, #9d4edd, #7b24d6);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.difficulty {
  display: flex;
  gap: 10px;
}

.difficulty-btn {
  font-size: 0.9rem;
  padding: 8px 15px;
}

.difficulty-btn.active {
  background: linear-gradient(145deg, #00bfff, #0099cc);
}

/* Game message */
.game-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.game-message.hidden {
  opacity: 0;
  pointer-events: none;
}

.message-content {
  background: linear-gradient(145deg, #222, #333);
  border: 2px solid var(--secondary-color);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 0 20px var(--secondary-color);
  animation: message-appear 0.5s ease;
}

@keyframes message-appear {
  from {
      transform: scale(0.8);
      opacity: 0;
  }
  to {
      transform: scale(1);
      opacity: 1;
  }
}

.message-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.message-content p {
  font-size: 1.2rem;
  margin-bottom: 25px;
}

#continue-btn {
  margin: 0 auto;
}

/* Responsive styling */
@media (max-width: 768px) {
  h1 {
      font-size: 1.8rem;
  }
  
  .game-area {
      flex-direction: column;
      align-items: center;
  }
  
  .hangman-container {
      width: 200px;
      height: 200px;
      margin-bottom: 20px;
  }
  
  .word-container {
      width: 100%;
  }
  
  .letter {
      width: 30px;
      height: 40px;
      font-size: 1.5rem;
  }
  
  .key {
      width: 35px;
      height: 35px;
      font-size: 1rem;
  }
  
  .game-buttons {
      flex-direction: column;
      gap: 15px;
  }
  
  .spaceship-container {
      top: 5%;
      right: 5%;
      transform: scale(0.7) rotate(-15deg);
  }
}