body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", sans-serif;
  text-align: center;
  background-color: #0d1b2a;
  color: #f5f5f5;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#level-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2.5rem;
  margin: 3rem 0;
  color: #f9c74f;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  animation: fadeIn 1s ease-out;
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

.row {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.btn {
  height: 150px;
  width: 150px;
  margin-top: 50px;
  border: 4px solid #fff;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: scale(0.95) translateY(5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.red {
  background: linear-gradient(145deg, #ff4e50, #ff0000);
}

.green {
  background: linear-gradient(145deg, #28df99, #00a878);
}

.blue {
  background: linear-gradient(145deg, #5dade2, #1f78ff);
}

.yellow {
  background: linear-gradient(145deg, #ffe66d, #f5c518);
}

.pressed {
  box-shadow: 0 0 30px white inset;
  transform: scale(0.95);
  transition: all 0.1s ease;
}

.game-over {
  background-color: #d62828 !important;
  opacity: 0.8;
  transition: background-color 0.5s ease;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  .btn {
    width: 42vw;
    height: 42vw;
    min-width: 120px;
    min-height: 120px;
    max-width: 180px;
    max-height: 180px;
    margin: 2vw;
    border-width: 3px;
    border-radius: 15px;
    transition: all 0.15s ease;
  }

  .btn:active {
    transform: scale(0.9);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8) inset;
  }

  #level-title {
    font-size: 1.4rem;
    margin: 1.5rem 0;
    padding: 0 1rem;
    line-height: 1.3;
  }

  .container {
    padding: 1rem;
    gap: 1rem;
    max-width: 95vw;
  }

  .theme-selector {
    position: relative;
    top: 0;
    right: auto;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
  }

  .theme-btn {
    font-size: 0.7rem;
    padding: 8px 12px;
    margin: 2px;
  }
}

@media (max-width: 480px) {
  .btn {
    width: 45vw;
    height: 45vw;
    min-width: 100px;
    min-height: 100px;
    margin: 1.5vw;
  }

  #level-title {
    font-size: 1.2rem;
    margin: 1rem 0;
  }

  .container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
}
/* Theme Selector Styles */
.theme-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.theme-btn {
  padding: 8px 16px;
  border: 2px solid var(--btn-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--btn-shadow);
}

.theme-btn.active {
  background: var(--title-color);
  color: var(--bg-color);
  box-shadow: 0 0 20px var(--title-color);
}

/* Space Theme Button Styles */
body.space-theme .theme-btn {
  border-color: #4a9eff;
  box-shadow: 0 0 10px rgba(74, 158, 255, 0.3);
}

body.space-theme .theme-btn:hover {
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.5);
}

body.space-theme .theme-btn.active {
  background: #00d4ff;
  color: #0a0a0a;
  box-shadow: 0 0 25px #00d4ff;
}

/* Synthwave Theme Button Styles */
body.synthwave-theme .theme-btn {
  border-color: #00ffff;
  box-shadow: 0 0 10px rgba(255, 45, 226, 0.3);
}

body.synthwave-theme .theme-btn:hover {
  box-shadow: 0 4px 20px rgba(255, 45, 226, 0.5);
}

body.synthwave-theme .theme-btn.active {
  background: #ff2de2;
  color: #0f0f0f;
  box-shadow: 0 0 25px #ff2de2;
}

/* Mobile responsive for theme selector */
@media (max-width: 600px) {
  .theme-selector {
    position: relative;
    top: 10px;
    right: auto;
    justify-content: center;
    margin-bottom: 20px;
  }

  .theme-btn {
    font-size: 8px;
    padding: 6px 12px;
  }
}

/* Enhanced Animation Effects */

/* Shake effect for game over */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-10px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(10px);
  }
}

/* Space theme enhanced effects */
.space-glow {
  animation: spaceGlow 0.3s ease-out !important;
}

