/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Orbitron", monospace;
  background: linear-gradient(135deg, #0a0a23 0%, #1a1a3a 50%, #2d2d5f 100%);
  background-attachment: fixed;
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

/* Animated Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(
      1px 1px at 130px 80px,
      rgba(255, 255, 255, 0.6),
      transparent
    ),
    radial-gradient(2px 2px at 160px 30px, #fff, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 3s infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.3;
  }
}

/* Game Container */
#gameContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Canvas with Enhanced Animations */
#gameCanvas {
  border: 3px solid #00ffff;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  background: radial-gradient(ellipse at center, #001122 0%, #000511 100%);
  animation: canvasPulse 3s ease-in-out infinite,
    canvasBorderGlow 2s ease-in-out infinite alternate;
  transition: all 0.3s ease;

  /* Additional resilience properties for dev tools scenarios */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 200px;
  min-height: 150px;
  position: relative;
  z-index: 1;
}

@keyframes canvasPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.005);
  }
}

@keyframes canvasBorderGlow {
  from {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
      inset 0 0 20px rgba(0, 255, 255, 0.1);
  }
  to {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7),
      inset 0 0 30px rgba(0, 255, 255, 0.2);
  }
}

#gameCanvas:hover {
  transform: scale(1.01);
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.8),
    inset 0 0 40px rgba(0, 255, 255, 0.3);
}

/* Panel Styling with Enhanced Animations */
.panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    145deg,
    rgba(25, 25, 75, 0.95),
    rgba(50, 50, 100, 0.95)
  );
  backdrop-filter: blur(15px);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 255, 255, 0.2);
  z-index: 1000;
  min-width: 300px;
  animation: slideInFromTop 0.6s ease-out;
  transition: all 0.3s ease;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.panel:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 255, 255, 0.3);
  transform: translate(-50%, -50%) scale(1.02);
}

.panel.overlay {
  background: linear-gradient(
    145deg,
    rgba(15, 15, 45, 0.98),
    rgba(30, 30, 70, 0.98)
  );
}

.panel-content h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #00ffff, #ff00ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.panel-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.panel-content h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #ccccff;
}

.panel-content p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #aaaaff;
  line-height: 1.5;
}

