/* src/styles/game.css */
.gameContainer {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  outline: none;
  border: 2px solid #0000;
  height: 500px;
  transition: border-color .2s;
}

.gameContainer:focus {
  border-color: var(--accent);
}

.gameContainer.blurred:after {
  content: "Click to play!";
  position: absolute;
  display: flex;
  border-radius: var(--radius);
  color: var(--text-dim);
  z-index: 5;
  background: #1a1b2ecc;
  justify-content: center;
  align-items:  center;
  font-size: 18px;
  inset: 0;
}

.gameHud {
  position: absolute;
  display: flex;
  z-index: 2;
  font-family: var(--font-mono);
  background: linear-gradient(#1a1b2ee6, #0000);
  justify-content: space-between;
  padding: 16px 20px;
  top: 0;
  left: 0;
  right: 0;
}

.hudItem {
  display: flex;
  flex-direction: column;
  align-items:  center;
}

.hudLabel {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-size: 10px;
}

.hudValue {
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.dangerZone {
  position: absolute;
  background: var(--error);
  opacity: .6;
  height: 4px;
  bottom: 0;
  left: 0;
  right: 0;
}

.word {
  position: absolute;
  font-family: var(--font-mono);
  background: var(--bg-hover);
  border: 2px solid var(--accent);
  color: var(--text);
  white-space: nowrap;
  border-radius: 8px;
  padding: 6px 14px;
  transition: transform 50ms linear;
  font-size: 20px;
  font-weight: 600;
}

.wordMatched {
  border-color: var(--success);
}

.wordMatchedChar {
  color: var(--success);
}

.inputDisplay {
  position: absolute;
  background: var(--bg);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  color: var(--accent);
  border: 2px solid var(--accent);
  text-align: center;
  z-index: 3;
  min-width: 200px;
  padding: 10px 24px;
  font-size: 20px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.lives {
  letter-spacing: 4px;
  font-size: 20px;
}

.gameOver {
  position: absolute;
  display: flex;
  z-index: 10;
  animation: fadeIn .3s ease;
  background: #1a1b2ef2;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  inset: 0;
}

.gameOverTitle {
  margin-bottom: 16px;
  font-size: 36px;
  font-weight: 700;
}

.gameOverScore {
  color: var(--text-dim);
  margin-bottom: 8px;
  font-size: 20px;
}

.highScore {
  color: var(--warning);
  font-weight: 600;
}

.gameOverButtons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.statsCard {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
}

.statsCardTitle {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 14px;
}

.progressBar {
  background: var(--bg);
  overflow: hidden;
  border-radius: 6px;
  height: 12px;
}

.progressFill {
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 6px;
  height: 100%;
  transition: width .5s;
}

.wordExploding {
  animation: wordExplode .45s ease-out forwards;
  pointer-events: none;
  border-color: var(--success) !important;
  background: var(--success) !important;
  color: #fff !important;
}

@keyframes wordExplode {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
  }

  30% {
    transform: scale(1.3);
    opacity: 1;
    filter: brightness(2);
  }

  100% {
    transform: scale(.2);
    opacity: 0;
    filter: brightness(3) blur(4px);
  }
}

.particle {
  position: absolute;
  pointer-events: none;
  animation: particleFly var(--duration) ease-out forwards;
  z-index: 20;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

@keyframes particleFly {
  0% {
    transform: translate(0)scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

.scorePopup {
  position: absolute;
  font-family: var(--font-mono);
  color: var(--success);
  pointer-events: none;
  z-index: 20;
  text-shadow: 0 0 12px var(--success), 0 0 24px #2ecc7166;
  animation: scoreFloat .8s ease-out forwards;
  font-size: 24px;
  font-weight: 800;
}

@keyframes scoreFloat {
  0% {
    transform: translateY(0)scale(.5);
    opacity: 0;
  }

  20% {
    transform: translateY(-10px)scale(1.2);
    opacity: 1;
  }

  100% {
    transform: translateY(-60px)scale(.8);
    opacity: 0;
  }
}

.screenFlash {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  animation: flash .3s ease-out forwards;
  border-radius: var(--radius);
  inset: 0;
}

@keyframes flash {
  0% {
    background: #2ecc7133;
  }

  100% {
    background: none;
  }
}

.comboText {
  position: absolute;
  font-family: var(--font-mono);
  pointer-events: none;
  z-index: 20;
  animation: comboPop .6s ease-out forwards;
  background: linear-gradient(135deg, var(--accent), #e84393, var(--warning));
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 20px var(--accent));
  -webkit-background-clip: text;
  font-size: 48px;
  font-weight: 800;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes comboPop {
  0% {
    transform: translate(-50%, -50%)scale(.3)rotate(-10deg);
    opacity: 0;
  }

  30% {
    transform: translate(-50%, -50%)scale(1.3)rotate(3deg);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%)scale(.8)rotate(0);
    opacity: 0;
  }
}