@keyframes spaceGlow {
  0% {
    box-shadow: 0 0 20px var(--btn-shadow),
      inset 0 0 20px rgba(74, 158, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 60px #00d4ff, inset 0 0 40px rgba(0, 212, 255, 0.8);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 20px var(--btn-shadow),
      inset 0 0 20px rgba(74, 158, 255, 0.1);
  }
}

/* Synthwave theme enhanced effects */
.neon-flash {
  animation: neonFlash 0.3s ease-out !important;
}

@keyframes neonFlash {
  0% {
    box-shadow: 0 0 20px var(--btn-shadow);
  }
  50% {
    box-shadow: 0 0 80px #ff2de2, 0 0 120px #00ffff;
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 20px var(--btn-shadow);
  }
}

/* Enhanced pressed state for all themes */
.pressed {
  box-shadow: 0 0 30px white inset !important;
  transform: scale(0.95) !important;
  transition: all 0.1s ease !important;
}

/* Enhanced game over state with theme support */
body.game-over {
  background-color: #d62828 !important;
  opacity: 0.8;
  transition: background-color 0.5s ease;
}

body.space-theme.game-over {
  background: radial-gradient(circle, #8b0000, #2d0000) !important;
}

body.synthwave-theme.game-over {
  background: linear-gradient(45deg, #8b0000, #4d0026) !important;
}

/* Optional: Score display styling */
.score-display {
  position: fixed;
  top: 20px;
  left: 20px;
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: var(--text-color);
  z-index: 1000;
}

@media (max-width: 600px) {
  .score-display {
    position: relative;
    top: 10px;
    left: auto;
    text-align: center;
    margin-bottom: 10px;
  }
}

/* Space Theme Styles */
body.space-theme {
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  color: #fff;
  transition: background 0.5s;
}

body.space-theme #level-title {
  text-shadow: 0 0 4px #fff, 0 0 12px #00f6ff; /* Reduced glow */
  color: #00f6ff;
}

body.space-theme .container {
  box-shadow: 0 0 40px 10px #00f6ff44;
  border-radius: 20px;
  background: rgba(20, 30, 50, 0.7);
  padding-bottom: 60px; /* Add this line or increase the value */
}

body.space-theme .btn {
  border: 6px solid #fff; /* Increased border thickness */
  margin-bottom: 18px; /* Push border further down visually */
}

body.space-theme .btn.green {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  box-shadow: 0 0 20px 4px #38f9d788;
}

body.space-theme .btn.red {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 0 20px 4px #fa709a88;
}

body.space-theme .btn.yellow {
  background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
  box-shadow: 0 0 20px 4px #fbc2eb88;
}

body.space-theme .btn.blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 0 20px 4px #667eea88;
}

body.space-theme .theme-selector {
  background: rgba(20, 30, 50, 0.8);
  border-radius: 10px;
  box-shadow: 0 0 10px #00f6ff44;
}

body.space-theme .theme-btn.active {
  border-color: #00f6ff;
  color: #00f6ff;
}

/* Synthwave Theme Styles */
body.synthwave-theme {
  background: linear-gradient(135deg, #2d006b 0%, #0f2027 100%);
  color: #fff;
  transition: background 0.5s;
}

body.synthwave-theme #level-title {
  color: #ff2de2;
  text-shadow: 0 0 2px #fff, 0 0 10px #00fff7, 0 0 20px #ff2de2; /* Neon glow */
}

body.synthwave-theme .container {
  box-shadow: 0 0 60px 10px #ff2de288;
  border-radius: 20px;
  background: rgba(30, 0, 60, 0.85);
  padding-bottom: 60px;
}

body.synthwave-theme .btn {
  border: 4px solid #00fff7;
  margin-bottom: 18px;
  box-shadow: 0 0 24px 4px #ff2de288, 0 0 8px #00fff7;
}

body.synthwave-theme .btn.green {
  background: linear-gradient(135deg, #00fff7 0%, #2dffb7 100%);
  box-shadow: 0 0 24px 4px #00fff788;
}

body.synthwave-theme .btn.red {
  background: linear-gradient(135deg, #ff2de2 0%, #ff6b6b 100%);
  box-shadow: 0 0 24px 4px #ff2de288;
}

body.synthwave-theme .btn.yellow {
  background: linear-gradient(135deg, #ffe66d 0%, #ff2de2 100%);
  box-shadow: 0 0 24px 4px #ffe66d88;
}

body.synthwave-theme .btn.blue {
  background: linear-gradient(135deg, #5dade2 0%, #00fff7 100%);
  box-shadow: 0 0 24px 4px #00fff788;
}

body.synthwave-theme .theme-selector {
  background: rgba(30, 0, 60, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 10px #ff2de244;
}

body.synthwave-theme .theme-btn.active {
  border-color: #ff2de2;
  color: #ff2de2;
  background: #00fff7;
  box-shadow: 0 0 25px #ff2de2;
}

/* Auth Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 20, 40, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.modal-card {
  background: #181f2f;
  border-radius: 18px;
  box-shadow: 0 0 32px #00f6ff55;
  padding: 36px 28px 28px 28px;
  text-align: center;
  min-width: 300px;
  max-width: 90vw;
  animation: fadeIn 0.5s;
}

.modal-card h2 {
  margin-top: 0;
  color: #00f6ff;
  font-family: "Press Start 2P", cursive;
  font-size: 1.2em;
  margin-bottom: 12px;
}

.modal-card p {
  color: #fff;
  margin-bottom: 28px;
  font-size: 1em;
}

.modal-btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px 0;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  background: #00f6ff;
  color: #181f2f;
  font-family: "Press Start 2P", cursive;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.modal-btn.google {
  background: #fff;
  color: #181f2f;
  border: 2px solid #00f6ff;
}

.modal-btn:hover {
  background: #00c6d6;
}

/* Scoreboard Styles */
.scoreboard-btns {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 32px 0 0 0;
}

.scoreboard-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  background: #00f6ff;
  color: #181f2f;
  box-shadow: 0 0 12px #00f6ff88;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.scoreboard-btn:hover {
  background: #00c6d6;
  color: #fff;
  box-shadow: 0 0 20px #00f6ffcc;
}

.score-modal-overlay {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 20, 40, 0.85);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.score-modal-card {
  background: #181f2f;
  border-radius: 18px;
  box-shadow: 0 0 32px #00f6ff55;
  padding: 36px 28px 28px 28px;
  min-width: 320px;
  max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  animation: fadeIn 0.4s;
}

@media (max-width: 600px) {
  .modal-card {
    min-width: 90vw;
    padding: 18px 6vw 18px 6vw;
  }
  .modal-btn {
    font-size: 0.95em;
    padding: 10px 0;
  }

  .score-modal-card {
    min-width: 90vw;
    padding: 18px 6vw 18px 6vw;
    max-height: 90vh;
  }
  .scoreboard-btns {
    flex-direction: column;
    gap: 16px;
  }
}

/* Enhanced Mobile Touch Support */
@media (max-width: 700px) {
  .container {
    max-width: 98vw !important;
    padding: 4vw 2vw 8vw 2vw !important;
    gap: 1rem !important;
  }
  
  .btn {
    width: 40vw !important;
    height: 40vw !important;
    min-width: 120px !important;
    min-height: 120px !important;
    max-width: 180px !important;
    max-height: 180px !important;
    margin: 2vw !important;
    border-width: 4px !important;
    border-radius: 20px !important;
    transition: all 0.1s ease !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .btn:active {
    transform: scale(0.9) !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.9) inset !important;
  }
  
  #level-title {
    font-size: 1.3em !important;
    margin: 1.5rem 0 !important;
    padding: 0 1rem !important;
    line-height: 1.4 !important;
  }
  
  .modal-overlay,
  .score-modal-overlay {
    align-items: flex-start !important;
    padding-top: 5vw !important;
    width: 100vw !important;
  }
  
  #global-score-modal {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
  }
  
  .theme-selector {
    position: relative !important;
    top: 0 !important;
    right: auto !important;
    justify-content: center !important;
    margin: 1rem 0 !important;
    flex-wrap: wrap !important;
  }
  
  .theme-btn {
    font-size: 0.6rem !important;
    padding: 6px 10px !important;
    margin: 2px !important;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