/* Buttons */
.btn {
  background: linear-gradient(145deg, #0066ff, #0044cc);
  border: 2px solid #00aaff;
  color: white;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: "Orbitron", monospace;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: buttonGlow 2s ease-in-out infinite alternate;
  margin: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

@keyframes buttonGlow {
  from {
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
  }
  to {
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.5);
  }
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  background: linear-gradient(145deg, #0080ff, #0066ff);
  box-shadow: 0 6px 20px rgba(0, 128, 255, 0.5);
  transform: translateY(-2px);
}

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

.btn-primary {
  background: linear-gradient(145deg, #ff6600, #ff4400);
  border-color: #ff8800;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #ff8800, #ff6600);
  box-shadow: 0 6px 20px rgba(255, 136, 0, 0.5);
}

.btn-secondary {
  background: linear-gradient(145deg, #666666, #444444);
  border-color: #888888;
  box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Level Selection Grid */
.level-selector {
  margin: 20px 0;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.level-btn {
  background: linear-gradient(145deg, #330066, #220044);
  border: 2px solid #6600cc;
  color: #ccccff;
  padding: 10px;
  font-size: 0.9rem;
  font-family: "Orbitron", monospace;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.level-btn:hover {
  background: linear-gradient(145deg, #4400aa, #330088);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(102, 0, 204, 0.4);
  transform: scale(1.05);
}

.level-btn[data-level="10"] {
  background: linear-gradient(145deg, #aa0000, #880000);
  border-color: #ff0000;
  color: #ffcccc;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
  }
}

/* HUD */
.hud {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  pointer-events: none;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 20px;
}

.hud-right {
  pointer-events: auto;
}

.stat {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.8),
    rgba(20, 20, 60, 0.8)
  );
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat .label {
  color: #00ffff;
  margin-right: 5px;
}

.stat span:last-child {
  color: #ffffff;
}

/* Controls Info */
.controls-info {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.8),
    rgba(20, 20, 60, 0.8)
  );
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.8rem;
  color: #ccccff;
  backdrop-filter: blur(10px);
}

/* Wallet Info */
.wallet-info {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(
    145deg,
    rgba(0, 100, 0, 0.3),
    rgba(0, 150, 0, 0.3)
  );
  border: 1px solid rgba(0, 255, 0, 0.5);
  border-radius: 10px;
}

.wallet-info p {
  margin: 5px 0;
  color: #ccffcc;
}

/* Game Over Stats */
.game-over-stats {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(
    145deg,
    rgba(50, 50, 50, 0.5),
    rgba(30, 30, 30, 0.5)
  );
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-over-stats p {
  margin: 10px 0;
  font-size: 1.1rem;
}

.new-record {
  background: linear-gradient(
    145deg,
    rgba(255, 215, 0, 0.3),
    rgba(255, 165, 0, 0.3)
  );
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  }
  to {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

/* Leaderboard */
.leaderboard-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 20px 0;
  padding: 10px;
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.3),
    rgba(20, 20, 40, 0.3)
  );
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 5px 0;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 5px;
  transition: all 0.3s ease;
}

.leaderboard-entry:hover {
  background: linear-gradient(
    145deg,
    rgba(0, 255, 255, 0.1),
    rgba(0, 255, 255, 0.2)
  );
  transform: scale(1.02);
}

.leaderboard-entry.top-3 {
  background: linear-gradient(
    145deg,
    rgba(255, 215, 0, 0.2),
    rgba(255, 165, 0, 0.2)
  );
  border: 1px solid rgba(255, 215, 0, 0.5);
}

/* Loading Screen */
.loading-animation {
  font-size: 4rem;
  margin: 30px 0;
  position: relative;
}

.spaceship {
  animation: float 3s ease-in-out infinite;
}

.stars {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: sparkle 2s linear infinite;
}

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

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.3;
    transform: translateX(-50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.2);
  }
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  width: 0%;
  transition: width 0.3s ease;
  animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
  from {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Enhanced transition animations */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.5s ease-in-out;
}

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

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

/* Loading screen enhancements */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 255, 255, 0.2);
  border-top: 4px solid #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Floating text animation for game UI */
@keyframes floatUp {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-50px) scale(1.1);
  }
}

.floating-text {
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
  position: absolute;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.loading {
  text-align: center;
  color: #aaaaff;
  font-style: italic;
  padding: 20px;
}

/* Responsive Design */
@media (max-width: 900px) {
  #gameCanvas {
    width: 90vw;
    height: 67.5vw; /* Maintain 4:3 aspect ratio */
    max-height: 70vh;
  }

  .panel {
    padding: 20px;
    margin: 10px;
    min-width: 280px;
  }

  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hud {
    padding: 0 10px;
  }

  .hud-left,
  .hud-right {
    gap: 10px;
  }

  .stat {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .panel-content h1 {
    font-size: 2rem;
  }

  .panel-content h2 {
    font-size: 1.5rem;
  }

  .level-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* SSD Shop Styles */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
}

.shop-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #4a9eff;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.shop-item:hover {
  background: rgba(74, 158, 255, 0.2);
  transform: translateY(-2px);
}

.shop-item h3 {
  color: #4a9eff;
  margin-bottom: 10px;
}

.shop-item .price {
  color: #ffd700;
  font-weight: bold;
  font-size: 1.2em;
  margin: 10px 0;
}

.shop-item .duration {
  color: #aaa;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.ssd-balance {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #ffd700;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.ssd-balance p {
  margin: 5px 0;
  color: #ffd700;
}

/* Twitter Verification Styles */
.twitter-step {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.twitter-step h3 {
  color: #4fc3f7;
  margin-bottom: 1rem;
}

.twitter-step input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 1rem;
}

.twitter-step input::placeholder {
  color: #aaa;
}

.tweet-template {
  background: rgba(29, 161, 242, 0.1);
  border: 2px solid #1da1f2;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #e1e8ed;
  word-break: break-word;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.tweet-actions {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  align-items: center;
}

.tweet-actions .btn {
  flex: 1;
  min-width: 150px;
}

.tweet-info {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.twitter-verified {
  text-align: center;
  color: #4caf50;
  padding: 1.5rem;
  border: 2px solid #4caf50;
  border-radius: 8px;
  background: rgba(76, 175, 80, 0.1);
}

.error-message {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
  border: 2px solid #f44336;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.loading {
  text-align: center;
  color: #4fc3f7;
  font-style: italic;
  margin: 1rem 0;
}

.panel-footer {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn-outline {
  background: transparent;
  border: 2px solid #4fc3f7;
  color: #4fc3f7;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: #4fc3f7;
  color: #000;
  transform: translateY(-2px);
}

.support-link {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #aaa;
  text-align: center;
}

.support-link-text {
  color: #4fc3f7;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.support-link-text:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Features List Styles */
.features-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
}

.feature-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #4a9eff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
}

.feature-item h3 {
  color: #4a9eff;
  margin-bottom: 10px;
}

.feature-item p {
  color: #ddd;
  margin-bottom: 10px;
}

.feature-item .eta {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 215, 0, 0.8);
  color: #000;
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 0.8em;
  font-weight: bold;
}

/* Menu Buttons Grid */
.menu-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

/* Euclid Link */
.euclid-link {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #ffd700;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  margin-top: 20px;
}

.euclid-link a {
  color: #4a9eff;
  text-decoration: none;
  font-weight: bold;
}

.euclid-link a:hover {
  color: #ffd700;
  text-decoration: underline;
}

/* Admin Panel Styles */
.admin-stats {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #ffd700;
  border-radius: 10px;
  padding: 15px;
  margin: 20px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  color: #ffd700;
}

.stat-item label {
  font-weight: bold;
}

.admin-actions {
  margin: 20px 0;
}

.admin-actions h3 {
  color: #4a9eff;
  margin: 20px 0 10px 0;
}

.admin-actions p {
  color: #aaa;
  font-size: 0.9em;
  margin-bottom: 15px;
}

.fund-section,
.withdraw-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.fund-section input,
.withdraw-section input {
  flex: 1;
  padding: 10px;
  border: 1px solid #4a9eff;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
}

.fund-section input::placeholder,
.withdraw-section input::placeholder {
  color: #aaa;
}

.admin-section {
  text-align: center;
  margin-top: 10px;
}

#openAdmin {
  display: none; /* Hidden by default, shown only to contract owner */
}

/* SSD Reward Popup Styles */
.ssd-reward-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(
    145deg,
    rgba(255, 215, 0, 0.95),
    rgba(255, 165, 0, 0.95)
  );
  border: 3px solid #ffd700;
  border-radius: 20px;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4),
    0 0 50px rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(10px);
  color: #000;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  min-width: 300px;
}

