/* Futuristic UI Styles */

.hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 0 8px var(--primary-cyan);
  padding: 0 20px;
}

.hud-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-main {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.timer,
.score {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 255, 0.1),
    rgba(128, 0, 255, 0.1)
  );
  color: var(--text-accent);
  padding: 10px 18px;
  border-radius: 25px;
  border: 2px solid var(--primary-cyan);
  box-shadow:
    var(--glow-cyan),
    inset 0 0 10px rgba(0, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.timer::before,
.score::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.control-btn {
  background: linear-gradient(
    135deg,
    rgba(128, 0, 255, 0.2),
    rgba(255, 0, 170, 0.2)
  );
  color: var(--secondary-pink);
  border: 2px solid var(--secondary-pink);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: var(--glow-pink);
}

.control-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(128, 0, 255, 0.4),
    rgba(255, 0, 170, 0.4)
  );
  box-shadow:
    var(--glow-pink),
    0 0 20px rgba(255, 0, 170, 0.8);
  transform: scale(1.1);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.lives-display {
  background: linear-gradient(
    135deg,
    rgba(0, 128, 255, 0.1),
    rgba(0, 255, 136, 0.1)
  );
  color: var(--success);
  padding: 8px 15px;
  border-radius: 20px;
  border: 2px solid var(--success);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.lives-icons {
  display: flex;
  gap: 5px;
}

.life-icon {
  filter: drop-shadow(0 0 3px var(--success));
  transition: all 0.3s ease;
}

.lives-flash {
  animation: livesFlash 1s ease-in-out;
}

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

.score-pulse {
  animation: scorePulse 0.3s ease-out;
}

@keyframes scorePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Shared dialog overlay */
.dialog-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Shared dialog panel */
.dialog {
  background: linear-gradient(
    135deg,
    rgba(10, 10, 15, 0.95),
    rgba(26, 26, 46, 0.95)
  );
  margin: 10px;
  padding: 40px;
  border-radius: 20px;
  backdrop-filter: blur(20px);
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

/* Game Over content panel */
.game-over-content {
  border: 3px solid var(--secondary-pink);
  box-shadow:
    var(--glow-pink),
    0 0 50px rgba(255, 0, 170, 0.3);
  max-width: 500px;
}

.game-over-show .dialog {
  animation: gameOverSlide 0.5s ease-out;
}

@keyframes gameOverSlide {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.game-over-content h2 {
  color: var(--secondary-pink);
  font-size: 42px;
  margin-bottom: 25px;
  text-shadow: var(--glow-pink);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.game-over-content p {
  font-size: 20px;
  margin-bottom: 18px;
  color: var(--text-secondary);
  text-shadow: 0 0 5px rgba(204, 204, 255, 0.5);
}

#restartBtn {
  background: linear-gradient(45deg, var(--primary-cyan), var(--primary-blue));
  color: var(--bg-dark);
  border: none;
  padding: 18px 35px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 15px;
  cursor: pointer;
  margin-top: 25px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--glow-cyan);
}

#restartBtn:hover {
  background: linear-gradient(45deg, var(--accent-yellow), var(--primary-cyan));
  transform: scale(1.05);
  box-shadow:
    var(--glow-cyan),
    0 0 25px rgba(0, 255, 255, 0.8);
}

.high-scores {
  margin: 20px 0;
  padding: 20px;
  border-top: 1px solid var(--primary-purple);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.high-scores p {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
}

.high-scores strong {
  color: var(--accent-yellow);
}

.high-scores span {
  color: var(--primary-cyan);
  font-weight: bold;
}

.controls-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  text-shadow: 0 0 8px rgba(204, 204, 255, 0.3);
  z-index: 100;
  background: rgba(26, 26, 46, 0.7);
  padding: 10px 20px;
  border-radius: 15px;
  border: 1px solid var(--primary-blue);
  backdrop-filter: blur(10px);
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
}

.notification {
  padding: 15px 20px;
  border-radius: 15px;
  font-weight: bold;
  text-align: center;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.notification-show {
  transform: translateY(0);
  opacity: 1;
}

.notification-hide {
  transform: translateY(-100%);
  opacity: 0;
}

.notification-info {
  background: linear-gradient(
    135deg,
    rgba(0, 128, 255, 0.2),
    rgba(0, 255, 255, 0.2)
  );
  border: 2px solid var(--info);
  color: var(--info);
  box-shadow: var(--glow-blue);
}

.notification-success {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.2),
    rgba(0, 255, 255, 0.2)
  );
  border: 2px solid var(--success);
  color: var(--success);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.notification-warning {
  background: linear-gradient(
    135deg,
    rgba(255, 170, 0, 0.2),
    rgba(255, 255, 0, 0.2)
  );
  border: 2px solid var(--warning);
  color: var(--warning);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.notification-error {
  background: linear-gradient(
    135deg,
    rgba(255, 51, 102, 0.2),
    rgba(255, 0, 170, 0.2)
  );
  border: 2px solid var(--error);
  color: var(--error);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

/* Pause Overlay */
.pause-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pause-text {
  font-size: 72px;
  font-weight: bold;
  color: var(--primary-cyan);
  text-shadow: 0 0 20px var(--primary-cyan);
  letter-spacing: 8px;
  animation: pausePulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pausePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@media (max-width: 768px) {
  .pause-text {
    font-size: 56px;
    letter-spacing: 6px;
  }
}

@media (max-width: 480px) {
  .pause-text {
    font-size: 42px;
    letter-spacing: 4px;
  }
}

/* Help content panel (specific overrides) */
.help-content {
  border: 2px solid var(--primary-cyan);
  box-shadow: var(--glow-cyan);
  max-width: 500px;
  text-align: left;
}

.help-content h2 {
  color: var(--primary-cyan);
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
}

.help-content h3 {
  color: var(--secondary-pink);
  margin-bottom: 10px;
  font-size: 18px;
}

.help-content p {
  margin-bottom: 10px;
  line-height: 1.4;
}

.help-content ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.help-content a {
  color: var(--primary-cyan);
  text-decoration: underline;
}

.help-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--primary-purple);
  font-size: 14px;
}

.help-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.install-btn {
  display: none;
}

.install-btn,
#closeHelpBtn {
  background: var(--primary-cyan);
  color: var(--bg-dark);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.install-btn {
  background: var(--success);
}

#installBtnGameOver {
  display: none;
  margin-top: 25px;
}

.install-btn:hover {
  background: var(--primary-cyan);
  transform: scale(1.05);
}

#closeHelpBtn:hover {
  background: var(--accent-yellow);
  transform: scale(1.05);
}

.install-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .hud {
    font-size: 14px;
    padding: 0 15px;
  }

  .hud-main {
    gap: 15px;
  }

  .hud-controls {
    gap: 8px;
    right: 15px;
  }

  .timer,
  .score,
  .lives-display {
    padding: 8px 14px;
    font-size: 13px;
  }

  .control-btn {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .game-over-content {
    padding: 35px 25px;
  }

  .game-over-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
  }

  .game-over-content p {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .high-scores {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .high-scores p {
    font-size: 14px;
  }

  #restartBtn {
    padding: 14px 28px;
    font-size: 16px;
  }

  .controls-info {
    font-size: 12px;
    bottom: 15px;
    padding: 8px 15px;
  }

  .notification-container {
    top: 80px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: calc(100vw - 20px);
  }

  .notification {
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hud {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .hud-main {
    justify-content: space-between;
  }

  .hud-controls {
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: 80px;
    right: 15px;
    left: auto;
  }

  .game-over-content h2 {
    font-size: 24px;
  }

  .game-over-content {
    padding: 25px 20px;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .controls-info {
    display: none;
  }

  .control-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  #restartBtn {
    padding: 20px 40px;
    font-size: 18px;
  }
}
