/* ---------- MAIN MENU STYLES ---------- */

.menu-container {
  width: 100vw; height: 100vh;
  background: linear-gradient(180deg, #5d94f1 0%, #4a7bc8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.menu-stage {
  position: absolute;
  width: 100vw;
  height: 100vh;
  transition: opacity .6s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- MENU BACKGROUND ---------- */
.menu-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('image/background.png') center / cover;
  opacity: 0.3;
  filter: blur(2px);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
  transition: opacity 0.6s ease-in-out;
  pointer-events: none; /* Prevent interaction issues during transitions */
}

/* ---------- MENU CONTENT ---------- */
.menu-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 40px;
  box-sizing: border-box;
}

.menu-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(32px, 6vw, 80px);  /* Responsive sizing */
  letter-spacing: 2px;
  color: #fff;
  margin: 0 0 60px 0;
  text-shadow:
    0 4px 0 #2b4a80, 4px 0 0 #2b4a80, -4px 0 0 #2b4a80, 0 -4px 0 #2b4a80;
  image-rendering: pixelated;
  text-rendering: geometricPrecision;
}

/* ---------- MENU NAVIGATION ---------- */
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 600px;  /* Bigger buttons for fullscreen */
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 30px;  /* Bigger padding */
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid #2b4a80;
  border-radius: 0;
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(14px, 2.5vw, 32px);  /* Responsive font */
  color: #2b4a80;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  
  /* Pixel-perfect rendering */
  image-rendering: pixelated;
  text-rendering: geometricPrecision;
  
  /* Remove default button styles */
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #2b4a80;
}

.menu-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.menu-button:focus {
  background: rgba(255, 255, 255, 1);
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.button-icon {
  font-size: clamp(20px, 3vw, 40px);  /* Responsive icon size */
  margin-right: 16px;
  line-height: 1;
  filter: grayscale(100%);
  transition: filter 0.15s ease;
}

.menu-button:hover .button-icon,
.menu-button:focus .button-icon {
  filter: grayscale(0%);
}

.button-text {
  line-height: 1;
  flex: 1;
}

/* Button-specific styling */
.menu-button[data-action="play"] {
  background: rgba(106, 150, 40, 0.9);
  color: #fff;
  border-color: #4a6b1a;
}

.menu-button[data-action="play"]:hover,
.menu-button[data-action="play"]:focus {
  background: rgba(106, 150, 40, 1);
  box-shadow: 0 2px 0 #4a6b1a;
}

/* ---------- MENU FOOTER ---------- */
.menu-footer {
  position: absolute;
  bottom: 20px;
  right: 30px;
}

.version-text {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(10px, 1.5vw, 20px);  /* Responsive version text */
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  image-rendering: pixelated;
  text-rendering: geometricPrecision;
}

/* ---------- ANIMATIONS ---------- */
@keyframes menu-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-content {
  animation: menu-fade-in 0.8s ease-out;
}

.menu-button {
  animation: menu-fade-in 0.6s ease-out;
}

.menu-button:nth-child(1) { animation-delay: 0.1s; }
.menu-button:nth-child(2) { animation-delay: 0.2s; }
.menu-button:nth-child(3) { animation-delay: 0.3s; }
.menu-button:nth-child(4) { animation-delay: 0.4s; }

/* ---------- RESPONSIVE ADJUSTMENTS ---------- */
@media (max-height: 600px) {
  .menu-nav {
    gap: 6px;
  }
  
  .menu-button {
    padding: 6px 10px;
    font-size: calc(var(--px) * 1.6);
  }
  
  .button-icon {
    font-size: calc(var(--px) * 1.8);
    margin-right: 6px;
  }
}