.ssd-reward-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ssd-reward-popup.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-50px);
}

.reward-icon {
  font-size: 3rem;
  line-height: 1;
  animation: bounce 0.6s ease-in-out;
}

.reward-text {
  flex: 1;
}

.reward-title {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 5px;
  color: #003366;
}

.reward-amount {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ff6600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  margin-bottom: 3px;
}

.reward-details {
  font-size: 0.9rem;
  color: #004080;
  font-weight: 600;
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }
  40%,
  43% {
    transform: translateY(-15px);
  }
  70% {
    transform: translateY(-7px);
  }
  90% {
    transform: translateY(-3px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    color: #ffd700;
  }
  50% {
    transform: scale(1.1);
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  }
  100% {
    transform: scale(1);
    color: #ffd700;
  }
}

/* Enhanced notification styles */
.notification-success {
  background: linear-gradient(
    145deg,
    rgba(0, 255, 0, 0.9),
    rgba(0, 200, 0, 0.9)
  );
  border-left: 4px solid #00ff00;
}

.notification-warning {
  background: linear-gradient(
    145deg,
    rgba(255, 165, 0, 0.9),
    rgba(255, 140, 0, 0.9)
  );
  border-left: 4px solid #ffa500;
}

.notification-error {
  background: linear-gradient(
    145deg,
    rgba(255, 0, 0, 0.9),
    rgba(200, 0, 0, 0.9)
  );
  border-left: 4px solid #ff0000;
}

