.menu-popup {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: url("../img/5_background/desert.png") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.75rem, 10%, 1rem) 1rem clamp(0.5rem, 4%, 1rem);
  box-sizing: border-box;
  border-radius: 1rem 1rem 0 0;
}

.menu-popup[hidden] {
  display: none;
}

.menu-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(245, 197, 24, 0.4);
  color: #f5c518;
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-popup__close:hover {
  background: rgba(245, 197, 24, 0.2);
}

.menu-popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 197, 24, 0.4) transparent;
}

.menu-btn {
  font-family: "Zabars", Arial, sans-serif;
  font-size: 1.4rem;
  letter-spacing: 2px;
  width: min(220px, 80%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(245, 197, 24, 0.5);
  border-radius: 8px;
  color: #f5c518;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
  text-align: center;
}

.menu-btn:hover {
  background: rgba(245, 197, 24, 0.2);
  border-color: #f5c518;
}

.menu-btn--primary {
  background: #f5c518;
  color: #1a1008;
  border-color: #c8960c;
  box-shadow: 2px 3px 0 #8b6000;
}

.menu-btn--primary:hover {
  background: #ffd740;
}

.menu-btn--exit {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.65);
}

.menu-btn--exit:hover {
  background: rgba(255, 80, 50, 0.2);
  border-color: rgba(255, 100, 70, 0.7);
  color: #ff6644;
}

.menu-btn--small {
  font-size: 1rem;
  padding: 5px 12px;
  width: min(220px, 80%);
  letter-spacing: 1px;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

.menu-btn--small:hover {
  color: #f5c518;
  border-color: rgba(245, 197, 24, 0.4);
}

.menu-btn__divider {
  width: min(220px, 80%);
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 4px 0;
}

.menu-sound {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(220px, 80%);
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(245, 197, 24, 0.5);
  border-radius: 8px;
  padding: 8px 16px;
}

.menu-sound__label {
  font-family: "Zabars", Arial, sans-serif;
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: #f5c518;
}

/* =====================
   Responsive Menu
   ===================== */

@media (max-width: 480px) {
  .menu-btn {
    font-size: 1.1rem;
    letter-spacing: 1px;
    padding: 6px 12px;
  }

  .menu-btn--small {
    font-size: 0.85rem;
    padding: 4px 12px;
  }

  .menu-sound {
    padding: 6px 14px;
  }

  .menu-sound__label {
    font-size: 1.1rem;
  }

  .menu-popup__content {
    gap: 0.45rem;
  }

  .menu-btn__divider {
    margin: 0;
  }

  .menu-popup__close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    padding: 3px 8px;
  }
}

@media (max-width: 400px) {
  .menu-btn {
    font-size: 1rem;
    padding: 5px 12px;
  }

  .menu-btn--small {
    font-size: 0.8rem;
    padding: 3px 10px;
  }

  .menu-sound {
    padding: 5px 12px;
    gap: 3px;
  }

  .menu-sound__label {
    font-size: 1rem;
  }

  .menu-popup__content {
    gap: 0.3rem;
  }
}
