/* Tunnel Rush 3D - Styling */
/* Customize these styles to change the game's visual appearance */

/* === GLOBAL STYLES === */
body {
  margin: 0;
  overflow: hidden;
  background-color: var(--bg-color, #000);
  color: var(--text-color, #fff);
  font-family: "Courier New", Courier, monospace;
}

canvas {
  display: block;
}

/* === CSS VARIABLES FOR EASY CUSTOMIZATION === */
:root {
  --bg-color: #000;
  --text-color: #fff;
  --button-bg: #fff;
  --button-text: #000;
  --button-hover: #ddd;
  --score-size: 2em;
  --powerup-status-size: 1.2em;
  --title-size: 3em;
  --text-size: 1.2em;
  --button-size: 1.5em;
  --menu-bg: rgba(0, 0, 0, 0.7);
  --powerup-bg: rgba(0, 0, 0, 0.5);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-strong: rgba(0, 0, 0, 0.8);
}

/* === UI CONTAINER === */
#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none; /* Let mouse events pass through to the canvas */
}

/* === SCORE DISPLAY === */
#score {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: var(--score-size);
  text-shadow: 2px 2px 4px var(--shadow-color);
  font-weight: bold;
  z-index: 100;
}

/* === POWERUP STATUS === */
#powerup-status {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: var(--powerup-status-size);
  text-align: left;
  text-shadow: 2px 2px 4px var(--shadow-strong);
  z-index: 100;
}

#powerup-status div {
  margin-top: 5px;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: var(--powerup-bg);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

/* === MENU STYLES === */
#menu,
#game-over {
  background-color: var(--menu-bg);
  padding: 40px;
  border-radius: 15px;
  pointer-events: all; /* Capture mouse events on the menus */
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: menuFadeIn 0.5s ease-out;
  max-width: 400px;
  width: 90%;
}

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

/* === TYPOGRAPHY === */
h1 {
  font-size: var(--title-size);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 5px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
  background: linear-gradient(45deg, #fff, #ccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

p {
  font-size: var(--text-size);
  margin-bottom: 30px;
  line-height: 1.5;
  opacity: 0.9;
}

/* === BUTTON STYLES === */
button {
  padding: 15px 30px;
  font-size: var(--button-size);
  cursor: pointer;
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

button::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;
}

button:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* === ANIMATIONS === */
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

.blinking {
  animation: blink 0.5s infinite;
}

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

.pulsing {
  animation: pulse 2s infinite ease-in-out;
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInFromLeft 0.5s ease-out;
}

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

.slide-in-bottom {
  animation: slideInFromBottom 0.5s ease-out;
}

/* === UTILITY CLASSES === */
.hidden {
  display: none !important;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  :root {
    --title-size: 2em;
    --text-size: 1em;
    --button-size: 1.2em;
    --score-size: 1.5em;
    --powerup-status-size: 1em;
  }

  #menu,
  #game-over {
    padding: 20px;
    margin: 20px;
  }

  #score {
    top: 10px;
    left: 10px;
  }

  #powerup-status {
    bottom: 10px;
    left: 10px;
  }

  #powerup-status div {
    padding: 3px 8px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  :root {
    --title-size: 1.5em;
    --text-size: 0.9em;
    --button-size: 1em;
    --score-size: 1.2em;
    --powerup-status-size: 0.8em;
  }

  h1 {
    letter-spacing: 2px;
  }

  button {
    padding: 12px 20px;
  }
}

/* === THEME VARIATIONS === */
/* Dark Theme (default) */
.theme-dark {
  --bg-color: #000;
  --text-color: #fff;
  --button-bg: #fff;
  --button-text: #000;
  --button-hover: #ddd;
}

/* Neon Theme */
.theme-neon {
  --bg-color: #0a0a0a;
  --text-color: #00ffff;
  --button-bg: #00ffff;
  --button-text: #000;
  --button-hover: #00cccc;
  --menu-bg: rgba(0, 20, 20, 0.8);
}

.theme-neon h1 {
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
}

.theme-neon #score {
  text-shadow: 0 0 5px #00ffff;
}

/* Retro Theme */
.theme-retro {
  --bg-color: #1a1a2e;
  --text-color: #eee;
  --button-bg: #16213e;
  --button-text: #eee;
  --button-hover: #0f3460;
  --menu-bg: rgba(26, 26, 46, 0.9);
}

/* High Contrast Theme */
.theme-high-contrast {
  --bg-color: #000;
  --text-color: #ffff00;
  --button-bg: #ffff00;
  --button-text: #000;
  --button-hover: #cccc00;
  --menu-bg: rgba(0, 0, 0, 0.9);
}