/* 🚰 Faucet Panel Styles */
.faucet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin: 20px 0;
}

.faucet-btn {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: linear-gradient(145deg, #2a2a3a, #3a3a4a);
  border: 2px solid #4a9eff;
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
}

.faucet-btn:hover {
  background: linear-gradient(145deg, #3a3a4a, #4a4a5a);
  border-color: #6bb6ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 158, 255, 0.3);
}

.faucet-desc {
  font-size: 0.9em;
  color: #aaaaaa;
  margin-top: 5px;
}

.faucet-info {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.faucet-info h3 {
  color: #4a9eff;
  margin-bottom: 15px;
}

.faucet-info ol {
  margin: 0;
  padding-left: 20px;
}

.faucet-info li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.faucet-network-info {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.faucet-network-info h3 {
  color: #ffd700;
  margin-bottom: 15px;
}

.network-details {
  display: grid;
  gap: 10px;
}

.network-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.network-item:last-child {
  border-bottom: none;
}

.network-item strong {
  color: #ffd700;
  min-width: 120px;
}

@media (min-width: 768px) {
  .faucet-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Responsive Design Updates */
@media (max-width: 768px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .menu-buttons {
    grid-template-columns: 1fr;
  }

  .feature-item .eta {
    position: static;
    display: inline-block;
    margin-top: 10px;
  }

  .fund-section,
  .withdraw-section {
    flex-direction: column;
    gap: 10px;
  }

  .fund-section input,
  .withdraw-section input {
    width: 100%;
  }
}

/* Tutorial Panel Styling */
.tutorial-header {
  margin-bottom: 30px;
}

.tutorial-progress {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 16.67%; /* 1/6 for first step */
}

#tutorialStepIndicator {
  color: #00ffff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tutorial-content {
  margin: 30px 0;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: float 2s ease-in-out infinite;
}

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

#tutorialStepTitle {
  color: #00ffff;
  font-size: 1.5rem;
  margin-bottom: 15px;
}

#tutorialStepDescription {
  color: #aaaaff;
  font-size: 1.1rem;
  margin-bottom: 25px;
  line-height: 1.6;
}

.tutorial-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.key-demo {
  text-align: center;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.key {
  background: linear-gradient(145deg, #333, #555);
  border: 2px solid #777;
  border-radius: 8px;
  padding: 10px 15px;
  color: #fff;
  font-weight: bold;
  font-family: "Orbitron", monospace;
  min-width: 40px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  animation: keyPulse 2s ease-in-out infinite;
}

@keyframes keyPulse {
  0%,
  100% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 12px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
  }
}

.key-text {
  color: #00ffff;
  font-size: 0.9rem;
  margin-top: 10px;
}

.tutorial-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  gap: 10px;
}

.weapon-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.space-key {
  background: linear-gradient(145deg, #ff6600, #ff4400);
  border: 2px solid #ff8800;
  border-radius: 8px;
  padding: 15px 30px;
  color: #fff;
  font-weight: bold;
  font-family: "Orbitron", monospace;
  font-size: 1.1rem;
  box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
  animation: spaceKeyPulse 1.5s ease-in-out infinite;
}

@keyframes spaceKeyPulse {
  0%,
  100% {
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 12px rgba(255, 102, 0, 0.8);
    transform: scale(1.1);
  }
}

.powerup-demo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  max-width: 300px;
}

.powerup-item {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  animation: powerupGlow 3s ease-in-out infinite;
}

@keyframes powerupGlow {
  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.3);
  }
  50% {
    border-color: rgba(255, 255, 0, 0.8);
  }
}

.powerup-item .powerup-icon {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.powerup-item .powerup-name {
  font-size: 0.8rem;
  color: #ffff00;
}

.health-demo {
  display: flex;
  align-items: center;
  gap: 20px;
}

.health-bar {
  display: flex;
  gap: 5px;
}

.health-heart {
  color: #ff0000;
  font-size: 1.5rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.level-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.level-progression {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-badge {
  background: linear-gradient(145deg, #330066, #220044);
  border: 2px solid #6600cc;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccccff;
  font-weight: bold;
  animation: levelGlow 2s ease-in-out infinite;
}

@keyframes levelGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(102, 0, 204, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(102, 0, 204, 1);
  }
}

.level-arrow {
  color: #00ffff;
  font-size: 1.5rem;
  animation: arrowPulse 1s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.web3-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.wallet-icon {
  font-size: 3rem;
  color: #ffd700;
  animation: walletShine 2s ease-in-out infinite;
}

@keyframes walletShine {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 20px #ffd700;
  }
}

.blockchain-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 300px;
}

.benefit-item {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #00ffff;
}

/* Wallet Connection Improvements */
.wallet-status {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
  text-align: center;
}

#walletStatusText {
  color: #00ffff;
  font-weight: 600;
  margin: 0;
}

.wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

/* Advanced Connection Options */
.advanced-connect-options {
  margin: 15px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.connection-methods {
  margin-bottom: 15px;
}

.connection-methods h4 {
  margin-bottom: 15px;
  color: #00ffff;
  text-align: center;
}

.btn-connector {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
  border: 2px solid rgba(0, 255, 255, 0.5);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: "Orbitron", monospace;
  font-weight: 600;
}

.btn-connector:hover {
  background: linear-gradient(145deg, #3a3a5a, #2a2a4a);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-connector:active {
  transform: translateY(0);
}

.connection-note {
  font-size: 0.9em;
  color: #cccccc;
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(0, 255, 255, 0.5);
  color: #00ffff;
}

.btn-outline:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: #00ffff;
  color: #fff;
}

.wallet-download-options {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wallet-download-options p {
  color: #aaaaff;
  margin-bottom: 15px;
  text-align: center;
}

.wallet-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 15px 0;
}

.wallet-option-btn {
  background: linear-gradient(145deg, #0066ff, #0044cc);
  border: 2px solid #00aaff;
  color: white;
  padding: 15px 20px;
  font-size: 1rem;
  font-family: "Orbitron", monospace;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-option-btn:hover {
  background: linear-gradient(145deg, #0080ff, #0066ff);
  box-shadow: 0 6px 20px rgba(0, 128, 255, 0.5);
  transform: translateY(-2px);
}

.wallet-option-btn:active {
  transform: translateY(0);
}

/* Status indicators */
.wallet-status.checking {
  border-color: rgba(255, 255, 0, 0.5);
  background: rgba(255, 255, 0, 0.1);
}

.wallet-status.checking #walletStatusText {
  color: #ffff00;
}

.wallet-status.detected {
  border-color: rgba(0, 255, 0, 0.5);
  background: rgba(0, 255, 0, 0.1);
}

.wallet-status.detected #walletStatusText {
  color: #00ff00;
}

.wallet-status.not-detected {
  border-color: rgba(255, 136, 0, 0.5);
  background: rgba(255, 136, 0, 0.1);
}

.wallet-status.not-detected #walletStatusText {
  color: #ff8800;
}

/* Animation for status checking */
.checking-animation {
  display: inline-block;
  animation: checkingPulse 1.5s ease-in-out infinite;
}

@keyframes checkingPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Dropdown Styles */
.somnia-resources {
  margin: 20px 0;
}

.dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}

.dropdown-btn {
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(
    145deg,
    rgba(15, 15, 45, 0.98),
    rgba(30, 30, 70, 0.98)
  );
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 15px;
  padding: 20px;
  z-index: 1001;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  margin-top: 5px;
  animation: dropdownSlide 0.3s ease-out;
}

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

.dropdown-content h4 {
  color: #00ffff;
  font-size: 1rem;
  margin: 10px 0 8px 0;
  text-align: center;
  font-weight: 600;
}

.dropdown-content h4:first-child {
  margin-top: 0;
}

.dropdown-link {
  display: block;
  padding: 12px 15px;
  background: linear-gradient(
    145deg,
    rgba(0, 102, 255, 0.1),
    rgba(0, 68, 204, 0.1)
  );
  border: 1px solid rgba(0, 170, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  margin: 8px 0;
  transition: all 0.3s ease;
  font-family: "Orbitron", monospace;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-link:hover {
  background: linear-gradient(
    145deg,
    rgba(0, 128, 255, 0.2),
    rgba(0, 102, 255, 0.2)
  );
  border-color: rgba(0, 170, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 128, 255, 0.3);
}

.dropdown-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 255, 255, 0.5),
    transparent
  );
  margin: 15px 0;
}

/* Tutorial Access Button */
.tutorial-access {
  margin: 15px 0;
}

.tutorial-access button {
  width: 100%;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 480px) {
  /* Body and container adjustments */
  body {
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  #gameContainer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }

  /* Panel improvements for small screens */
  .panel {
    width: 95vw;
    max-width: 95vw;
    min-width: unset;
    margin: 10px auto;
    padding: 20px 15px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    transform: translate(-50%, -50%) scale(0.95);
  }

  .panel-content {
    padding: 10px;
  }

  .panel-content h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.2;
  }

  .panel-content h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.3;
  }

  .panel-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .panel-content p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 15px;
  }

  /* Button improvements for touch */
  .btn {
    padding: 12px 20px;
    font-size: 1rem;
    min-height: 44px; /* iOS touch target size */
    margin: 5px 0;
    border-radius: 8px;
    touch-action: manipulation; /* Prevent zoom on double tap */
  }

  .btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-height: 36px;
  }

  /* Menu buttons layout */
  .menu-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 20px 0;
  }

  /* Wallet actions improvements */
  .wallet-actions {
    gap: 12px;
  }

  .wallet-status {
    margin: 15px 0;
    padding: 12px;
    font-size: 0.9rem;
  }

  /* Dropdown improvements */
  .dropdown-content {
    position: fixed;
    top: 20%;
    left: 5vw;
    right: 5vw;
    width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1002;
  }

  .dropdown-link {
    padding: 15px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    margin: 8px 0;
  }

  /* Loading screen mobile optimizations */
  .loading-animation {
    font-size: 3rem;
    margin: 20px 0;
  }

  .progress-bar {
    height: 8px;
    margin: 15px 0;
  }

  /* Game UI mobile adjustments */
  .hud {
    padding: 8px;
    font-size: 0.8rem;
  }

  .hud-left,
  .hud-right {
    gap: 5px;
  }

  .stat {
    padding: 4px 6px;
    font-size: 0.7rem;
    min-width: 60px;
  }

  /* Canvas adjustments */
  #gameCanvas {
    width: 95vw;
    height: calc(95vw * 0.75); /* Maintain 4:3 ratio */
    max-height: 60vh;
    border-width: 2px;
  }

  /* Form elements */
  input[type="text"],
  input[type="number"],
  input[type="email"] {
    padding: 12px;
    font-size: 1rem;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    margin: 5px 0;
  }

  /* Shop grid mobile */
  .shop-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 60vh;
    padding: 0 5px;
  }

  .shop-item {
    padding: 12px;
    font-size: 0.9rem;
  }

  /* Tutorial mobile adjustments */
  .tutorial-content {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .tutorial-nav {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .tutorial-nav .btn {
    width: 100%;
  }

  /* Stats and info displays */
  .wallet-info p {
    font-size: 0.85rem;
    margin: 8px 0;
    word-break: break-all;
  }

  .admin-stats,
  .feature-list {
    font-size: 0.85rem;
  }

  .stat-item {
    margin: 8px 0;
    padding: 8px;
  }

  /* Level selection mobile */
  .level-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
  }

  .level-card {
    padding: 12px;
    font-size: 0.85rem;
  }

  /* Leaderboard mobile */
  .leaderboard-list {
    max-height: 50vh;
    font-size: 0.85rem;
  }

  .leaderboard-item {
    padding: 10px 8px;
    margin: 5px 0;
  }

  /* Somnia resources dropdown mobile fix */
  .somnia-resources {
    margin: 15px 0;
  }

  .dropdown-btn {
    width: 100%;
    font-size: 0.9rem;
  }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
  .panel {
    width: 98vw;
    padding: 15px 10px;
    transform: translate(-50%, -50%) scale(0.9);
  }

  .panel-content h1 {
    font-size: 1.6rem;
  }

  .btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    min-height: 40px;
  }

  #gameCanvas {
    width: 98vw;
    height: calc(98vw * 0.75);
    max-height: 55vh;
  }

  .loading-animation {
    font-size: 2.5rem;
  }

  .dropdown-content {
    left: 2vw;
    right: 2vw;
    width: 96vw;
  }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (orientation: landscape) {
  .panel {
    max-height: 80vh;
    max-height: 80dvh;
    transform: translate(-50%, -50%) scale(0.85);
  }

  #gameCanvas {
    width: 80vw;
    height: calc(80vw * 0.75);
    max-height: 70vh;
  }

  .dropdown-content {
    max-height: 60vh;
    top: 10vh;
  }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
  /* Touch device specific styles */
  .btn:hover {
    transform: none; /* Disable hover animations on touch */
  }

  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .shop-item:hover {
    transform: none; /* Disable hover on touch devices */
  }

  .level-card:hover {
    transform: none;
  }

  /* Larger touch targets */
  button,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== MOBILE TOUCH CONTROLS ===== */

.mobile-controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2000;
}

.mobile-controls.hidden {
  display: none;
}

/* Virtual Joystick */
.virtual-joystick {
  position: absolute;
  bottom: 80px;
  left: 40px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  border: 3px solid rgba(0, 255, 255, 0.6);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 255, 255, 0.1) 0%,
    rgba(0, 200, 200, 0.2) 100%
  );
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.joystick-knob {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.9),
    rgba(200, 200, 200, 0.7)
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 255, 255, 0.4);
}

.joystick-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron", monospace;
  font-size: 12px;
  font-weight: bold;
  color: rgba(0, 255, 255, 0.8);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Fire Button */
.fire-button {
  position: absolute;
  bottom: 100px;
  right: 50px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.fire-button-inner {
  width: 100px;
  height: 100px;
  border: 3px solid rgba(255, 100, 0, 0.8);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 100, 0, 0.3) 0%,
    rgba(255, 50, 0, 0.5) 100%
  );
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 100, 0, 0.8);
  box-shadow: 0 0 25px rgba(255, 100, 0, 0.4),
    inset 0 0 20px rgba(255, 100, 0, 0.2);
  transition: all 0.1s ease;
}

.fire-button-inner:active {
  transform: scale(0.95);
  box-shadow: 0 0 30px rgba(255, 100, 0, 0.6),
    inset 0 0 25px rgba(255, 100, 0, 0.4);
}

.fire-button-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron", monospace;
  font-size: 12px;
  font-weight: bold;
  color: rgba(255, 100, 0, 0.8);
  text-shadow: 0 0 10px rgba(255, 100, 0, 0.5);
}

/* Mobile Pause Button */
.mobile-pause-btn {
  position: absolute;
  top: 60px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  transition: all 0.1s ease;
}

.mobile-pause-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 480px) {
  .virtual-joystick {
    bottom: 60px;
    left: 20px;
  }

  .joystick-base {
    width: 100px;
    height: 100px;
  }

  .joystick-knob {
    width: 40px;
    height: 40px;
  }

  .fire-button {
    bottom: 80px;
    right: 30px;
  }

  .fire-button-inner {
    width: 80px;
    height: 80px;
    font-size: 24px;
  }
}

@media (max-height: 600px) {
  .virtual-joystick {
    bottom: 40px;
  }

  .fire-button {
    bottom: 60px;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .virtual-joystick {
    bottom: 20px;
    left: 20px;
  }

  .fire-button {
    bottom: 40px;
    right: 20px;
  }

  .mobile-pause-btn {
    top: 20px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Touch feedback animations */
@keyframes joystick-pulse {
  0% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
  }
  100% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  }
}

@keyframes fire-pulse {
  0% {
    box-shadow: 0 0 25px rgba(255, 100, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 100, 0, 0.7);
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 100, 0, 0.4);
  }
}

.joystick-base.active {
  animation: joystick-pulse 0.3s ease;
}

.fire-button-inner.active {
  animation: fire-pulse 0.2s ease;
}
